com.starbase.starteam
Class Catalog

java.lang.Object
  |
  +--com.starbase.starteam.CatalogBase
        |
        +--com.starbase.starteam.Catalog

public class Catalog
extends com.starbase.starteam.CatalogBase

The Catalog class provides "global" access to certain properties of objects from different classes. The catalog provides information about Property values for the primary and secondary descriptors of objects.

See Also:
Property.getClassIDOfValue(), Server.getTypes(), Type.getClassID()

Constructor Summary
Catalog(Server server, Type type, int viewScopeID)
          Deprecated.  
 
Method Summary
 void discard()
          Discards all cached data for this Catalog.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 java.lang.Object get(int objectID, int propertyID)
          Returns the property value for the specified "object" ID and propertyID.
 int[] getAllIDs()
          Returns a list of the object IDs currently stored in the catalog.
 Set getIDs()
          Deprecated. Use getAllIDs() instead.
 java.lang.Object getPrimaryDescriptor(int objectID)
          Returns the property value for the "primary descriptor" property of the given "object" ID.
 int[] getPropertyIDs()
          Returns an array of property IDs for which this catalog has data.
 Type getType()
          Gets the type that owns this catalog.
 int hashCode()
          returns a unique hash for all instances of this type
 boolean hasID(int id)
          Determines whether or not information for specified ObjectID has been cached in this Catalog.
 boolean isRefreshIDsRequired(int[] objIDs)
          Returns true if a refresh() operation might have resulted in the catalog information being updated for any of the given object IDs; returns false if and only if it is known that the catalog information had not been changed since the last refresh.
 boolean isRefreshRequired()
          Returns true if a refresh() operation might have resulted in the catalog information being updated; returns false if and only if it is known that the catalog information had not been changed since the last refresh.
 void populate()
          Fetch the catalog data if needed.
 void refresh()
          Update the contents of the Catalog to reflect recent changes to the server.
 void refreshIDs(int[] objectIDs)
          Update the contents of the Catalog for the given Object IDs to reflect recent changes to the server.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Catalog

public Catalog(Server server,
               Type type,
               int viewScopeID)
Deprecated.  

Create a new Catalog object for the specified Server and Type. NOTE: This public constructor is deprecated; use Type.getCatalog() instead.

Parameters:
server - the server source for the catalog information
type - the type for this catalog
viewScopeID - This parameter is ignored; it's here only for backward compatibility with earlier SDK releases.
See Also:
Type.getCatalog()
Method Detail

getType

public Type getType()
Gets the type that owns this catalog.

Returns:
The type that owns this catalog.

populate

public void populate()
Fetch the catalog data if needed. If the data has already been fetched then this is essentially a no-op.

Overrides:
populate in class com.starbase.starteam.CatalogBase
See Also:
Catalog.refresh(), Catalog.discard()

refreshIDs

public void refreshIDs(int[] objectIDs)
Update the contents of the Catalog for the given Object IDs to reflect recent changes to the server. If MPX is enabled, refresh() is optimized to avoid unneccessary server commands.

Overrides:
refreshIDs in class com.starbase.starteam.CatalogBase
Parameters:
objectIDs - List of objectIDs to be refreshed.
See Also:
Catalog.refresh(), Catalog.populate(), Catalog.discard(), Server.enableMPX()

discard

public void discard()
Discards all cached data for this Catalog. A subsequent get() will re-fetch the data from the server (even when MPX is enabled).

Overrides:
discard in class com.starbase.starteam.CatalogBase
See Also:
Catalog.refresh()

refresh

public void refresh()
Update the contents of the Catalog to reflect recent changes to the server. If MPX is enabled, refresh() is optimized to avoid unneccessary server commands.

Overrides:
refresh in class com.starbase.starteam.CatalogBase
See Also:
Catalog.refreshIDs(int[]), Catalog.populate(), Catalog.discard(), Server.enableMPX()

getPropertyIDs

public int[] getPropertyIDs()
Returns an array of property IDs for which this catalog has data.

Overrides:
getPropertyIDs in class com.starbase.starteam.CatalogBase
Returns:
an array of property IDs for this catalog.
See Also:
Property.getID()

get

public java.lang.Object get(int objectID,
                            int propertyID)
Returns the property value for the specified "object" ID and propertyID. Will throw an IllegalArgumentException if the object ID is not in the catalog. If the specified ID is not cached in the catalog this method will go to the server to get the catalog data for that ID alone. If still not found the exception is thrown.

Overrides:
get in class com.starbase.starteam.CatalogBase
Parameters:
objectID - the object ID for requested object
propertyID - the propertyID for the requested property value
Returns:
the specified property's value for the given object.
Throws:
java.lang.IllegalArgumentException - is the object with the specified ID is not in the catalog
See Also:
Catalog.getPropertyIDs()

getPrimaryDescriptor

public java.lang.Object getPrimaryDescriptor(int objectID)
Returns the property value for the "primary descriptor" property of the given "object" ID.

Overrides:
getPrimaryDescriptor in class com.starbase.starteam.CatalogBase
Parameters:
objectID - the object ID for which you want the value.
Returns:
the value of the primary descriptor property
See Also:
Property.isPrimaryDescriptor()

hasID

public boolean hasID(int id)
Determines whether or not information for specified ObjectID has been cached in this Catalog.

Overrides:
hasID in class com.starbase.starteam.CatalogBase
Parameters:
id - ObjectID to be examined.
Returns:
true if information for specified ID has been cached in this Catalog; false otherwise.

getIDs

public Set getIDs()
Deprecated. Use getAllIDs() instead.

Returns the set of object IDs currently stored in the catalog.

Returns:
The set of object IDs currently stored in the catalog.

getAllIDs

public int[] getAllIDs()
Returns a list of the object IDs currently stored in the catalog.

Overrides:
getAllIDs in class com.starbase.starteam.CatalogBase
Returns:
A list of the object IDs currently stored in the catalog.

isRefreshRequired

public boolean isRefreshRequired()
Returns true if a refresh() operation might have resulted in the catalog information being updated; returns false if and only if it is known that the catalog information had not been changed since the last refresh. If MPX is not enabled, then isRefreshRequired() returns true.

Overrides:
isRefreshRequired in class com.starbase.starteam.CatalogBase
Returns:
true if catalog information may be out of date.
See Also:
Catalog.refresh()

isRefreshIDsRequired

public boolean isRefreshIDsRequired(int[] objIDs)
Returns true if a refresh() operation might have resulted in the catalog information being updated for any of the given object IDs; returns false if and only if it is known that the catalog information had not been changed since the last refresh. If MPX is not enabled, then isRefreshIDsRequired() returns true.

Overrides:
isRefreshIDsRequired in class com.starbase.starteam.CatalogBase
Parameters:
objIDs - List of objectIDs to be tested.
Returns:
true if catalog information may be out of date.
See Also:
Catalog.refreshIDs(int[])

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.0, Build 58
Copyright © 2003-2004 Borland Software Corporation. All rights reserved.