TPTP 4.6.0 Platform Project
Internal API Specification

org.eclipse.hyades.internal.execution.core.file
Class FileServerCommandFactory

java.lang.Object
  extended by org.eclipse.hyades.internal.execution.core.file.FileServerCommandFactory
All Implemented Interfaces:
IFileServerCommandFactory

public final class FileServerCommandFactory
extends java.lang.Object
implements IFileServerCommandFactory

Used by the client and server side of the file manager implementation to create commands that encapsulate the state and behavior associated with a particular action that should be conducted.

There is a maintained singleton on the server and a qualified set of instances on the client side per address and port combination. The current supports commands are gathered from the public interface to the file server command factory.

This class encapsulates the client side connection to the server, figuring out the proper port to use to initiate file server commands and whether to create new or reuse existing sockets. In server operation, this factory will operate on the socket channels that are passed-in per call and not keep the server running -- this is done in the file server extended class.

There is also a polymorphic create method that will create a command based on the fully-qualified Java class name; this is used on the server-side to create commands based on the comman identity that is sent over the wire.

See Also:
FileServerExtended, FileManagerExtendedImpl, #createDeleteFileCommand(Cookie, IProgressMonitor), #createDeleteFileCommand(FileIdentifierList, IProgressMonitor), #createGetFileCommand(Cookie, FileIdentifierList, FileIdentifierList, Option[], IProgressMonitor), #createListContentCommand(FileIdentifierList, IProgressMonitor), #createModifyPermissionCommand(FileIdentifierList, String, IProgressMonitor), #createPutFileCommand(Cookie, FileIdentifierList, FileIdentifierList, Option[], IProgressMonitor), createQueryServerStatusCommand()

Method Summary
 IDeleteDirectoryCommand createDeleteDirectoryCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers, org.eclipse.core.runtime.IProgressMonitor monitor)
          Create delete directory command for use by file transfer service clients
 IDeleteFileCommand createDeleteFileCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.Cookie cookie, org.eclipse.core.runtime.IProgressMonitor monitor)
          Create delete file command for use by file transfer service clients
 IDeleteFileCommand createDeleteFileCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers, org.eclipse.core.runtime.IProgressMonitor monitor)
          Create delete file command for use by file transfer service clients
 IFileServerCommand createFileServerCommand(java.lang.String identity, ISocketChannel clientChannel)
          Create a file server command to be used by the file transfer service server, all server-side hosted file server commands are created through this method -- the appropriate command to create is identified by the identity argument passed in.
 IGetFileCommand createGetFileCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList localIdentifiers, org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers, org.eclipse.hyades.execution.core.file.IFileManagerExtended.Option[] options, org.eclipse.core.runtime.IProgressMonitor monitor)
          Create get file command for use by file transfer service clients
 IListContentCommand createListContentCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers, org.eclipse.core.runtime.IProgressMonitor monitor)
          Create list content command for use by file transfer service clients, used to list the content of a directory or folder on the remote server
 IModifyPermissionCommand createModifyPermissionCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers, java.lang.String permissionDirective, org.eclipse.core.runtime.IProgressMonitor monitor)
          Create modify permission command for use by file transfer service clients, used to modify the permissions of files on the remote file server
 IPutFileCommand createPutFileCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.Cookie cookie, org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList localIdentifiers, org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers, org.eclipse.hyades.execution.core.file.IFileManagerExtended.Option[] options, org.eclipse.core.runtime.IProgressMonitor monitor)
          Create put file command for use by file transfer service clients
 IQueryServerStatusCommand createQueryServerStatusCommand()
          Create query server status command for use by file transfer service clients, used to query the status of the file server, a simple echo test or equivalent is used as a simple sanity test
static IFileServerCommandFactory getInstance()
          Singleton instance used by file server, no address is needed since its the server
static IFileServerCommandFactory getInstance(org.eclipse.hyades.execution.core.file.IFileLocation fileServerLocation)
          A pool of factories is kept, qualified by the address of the server
 void reset()
          Resets any appropriate resources or connections associated with this factory, cleans out the state as if the factory instance was constructed new
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IFileServerCommandFactory getInstance()
Singleton instance used by file server, no address is needed since its the server

Returns:
the factory to interpet commands and create concrete commands to execute

getInstance

public static IFileServerCommandFactory getInstance(org.eclipse.hyades.execution.core.file.IFileLocation fileServerLocation)
A pool of factories is kept, qualified by the address of the server

Parameters:
fileServerLocation - the location and other important information qualifying the exact file server host to use
Returns:
a factory ready to use for the specified address

createDeleteDirectoryCommand

public IDeleteDirectoryCommand createDeleteDirectoryCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers,
                                                            org.eclipse.core.runtime.IProgressMonitor monitor)
                                                     throws ServerNotAvailableException
Description copied from interface: IFileServerCommandFactory
Create delete directory command for use by file transfer service clients

Specified by:
createDeleteDirectoryCommand in interface IFileServerCommandFactory
Parameters:
remoteIdentifiers - the identifiers on the remote server to be deleted
monitor - progress monitor for the delete directory command
Returns:
the delete directory command that is ready to command
Throws:
ServerNotAvailableException

createDeleteFileCommand

public IDeleteFileCommand createDeleteFileCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.Cookie cookie,
                                                  org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface: IFileServerCommandFactory
Create delete file command for use by file transfer service clients

