|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unido.ls5.eti.client.TransferHandler
public class TransferHandler
This class manages the jETI file context. It keeps track where the most recently modified version of a filename can be found. and stores/retrieves/forwards them the the required location if necessary.
Field Summary | |
---|---|
static String |
CONTEXT_ETI_CONNECTIONS
context key name where the EtiConnection
Map is stored. |
static String |
CONTEXT_TRANSFER_HANDLER
Context key name where the TransferHandler is stored. |
Method Summary | |
---|---|
void |
closeAllSessions()
|
static TransferHandler |
get(Map<String,Object> env)
Retrieves the TransferHandler from given ExecutionEnvironment. |
VirtualFile |
get(String name)
Retrieves the VirtualFile Object from the Context. |
EtiConnection |
getEtiConnection(List<URI> uris)
Retrieve an ETI Connection for a given List of uris following the order of the list. |
EtiConnection |
getEtiConnection(URI uri,
boolean createNew)
Looks up the internal LightweightExecutionEnvironment wether there already exists a connection to the jETI toolserver
identified by uri. |
static boolean |
isDebug()
|
void |
put(VirtualFile vFile,
String name)
put virtual file into executionEnvironment and set cache entry for name to local URI |
void |
setCurrentLocation(List<String> names,
URI uri)
|
void |
setCurrentLocation(String[] names,
URI uri)
This method can be used to tell the transfher handler, that the most recently modified version of given filenames can now be found at uri. |
static void |
setDebug(boolean debug)
|
void |
storeToLocation(List<String> names,
URI targetServer)
|
void |
storeToLocation(String[] names,
URI targetServer)
Makes sure that the newest version of all files provided by parameter 'names' is located at the given URI afterwards. |
String |
toString()
Generates a String representation of this transfher handler that contains debug information such as number of known files and number of files in local context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CONTEXT_ETI_CONNECTIONS
EtiConnection
Map is stored. Only used in debug mode
public static final String CONTEXT_TRANSFER_HANDLER
TransferHandler
is stored.
Method Detail |
---|
public static TransferHandler get(Map<String,Object> env)
env
- the given execution environment
ClassCastException
- if the environment contains an Object with
key CONTEXT_TRANSFER_HANDLER
that cannot be
casted to TransfherHandlerpublic EtiConnection getEtiConnection(URI uri, boolean createNew) throws EtiLocalException, EtiRemoteException
LightweightExecutionEnvironment
wether there already exists a connection to the jETI toolserver
identified by uri. If a connection exists, it is returned. If not, a new one is instanciated or null is returned
(depends on createNew)
(EtiConnectionFactory.createConnection(URI)
is used to create new connection)
uri
- URI of the jETI toolservercreateNew
- defines wether a new EtiConnection should be instanciated if there's
none found
EtiLocalException
- if the URI is not valid for jETI connections
EtiRemoteException
- if login to server failedpublic EtiConnection getEtiConnection(List<URI> uris) throws EtiLocalException
uris
-
EtiLocalException
public void put(VirtualFile vFile, String name)
vFile
- name
- public VirtualFile get(String name) throws EtiLocalException, EtiRemoteException
name
-
EtiLocalException
EtiRemoteException
public void setCurrentLocation(List<String> names, URI uri)
public void setCurrentLocation(String[] names, URI uri)
names
- uri
- public void storeToLocation(List<String> names, URI targetServer) throws EtiLocalException, EtiRemoteException
EtiLocalException
EtiRemoteException
public void storeToLocation(String[] names, URI targetServer) throws EtiLocalException, EtiRemoteException
names
- array of filenames from the jETI contexttargetServer
- the URI of the server where the newest versions
of names
are needed.
EtiLocalException
- if names contains an unknown filename
EtiRemoteException
- if store or forward somehow failspublic void closeAllSessions()
public String toString()
toString
in class Object
public static boolean isDebug()
public static void setDebug(boolean debug)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |