jpl.mipl.mdms.FileService.komodo.api
Class Client

java.lang.Object
  extended by jpl.mipl.mdms.FileService.komodo.api.Client

public class Client
extends Object

A simplified wrapper class for all general user operations defined in the APIs.

Version:
$Id: Client.java,v 1.103 2009/09/08 19:26:07 ntt Exp $
Author:
Rich Pavlovsky, Thomas Huang

Field Summary
static String OPTION_ABORT
          Abort option
static String OPTION_AUTODELETE
          Auto delete option
static String OPTION_COMPUTECHECKSUM
          Compute checksum option
static String OPTION_DIFF
          Diff option
static String OPTION_RECEIPT
          Receipt option
static String OPTION_REPLACEFILE
          Replace file option
static String OPTION_REPLICATE
          Replicate option
static String OPTION_RESTART
          Restart option
static String OPTION_RESUME
          Resume option
static String OPTION_SAFEREAD
          Safe read option
static String OPTION_VERSIONFILE
          Version file option
 
Constructor Summary
Client(String domainFile, String trustStore)
          Constructor to initialize to the komodo server connection properties.
Client(URL domainFile)
          Another constructor to initialize to the komodo server connection properties.
Client(URL domainFile, String trustStore)
          Constructor to initialize to the komodo server connection properties.
 
Method Summary
 int add(String file)
          Method to add a single file to the server.
 int add(String[] files)
          Method to add a list of files to the server.
 int add(String[] files, String comment)
          Method to add a list of files to the server with an associated comment
 int add(String file, String comment)
          Method to add a single file to the server with comment.
 int addReference(String vftName, String refName, String linkName)
          Create a reference in a VFT.
 int addReference(String vftName, String refName, String linkName, String comment)
          Create a reference in the current vft with comment.
 int addVFT(String name, String comment)
          Command to add a virtual file type.
 void changeDir(String dir)
          Change the directory used by the client.
 int changePassword(String oldPassword, String newPassword)
          Method to change user password for a server group.
 void changeType(String fileType)
          Deprecated.  
 void clearResults()
          Method to clear previous results from queue
 int comment(String fileName, String comment)
          Method to add a comment to a file
 int delete(String fileExpr)
          Deletes a file from a file type.
 int delReference(String vftName, String refName)
          Delete the file system reference, and all history.
 int delVFT(String name)
          Delete a virtual file type.
 int get(String fileExpr)
          Method to get files from a server filtered by a file expression.
 int get(String[] files)
          Method to get a list of files from the server.
 int get(String file, OutputStream out)
          Method to get a single file from the server and return contents on the outputstream object.
 int getAfter(Date date)
          Method to get a list of files from the server after a given date.
 int getAfter(Date date, String fileExpr)
          Method to get a list of files from the server after a given date filtered by a file name expression.
 int getBefore(Date before)
          Method to get a list of files from the server before a given date.
 int getBefore(Date before, String fileExpr)
          Method to get a list of files from the server before a given date filtered by a file name expression.
 int getBetween(Date begin, Date end)
          Method to get a list of files from the server between two given dates.
 int getBetween(Date begin, Date end, String fileExpr)
          Method to get a list of files from the server between two given dates filtered by a file name expression.
 String getDefaultGroup()
          Get the default server group.
 String getDir()
          Method to return the client's current directory.
 LinkedList getFileTypeList(String groupName)
          Get a sorted list of file types in a server group
 LinkedList getGroupList()
          Get a sorted list of server groups in the domain.
 int getLatest(String fileExpr)
          Method to get the latest file added to the fileType.
 Result getResult()
          Get a result object
 Result getResult(int timeDelay)
          Get a result object after time delay
 Vector getResultCodes()
          Method to retrieved error codes from operation results
 Vector getResultMsgs()
          Method to retrieved result messages from operation results
 Vector getResultNames()
          Method to retrieved result filenames from operation results
 Vector getResults()
          Method to retrieved queued results
 int getTransactionCount()
          Get current transaction count for the session
 String getType()
          Returns currently connected file type name with server group, returns null if not connected to a file type.
 boolean isGroupDefined(String groupName)
          Returns true if servergroup passed in as parameter is defined
 boolean isLoggedOn()
          Utiity method to check if currently logged on.
 boolean isSet(String command)
          Method to return session settings.
 int lockType(String lockMode)
          Method to lock filetype, with optional mode parameter.
 void login(String username, String password)
          Method to establish connection to the set login information for FEI server, but not connect to a file type.
 void login(String username, String password, String fileType)
          Deprecated. Please use the login(username, password, groupName, typeName) method. This method does not respect server group namespaces in FEI!
 void login(String username, String password, String groupName, String typeName)
          Method to establish connection to the komodo server on the specified file type.
 void logout()
          Method to disconnect from the server.
 void logout(String group, String filetype)
           
 void logoutImmediate()
          Method to disconnect from the server immediately
 int register(String[] files, boolean replace, boolean force, String comment)
          Method to register a list of files with an associated comment
 int rename(String oldName, String newName)
          Method to rename a file in a file type.
 int replace(String file)
          Method to replace a single file on the server
 int replace(String[] files)
          Method to replace a list of files on the server
 int replace(String[] files, String comment)
          Method to replace a list of files with an associated comment
 int replace(String file, String comment)
          Method to replace a single file on the server with comment
 void set(String command, boolean value)
          Method to handle change session settings (set command).
 void setDefaultGroup(String groupName)
          Set the default server group.
 void setDomainFile(URL domainFile)
          Method to set the domain file reference.
 int setReference(String vftName, String refName, String fileType, String fileName)
          Set a reference in a virtual file type.
 void setReplicationRoot(String rootPath)
          Method to set the replication root directory location.
 void setTrustStore(String trustStore)
          Method to set the SSL trust keystore location.
 void setType(String fileType)
          Deprecated. Please use the setType(String groupName, String typeName) method. This method does not respace server group namespaces!
 void setType(String groupName, String typeName)
          Connects to the file type, closes an old connection if it already exists
 void setVerbose(boolean verbose)
          Method to enable/disable verbose to output file metadata.
 void setVeryVerbose(boolean veryVerbose)
          Method to enable/disable very verbose to output detailed file metadata.
 int show()
          Method to query the komodo server for a list of files on the connected file type.
 int show(String regex)
          Method to query the komodo server for a list of files on the specified file name filtering regular expression.
 int showAfter(Date after)
          Method to query the komodo server for a list of files added after a date.
 int showAfter(Date after, String regex)
          Method to query the komodo server for a list of files on the specified file name filtering regular expression added after a date.
 int showBefore(Date before)
          Method to query the komodo server for a list of files added before a date.
 int showBefore(Date before, String regex)
          Method to query the komodo server for a list of files on the specified file name filtering regular expression added before a date.
 int showBetween(Date begin, Date end)
          Method to query the komodo server for a list of files added between two dates.
 int showBetween(Date begin, Date end, String regex)
          Method to query the komodo server for a list of files on the specified file name filtering regular expression added between two dates.
 Vector showNoResults(String regex)
          Show files in current file type, returns file names in Vector
 Vector showResults(String regex)
          Show files in current file type, returns Results objects in Vector
 Vector showTypes()
          Method to show the file types
 void showVFT(String vftName)
          Show current vft list.
 int stopSubscribe()
          Dispatches subscription termination request to filetype.
 int subscribe(String operation, boolean commit)
          Dispatches subscription request to filetype.
 int unlockType(String lockMode)
          Method to unlock filetype, with optional mode parameter.
 int unregister(String fileExpr)
          Unregisters a file from a file type.
 int updateVFT(String vftName)
          Method to update an existing virtual file type
 int updateVFT(String vftName, String comment)
          Method to update an existing virtual file type with comment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_ABORT

public static final String OPTION_ABORT
Abort option

See Also:
Constant Field Values

OPTION_SAFEREAD

public static final String OPTION_SAFEREAD
Safe read option

See Also:
Constant Field Values

OPTION_COMPUTECHECKSUM

public static final String OPTION_COMPUTECHECKSUM
Compute checksum option

See Also:
Constant Field Values

OPTION_AUTODELETE

public static final String OPTION_AUTODELETE
Auto delete option

See Also:
Constant Field Values

OPTION_RECEIPT

public static final String OPTION_RECEIPT
Receipt option

See Also:
Constant Field Values

OPTION_REPLACEFILE

public static final String OPTION_REPLACEFILE
Replace file option

See Also:
Constant Field Values

OPTION_VERSIONFILE

public static final String OPTION_VERSIONFILE
Version file option

See Also:
Constant Field Values

OPTION_RESTART

public static final String OPTION_RESTART
Restart option

See Also:
Constant Field Values

OPTION_RESUME

public static final String OPTION_RESUME
Resume option

See Also:
Constant Field Values

OPTION_REPLICATE

public static final String OPTION_REPLICATE
Replicate option

See Also:
Constant Field Values

OPTION_DIFF

public static final String OPTION_DIFF
Diff option

See Also:
Constant Field Values
Constructor Detail

Client

public Client(String domainFile,
              String trustStore)
       throws SessionException
Constructor to initialize to the komodo server connection properties. This wrapper class requires SSL encryption.

Parameters:
domainFile - the komodo domain file
trustStore - the SSL keystore location
Throws:
SessionException - when connection fails

Client

public Client(URL domainFile,
              String trustStore)
       throws SessionException
Constructor to initialize to the komodo server connection properties. Location of domain file is a URL. This wrapper class requires SSL encryption.

Parameters:
domainFile - URL location of komodo domain file
trustStore - String location of SSL keystore
Throws:
SessionException - when connection fails

Client

public Client(URL domainFile)
       throws SessionException
Another constructor to initialize to the komodo server connection properties. Location of the domain file is a URL. This wrapper class requires SSL encryption.

Parameters:
domainFile - URL location of komodo domain file
Throws:
SessionException - when connection fails
Method Detail

setDomainFile

public void setDomainFile(URL domainFile)
Method to set the domain file reference.

Parameters:
domainFile - the domain file

setTrustStore

public void setTrustStore(String trustStore)
Method to set the SSL trust keystore location.

Parameters:
trustStore - the keystore location.

setReplicationRoot

public void setReplicationRoot(String rootPath)
                        throws SessionException
Method to set the replication root directory location.

Parameters:
rootPath - the root location.
Throws:
SessionException

setVerbose

public void setVerbose(boolean verbose)
Method to enable/disable verbose to output file metadata.

Parameters:
verbose - the verbose flag

setVeryVerbose

public void setVeryVerbose(boolean veryVerbose)
Method to enable/disable very verbose to output detailed file metadata.

Parameters:
veryVerbose - the very verbose flag

login

public void login(String username,
                  String password,
                  String fileType)
           throws SessionException
Deprecated. Please use the login(username, password, groupName, typeName) method. This method does not respect server group namespaces in FEI!

Method to establish connection to the komodo server on the specified file type.

Parameters:
username - the user name
password - the password
fileType - the target file type
Throws:
SessionException - when connection failed.

login

public void login(String username,
                  String password,
                  String groupName,
                  String typeName)
           throws SessionException
Method to establish connection to the komodo server on the specified file type.

Parameters:
username - the user name
password - the password
groupName - the server group for chosen file type
typeName - the target file type
Throws:
SessionException - when connection failed.

login

public void login(String username,
                  String password)
           throws SessionException
Method to establish connection to the set login information for FEI server, but not connect to a file type.

Parameters:
username - the user name
password - the password
Throws:
SessionException - when session object allocation failure.

isLoggedOn

public boolean isLoggedOn()
Utiity method to check if currently logged on.


logout

public void logout()
            throws SessionException
Method to disconnect from the server.

Throws:
SessionException - when disconnect failed

logout

public void logout(String group,
                   String filetype)
            throws SessionException
