com.starteam
Class ArtifactCacheManager.Context

java.lang.Object
  extended by com.starteam.ArtifactCacheManager.Context
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
ArtifactCacheManager

public static final class ArtifactCacheManager.Context
extends java.lang.Object
implements java.io.Serializable

Establish the context in which a web application will execute some session specific requirement. The context may be as coarse or fine grained as desired. A context may be resolved to one and only one StarTeam object. The rules will be applied deterministically, to guard against the possibility of conflict The user is responsible for the integrity of the various id's stored in the object

See Also:
Serialized Form

Constructor Summary
ArtifactCacheManager.Context(java.lang.String guid, int userid)
          Create a Tip Context for a user session.
 
Method Summary
 ArtifactCacheManager.Context copy()
          returns a copy of this Context
static ArtifactCacheManager.Context createFrom(java.lang.String guid, int userid, int viewID, double dateTime)
          Create a rolled back Context for a user session.
 boolean equals(java.lang.Object o)
          Indicates whether this Context equals the other
 ArtifactCache getArtifactCache()
          Returns the ArtifactCache whose context is described by this object
 ArtifactCacheManager getArtifactCacheManager()
          Returns the ArtifactCacheManager whose context is described by this object
 double getDateTime()
          return the datetime for this context
 java.lang.String getGUID()
          return the GUID for this context
 Server.WebCacheServer getServer()
          return the Server for this context
 User.WebCacheUser getUser()
          Returns the user whose context is described by this object
 int getUserID()
          return the userid for this context
 View.WebCacheView getView()
          return the View for this context
 int getViewID()
          return the viewID for this context
 int hashCode()
          returns a hash code for this context
 boolean isTip()
          Returns True if this context represents a Tip Configuration notionally, this simply means that the date time has not been set - this does NOT make the Context object equivalent to a ViewConfiguration.
 ViewMember.WebCacheViewMember resolve(java.lang.String url)
          Resolve a given {hostname, port, ID} based StarTeam URL to an object in the Artifact Cache represented by this context.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArtifactCacheManager.Context

public ArtifactCacheManager.Context(java.lang.String guid,
                                    int userid)
Create a Tip Context for a user session. Tip Context targets the Tip artifact cache and cannot be used for a rolled back or baseline cache (or vice versa)

Parameters:
guid - the server GUID
userid - the user
Method Detail

createFrom

public static ArtifactCacheManager.Context createFrom(java.lang.String guid,
                                                      int userid,
                                                      int viewID,
                                                      double dateTime)
Create a rolled back Context for a user session. A rolled back context targets a view specific rolled back artifact cache and cannot be used against the tip cache (or vice versa)

Parameters:
guid - the server GUID
userid - the user
viewID - the rolled back view
dateTime - the rolled back (historical) time
Returns:
a rolled back Context

getGUID

public java.lang.String getGUID()
return the GUID for this context

Returns:
the GUID for this context

getUserID

public int getUserID()
return the userid for this context

Returns:
the userid for this context

getViewID

public int getViewID()
return the viewID for this context

Returns:
the viewID for this context

getDateTime

public double getDateTime()
return the datetime for this context

Returns:
the datetime for this context

isTip

public boolean isTip()
Returns True if this context represents a Tip Configuration notionally, this simply means that the date time has not been set - this does NOT make the Context object equivalent to a ViewConfiguration.

Returns:
True if this context represents a Tip Configuration

getArtifactCacheManager

public ArtifactCacheManager getArtifactCacheManager()
Returns the ArtifactCacheManager whose context is described by this object

Returns:
the ArtifactCacheManager whose context is described by this object

getArtifactCache

public ArtifactCache getArtifactCache()
Returns the ArtifactCache whose context is described by this object

Returns:
the ArtifactCache whose context is described by this object

equals

public boolean equals(java.lang.Object o)
Indicates whether this Context equals the other

Overrides:
equals in class java.lang.Object
Parameters:
o - the context to test for equality

hashCode

public int hashCode()
returns a hash code for this context

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this context

copy

public ArtifactCacheManager.Context copy()
returns a copy of this Context

Returns:
a copy of this Context

getServer

public Server.WebCacheServer getServer()
return the Server for this context

Returns:
the Server for this context

getView

public View.WebCacheView getView()
return the View for this context

Returns:
the View for this context or NULL

getUser

public User.WebCacheUser getUser()
Returns the user whose context is described by this object

Returns:
the user whose context is described by this object

resolve

public ViewMember.WebCacheViewMember resolve(java.lang.String url)
Resolve a given {hostname, port, ID} based StarTeam URL to an object in the Artifact Cache represented by this context. The URL is expected to be the output of Application.toStarTeamURL(ViewMember), using an ID based scheme

Parameters:
url - the URL to resolve
Returns:
an object cached in this artifact cache


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