com.starteam
Class Server.WebCacheServer

java.lang.Object
  extended by com.starteam.Server.WebCacheServer
Enclosing class:
Server

public static final class Server.WebCacheServer
extends java.lang.Object

Base accessor for cached SDK objects encapsulating the statefulness of objects obtained from the artifact cache.


Method Summary
 void addGroupListener(WebCacheGroupListener listener)
          Add a listener for WebCacheGroup events Listeners are supported on the tip cache only, since rolled back caches do not change over time
 void addProjectListener(WebCacheProjectListener listener)
          Add a listener for WebCacheProject events Listeners are supported on the tip cache only, since rolled back caches do not change over time
 void addTypeListener(WebCacheTypeListener listener)
          Add a listener for WebCacheType events Listeners are supported on the tip cache only, since rolled back caches do not change over time
 void addUserListener(WebCacheUserListener listener)
          Add a listener for WebCacheUser events Listeners are supported on the tip cache only, since rolled back caches do not change over time
 User.WebCacheUser changePassword(java.lang.String logonName, java.lang.String oldPassword, java.lang.String newPassword)
          Change the user's password
 Item.Type.WebCacheItemType createType(java.lang.String xmlDefinition, boolean toCreate)
          create a custom component (a new type) on the server.
static void declareWebCacheDefinitions(java.lang.String typeName, java.lang.String propertyName, java.lang.Class[] clazz)
          Registers this type to a set of user defined custom component class definitions.
 Group.WebCacheGroup findGroup(int groupID)
          return an accessible group on this server or NULL
 Principal.WebCachePrincipal findPrincipal(int principalID)
          return an accessible principal (user or group) on this server or NULL
 Project.WebCacheProject findProject(int projectID)
          return an accessible Project on this server or NULL Note that accessible projects need not yet have been cached in the artifact cache However, if it has been cached ,and is accessible, the cached project will be returned
 Project.WebCacheProject findProject(java.lang.String projectName)
          return an accessible Project on this server or NULL Note that accessible projects need not yet have been cached in the artifact cache However, if it has been cached ,and is accessible, the cached project will be returned
 Type.WebCacheType findType(int typeID)
          return an accessible type on this server or NULL
 Type.WebCacheType findType(java.lang.String typeName)
          return an accessible type on this server or NULL
 User.WebCacheUser findUser(int userID)
          return an accessible user on this server or NULL
 java.lang.String getAddress()
          Network address of this server.
 Group.WebCacheGroup getAdministratorsGroup()
          Return an instance of the "Administrators" Group.
 User.WebCacheUser[] getAllLoggedOnUsers()
          returns all the users currently logged into this cache manager
 Group.WebCacheGroup getAllUsersGroup()
          Return an instance of the "AllUsers" Group.
 ArtifactCacheManager.Context getContext()
          Returns the context of this object.
 DateTime getCurrentTime()
          Gets the current time on the server.
 Group.WebCacheGroup[] getGroups()
          Return the set of all groups cached by this ArtifactCacheManager The returned instances are type safe read only Group Instances that reflect the current & consistent state of each group w.r.t their user members until the next refresh
 User.WebCacheUser getLoggedInUser()
          Gets the user object of the logged in user.
 int getPort()
          TCP/IP port on which to connect to the remote server.
 Project.WebCacheProject[] getProjects()
          Returns the set of projects accessible by this User on this server The returned project context is that of the managed server connection of the tip cache However, the returned projects may or may not be cached in the tip cache.
 GUID getRepositoryID()
          Uniquely identifies the repository served by this server amongst all StarTeam repositories in the universe.
 ServerInfo getServerInfo()
          Return the serverInfo object used to construct this server session
 Task.Status[] getStatus(Story.Status sts)
          Return the subset of Task Status values that match the specified Story Status for this project.
 Type.WebCacheType[] getTypes()
          Returns collection of Type objects supported by this server.
 EnumeratedValue[] getUDAGroupings(Requirement.RequirementType typ)
          Return the subset of Requirement UDA Grouping values that match the specified Requirement Type for this project.
 User.WebCacheUser[] getUsers()
          Return the set of all users cached by this ArtifactCacheManager The returned instances are type safe read only User Instances that reflect the current & consistent state of each user w.r.t their Group membership until the next refresh
 Property.WebCacheProperty[] getVisibleProperties(EnumeratedValue value)
          Return the subset of properties that are visible in the context of the specified Enumerated Value
 boolean hasSavedStatus(Story.Status sts)
          Returns true if an explicit Story Status mapped to a Task Status (or set) has been saved for this project Note that if a status mapping is not saved to the server, the getStatus() api returns a default mapping
 boolean isCached(int projectID)
          Returns true if the project has been cached in the ArtifactCache and is visible in this user context.
 boolean isLoggedOn(User.WebCacheUser u)
          Returns true if this user is logged on Note that the Administrator in whose context the artifact cache is created is always logged on.
 boolean isMPXEnabled()
          Determines whether or not MPX has been enabled for this server.
 void logoff(User.WebCacheUser u)
          Logoff a User who was earlier logged on, release the license consumed by the user The logoff operation is executed on the specified server instance
 User.WebCacheUser logon(java.lang.String logonUserName, java.lang.String password)
          Logon a User with a specified user name and password, return the User Object or throw a logon exception If the logon is successful, consume a license for this user This api may only be used for logging in users in on-premise systems or for logging in additional global administrators in the hosted system's global cache.
 User.WebCacheUser logon(java.lang.String globalUserName, java.lang.String globalUserPassword, java.lang.String tenantUserName)
          Logon a Tenant User with a specified user name, return the User Object or throw a logon exception If the logon is successful, consume a license for this user
 void setStatus(Story.Status rfrnc, Task.Status[] mppdSts)
          Map a subset of Task Status values to specific Story States for the given project.
 void setUDAGroupings(Requirement.RequirementType typ, EnumeratedValue[] udas)
          Map a subset of UDA Grouping values to specific Requirement Types for the given project.
 void setVisibleProperties(EnumeratedValue value, Property.WebCacheProperty[] properties)
          Define a subset of properties of a given type that are marked visible
 void synchronize(java.lang.String[] keys, boolean acquire)
          Add or release a set of keys, i.e.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