Throws:
SessionException

logoutImmediate

public void logoutImmediate()
                     throws SessionException
Method to disconnect from the server immediately

Throws:
SessionException - when disconnect failed

getDefaultGroup

public String getDefaultGroup()
Get the default server group. This differs from the domain concept of default server group in that if the current server group is defined, it is returned. Else if there is a current filetype, its server group is returned. Else return the default server group from the session domain. Returns an empty string if default server group is not defined in domain file.

Returns:
default server group name

setDefaultGroup

public void setDefaultGroup(String groupName)
                     throws SessionException
Set the default server group.

Parameters:
groupName - the server group name
Throws:
SessionException - when groupName not defined in domain

getGroupList

public LinkedList getGroupList()
Get a sorted list of server groups in the domain.

Returns:
sorted linked list of server group names

isGroupDefined

public boolean isGroupDefined(String groupName)
Returns true if servergroup passed in as parameter is defined

Parameters:
servergroup - Name of server group to query
Returns:
True if servergroup exists, false otherwise

getFileTypeList

public LinkedList getFileTypeList(String groupName)
                           throws SessionException
Get a sorted list of file types in a server group

Parameters:
groupName - the name of the server group
Returns:
sorted linked list of server group names
Throws:
SessionException - when operation fails

show

public int show()
         throws SessionException
Method to query the komodo server for a list of files on the connected file type. Shows all files in the file type.

Returns:
a vector containing error codes of operations.
Throws:
SessionException - when operation failed

show

public int show(String regex)
         throws SessionException
Method to query the komodo server for a list of files on the specified file name filtering regular expression.

Parameters:
regex - the file filter regular expression
Returns:
the transaction ID
Throws:
SessionException - when operation failed.

showNoResults

public Vector showNoResults(String regex)
                     throws SessionException
Show files in current file type, returns file names in Vector

Parameters:
regex - string regex to query file names
Returns:
file names in vector
Throws:
SessionException - when show operation fails or filetype is null

showResults

public Vector showResults(String regex)
                   throws SessionException
Show files in current file type, returns Results objects in Vector

Parameters:
regex - string regex to query file names
Returns:
results objects in vector
Throws:
SessionException - when show operation fails or filetype is null

showBefore

public int showBefore(Date before)
               throws SessionException
Method to query the komodo server for a list of files added before a date.

Parameters:
before - the before date
Returns:
a vector containing error codes of operations.
Throws:
SessionException - when operation fails.

showBefore

public int showBefore(Date before,
                      String regex)
               throws SessionException
Method to query the komodo server for a list of files on the specified file name filtering regular expression added before a date.

Parameters:
before - the before date
regex - the file filter regular expression
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

showAfter

public int showAfter(Date after)
              throws SessionException
Method to query the komodo server for a list of files added after a date.

Parameters:
after - the after date
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

showAfter

public int showAfter(Date after,
                     String regex)
              throws SessionException
Method to query the komodo server for a list of files on the specified file name filtering regular expression added after a date.

Parameters:
after - the after date
regex - the file filter regular expression
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

showBetween

public int showBetween(Date begin,
                       Date end)
                throws SessionException
Method to query the komodo server for a list of files added between two dates.

Parameters:
begin - the begin date
end - the end date
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

showBetween

public int showBetween(Date begin,
                       Date end,
                       String regex)
                throws SessionException
Method to query the komodo server for a list of files on the specified file name filtering regular expression added between two dates.

Parameters:
begin - the begin date
end - the end date
regex - the file filter regular expression
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

comment

public int comment(String fileName,
                   String comment)
            throws SessionException
Method to add a comment to a file

Parameters:
fileName - the name of the file
comment - the comment text
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

showTypes

public Vector showTypes()
                 throws SessionException
Method to show the file types

Returns:
List of file types for the server
Throws:
SessionException - when operation fails

changeType

public void changeType(String fileType)
                throws SessionException
Deprecated. 

Process use command to change file type connection

