|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.Server
public class Server
The Server class provides network access to a remote StarTeam Server. It only supports access through TCP/IP sockets and has the ability to encrypt and compress all communication between the client server.
| Nested Class Summary | |
|---|---|
static class |
Server.CacheController
For each repository accessed via some Server object, we maintain a local cache that holds data fetched from the repository. |
static class |
Server.EmailAttachment
This class embodies an email attachment. |
static class |
Server.EncryptionAlgorithm
This class provides a convenient place to refer to the different encryption algorithms that can be used for secure StarTeam connections. |
static class |
Server.ProductCode
This public final class defines constant values for the various StarTeam product codes. |
static class |
Server.Session
Represents a user's session with the server. |
static class |
Server.WebCacheServer
Base accessor for cached SDK objects encapsulating the statefulness of objects obtained from the artifact cache. |
| Field Summary | |
|---|---|
static DotNotation |
CONNECT_AS_110
The server command API revision level of the StarTeam 2009 (11.0) server. |
static DotNotation |
CONNECT_AS_120
The server command API revision level of the StarTeam 12.0 server. |
static DotNotation |
CONNECT_AS_125
The server command API revision level of the StarTeam 12.5 server. |
static DotNotation |
CONNECT_AS_130
The server command API revision level of the StarTeam 13.0 server. |
static DotNotation |
CONNECT_AS_140
The server command API revision level of the StarTeam 14.0 server. |
| Constructor Summary | |
|---|---|
Server(ServerInfo info)
Creates a new Server object, using the given connection information. |
|
Server(java.lang.String serverName)
Looks up the given server name in starteam-servers.xml, and uses the resulting ServerInfo to construct the server. |
|
Server(java.lang.String address,
int port)
Constructs an object that represents a remote server process. |
|
| Method Summary | |
|---|---|
void |
addGroupListener(GroupListener listener)
Adds a listener for Group events. |
void |
addMPXStatusListener(MPXStatusListener listener)
Adds a listener for MPXStatusEvents. |
void |
addProjectListener(ProjectListener listener)
Adds a listener for Project events. |
void |
addServerControlListener(ServerControlListener listener)
Adds a listener for ServerControl events. |
void |
addTypedResourceListener(TypedResourceListener listener,
LiveObject container,
TypeCollection types)
Adds a listener for all events occurring on the specified container (Currently supports Project, View and Folder) This is a lightweight solution for listening to events without the need to keep the container open. |
void |
addTypeListener(TypeListener listener)
Adds a listener for Type events. |
void |
addUserListener(UserListener listener)
Adds a listener for User events. |
CacheAgent |
autoLocateCacheAgent()
autoLocate a Cache Agent, return null if none found Attempts to autolocate can be expensive |
User |
autoLogOn()
Log on to this server using credentials that have been cached on this workstation. |
void |
cacheLogOnCredentials(java.lang.String username,
java.lang.String password)
Saves logon credentials for this server so that they may be used in future calls to autoLogOn(). |
User |
changePassword(java.lang.String logOnName,
java.lang.String password,
java.lang.String newPassword)
Changes the password to the specified new password upon a successful login to the server, and immediately logs out. |
void |
connect()
Establishes a network connection to the remote server process. |
void |
connect(DotNotation clientVersion)
Establishes a network connection to the remote server process. |
void |
createTenant(int tenantID,
java.lang.String tenantName,
java.lang.String tenantAdminLoginName,
java.lang.String tenantAdminPassword)
Create a new tenant in an environment that supports multi-tenant hosting Will throw a server exception for on-premise servers |
Item.Type |
createType(java.lang.String xmlDefinition,
boolean toCreate)
create a custom component (a new type) on the server. |
static void |
declareComponentDefinition(java.lang.String typeName,
java.lang.Class componentClass)
Registers this type to a User-defined (custom) component class definition. |
static void |
declareComponentDefinitions(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. |
void |
disableMPX()
Disables MPX, if it was enabled for this server. |
void |
discardAccounts()
Discards all cached User and Group information. |
void |
discardGroups()
Discards cached Group information. |
void |
discardProjects()
Discards the list of cached projects. |
void |
discardUsers()
Discards cached User information. |
void |
disconnect()
Terminates the network connection to the remote server process. |
static void |
enableCredentialCaching()
Enables credential caching on this workstation, if it is available and not already enabled. |
void |
enableMPX()
Enables MPX using the default client MPX profile. |
void |
enableMPX(EventHandlerProfile profile)
Enables MPX using the given MPX profile. |
void |
enableMPX(java.lang.String strProfileName)
Enables MPX using the MPX profile with the given name. |
static java.io.File |
encryptPasswordToFile(java.lang.String password,
java.lang.String fileName)
Encrypt and save the specified clear text password to a file Return the file to the caller when done |
User[] |
fetchEmailUsers()
This method issues a command to the server to return the list of users who are able to receive email messages. |
Group |
findGroup(int groupID)
Returns the Group object for the given ID. |
Project |
findProject(int projectID)
Finds a project in the server's project collection. |
Project |
findProject(java.lang.String name)
Finds a project in the server's project collection. |
User |
findUser(int userID)
Returns the User object for the given ID. |
Group[] |
getActiveGroups()
Returns all of the active (non-deleted) groups in this Server. |
User[] |
getActiveUsers()
Returns all of the active (non-deleted) users in this Server. |
java.lang.String |
getAddress()
Network address of this server. |
ServerAdministration |
getAdministration()
Returns the ServerAdministration object through which
various administration operations can be performed on the server. |
Group |
getAdministratorsGroup()
Return an instance of the "Administrators" Group. |
Group |
getAllUsersGroup()
Return an instance of the "AllUsers" Group. |
Application |
getApplication()
Gets the client application that owns this Server instance. |
int |
getAutoReconnectAttempts()
If automatic reconnect is enabled, indicates the maximum number of attempts to reconnect that will be made while executing a single server command. |
int |
getAutoReconnectWait()
If automatic reconnect is enabled, indicates the number of seconds that we will wait before each reconnect attempt. |
static ServerInfoCollection |
getCachedCredentials()
If the StarTeam toolbar is running on this machine, and credentials have been cached return a collection of ServerInfo Objects representing Cached Credentials The returned ServerInfo objects in the collection have (at least) the user name, host name & port populated |
ClientContext |
getClientContext()
Returns the ClientContext associated when logged in to the Server. |
java.lang.String |
getCommandAPIRevisionLevel()
Returns the command interface revision level (dot notation) supported by this server. |
int |
getCommandCount()
Gets the number of commands sent to the StarTeam server since the connection was established. |
CacheAgent |
getCurrentCacheAgent()
returns the CacheAgent currently in use by this server, or null will attempt to locate a cache agent at a specified {address, port} or autoLocate one, if necessary |
EventHandlerProfile |
getCurrentMPXProfile()
Gets the current MPX event handler profile. |
DateTime |
getCurrentTime()
Gets the current time on the server. |
Server.EncryptionAlgorithm |
getEncryptionAlgorithm()
Gets the level of EncryptionAlgorithm requested for the connection. |
EventHandlerInfo |
getEventHandlerInfo(java.lang.String eventHandlerInfoName)
Returns the specified EventHandlerInfo object on this server. |
java.lang.String[] |
getEventHandlerInfoNames()
Returns an array containing the names of all existing EventHandlerInfos on this server. |
Group[] |
getGroups()
Returns all of the groups on this Server. |
int |
getKeepAliveInterval()
Gets the keep-alive interval, in minutes. |
User |
getLoggedInUser()
Gets the user object of the logged in user. |
int |
getMPXMessageCount()
Gets the number of MPX messages received by the server since MPX was enabled. |
java.lang.String |
getMPXTransmitterName()
The name of the event handler for the StarTeam MPX Transmitter. |
int |
getPort()
TCP/IP port on which to connect to the remote server. |
Server.ProductCode[] |
getProductCodes()
Gets the product codes licensed for this server. |
Project[] |
getProjects()
Ensures that this server's project list has been retrieved and cached locally. |
int |
getProtocol()
Gets the protocol used to connect to the server. |
GUID |
getRepositoryID()
Uniquely identifies the repository served by this server amongst all StarTeam repositories in the universe. |
Server.EncryptionAlgorithm |
getRequiredEncryptionLevel()
Returns the level of security required to connect to the server. |
short |
getRevisionLevel()
Returns the interface revision level supported by this server. |
java.lang.String |
getServerBuild()
Returns the server build number as reported by the server. |
java.lang.String |
getServerBuildDescription()
Returns a server build description as reported by the server. |
ServerInfo |
getServerInfo()
Return a copy of the serverInfo object used to construct this server session A copy is returned to prevent the caller from modifying the internal state of the server object after the connection has been established |
Server.Session |
getSession()
Returns session information for the currently logged on user. |
Task.Status[] |
getStatus(Story.Status sts)
Return the subset of Task Status values that match the specified Story Status for this project. |
SupportedFeatures |
getSupportedFeatures()
Gets an instance of the SupportedFeatures class that can tell which features are available for this StarTeam server. |
TypeCollection |
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[] |
getUsers()
Returns all the active and deleted users on this Server. |
PropertyCollection |
getVisibleProperties(EnumeratedValue value)
Return the subset of properties that are visible in the context of the specified Enumerated Value |
void |
handleEvents()
Places the current thread in an event-handling state. |
boolean |
hasInactivityTimeout()
Returns true if the server has an inactivity timeout interval specified |
boolean |
hasProductCode(Server.ProductCode code)
Determines whether or not the server has a license for the specified product code. |
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 |
void |
interruptHandleEvents()
Interrupts a handleEvents() loop, if there is one running. |
boolean |
isAutoLogOnAvailable()
Determines whether or not logon credentials for this server have been cached on this workstation. |
boolean |
isAutoReconnectEnabled()
Indicates whether or not a reconnect is automatically attempted whenever a connection problem is detected while executing a server command. |
boolean |
isCompressed()
Determines whether or not the server connection is compressed. |
boolean |
isConnected()
Tells whether a network connection has been established to the server. |
static boolean |
isCredentialCachingAvailable()
Determines whether or not the credential caching feature is available on this workstation. |
static boolean |
isCredentialCachingEnabled()
Determines whether or not credential caching is enabled on this workstation. |
boolean |
isKeepAliveEnabled()
Determines whether or not keep-alive mode is in effect. |
boolean |
isLoggedOn()
Returns true if someone has logged on through this server object. |
boolean |
isMailAvailable()
Determines whether or not the server supports email. |
boolean |
isMPXAvailable()
Determines whether or not MPX is installed on this server. |
boolean |
isMPXEnabled()
Determines whether or not MPX has been enabled for this server. |
boolean |
isMPXResponding()
Determines whether or not the MPX server is running properly. |
boolean |
isRefreshAccountsRequired()
Returns true if a refreshAccounts() operation might have resulted in User or Group information being updated; returns false if and only if it is known that the User and Group information had not been changed since the last refresh. |
boolean |
isRefreshGroupsRequired()
Returns true if a refreshGroups() operation might have resulted in Group information being updated; returns false if and only if it is known that the Group information had not been changed since the last refresh. |
boolean |
isRefreshProjectsRequired()
Determines whether or not the server's project list needs to be refreshed. |
boolean |
isRefreshUsersRequired()
Returns true if a refreshUsers() operation might have resulted in User information being updated; returns false if and only if it is known that the User information had not been changed since the last refresh. |
CacheAgent |
locateCacheAgent(java.lang.String hostName,
int port)
locate a CacheAgent at a given address and port |
User |
logOn(java.lang.String logOnName,
java.io.File passwordFile)
Establishes a user-session with the remote server process. |
User |
logOn(java.lang.String logOnName,
java.lang.String password)
Establishes a user-session with the remote server process. |
User |
logOn(java.lang.String logOnName,
java.lang.String password,
ClientContext context)
Establishes a user-session with the remote server process, on behalf of the specified ClientContext. |
User |
logOn(java.lang.String logOnName,
java.lang.String password,
GUID workStationID)
Establishes a user-session with the remote server process, on behalf of the workstation with the given ID. |
GUID |
obtainLicense(User user)
Get/Consume a license for the specified User, using this Server's session ID to obtain the license. |
GUID |
obtainLicense(User user,
Server server)
Get/Consume a license for the specified User, using the specified Server's session ID to obtain the license. |
boolean |
ping()
Verifies that the server is responding and informs the server that this connection/user session is still active. |
void |
pingMPXServer()
Throws an appropriate MPXException if the MPX server is not running properly. |
void |
reconnect()
Attempts to re-establish the connection to the server, re-opening any existing view sessions. |
void |
reconnect(java.lang.String password)
Attempts to re-establish the connection to the server, re-opening any existing view sessions. |
void |
refreshAccounts()
Refreshes cached User and Group information. |
void |
refreshGroups()
Refreshes cached Group information to reflect recent changes to the repository. |
void |
refreshProjects()
Ensures that the latest list of projects has been retrieved from the server and cached locally. |
void |
refreshUsers()
Refreshes cached User information to reflect recent changes to the repository. |
void |
releaseLicense(User user)
Release a license owned by the specified User, where this Server's session ID was used to obtain the license. |
void |
releaseLicense(User user,
GUID sessionID)
Release the license obtained for the specified User via the specified GUID. |
void |
releaseLicense(User user,
Server server)
Release a license owned by the specified User, where the specified Server's session ID was used to obtain the license. |
void |
removeGroupListener(GroupListener listener)
Removes a listener for Group events. |
void |
removeMPXStatusListener(MPXStatusListener listener)
Removes a listener for MPXStatusEvents. |
void |
removeProjectListener(ProjectListener listener)
Removes a listener for Project events. |
void |
removeServerControlListener(ServerControlListener listener)
Removes a listener for ServerControl events. |
void |
removeTypedResourceListener(TypedResourceListener listener,
LiveObject container)
Removes a listener for TypedResource events. |
void |
removeTypeListener(TypeListener listener)
Removes a listener for Type events. |
void |
removeUserListener(UserListener listener)
Removes a listener for User events. |
void |
sendMail(View view,
User[] to,
User[] cc,
User[] bcc,
java.lang.String subject,
java.lang.String body)
Directs the StarTeam Server to send mail to the specified StarTeam users. |
void |
sendMail(View view,
User[] to,
User[] cc,
User[] bcc,
java.lang.String subject,
java.lang.String body,
Server.EmailAttachment[] attachments)
Directs the StarTeam Server to send mail to the specified StarTeam users. |
void |
setAutoReconnectAttempts(int nAttempts)
If automatic reconnect is enabled, specifies the maximum number of attempts to reconnect that will be made while executing a single server command. |
void |
setAutoReconnectEnabled(boolean bEnabled)
Specifies whether or not a reconnect is automatically attempted whenever a connection problem is detected while executing a server command. |
void |
setAutoReconnectWait(int nSeconds)
If automatic reconnect is enabled, specifies the number of seconds that we will wait before each reconnect attempt. |
void |
setKeepAlive(boolean bKeepAlive)
Enables or disables keep-alive mode. |
void |
setKeepAliveInterval(int nMinutes)
Sets the keep-alive interval, in minutes. |
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,
PropertyCollection 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. |
java.lang.String |
toString()
Returns a summary String representation of this server. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final DotNotation CONNECT_AS_110
Server.connect(DotNotation)public static final DotNotation CONNECT_AS_120
Server.connect(DotNotation)public static final DotNotation CONNECT_AS_125
Server.connect(DotNotation)public static final DotNotation CONNECT_AS_130
Server.connect(DotNotation)public static final DotNotation CONNECT_AS_140
Server.connect(DotNotation)| Constructor Detail |
|---|
public Server(java.lang.String serverName)
serverName - String a server name in starteam-servers.xml
public Server(java.lang.String address,
int port)
address - the host address of the remote serverport - the TCP/IP port of the remote serverServer.Server(ServerInfo)public Server(ServerInfo info)
The ServerInfo must specify a supported protocol; otherwise, an IllegalArgumentException will be thrown.
If ServerInfo specifies an MPXProfileName, then later, after the Server connection itself is established, an attempt will be made to automatically enable MPX.
info - Server connection information.
java.lang.IllegalArgumentExceptionServerInfo,
Server.connect(),
Server.enableMPX()| Method Detail |
|---|
public Group getAdministratorsGroup()
public Group getAllUsersGroup()
public ServerInfo getServerInfo()
public Application getApplication()
public TypeCollection getTypes()
Type objects supported by this server.
Types instancespublic ServerAdministration getAdministration()
ServerAdministration object through which
various administration operations can be performed on the server.
public Server.Session getSession()
public User[] fetchEmailUsers()
public boolean isRefreshUsersRequired()
Server.refreshUsers(),
Server.enableMPX()public void refreshUsers()
Server.isRefreshUsersRequired(),
Server.getUsers(),
Server.discardUsers(),
Server.enableMPX()public void discardUsers()
Server.getUsers(),
Server.refreshUsers()public void refreshAccounts()
Server.isRefreshAccountsRequired(),
Server.refreshUsers(),
Server.refreshGroups(),
Server.discardAccounts()public void discardAccounts()
Server.refreshAccounts()public boolean isRefreshAccountsRequired()
Server.refreshAccounts(),
Server.isRefreshUsersRequired(),
Server.isRefreshGroupsRequired(),
Server.enableMPX()public boolean isRefreshGroupsRequired()
Server.refreshGroups(),
Server.enableMPX()public void discardGroups()
Server.getGroups(),
Server.refreshGroups()public void refreshGroups()
Server.isRefreshGroupsRequired(),
Server.getGroups(),
Server.discardGroups()public java.lang.String getAddress()
public int getPort()
public Server.EncryptionAlgorithm getEncryptionAlgorithm()
Server.EncryptionAlgorithmpublic boolean isCompressed()
public int getProtocol()
ServerConfiguration.PROTOCOL_TCP_IP_SOCKETSpublic GUID getRepositoryID()
com.starteam.util.GUIDpublic Server.EncryptionAlgorithm getRequiredEncryptionLevel()
public boolean isConnected()
public ClientContext getClientContext()
public Project[] getProjects()
Server.refreshProjects()public boolean isRefreshProjectsRequired()
Server.refreshProjects(),
Server.enableMPX()public void refreshProjects()
Server.getProjects(),
Server.isRefreshProjectsRequired(),
Server.discardProjects(),
Server.enableMPX()public void discardProjects()
Server.getProjects(),
Server.refreshProjects(),
Server.enableMPX()public Project findProject(int projectID)
projectID - The project ID of the desired project.
public Project findProject(java.lang.String name)
name - The name of the desired project.
public User[] getActiveUsers()
ServerAdministration.getUsers() to reduce the number
of server commands issued.
Server.getUsers(),
ServerAdministration.getUsers()public User[] getUsers()
ServerAdministration.getUsers() which loads the
complete account information for all users. However, applications
requiring access to the full user account information should use use
ServerAdministration.getUsers() to reduce the number
of server commands issued.
Server.refreshUsers(),
Server.discardUsers(),
Server.getActiveUsers(),
ServerAdministration.getUsers()public Group[] getActiveGroups()
ServerAdministration.getGroups() to reduce the
number of server commands issued.
Server.getGroups(),
ServerAdministration.getGroups()public Group[] getGroups()
ServerAdministration.getGroups() to load the
complete group account information
Server.refreshGroups(),
Server.discardGroups(),
Server.getActiveGroups()public User findUser(int userID)
User object for the given ID. The user returned
will contain only a limited subset of the account information. Returns
null if userID is not found.
userID - the user ID in question
User object with the given ID.Will return null
if not found.Server.getUsers()public Group findGroup(int groupID)
Group object for the given ID.
groupID - the group ID in question
Group object with the given ID. Will return null
if not found.Server.getGroups()public SupportedFeatures getSupportedFeatures()
java.lang.IllegalStateException - if the server is not connectedServer.isConnected()public Server.ProductCode[] getProductCodes()
Server.ProductCode,
Server.hasProductCode(com.starteam.Server.ProductCode)public boolean hasProductCode(Server.ProductCode code)
code - A product code.
Server.ProductCode,
Server.getProductCodes()public short getRevisionLevel()
public java.lang.String getCommandAPIRevisionLevel()
public java.lang.String getServerBuild()
public java.lang.String getServerBuildDescription()
public int getCommandCount()
public int getMPXMessageCount()
public void connect()
If the network connection is successfully established, and an MPXProfileName was specified in the Server constructor, then an attempt is made to automatically enable MPX. If an MPXException is thrown, it will be ignored, and will not cause the connect() to fail. An application can use isMPXEnabled() to determine whether or not MPX was properly enabled.
Server.Server(ServerInfo),
Server.enableMPX(),
Server.isMPXEnabled()public void connect(DotNotation clientVersion)
This variation of connect() allows the client application to request a specific version of the server's command API. For example, requesting CONNECT_AS_110 would make a more recent server behave as if it were connecting to a StarTeam 11.0 client.
clientVersion - a representation of the specific version of the command api
requestedServer.connect()public void disconnect()
public User logOn(java.lang.String logOnName,
java.lang.String password)
logOnName - the user's logon namepassword - the user's password
public static java.io.File encryptPasswordToFile(java.lang.String password,
java.lang.String fileName)
throws java.io.IOException
password - the clear text passwordfileName - the fully qualified path to a file If fileName is null or
empty, a temporary file with the prefix "pwd" will be created
The returned file with the encrypted password can be used by
the method Server.logOn(String, java.io.File) or through the
CommandProcessor
java.io.IOException - if a file cannot be createdCommandProcessor
public User logOn(java.lang.String logOnName,
java.io.File passwordFile)
logOnName - the user's logon namepasswordFile - the encrypted user's password saved in a file via the StarTeam
Command Line or using the static method
Server.encryptPasswordToFile(String, String)
CommandProcessor
public User changePassword(java.lang.String logOnName,
java.lang.String password,
java.lang.String newPassword)
logOnName - The user's logon name.password - The user's old password.newPassword - The user's new password.
public User logOn(java.lang.String logOnName,
java.lang.String password,
GUID workStationID)
logOnName - The user's logon name.password - The user's password.workStationID - The GUID of the client workstation.
GUID
public User logOn(java.lang.String logOnName,
java.lang.String password,
ClientContext context)
logOnName - The user's logon name.password - The user's password.context - The ClientContext of the client workstation.
GUIDpublic void reconnect()
Uses the user credentials provided at logon time.
Server.isAutoReconnectEnabled()public void reconnect(java.lang.String password)
The server will re-authenticate the connection using the user name provided at logon time and the given password.
password - The password used to re-authenticate the connection.public boolean isAutoReconnectEnabled()
Server.getAutoReconnectAttempts(),
Server.getAutoReconnectWait(),
Server.reconnect()public void setAutoReconnectEnabled(boolean bEnabled)
bEnabled - true if a reconnect is automatically attempted whenever a
connection problem is detected while executing a server
command.public int getAutoReconnectAttempts()
Server.isAutoReconnectEnabled(),
Server.getAutoReconnectWait(),
Server.reconnect()public void setAutoReconnectAttempts(int nAttempts)
nAttempts - If automatic reconnect is enabled, the maximum number of
attempts to reconnect that will be made while executing a
single server command.public int getAutoReconnectWait()
Server.isAutoReconnectEnabled(),
Server.getAutoReconnectAttempts(),
Server.reconnect()public void setAutoReconnectWait(int nSeconds)
nSeconds - If automatic reconnect is enabled, the number of seconds that
we will wait before each reconnect attempt.public boolean ping()
public static void declareComponentDefinitions(java.lang.String typeName,
java.lang.String propertyName,
java.lang.Class[] clazz)
typeName - String The name of the Type to be registeredpropertyName - String The name of the property whose value matches one of the
class names in the arrayclazz - a set of classes which provide alternate definitions for an
artifact instance
java.lang.IllegalArgumentExceptionThe SDK makes no assumptions about the assignability of the class
definitions w.r.t. each other, other than that they subclass
{Tree}Item and override the public constructor which takes the
single Folder parameter.
Call this method before calling either connect() or logon() on a
server instance Note that usage of this api requires the specified
property value to have been loaded prior to calls to
View.findItem(...) or Folder.getItems(...),
Class.getName()
public static void declareComponentDefinition(java.lang.String typeName,
java.lang.Class componentClass)
typeName - String The name of the Type to be registered or a regular
expression wildcard describing a set of typescomponentClass - the component class
java.lang.IllegalArgumentExceptionpublic DateTime getCurrentTime()
public static boolean isCredentialCachingAvailable()
Server.autoLogOn(),
Server.isCredentialCachingEnabled()public static boolean isCredentialCachingEnabled()
Server.autoLogOn(),
Server.isCredentialCachingAvailable(),
Server.enableCredentialCaching()
public static ServerInfoCollection getCachedCredentials()
throws java.io.IOException
java.io.IOExceptionServerInfo.getHost(),
ServerInfo.getPort(),
ServerInfo.getUserName()public static void enableCredentialCaching()
Server.autoLogOn(),
Server.isCredentialCachingAvailable(),
Server.isCredentialCachingEnabled(),
Server.cacheLogOnCredentials(java.lang.String, java.lang.String)public boolean isAutoLogOnAvailable()
Server.autoLogOn(),
Server.isCredentialCachingEnabled(),
Server.cacheLogOnCredentials(java.lang.String, java.lang.String)public User autoLogOn()
Server.isAutoLogOnAvailable(),
Server.cacheLogOnCredentials(java.lang.String, java.lang.String)
public void cacheLogOnCredentials(java.lang.String username,
java.lang.String password)
username - the user name to save.password - the password to save.Server.autoLogOn(),
Server.isAutoLogOnAvailable(),
Server.isCredentialCachingEnabled()
public Item.Type createType(java.lang.String xmlDefinition,
boolean toCreate)
xmlDefinition - the xml definition describing the schema of the new TypetoCreate - true to create the Component, false to verify the schema
public void createTenant(int tenantID,
java.lang.String tenantName,
java.lang.String tenantAdminLoginName,
java.lang.String tenantAdminPassword)
tenantID - the tenant IDtenantName - the tenant NametenantAdminLoginName - the Login Name of the Tenant AdministratortenantAdminPassword - a clear text password for the Tenant Administrator
public void synchronize(java.lang.String[] keys,
boolean acquire)
keys - the keys to be acquired or releasedacquire - true to acquire the keys, false to release thempublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isLoggedOn()
public User getLoggedInUser()
public void sendMail(View view,
User[] to,
User[] cc,
User[] bcc,
java.lang.String subject,
java.lang.String body)
view - a valid view the sender has access toto - the user IDs to whom the mail should be sent (To:)cc - the user IDs to whom the mail should be cc'd (Cc:)bcc - the user IDs to whom the mail should be blind-cc'd (Bcc:)subject - the subject text for the mail messagebody - the body of the mail message
public void sendMail(View view,
User[] to,
User[] cc,
User[] bcc,
java.lang.String subject,
java.lang.String body,
Server.EmailAttachment[] attachments)
view - a valid view the sender has access toto - the users to whom the mail should be sent (To:)cc - the users to whom the mail should be cc'd (Cc:)bcc - the users to whom the mail should be blind-cc'd (Bcc:)subject - the subject text for the mail messagebody - the body of the mail messageattachments - The attachments to include with the emailpublic boolean isMailAvailable()
public java.lang.String[] getEventHandlerInfoNames()
public EventHandlerInfo getEventHandlerInfo(java.lang.String eventHandlerInfoName)
eventHandlerInfoName - The name of the EventHandlerInfo object to be returned.
Server.getEventHandlerInfoNames()public java.lang.String getMPXTransmitterName()
public boolean isMPXAvailable()
Server.enableMPX(),
Server.enableMPX(String),
Server.enableMPX(EventHandlerProfile)
public void enableMPX()
throws MPXException
MPXExceptionServer.enableMPX(String),
Server.enableMPX(EventHandlerProfile)
public void enableMPX(java.lang.String strProfileName)
throws MPXException
strProfileName - The name of an MPX profile on this server.
MPXExceptionServer.enableMPX(),
Server.enableMPX(EventHandlerProfile)
public void enableMPX(EventHandlerProfile profile)
throws MPXException
profile - An MPX profile.
MPXExceptionServer.enableMPX(),
Server.enableMPX(String),
Server.isMPXAvailable(),
Server.isMPXEnabled(),
Server.isMPXResponding(),
Server.pingMPXServer(),
Server.disableMPX()public boolean isMPXEnabled()
public EventHandlerProfile getCurrentMPXProfile()
public boolean isMPXResponding()
public void pingMPXServer()
throws MPXException
MPXExceptionpublic void disableMPX()
public void addTypedResourceListener(TypedResourceListener listener,
LiveObject container,
TypeCollection types)
Event handlers will be triggered whenever a TypedResource is added, changed or deleted in the specified container. Note that an application will receive only those events for which they have access, and for types to which they have registered.
In order to handle events, an application must enable MPX.
listener - Application-specific event handler for TypedResource events.container - the container whose events the application is interested on.
If null, application gets events on all views on the server.types - event types (File, ChangeRequest etc) that the application is
interested on.TypedResourceListener,
Server.removeTypedResourceListener(com.starteam.events.TypedResourceListener, com.starteam.LiveObject),
Server.enableMPX()
public void removeTypedResourceListener(TypedResourceListener listener,
LiveObject container)
listener - Previously-registered event handler for TypedResource events.container - TypedResourceListener,
Server.addTypedResourceListener(com.starteam.events.TypedResourceListener, com.starteam.LiveObject, com.starteam.TypeCollection),
Server.enableMPX()public void handleEvents()
While in an event-handling state, the thread is usually asleep, waking occasionally just long enough to ping the server (keeping the connection alive). The event-handling loop continues until some other thread (presumably, the event-handling thread for this Server object) calls interruptHandleEvents().
An application does not need to call handleEvents() in order to handle events; this is just a convenience method for applications that have nothing else they need to do while waiting for an event to occur.
Only one thread may call handleEvents() per Server object at any given time. After handleEvents() exits (as a result of a call to interruptHandleEvents), then handleEvents() may be called again by the same thread or by some other thread.
handleEvents() will fail if MPX is not enabled, or if there are no event-handlers running.
handleEvents() should not be called from within an event handler. (This would put the event-handling thread to sleep.)
Server.interruptHandleEvents(),
Server.enableMPX()public void interruptHandleEvents()
Server.handleEvents()public void addMPXStatusListener(MPXStatusListener listener)
Event handlers will be triggered whenever an important change occurs in the status of MPX or the MPX event transmitter.
listener - Application-specific event handler for MPXStatusEvents.MPXStatusListener,
Server.removeMPXStatusListener(com.starteam.events.MPXStatusListener)public void removeMPXStatusListener(MPXStatusListener listener)
listener - Previously-registered event handlers for MPXStatusEvents.MPXStatusListener,
Server.addMPXStatusListener(com.starteam.events.MPXStatusListener)public void addServerControlListener(ServerControlListener listener)
Event handlers will be triggered whenever this Server is stopped or restarted.
In order to handle events, an application must enable MPX.
listener - Application-specific event handler for ServerControl events.ServerControlListener,
Server.removeServerControlListener(com.starteam.events.ServerControlListener),
Server.enableMPX()public void removeServerControlListener(ServerControlListener listener)
listener - Previously-registered event handlers for ServerControl events.ServerControlListener,
Server.addServerControlListener(com.starteam.events.ServerControlListener)public void addTypeListener(TypeListener listener)
Event handlers will be triggered whenever a Type (or its associated Properties) are modified on this Server.
In order to handle events, an application must enable MPX.
listener - Application-specific event handler for Type events.TypeListener,
Server.removeTypeListener(com.starteam.events.TypeListener),
Server.enableMPX()public void removeTypeListener(TypeListener listener)
listener - Previously-registered event handler for Type events.TypeListener,
Server.addTypeListener(com.starteam.events.TypeListener)public void addUserListener(UserListener listener)
Event handlers will be triggered whenever a User is added, changed or deleted on this Server.
In order to handle events, an application must enable MPX.
listener - Application-specific event handler for User events.UserListener,
Server.removeUserListener(com.starteam.events.UserListener),
Server.enableMPX()public void removeUserListener(UserListener listener)
listener - Previously-registered event handler for User events.UserListener,
Server.addUserListener(com.starteam.events.UserListener)public void addProjectListener(ProjectListener listener)
Event handlers will be triggered whenever a Project is added, changed or deleted on this Server. Note that an application will not receive events for Projects that the logged-in user does not have permission to access.
In order to handle events, an application must enable MPX.
listener - Application-specific event handler for Project events.ProjectListener,
Server.removeProjectListener(com.starteam.events.ProjectListener),
Server.enableMPX()public void removeProjectListener(ProjectListener listener)
listener - Previously-registered event handler for Project events.ProjectListener,
Server.addProjectListener(com.starteam.events.ProjectListener)public void addGroupListener(GroupListener listener)
Event handlers will be triggered whenever a Group is added, changed or deleted on this Server.
In order to handle events, an application must enable MPX.
listener - Application-specific event handler for Group events.GroupListener,
Server.removeGroupListener(com.starteam.events.GroupListener),
Server.enableMPX()public void removeGroupListener(GroupListener listener)
listener - Previously-registered event handler for Group events.GroupListener,
Server.addGroupListener(com.starteam.events.GroupListener)public boolean hasInactivityTimeout()
public int getKeepAliveInterval()
Server.setKeepAlive(boolean)public void setKeepAliveInterval(int nMinutes)
nMinutes - The new keep-alive interval, in minutes.public boolean isKeepAliveEnabled()
Server.getKeepAliveInterval()public void setKeepAlive(boolean bKeepAlive)
bKeepAlive - true to enable keep-alive mode; false to disable it. In
keep-alive mode, a background thread periodically pings the
server to keep the connection alive. Keep-alive is off by
default.public CacheAgent autoLocateCacheAgent()
ServerInfo.getAutoLocateCacheAgent()
public CacheAgent locateCacheAgent(java.lang.String hostName,
int port)
hostName - String the address at which to look for a cache agentport - int the port the cache agent is running on
ServerInfo.getMPXCacheAgentAddress(),
ServerInfo.getMPXCacheAgentPort()public CacheAgent getCurrentCacheAgent()
Server.locateCacheAgent(String, int),
Server.autoLocateCacheAgent()public GUID obtainLicense(User user)
user - the user who will "own" the license.
public GUID obtainLicense(User user,
Server server)
user - the user who will "own" the license.server - the server whose session ID will be used to obtain the
license.
public void releaseLicense(User user)
user - the user who "owns" the license.
public void releaseLicense(User user,
Server server)
user - the user who "owns" the license.server - the server whose session ID was used to obtain the license.
public void releaseLicense(User user,
GUID sessionID)
user - the User who "owns" the license.sessionID - the GUID that was used to obtain the license.public PropertyCollection getVisibleProperties(EnumeratedValue value)
value - an Enumerated Value for a specific Enumerated Property of a chosen type
public EnumeratedValue[] getUDAGroupings(Requirement.RequirementType typ)
typ - the requirement type to test
public void setUDAGroupings(Requirement.RequirementType typ,
EnumeratedValue[] udas)
typ - the requirement type to be mappedudas - the set of UDA Groupings
public void setVisibleProperties(EnumeratedValue value,
PropertyCollection properties)
value - an Enumerated Value for a specific Enumerated Property of a chosen typeproperties - the set of properties marked visible in the context of the specified enumpublic Task.Status[] getStatus(Story.Status sts)
sts - the story status to test
public void setStatus(Story.Status rfrnc,
Task.Status[] mppdSts)
rfrnc - the reference Story Status to be mappedmppdSts - the Task States to map it to.public boolean hasSavedStatus(Story.Status sts)
sts - the status to test for in this project context
Server.getStatus(com.starteam.Story.Status)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||