declareWebCacheDefinitions

public static void declareWebCacheDefinitions(java.lang.String typeName,
                                              java.lang.String propertyName,
                                              java.lang.Class[] clazz)
Registers this type to a set of user defined custom component class definitions. The classes should subclass either Item or TreeItem, but not both. The classes should be "public" and should provide a public constructor with a single argument of type "com.starteam.Folder".

Parameters:
typeName - String The name of the Type to be registered
propertyName - String The name of the property whose value matches one of the class names in the array
clazz - a set of classes which provide alternate definitions for an artifact instance
Throws:
java.lang.IllegalArgumentException
See Also:
Class.getName(), Server.declareComponentDefinitions(String, String, Class[])

getContext

public ArtifactCacheManager.Context getContext()
Returns the context of this object.

Returns:
the context of this object.

getCurrentTime

public DateTime getCurrentTime()
Gets the current time on the server.

Returns:
The current server time

getAddress

public java.lang.String getAddress()
Network address of this server.

Returns:
string representing the network address

getPort

public int getPort()
TCP/IP port on which to connect to the remote server.

Returns:
server's TCP/IP port

getServerInfo

public ServerInfo getServerInfo()
Return the serverInfo object used to construct this server session

Returns:
A copy of serverInfo object used to construct this server session

getProjects

public Project.WebCacheProject[] getProjects()
Returns the set of projects accessible by this User on this server The returned project context is that of the managed server connection of the tip cache However, the returned projects may or may not be cached in the tip cache. If they are, the cached projects are returned in preference to the uncached ones

Returns:
the set of projects accessible by this User

findProject

public Project.WebCacheProject findProject(int projectID)
return an accessible Project on this server or NULL Note that accessible projects need not yet have been cached in the artifact cache However, if it has been cached ,and is accessible, the cached project will be returned

Parameters:
projectID - the id of the project
Returns:
an accessible Project on this server or NULL

findProject

public Project.WebCacheProject findProject(java.lang.String projectName)
return an accessible Project on this server or NULL Note that accessible projects need not yet have been cached in the artifact cache However, if it has been cached ,and is accessible, the cached project will be returned

Parameters:
projectName - the name of the project
Returns:
an accessible Project on this server or NULL

isMPXEnabled

public boolean isMPXEnabled()
Determines whether or not MPX has been enabled for this server.

Returns:
true if MPX has been enabled for this server, false otherwise.

isCached

public boolean isCached(int projectID)
Returns true if the project has been cached in the ArtifactCache and is visible in this user context. Note that projects cached in the ArtifactCache need not be visible in the context of a user without the appropriate access rights. In other words, it is possible for this api to return true in the administrator context, but false in an unauthorized user context

Parameters:
projectID - the project to check for
Returns:
true if the project is cached in the Artifact Cache

getTypes

public Type.WebCacheType[] getTypes()
Returns collection of Type objects supported by this server.

