com.starteam
Class ArtifactCacheManager

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

public final class ArtifactCacheManager
extends java.lang.Object

A collection of ArtifactCache's managed for a given server. The framework owns these caches and the associated baselines, so that all web client applications (if loaded in the same JRE) will be able to access each others cache and share types across caches The managed caches comprise tip and baselines, i.e. rolled back configurations (identified by Context) The Tip Artifact caches all interesting projects, views and types (as determined by the caller) In contrast, each rolled back cache contains all the types for a single rolled back view


Nested Class Summary
static class ArtifactCacheManager.Client
          Establish the context of a Client Application.
static class ArtifactCacheManager.Context
          Establish the context in which a web application will execute some session specific requirement.
static interface ArtifactCacheManager.Securable
          An object that can be secured in the repository.
static interface ArtifactCacheManager.SecurableContainer
          A container in the repository that can hold secured objects of a given type.
 
Method Summary
 void dropCache(ArtifactCacheManager.Context ctxt)
          Drop a tip or historical cache configuration In a multi-tenant hosted model, there may be several tip caches, one per tenant
static ArtifactCacheManager[] getAllArtifactCacheManagers()
          returns the set of all artifact cache managers registered in this cache
 ArtifactCache[] getAllHistoricalCaches()
          returns the set of all historical Artifact Caches managed by this ArtifactCacheManager manager
 ArtifactCacheManager.Client[] getAllRegisteredClients()
          return the set of all registered clients
static java.util.Hashtable getApplicationStore()
          return a Hashtable that Hub clients may use to communicate across threads, across sessions, across processes – as long as they share the same VM (Runtime) The contents of this hashtable are irrelevant to the Baseline Manager
 ArtifactCache getCache(ArtifactCacheManager.Context ctxt)
          return the tip artifact cache for a specific tenant or the ArtifactCache used to house a historical (rolled back) configuration Note that the tenant is identified by the Administrative Context, i.e.
 ArtifactCacheManager.Client getClient(java.lang.String applicationName)
          Return the Client described by the specified Application Name or null if there is no client registered matching this application name Applications may choose to maintain their own Client Context, or allow the ArtifactCacheManager to maintain the Client context on their behalf
 java.lang.String getGUID()
          Returns the GUID for this ArtifactCacheManager
static ArtifactCacheManager getManager(java.lang.String guid)
          returns an artifact cache manager responsible for managing the caches for a server or NULL
 boolean hasCache(ArtifactCacheManager.Context ctxt)
          returns true if this manager houses a historical cache described by the specified context
static ArtifactCacheManager.Context register(ServerInfo si)
          create an artifact cache manager with the given connectivity and credentials Always registers the Artifact Cache for the global system administrative content.
static ArtifactCacheManager.Context register(ServerInfo si, int tenantID)
          create an artifact cache manager with the given connectivity and credentials Tenant Artifact Caches cannot be registered until the global system artifact cache has been registered This requirement ensures that MPX is enabled on a permanently connected global artifact cache and that the global administrative user context has been set up.
 ArtifactCacheManager.Client registerClient(java.lang.String appName)
          Register a Client for this ArtifactCacheManager.
 void resetRefreshPeriod(int refreshPeriod)
          Reset the refresh period for the artifact cache managers.
static void unregister(java.lang.String guid)
          remove an artifact cache manager from the cache
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getClient

public ArtifactCacheManager.Client getClient(java.lang.String applicationName)
Return the Client described by the specified Application Name or null if there is no client registered matching this application name Applications may choose to maintain their own Client Context, or allow the ArtifactCacheManager to maintain the Client context on their behalf

Parameters:
applicationName - the application name
Returns:
the Client described by the specified Application Name

getAllRegisteredClients

public ArtifactCacheManager.Client[] getAllRegisteredClients()
return the set of all registered clients

Returns:
the set of all registered clients

registerClient