Specified by:
createDeleteFileCommand in interface IFileServerCommandFactory
Parameters:
cookie - the cookie to use for identifying the associated file operation that created files, a cookie used for a put file command for example, can then be used to pass in the delete file command -- this will then result in the delete command deleting only the files that were created during the put file command operation, the cookie identifies which files to remove via the remote server process
monitor - progress monitor for the delete file command
Returns:
the delete file command that is ready to command

createDeleteFileCommand

public IDeleteFileCommand createDeleteFileCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers,
                                                  org.eclipse.core.runtime.IProgressMonitor monitor)
                                           throws ServerNotAvailableException
Description copied from interface: IFileServerCommandFactory
Create delete file command for use by file transfer service clients

Specified by:
createDeleteFileCommand in interface IFileServerCommandFactory
Parameters:
remoteIdentifiers - the identifiers on the remote server to be deleted
monitor - progress monitor for the delete file command
Returns:
the delete file command that is ready to command
Throws:
ServerNotAvailableException

createFileServerCommand

public IFileServerCommand createFileServerCommand(java.lang.String identity,
                                                  ISocketChannel clientChannel)
                                           throws InvalidFileServerCommandException
Description copied from interface: IFileServerCommandFactory
Create a file server command to be used by the file transfer service server, all server-side hosted file server commands are created through this method -- the appropriate command to create is identified by the identity argument passed in. The client channel is passed in, which is the channel to use for communicating with the client-side of the file transfer mechanism. Uses the default classloader to load the file server command.

Specified by:
createFileServerCommand in interface IFileServerCommandFactory
Parameters:
identity - the identity of the command to create on the server
clientChannel - the channel to use to communicate with the client from the server
Returns:
a file server command for server-side handling
Throws:
InvalidFileServerCommandException
See Also:
#createFileServerCommand(String, ISocketChannel, ClassLoader)

createGetFileCommand

public IGetFileCommand createGetFileCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList localIdentifiers,
                                            org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers,
                                            org.eclipse.hyades.execution.core.file.IFileManagerExtended.Option[] options,
                                            org.eclipse.core.runtime.IProgressMonitor monitor)
                                     throws ServerNotAvailableException
Description copied from interface: IFileServerCommandFactory
Create get file command for use by file transfer service clients

Specified by:
createGetFileCommand in interface IFileServerCommandFactory
Parameters:
localIdentifiers - the identifiers of the files to be created locally, the destination file identifiers for the transfer
remoteIdentifiers - the identifiers of the files to be transferred from the remote server to the local client, the source file identifiers for the transfer
options - options to configure the get file command behavior
monitor - progress monitor for the get file command operation
Returns:
the get file command that is ready to command
Throws:
ServerNotAvailableException

createListContentCommand

public IListContentCommand createListContentCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers,
                                                    org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface: IFileServerCommandFactory
Create list content command for use by file transfer service clients, used to list the content of a directory or folder on the remote server

Specified by:
createListContentCommand in interface IFileServerCommandFactory
Parameters:
remoteIdentifiers - identifies the directories to list the contents of
monitor - progress monitor for the list content command
Returns:
the list content command

createModifyPermissionCommand

public IModifyPermissionCommand createModifyPermissionCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers,
                                                              java.lang.String permissionDirective,
                                                              org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface: IFileServerCommandFactory
Create modify permission command for use by file transfer service clients, used to modify the permissions of files on the remote file server

Specified by:
createModifyPermissionCommand in interface IFileServerCommandFactory
Parameters:
remoteIdentifiers - the remote identifiers to affect with the modify permission command's operation
permissionDirective - the permission directives to affect the files
monitor - progress monitor for the modify permission command
Returns:
the modify permission command

createPutFileCommand

public IPutFileCommand createPutFileCommand(org.eclipse.hyades.execution.core.file.IFileManagerExtended.Cookie cookie,
                                            org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList localIdentifiers,
                                            org.eclipse.hyades.execution.core.file.IFileManagerExtended.FileIdentifierList remoteIdentifiers,
                                            org.eclipse.hyades.execution.core.file.IFileManagerExtended.Option[] options,
                                            org.eclipse.core.runtime.IProgressMonitor monitor)
                                     throws ServerNotAvailableException
Description copied from interface: IFileServerCommandFactory
Create put file command for use by file transfer service clients

Specified by:
createPutFileCommand in interface IFileServerCommandFactory
Parameters:
cookie - the cookie to use for identifying the instance of the command between client and server, for example, the cookie represents an instance of the command on the client and can then be associated with the command on the server that is associated with the same operation
localIdentifiers - the identifiers of the files to be sent to the remote server, the source file identifiers in this operation
remoteIdentifiers - the identifiers of the files to be created on the remote server process, the destination file identifiers in the operation
options - options to configure the put file command behavior
monitor - progress monitor for the put file command
Returns:
the put file command that is ready to command
Throws:
ServerNotAvailableException

createQueryServerStatusCommand

public IQueryServerStatusCommand createQueryServerStatusCommand()
                                                         throws ServerNotAvailableException
Description copied from interface: IFileServerCommandFactory
Create query server status command for use by file transfer service clients, used to query the status of the file server, a simple echo test or equivalent is used as a simple sanity test

Specified by:
createQueryServerStatusCommand in interface IFileServerCommandFactory
Returns:
the query server status command
Throws:
ServerNotAvailableException

reset

public void reset()
Description copied from interface: IFileServerCommandFactory
Resets any appropriate resources or connections associated with this factory, cleans out the state as if the factory instance was constructed new

Specified by:
reset in interface IFileServerCommandFactory

TPTP 4.6.0 Platform Project
Internal API Specification