Returns:
a collection of Types instances

findType

public Type.WebCacheType findType(int typeID)
return an accessible type on this server or NULL

Parameters:
typeID - the id of the type
Returns:
an accessible Type on this server or NULL

findType

public Type.WebCacheType findType(java.lang.String typeName)
return an accessible type on this server or NULL

Parameters:
typeName - the name of the type
Returns:
an accessible Type on this server or NULL

findPrincipal

public Principal.WebCachePrincipal findPrincipal(int principalID)
return an accessible principal (user or group) on this server or NULL

Parameters:
principalID - the id of the principal
Returns:
an accessible Principal on this server or NULL

getUsers

public User.WebCacheUser[] getUsers()
Return the set of all users cached by this ArtifactCacheManager The returned instances are type safe read only User Instances that reflect the current & consistent state of each user w.r.t their Group membership until the next refresh

Returns:
the set of all users cached by this ArtifactCacheManager

findUser

public User.WebCacheUser findUser(int userID)
return an accessible user on this server or NULL

Parameters:
userID - the id of the user
Returns:
an accessible User on this server or NULL

findGroup

public Group.WebCacheGroup findGroup(int groupID)
return an accessible group on this server or NULL

Parameters:
groupID - the id of the group
Returns:
an accessible Group on this server or NULL

getGroups

public Group.WebCacheGroup[] getGroups()
Return the set of all groups cached by this ArtifactCacheManager The returned instances are type safe read only Group Instances that reflect the current & consistent state of each group w.r.t their user members until the next refresh

Returns:
All of the groups on this server.

getAdministratorsGroup

public Group.WebCacheGroup getAdministratorsGroup()
Return an instance of the "Administrators" Group.

Returns:
"Administrators" group on this server.

getAllUsersGroup

public Group.WebCacheGroup getAllUsersGroup()
Return an instance of the "AllUsers" Group.

Returns:
"AllUsers" group on this server.

logon

public User.WebCacheUser logon(java.lang.String logonUserName,
                               java.lang.String password)
Logon a User with a specified user name and password, return the User Object or throw a logon exception If the logon is successful, consume a license for this user This api may only be used for logging in users in on-premise systems or for logging in additional global administrators in the hosted system's global cache.

Parameters:
logonUserName - The logon user name
password - the password to use for logging on
Returns:
a User object if the logon is successful

logon

public User.WebCacheUser logon(java.lang.String globalUserName,
                               java.lang.String globalUserPassword,
                               java.lang.String tenantUserName)
Logon a Tenant User with a specified user name, return the User Object or throw a logon exception If the logon is successful, consume a license for this user

Parameters:
globalLogonUserName - The global logon administrator name
globalUserPassword - The global logon administrator password
tenantUserName - The tenant user to be logged on. Note that in the hosted context, the tenant user has already been authenticated via the login portal Logging in the user through the artifact cache is a separate requirement of the web application
Returns:
a User object if the logon is successful

changePassword

public User.WebCacheUser changePassword(java.lang.String logonName,
                                        java.lang.String oldPassword,
                                        java.lang.String newPassword)
Change the user's password

Parameters:
logonName - the user whose password is being changed
oldPassword - the old password
newPassword - the new password
Returns:
the user object, logged on with the new password
See Also:
Server.changePassword(String, String, String)

getLoggedInUser

public User.WebCacheUser getLoggedInUser()
Gets the user object of the logged in user.

Returns:
The user object of the logged in user, or null if no one has logged in. The logged in user is the Administrator in whose context this artifact cache has been loaded up.

getRepositoryID

public GUID getRepositoryID()
Uniquely identifies the repository served by this server amongst all StarTeam repositories in the universe. Be warned that it is possible to take an existing StarTeam repository and re-host it on another machine in which case this unique ID is no longer unique.

Returns:
com.starteam.util.GUID

logoff

public void logoff(User.WebCacheUser u)
Logoff a User who was earlier logged on, release the license consumed by the user The logoff operation is executed on the specified server instance

Parameters:
u - the user being logged off

isLoggedOn

public boolean isLoggedOn(User.WebCacheUser u)
Returns true if this user is logged on Note that the Administrator in whose context the artifact cache is created is always logged on. This api really answers the question - is a user logged on and is that user consuming a web license

Parameters:
u - the specified user
Returns:
true if this user is logged on

getAllLoggedOnUsers

public User.WebCacheUser[] getAllLoggedOnUsers()
returns all the users currently logged into this cache manager

Returns:
all the users currently logged into this cache manager

synchronize

public void synchronize(java.lang.String[] keys,
                        boolean acquire)