Parameters:
fileType - the file type to be connected
Throws:
SessionException - when connection session fails

getType

public String getType()
Returns currently connected file type name with server group, returns null if not connected to a file type. Returns in the following format: <server group>:<file type>

Returns:
current file type name with server group or null if not set

setType

public void setType(String fileType)
             throws SessionException
Deprecated. Please use the setType(String groupName, String typeName) method. This method does not respace server group namespaces!

Connects to the file type, closes an old connection if it already exists

Parameters:
fileType - file type to connect to
Throws:
SessionException - when file type connection fails

setType

public void setType(String groupName,
                    String typeName)
             throws SessionException
Connects to the file type, closes an old connection if it already exists

Parameters:
groupName - the server group for the chosen file type
typeName - file type to connect to
Throws:
SessionException - when file type connection fails

add

public int add(String[] files)
        throws SessionException
Method to add a list of files to the server.

Parameters:
files - the file list array
Returns:
thre transaction ID
Throws:
SessionException - when operation fails.

add

public int add(String file)
        throws SessionException
Method to add a single file to the server.

Parameters:
file - the file name
Returns:
the transaction ID
Throws:
SessionException - when operation fails

add

public int add(String file,
               String comment)
        throws SessionException
Method to add a single file to the server with comment.

Parameters:
file - the file name
comment - The comment for the file
Returns:
the transaction ID
Throws:
SessionException - when operation fails

add

public int add(String[] files,
               String comment)
        throws SessionException
Method to add a list of files to the server with an associated comment

Parameters:
files - the file names
comment - the comment for the files
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

replace

public int replace(String[] files)
            throws SessionException
Method to replace a list of files on the server

Parameters:
files - the file array list
Returns:
the transaction ID
Throws:
SessionException - when operation fails

replace

public int replace(String file)
            throws SessionException
Method to replace a single file on the server

Parameters:
file - the file name
Returns:
error number of operation
Throws:
SessionException - when operation fails

replace

public int replace(String file,
                   String comment)
            throws SessionException
Method to replace a single file on the server with comment

Parameters:
file - the file name
comment - The comment for the file
Returns:
the transaction ID
Throws:
SessionException - when operation fails

replace

public int replace(String[] files,
                   String comment)
            throws SessionException
Method to replace a list of files with an associated comment

Parameters:
files - the file name array list
comment - the associated comment
Returns:
the transaction ID
Throws:
SessionException - when operation fails

register

public int register(String[] files,
                    boolean replace,
                    boolean force,
                    String comment)
             throws SessionException
Method to register a list of files with an associated comment

Parameters:
files - the file name array list
replace - flag indicating that file metadata should be re-registered
force - flag indicating that all file metadata should be re-registered, including location
comment - the associated comment
Returns:
the transaction ID
Throws:
SessionException - when operation fails

unregister

public int unregister(String fileExpr)
               throws SessionException
Unregisters a file from a file type.

Parameters:
fileExpr - name expression to unregister in file type
Returns:
transaction ID
Throws:
SessionException - when general operation failure

rename

public int rename(String oldName,
                  String newName)
           throws SessionException
Method to rename a file in a file type.

Parameters:
oldName - the old name of the file
newName - the new name of the file
Returns:
the transaction ID
Throws:
SessionException - when operation fails

get

public int get(String fileExpr)
        throws SessionException
Method to get files from a server filtered by a file expression.

Parameters:
fileExpr - the file expression to filter (i.e. *)
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

get

public int get(String file,
               OutputStream out)
        throws SessionException
Method to get a single file from the server and return contents on the outputstream object.

Parameters:
file - the file name
out - the outputstream object, not closed on return
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

get

public int get(String[] files)
        throws SessionException
Method to get a list of files from the server.

Parameters:
files - the file name array list
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

getAfter

public int getAfter(Date date)
             throws SessionException
Method to get a list of files from the server after a given date.

Parameters:
date - Date (and optional time) to get files after.
Returns:
the transaction ID
Throws:
SessionException - when operation fails

getAfter

