|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.oodt.cas.pushpull.protocol.ProtocolHandler
public class ProtocolHandler
This class is responsible for creating the appropriate Protocol for the given
RemoteSites. The boolean argument 'allowReuse' allows for one unique protocol
for each URL. That is, if allowReuse is set to true, then if no Protocol has
been created for the current site, the Protocol created will be saved and
then returned for any later called with allowReuse equals true. This is to
allow for the same Protocol object to be used by several classes. The
Protocol class has been synchronized so this is thread-safe. If you set
'allowReuse' to false then a new Protocol object will be created and
returned.
| Constructor Summary | |
|---|---|
ProtocolHandler(ProtocolInfo pi)
Creates a new ProtocolHandler for the given Config object |
|
| Method Summary | |
|---|---|
void |
cd(Protocol protocol,
ProtocolFile file)
|
void |
cdToHOME(Protocol protocol)
|
void |
cdToROOT(Protocol protocol)
|
void |
close()
Disconnects all waiting Protocols and clears the waiting lists. |
boolean |
connect(Protocol protocol,
RemoteSite remoteSite,
boolean test)
Connects the given Protocol to the given URL |
boolean |
delete(Protocol protocol,
ProtocolFile file)
|
void |
disconnect(Protocol protocol)
Disconnects and logs out the given Protocol |
void |
download(Protocol protocol,
ProtocolFile fromFile,
File toFile,
boolean delete)
|
String |
getAbsPathFor(Protocol protocol,
String path)
|
Protocol |
getAppropriateProtocol(ProtocolFile pFile,
boolean allowReuse,
boolean navigateToPathLoc)
Returns the appropriate protocol for the given Path |
Protocol |
getAppropriateProtocolBySite(RemoteSite remoteSite,
boolean allowReuse)
|
ProtocolFile |
getHomeDir(Protocol protocol)
|
ProtocolFile |
getProtocolFileFor(Protocol protocol,
String file,
boolean isDir)
|
String |
getProtocolType(Protocol protocol)
|
RemoteSite |
getRemoteSite(Protocol protocol)
|
boolean |
isProtocolConnected(Protocol protocol)
|
List<ProtocolFile> |
ls(Protocol protocol)
|
List<ProtocolFile> |
ls(Protocol protocol,
ProtocolFile dir)
|
List<ProtocolFile> |
ls(Protocol protocol,
ProtocolFileFilter filter)
|
List<ProtocolFile> |
nextPage(Protocol protocol)
|
List<ProtocolFile> |
nextPage(Protocol protocol,
ProtocolFileFilter filter)
|
ProtocolFile |
pwd(Protocol protocol)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProtocolHandler(ProtocolInfo pi)
config - The Config object that guides this ProtocolHandler in making
class instanciations| Method Detail |
|---|
public Protocol getAppropriateProtocol(ProtocolFile pFile,
boolean allowReuse,
boolean navigateToPathLoc)
throws RemoteConnectionException
ProtocolPath - Used to determine the appropriate Protocol to be returned and
the path to navigate on if navigateToPathLoc is set to true.allowReuse - Set to true if you would like ProtocolHandler to take care of
the protocol returned (i.e. reuseable protocols may be
returned by this method again, if it is the appropriate
protocol type for a given Path. Also ProtocolHandler will take
care of disconnecting the reuseable protocols)navigateToPathLoc - If true, will navigate the to the end of the Path location
specified
RemoteCommunicationException - If there is an error creating the protocol
RemoteConnectionException
public Protocol getAppropriateProtocolBySite(RemoteSite remoteSite,
boolean allowReuse)
throws ProtocolException
ProtocolException
public List<ProtocolFile> nextPage(Protocol protocol)
throws RemoteConnectionException,
ProtocolException
RemoteConnectionException
ProtocolException
public List<ProtocolFile> nextPage(Protocol protocol,
ProtocolFileFilter filter)
throws RemoteConnectionException,
ProtocolException
protocol -
RemoteConnectionException
ProtocolException
public void download(Protocol protocol,
ProtocolFile fromFile,
File toFile,
boolean delete)
throws RemoteConnectionException
RemoteConnectionException
public boolean connect(Protocol protocol,
RemoteSite remoteSite,
boolean test)
protocol - The Protocol that will be connectedurl - The server to which the Protocol will connect
RemoteConnectionException - If connection fails
RemoteLoginException - If login fails
public void cdToROOT(Protocol protocol)
throws ProtocolException
ProtocolException
public void cdToHOME(Protocol protocol)
throws ProtocolException
ProtocolException
public boolean isProtocolConnected(Protocol protocol)
throws ProtocolException
ProtocolException
public void cd(Protocol protocol,
ProtocolFile file)
throws ProtocolException
ProtocolException
public ProtocolFile getProtocolFileFor(Protocol protocol,
String file,
boolean isDir)
throws ProtocolException
ProtocolException
public boolean delete(Protocol protocol,
ProtocolFile file)
throws MalformedURLException,
ProtocolException
MalformedURLException
ProtocolException
public ProtocolFile pwd(Protocol protocol)
throws ProtocolException
ProtocolException
public List<ProtocolFile> ls(Protocol protocol,
ProtocolFile dir)
throws ProtocolException
ProtocolException
public List<ProtocolFile> ls(Protocol protocol)
throws ProtocolException
ProtocolException
public List<ProtocolFile> ls(Protocol protocol,
ProtocolFileFilter filter)
throws ProtocolException
ProtocolExceptionpublic String getProtocolType(Protocol protocol)
public RemoteSite getRemoteSite(Protocol protocol)
public ProtocolFile getHomeDir(Protocol protocol)
public String getAbsPathFor(Protocol protocol,
String path)
public void disconnect(Protocol protocol)
throws RemoteConnectionException
protocol - The Protocol to be logout out and disconnected
RemoteConnectionException
public void close()
throws RemoteConnectionException
RemoteConnectionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||