com.starteam
Class Catalog

java.lang.Object
  extended by com.starteam.Catalog

public final class Catalog
extends java.lang.Object

The Catalog class provides "global" access to certain properties of objects from different classes. The catalog provides information about Property values for the primary descriptors of objects. Note that the catalog is highly memory intensive and hence extremely expensive Applications should make every effort to retrieve the primary descriptor of an object using all means available before falling back to the catalog

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

Nested Class Summary
static class Catalog.WebCacheCatalog
          The Catalog class provides "global" access to certain properties of objects from different classes.
 
Method Summary
 void discard()
          Discards all cached data for this Catalog.
 java.lang.Object get(int objectID, Property prprty)
          Returns the property value for the specified "object" ID and property.
 int[] getAllIDs()
          Returns a list of the object IDs currently stored in the catalog.
 java.lang.Object getPrimaryDescriptor(int objectID)
          Returns the property value for the "primary descriptor" property of the given "object" ID.
 PropertyCollection getProperties()
          Returns the collection of properties for which this catalog has data.
 Type getType()
          Gets the type that owns this catalog.
 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


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, refreshIDs() is optimized to avoid unnecessary server commands.

Parameters:
objectIDs - List of objectIDs to be refreshed.
See Also:
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).


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 unnecessary server commands.

See Also:
Server.enableMPX()

getProperties

public PropertyCollection getProperties()
Returns the collection of properties for which this catalog has data.

Returns:
a collection of properties for this catalog.

get

public java.lang.Object get(int objectID,
                            Property prprty)
Returns the property value for the specified "object" ID and property. 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.

Parameters:
objectID - the object ID for requested object
prprty - the requested property
Returns:
the specified property's value for the given object or NULL.

getPrimaryDescriptor

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

Parameters:
objectID - the object ID for which you want the value.
Returns:
the value of the primary descriptor property or NULL
See Also:
Property.isPrimaryDescriptor()

hasID

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

Parameters:
id - ObjectID to be examined.
Returns:
true if information for specified ID has been cached in this Catalog; false otherwise.

getAllIDs

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

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() alwyas returns true.

Returns:
true if catalog information may be out of date.

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() always returns true.

Parameters:
objIDs - List of objectIDs to be tested.
Returns:
true if catalog information may be out of date.


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.