public int getAfter(Date date,
                    String fileExpr)
             throws SessionException
Method to get a list of files from the server after a given date filtered by a file name expression.

Parameters:
date - Date (and optional time) to get files after.
String - fileExpr file expression to filter results
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

getBetween

public int getBetween(Date begin,
                      Date end)
               throws SessionException
Method to get a list of files from the server between two given dates.

Parameters:
begin - Beginning date
end - Ending date
Returns:
Vector containing error numbers of operations
Throws:
SessionException - when operation fails

getBetween

public int getBetween(Date begin,
                      Date end,
                      String fileExpr)
               throws SessionException
Method to get a list of files from the server between two given dates filtered by a file name expression.

Parameters:
begin - Beginning date
end - Ending date
fileExpr - file Expression to filter results
Returns:
transaction ID
Throws:
SessionException - when operation fails.

getBefore

public int getBefore(Date before)
              throws SessionException
Method to get a list of files from the server before a given date.

Parameters:
before - Files to get BEFORE this date.
Returns:
transaction ID
Throws:
SessionException - when operation fails.

getBefore

public int getBefore(Date before,
                     String fileExpr)
              throws SessionException
Method to get a list of files from the server before a given date filtered by a file name expression.

Parameters:
before - Files to get BEFORE this date.
fileExpr - file name expression for filtering
Returns:
transaction ID
Throws:
SessionException - when operation fails.

getLatest

public int getLatest(String fileExpr)
              throws SessionException
Method to get the latest file added to the fileType.

Parameters:
fileExpr - The regular expression file selector
Returns:
transaction ID
Throws:
SessionException - when operation fail.

delete

public int delete(String fileExpr)
           throws SessionException
Deletes a file from a file type.

Parameters:
fileExpr - name expression to delete in file type
Returns:
transaction ID
Throws:
SessionException - when general operation failure

addVFT

public int addVFT(String name,
                  String comment)
           throws SessionException
Command to add a virtual file type.

Parameters:
name - the VFT name
comment - the associated comment
Returns:
transaction ID
Throws:
SessionException - when general operation failure

delVFT

public int delVFT(String name)
           throws SessionException
Delete a virtual file type.

Parameters:
name - the VFT name to be removed
Returns:
transaction ID
Throws:
SessionException - when general operation failure

setReference

public int setReference(String vftName,
                        String refName,
                        String fileType,
                        String fileName)
                 throws SessionException
Set a reference in a virtual file type.

Parameters:
vftName - The VFT in which the reference belongs
refName - The name of the reference
fileType - The file type name in which filename belongs
fileName - The name of the file
Returns:
transaction ID
Throws:
SessionException - when general operation failure

addReference

public int addReference(String vftName,
                        String refName,
                        String linkName)
                 throws SessionException
Create a reference in a VFT.

Parameters:
vftName - the VFT name
refName - the reference name
linkName - the server-side link
Returns:
transaction ID
Throws:
SessionException - when general operation failure

addReference

public int addReference(String vftName,
                        String refName,
                        String linkName,
                        String comment)
                 throws SessionException
Create a reference in the current vft with comment.

Parameters:
vftName - the VFT name
refName - the reference name
linkName - the server-side link
comment - the associated comment
Returns:
transaction ID
Throws:
SessionException - general operation failure

delReference

public int delReference(String vftName,
                        String refName)
                 throws SessionException
Delete the file system reference, and all history.

Parameters:
vftName - the name of the virtual file type
refName - the name of the reference in VFT server
Returns:
transaction ID
Throws:
SessionException - when general operation failure

updateVFT

public int updateVFT(String vftName)
              throws SessionException
Method to update an existing virtual file type

Parameters:
vftName - the VFT name
Returns:
transaction ID
Throws:
SessionException - when operation fails

updateVFT

public int updateVFT(String vftName,
                     String comment)
              throws SessionException
Method to update an existing virtual file type with comment.

Parameters:
vftName - the VFT name
comment - the associated comment
Returns:
transaction ID
Throws:
SessionException - when operation fails

