com.starteam
Class ArtifactCache

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

public final class ArtifactCache
extends java.lang.Object

An artifact cache is a collection of artifacts of different types The cache creates and maintains a private connection to the StarTeam server, using the credentials specified in the constructor This connection is closed when the cache is discarded. Well behaved applications should call the ArtifactCache.close() api. The cache manages the artifacts requested, and access rights to these artifacts General queries may be constructed of the form Does a given principal have the right to read (or write) to an object in this cache Typically, the cache is built up in the context of an Administrator, but cached objects are shared across less privileged users, depending upon their access rights This is a self-refreshing cache; refreshes are requested on a regular timer With MPX enabled, the refreshes are optimized to execute the fewest possible server commands Note that while it is certainly reasonable and expected for the calling application to have enabled MPX and registered the server object with a CacheAgent, this cache itself attempts to enable MPX, if required. However, the cache makes no attempt to auto locate a cache agent. There are two reasons for this Auto locating a cache agent makes no guarantees about the nearness of the cache agent. Auto location is based solely on which cache agent responds first to a broadcast When used in the context of a web server (the primary motif for this class) it is generally expected that the web service application is network near to the StarTeam server. In this case, a Cache Agent offers little to no performance benefit, and in some cases may even cause a potential degradation in overall performance and throughput. An application can however, explicitly locate a cache agent using Server.locateCacheAgent(String, int)


Method Summary
 void cacheViewMembers(View.WebCacheView view, ViewMember.Type.WebCacheViewMemberType type)
          Caches the view members of the specified type for the specified view.
 void cacheViewMembers(View.WebCacheView view, ViewMember.Type.WebCacheViewMemberType[] types)
          Caches the view members of the specified types for the specified view.
 void cacheViewMembers(ViewMember.Type.WebCacheViewMemberType[] types)
          Caches the view members of the specified types for the rolled back view.
 View.WebCacheView findView(User.WebCacheUser usr, int viewID)
          Returns a view cached by this artifact cache, matching the specified View ID
 DateTime getBaselineTime()
          returns the time at which this baseline has been cached.
 DateTime getLastUsedAt()
          Returns the time at which this Cache was last used
 ArtifactCacheManager getManager()
          returns the artifact cache manager that owns this cache
 boolean isBaseline()
          returns true if this is a baseline cache Baseline (rolled back) caches are historical, read only caches They are based on either a label, promotion state or historical point in time
 boolean isCached(View.WebCacheView view)
          Returns true if this view is currently cached in this ArtifactCache Note that views may be cached and then removed (dynamic caching) and subsequently re-cached.
 boolean isCached(View.WebCacheView view, ViewMember.Type.WebCacheViewMemberType type)
          Returns true if the specified type is currently cached in this ArtifactCache for the specified view Note that views may be cached and then removed (dynamic caching) and subsequently re-cached.
 boolean isOpen()
          Returns true if this artifact cache is open
 void remove(Project.WebCacheProject p)
          Remove this project from the ArtifactCache.
 void remove(View.WebCacheView vw)
          Close this view and remove it from the ArtifactCache.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLastUsedAt

public DateTime getLastUsedAt()
Returns the time at which this Cache was last used

Returns:
the time at which this Cache was last used

isBaseline

public boolean isBaseline()
returns true if this is a baseline cache Baseline (rolled back) caches are historical, read only caches They are based on either a label, promotion state or historical point in time

Returns:
true if this is a baseline cache

getBaselineTime

public DateTime getBaselineTime()
returns the time at which this baseline has been cached. Baselines are cached representations of a specific rolled back view. If the rolled back view is time based, then return the specified configuration time If it is label based, return the label time If PromotionState based, return the time of the label associated with the promotion state The Baseline time is necessary to identify the types assigned to a project in history

Returns:
the configuration time of the baseline or NULL

isOpen

public boolean isOpen()
Returns true if this artifact cache is open

Returns:
true if this artifact cache is open

getManager

public ArtifactCacheManager getManager()
returns the artifact cache manager that owns this cache

Returns:
the artifact cache manager that owns this cache

findView

public View.WebCacheView findView(User.WebCacheUser usr,
                                  int viewID)
Returns a view cached by this artifact cache, matching the specified View ID

Parameters:
usr - the user in whose context the view is being requested
viewID - a viewID to search for
Returns:
a view cached by this artifact cache, matching the specified View ID

isCached

public boolean isCached(View.WebCacheView view)
Returns true if this view is currently cached in this ArtifactCache Note that views may be cached and then removed (dynamic caching) and subsequently re-cached. This api makes no representation with regard to whether the view was ever historically cached

Parameters:
view - the view to test for
Returns:
true if the specified view is currently cached in this ArtifactCache

isCached

public boolean isCached(View.WebCacheView view,
                        ViewMember.Type.WebCacheViewMemberType type)
Returns true if the specified type is currently cached in this ArtifactCache for the specified view Note that views may be cached and then removed (dynamic caching) and subsequently re-cached. This api makes no representation with regard to whether the view or type was ever historically cached

Parameters:
view - the view to test for
type - the type to test for
Returns:
true if the specified type is currently cached for the specified view in this ArtifactCache

cacheViewMembers

public void cacheViewMembers(View.WebCacheView view,
                             ViewMember.Type.WebCacheViewMemberType type)
Caches the view members of the specified type for the specified view. If the specified type is an Item.Type, automatically cache parent folders too

Parameters:
view - the view whose view members will be cached
type - the type of view member to be cached

cacheViewMembers

public void cacheViewMembers(View.WebCacheView view,
                             ViewMember.Type.WebCacheViewMemberType[] types)
Caches the view members of the specified types for the specified view. If the specified type is an Item.Type, automatically cache parent folders too If specified, trace types will be cached last

Parameters:
view - the view whose view members will be cached
types - the types of view member to be cached

cacheViewMembers

public void cacheViewMembers(ViewMember.Type.WebCacheViewMemberType[] types)
Caches the view members of the specified types for the rolled back view. If the specified type is an Item.Type, automatically cache parent folders too If specified, trace types will be cached last

Parameters:
types - the types of view member to be cached

remove

public void remove(Project.WebCacheProject p)
Remove this project from the ArtifactCache. An application may choose to remove projects that have not been recently used, to conserve memory

Parameters:
p - the project whose cached views and view members will be dropped

remove

public void remove(View.WebCacheView vw)
Close this view and remove it from the ArtifactCache. An application may choose to remove views that have not been recently used, to conserve memory

Parameters:
vw - the view whose cached view members will be dropped


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