com.starteam
Class ClientContext

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

public final class ClientContext
extends java.lang.Object

The ClientContext class contains the necessary information in order to run the SDK on one machine for a client running on a different machine. This is useful, for example, when running an SDK application within a Web server for a remote browser based client. The information in the ClientContext includes a unique client GUID identifier, the address of the client machine, the client's end-of-line convention, whether or not the client treats file names as case sensitive or not and the string used to delimit directory names within an absolute file path. The Platform class has methods for returning those values on the host running the SDK.

See Also:
Platform.getWorkStationID(), Platform.getMachineName(), Platform.getEOL(), Platform.getCaseSensitiveFileNames(), Platform.getFilePathDelimiter()

Nested Class Summary
static class ClientContext.DirectoryOverrides
          A class that can parse a StarTeam.xml file and work with the view and folder overrides it specifies.
 
Constructor Summary
ClientContext()
          Creates a default client context based on properties of the machine actually running the code.
ClientContext(GUID workStationID)
          Creates a default client context based on properties of the machine actually running the code but using the specified workstation ID.
ClientContext(GUID workStationID, java.lang.String hostname, int eol, boolean caseSensitive, java.lang.String filePathDelim, ClientContext.DirectoryOverrides overrides)
          Creates a new client context based on the specified parameters.
 
Method Summary
 boolean getCaseSensitiveFileNames()
          Returns true if the client treats file names as case sensitive.
 ClientContext.DirectoryOverrides getDirectoryOverrides()
          Returns the directory override information for this client context.
 Platform.EOL getEOL()
          Returns the client machine's end-of-line convention.
 java.lang.String getFilePathDelimiter()
          Returns the string used to delimit directories in a file path.
 java.lang.String getHostName()
          Returns the client machine's host name.
 GUID getWorkStationID()
          Returns the workstation GUID identifying the client.
 void setCaseSensitiveFileNames(boolean caseSensitive)
          Sets whether or not the client treats file names as case sensitive.
 void setDirectoryOverrides(ClientContext.DirectoryOverrides overrides)
          Sets the directory override information for this client context.
 void setEOL(Platform.EOL eol)
          Sets the end of line sequence to use for this client context.
 void setFilePathDelimiter(java.lang.String delim)
          Sets the file path delimiter to use.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientContext

public ClientContext()
Creates a default client context based on properties of the machine actually running the code.


ClientContext

public ClientContext(GUID workStationID)
Creates a default client context based on properties of the machine actually running the code but using the specified workstation ID. Normally the workstation ID is read out of an .xml file. Passing in null for the workStationID will read the GUID out of the appropriate .xml file.

Parameters:
workStationID - the workstation GUID associated with the client, the value may be null

ClientContext

public ClientContext(GUID workStationID,
                     java.lang.String hostname,
                     int eol,
                     boolean caseSensitive,
                     java.lang.String filePathDelim,
                     ClientContext.DirectoryOverrides overrides)
Creates a new client context based on the specified parameters.

Parameters:
workStationID - the workstation GUID associated with the client, the value may be null
hostname - the address of the machine running the client
eol - the end of line convention for the client platform
caseSensitive - true if the client treats file names as case sensitive
filePathDelim - the string used to delimit directory names on a file path. Is "\" on windows and "/" for Unix.
overrides - view and folder .xml entries
Method Detail

getWorkStationID

public GUID getWorkStationID()
Returns the workstation GUID identifying the client.

Returns:
the workstation GUID identifying the client.

getHostName

public java.lang.String getHostName()
Returns the client machine's host name.

Returns:
the client machine's host name.

getEOL

public Platform.EOL getEOL()
Returns the client machine's end-of-line convention.

Returns:
the client machine's end-of-line convention.

setEOL

public void setEOL(Platform.EOL eol)
Sets the end of line sequence to use for this client context.

Parameters:
eol - the new eol sequence to use.

getCaseSensitiveFileNames

public boolean getCaseSensitiveFileNames()
Returns true if the client treats file names as case sensitive.

Returns:
true if the client treats file names as case sensitive.

setCaseSensitiveFileNames

public void setCaseSensitiveFileNames(boolean caseSensitive)
Sets whether or not the client treats file names as case sensitive.

Parameters:
caseSensitive - use true to mean the client treats file names as case sensitive

getFilePathDelimiter

public java.lang.String getFilePathDelimiter()
Returns the string used to delimit directories in a file path. Should be "\" for Windows and "/" for Unix.

Returns:
the string used to delimit directories in a file path.

setFilePathDelimiter

public void setFilePathDelimiter(java.lang.String delim)
Sets the file path delimiter to use. Should be "\" for Windows and "/" for Unix.

Parameters:
delim - the file path delimiter to use

getDirectoryOverrides

public ClientContext.DirectoryOverrides getDirectoryOverrides()
Returns the directory override information for this client context. the directory overrides allow a client to override the default working directories on a per folder or view basis.

Returns:
the directory override information for this client context.

setDirectoryOverrides

public void setDirectoryOverrides(ClientContext.DirectoryOverrides overrides)
Sets the directory override information for this client context. The directory overrides allow a client to override the default working directories on a per folder or view basis.

Parameters:
overrides - the new directory override information for this client context.


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