showVFT

public void showVFT(String vftName)
             throws SessionException
Show current vft list.

Parameters:
vftName - the VFT name
Throws:
SessionException - when network or operation failures

getTransactionCount

public int getTransactionCount()
                        throws SessionException
Get current transaction count for the session

Returns:
the transaction count
Throws:
SessionException - when operation fails

getResult

public Result getResult()
                 throws SessionException
Get a result object

Returns:
the result object
Throws:
SessionException - when operation fails

getResult

public Result getResult(int timeDelay)
                 throws SessionException
Get a result object after time delay

Parameters:
timeDelay - the number of milliseconds to wait to get result
Returns:
the result object
Throws:
SessionException - when operation fails

getResults

public Vector getResults()
                  throws SessionException
Method to retrieved queued results

Returns:
Vector containing Result objects
Throws:
SessionException - when operation fail

clearResults

public void clearResults()
                  throws SessionException
Method to clear previous results from queue

Throws:
SessionException - when operation fails

getResultCodes

public Vector getResultCodes()
                      throws SessionException
Method to retrieved error codes from operation results

Returns:
Vector containing Integer result error numbers
Throws:
SessionException - when operation fails

getResultMsgs

public Vector getResultMsgs()
                     throws SessionException
Method to retrieved result messages from operation results

Returns:
Vector containing String result messages
Throws:
SessionException - when operation fails

getResultNames

public Vector getResultNames()
                      throws SessionException
Method to retrieved result filenames from operation results

Returns:
Vector containing String result filenames
Throws:
SessionException - when operation fails

changeDir

public final void changeDir(String dir)
                     throws SessionException
Change the directory used by the client. This is useful for redirecting output or changing to a directory containing batch scripts.

Parameters:
dir - The directory to change to
Throws:
SessionException - when operation fails

getDir

public String getDir()
Method to return the client's current directory.

Returns:
the client's current directory.

set

public void set(String command,
                boolean value)
         throws SessionException
Method to handle change session settings (set command). Valid commands are: Client.OPTION_{ABORT,SAFEREAD,COMPUTECHECKSUM, AUTODELETE,RECEIPT,REPLACEFILE,RESTART,RESUME,REPLICATE}

Parameters:
command - the command to set
value - the value of the command
Throws:
SessionException - when operation fails

isSet

public boolean isSet(String command)
              throws SessionException
Method to return session settings. Valid commands are: Client.OPTION_{ABORT,SAFEREAD,COMPUTECHECKSUM,AUTODELETE, RECEIPT,REPLACEFILE,RESTART,RESUME,REPLICATE}

Parameters:
command - the command to set
Returns:
value the value of the command
Throws:
SessionException - when operation fails

subscribe

public int subscribe(String operation,
                     boolean commit)
              throws SessionException
Dispatches subscription request to filetype.

Parameters:
operation - Operation constant. AUTOGETFILES or AUTOSHOWFILES from Constants, for example.
commit - Flag indicating whether result information will be persisted to restart cache
Returns:
Request id
Throws:
SessionException - if filetype not selected or other session error occurs.

stopSubscribe

public int stopSubscribe()
                  throws SessionException
Dispatches subscription termination request to filetype.

Returns:
Request id
Throws:
SessionException - if filetype not selected or other session error occurs.

lockType

public int lockType(String lockMode)
             throws SessionException
Method to lock filetype, with optional mode parameter.

Parameters:
lockMode - Option parameter, legal values are 'group' and 'owner'
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

unlockType

public int unlockType(String lockMode)
               throws SessionException
Method to unlock filetype, with optional mode parameter.

Parameters:
lockMode - Option parameter, legal values are 'group' and 'owner'
Returns:
the transaction ID
Throws:
SessionException - when operation fails.

changePassword

public int changePassword(String oldPassword,
                          String newPassword)
                   throws SessionException
Method to change user password for a server group.

Parameters:
oldPassword - Old password
newPassword - New password
Returns:
the transaction ID
Throws:
SessionException - when operation fails.