com.starbase.starteam
Class ClientContext

java.lang.Object
  |
  +--com.starbase.starteam.ClientContext

public class ClientContext
extends java.lang.Object

The ClientContext class contains the nescessary 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 identitfier, the hostname 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.caseSensitiveFileNames(), Platform.getFilePathDelim()

Field Summary
static java.lang.String EOL_CR
          Carriage-return end-of-line sequence (i.e., "\r").
static java.lang.String EOL_CRLF
          Carriage-return + Line-feed end-of-line sequence (i.e., "\r\n").
static java.lang.String EOL_LF
          Line-feed end-of-line sequence (i.e., "\n").
static java.lang.String EOL_MAC
          End of line sequence commonly used on the MacIntosh.
static java.lang.String EOL_UNIX
          End of line sequence commonly used on Unix/Linux/Solaris.
static java.lang.String EOL_WINDOWS
          End of line sequence commonly used on Windows.
 
Constructor Summary
ClientContext()
          Creates a default client context based on propeties of the machine actually running the code.
ClientContext(GUID workStationID)
          Creates a default client context based on propeties of the machine actually running the code but using the specified workstation ID.
ClientContext(GUID workStationID, java.lang.String hostname, java.lang.String eol, boolean caseSensitive, java.lang.String filePathDelim, DirectoryOverrides overrides)
          Creates a new client context based on the specified parameters.
 
Method Summary
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 boolean getCaseSensitiveFileNames()
          Returns true if the client treats file names as case sensitive.
 DirectoryOverrides getDirectoryOverrides()
          Returns the directory override information for this client context.
 java.lang.String 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.
 int hashCode()
          returns a unique hash for all instances of this type
 void setCaseSensitiveFileNames(boolean caseSensitive)
          Sets whether or not the client treats file names as case sensitive.
 void setDirectoryOverrides(DirectoryOverrides overrides)
          Sets the directory override information for this client context.
 void setEOL(java.lang.String 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
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOL_CRLF

public static final java.lang.String EOL_CRLF
Carriage-return + Line-feed end-of-line sequence (i.e., "\r\n"). Typically used from Microsoft Windows.

See Also:
ClientContext.getEOL(), ClientContext.setEOL(java.lang.String), Constant Field Values

EOL_LF

public static final java.lang.String EOL_LF
Line-feed end-of-line sequence (i.e., "\n"). Typically used for Unix/Solaris/Linux.

See Also:
ClientContext.getEOL(), ClientContext.setEOL(java.lang.String), Constant Field Values

EOL_CR

public static final java.lang.String EOL_CR
Carriage-return end-of-line sequence (i.e., "\r"). Typically used for MacIntosh.

See Also:
ClientContext.getEOL(), ClientContext.setEOL(java.lang.String), Constant Field Values

EOL_WINDOWS

public static final java.lang.String EOL_WINDOWS
End of line sequence commonly used on Windows.

See Also:
ClientContext.EOL_CRLF, Constant Field Values

EOL_UNIX

public static final java.lang.String EOL_UNIX
End of line sequence commonly used on Unix/Linux/Solaris.

See Also:
ClientContext.EOL_LF, Constant Field Values

EOL_MAC

public static final java.lang.String EOL_MAC
End of line sequence commonly used on the MacIntosh.

See Also:
ClientContext.EOL_CR, Constant Field Values
Constructor Detail

ClientContext

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


ClientContext

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

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

ClientContext

public ClientContext(GUID workStationID,
                     java.lang.String hostname,
                     java.lang.String eol,
                     boolean caseSensitive,
                     java.lang.String filePathDelim,
                     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 hostname 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.
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 java.lang.String getEOL()
Returns the client machine's end-of-line convention.

Returns:
the client machine's end-of-line convention.
See Also:
ClientContext.EOL_CR, ClientContext.EOL_CRLF, ClientContext.EOL_LF

setEOL

public void setEOL(java.lang.String eol)
Sets the end of line sequence to use for this client context.

Parameters:
eol - the new eol sequence to use.
See Also:
ClientContext.EOL_CR, ClientContext.EOL_CRLF, ClientContext.EOL_LF

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 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(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.

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.