Add or release a set of keys, i.e. acquire a lock for these named keys The server will synchronize access to an internal hash table across any/all threads which attempt key acquisitions. The first thread wins and acquires the key all subsequent threads lose and a server exception will be thrown If this method fails, a server exception will be thrown Well behaved applications that acquire a locked key should release it as quickly as possible

Parameters:
keys - the keys to be acquired or released
acquire - true to acquire the keys, false to release them

addProjectListener

public void addProjectListener(WebCacheProjectListener listener)
Add a listener for WebCacheProject events Listeners are supported on the tip cache only, since rolled back caches do not change over time

Parameters:
listener - a listener for WebCacheProject events

addUserListener

public void addUserListener(WebCacheUserListener listener)
Add a listener for WebCacheUser events Listeners are supported on the tip cache only, since rolled back caches do not change over time

Parameters:
listener - a listener for WebCacheUser events

addGroupListener

public void addGroupListener(WebCacheGroupListener listener)
Add a listener for WebCacheGroup events Listeners are supported on the tip cache only, since rolled back caches do not change over time

Parameters:
listener - a listener for WebCacheGroup events

addTypeListener

public void addTypeListener(WebCacheTypeListener listener)
Add a listener for WebCacheType events Listeners are supported on the tip cache only, since rolled back caches do not change over time

Parameters:
listener - a listener for WebCacheType events

createType

public Item.Type.WebCacheItemType createType(java.lang.String xmlDefinition,
                                             boolean toCreate)
create a custom component (a new type) on the server. Support for Custom Components has been introduced in the 12.0 release

Parameters:
xmlDefinition - the xml definition describing the schema of the new Type
toCreate - true to create the Component, false to verify the schema
Returns:
the Type matching the component definition or NULL if the schema is being verified

getUDAGroupings

public EnumeratedValue[] getUDAGroupings(Requirement.RequirementType typ)
Return the subset of Requirement UDA Grouping values that match the specified Requirement Type for this project. This feature was introduced in the 14.0 server

Parameters:
typ - the requirement type to test
Returns:
a mapping set of UDA Groupings or an empty array

setUDAGroupings

public void setUDAGroupings(Requirement.RequirementType typ,
                            EnumeratedValue[] udas)
Map a subset of UDA Grouping values to specific Requirement Types for the given project.

Parameters:
typ - the requirement type to be mapped
udas - the set of UDA Groupings

getVisibleProperties

public Property.WebCacheProperty[] getVisibleProperties(EnumeratedValue value)
Return the subset of properties that are visible in the context of the specified Enumerated Value

Parameters:
value - an Enumerated Value for a specific Enumerated Property of a chosen type
Returns:
the subset of properties of the same Type that are marked visible in the context of this enum

setVisibleProperties

public void setVisibleProperties(EnumeratedValue value,
                                 Property.WebCacheProperty[] properties)
Define a subset of properties of a given type that are marked visible

Parameters:
value - an Enumerated Value for a specific Enumerated Property of a chosen type
properties - the set of properties marked visible in the context of the specified enum

getStatus

public Task.Status[] getStatus(Story.Status sts)
Return the subset of Task Status values that match the specified Story Status for this project. Story Status of NOT_STARTED and COMPLETED may return at most one corresponding Task Status. Story Status of STARTED may return a subset of Task Status The returned subsets across all three Story States are disjoint. This feature was introduced in the 14.0 server

Parameters:
sts - the story status to test
Returns:
a mapping set of Task States or an empty array

setStatus

public void setStatus(Story.Status rfrnc,
                      Task.Status[] mppdSts)
Map a subset of Task Status values to specific Story States for the given project. Story Status of NOT_STARTED and COMPLETED must map to one and only one equivalent Task Status Story Status of STARTED may map to a subset of Task States, provided that all mappings are unique and disjoint. The calling application is responsible for ensuring that each Story Status is mapped to one or more Task States as the case demands. This feature was introduced in the 14.0 server

Parameters:
rfrnc - the reference Story Status to be mapped
mppdSts - the Task States to map it to.

hasSavedStatus

public boolean hasSavedStatus(Story.Status sts)
Returns true if an explicit Story Status mapped to a Task Status (or set) has been saved for this project Note that if a status mapping is not saved to the server, the getStatus() api returns a default mapping

Parameters:
sts - the status to test for in this project context
Returns:
true if an explicit Story Status mapped to a Task Status (or set) has been saved for this project This feature was introduced in the 14.0 server
See Also:
Server.WebCacheServer.getStatus(com.starteam.Story.Status)


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