public ArtifactCacheManager.Client registerClient(java.lang.String appName)
Register a Client for this ArtifactCacheManager. Once registered, whenever a baseline cache is requested through this ArtifactCacheManager, all registered clients will be queried and their types will be cached in the ArtifactCacheManager Attempting to re-register a client with an existing name will throw an IllegalStateException If this client is interested in listening for events, listener interfaces must be attached to the client, and finally the client itself must be registered with the tip artifact cache

Parameters:
appName - the client to register

getApplicationStore

public static java.util.Hashtable getApplicationStore()
return a Hashtable that Hub clients may use to communicate across threads, across sessions, across processes – as long as they share the same VM (Runtime) The contents of this hashtable are irrelevant to the Baseline Manager

Returns:
a Hashtable that may be used for inter-client communication

resetRefreshPeriod

public void resetRefreshPeriod(int refreshPeriod)
Reset the refresh period for the artifact cache managers. The default refresh period is set to 30 seconds.

Parameters:
refreshPeriod - the new refresh period

register

public static ArtifactCacheManager.Context register(ServerInfo si)
create an artifact cache manager with the given connectivity and credentials Always registers the Artifact Cache for the global system administrative content. This will be used for on-premise applications and for starting up the REST server in a hosted system

Parameters:
si - the ServerInfo to register
Returns:
the registered baseline artifact cache manager context representing the logged in user

register

public static ArtifactCacheManager.Context register(ServerInfo si,
                                                    int tenantID)
create an artifact cache manager with the given connectivity and credentials Tenant Artifact Caches cannot be registered until the global system artifact cache has been registered This requirement ensures that MPX is enabled on a permanently connected global artifact cache and that the global administrative user context has been set up. Multi tenancy is only supported from 14.0+ servers in a hosted environment.

Parameters:
si - the ServerInfo to register
tenantID - the tenant to start up
Returns:
the registered baseline artifact cache manager context representing the tenant administrator

getManager

public static ArtifactCacheManager getManager(java.lang.String guid)
returns an artifact cache manager responsible for managing the caches for a server or NULL

Parameters:
guid - the GUID describing the repository (server)
Returns:
a artifact cache manager or NULL
See Also:
Server.getRepositoryID()

unregister

public static void unregister(java.lang.String guid)
remove an artifact cache manager from the cache

Parameters:
guid - the GUID describing the repository (server)

getAllArtifactCacheManagers

public static ArtifactCacheManager[] getAllArtifactCacheManagers()
returns the set of all artifact cache managers registered in this cache

Returns:
the set of all artifact cache managers registered in this cache

getGUID

public java.lang.String getGUID()
Returns the GUID for this ArtifactCacheManager

Returns:
the GUID for this ArtifactCacheManager

hasCache

public boolean hasCache(ArtifactCacheManager.Context ctxt)
returns true if this manager houses a historical cache described by the specified context

Parameters:
ctxt - the context that specifies a historical cache
Returns:
true if this manager houses a historical cache described by the specified context

getCache

public ArtifactCache getCache(ArtifactCacheManager.Context ctxt)
return the tip artifact cache for a specific tenant or the ArtifactCache used to house a historical (rolled back) configuration Note that the tenant is identified by the Administrative Context, i.e. the administrative logged in user id who registered the artifact cache

Parameters:
ctxt - the context that identifies the ArtifactCache. It may be the tip or rolled back
Returns:
an ArtifactCache matching the specified context

getAllHistoricalCaches

public ArtifactCache[] getAllHistoricalCaches()
returns the set of all historical Artifact Caches managed by this ArtifactCacheManager manager

Returns:
the set of all historical Artifact Caches

dropCache

public void dropCache(ArtifactCacheManager.Context ctxt)
Drop a tip or historical cache configuration In a multi-tenant hosted model, there may be several tip caches, one per tenant

Parameters:
ctxt - The context specifying a historical configuration


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