Package org.serviceconnector.server
Class FileServer
java.lang.Object
org.serviceconnector.server.Server
org.serviceconnector.server.FileServer
- All Implemented Interfaces:
IServer
The Class FileServer.
-
Field Summary
Fields inherited from class org.serviceconnector.server.Server
destroyed, operationTimeoutMultiplier, remoteNodeConfiguration, requester, serverKey, serverTimeoutMillis, socketAddress -
Constructor Summary
ConstructorsConstructorDescriptionFileServer(RemoteNodeConfiguration remoteNodeConfiguration, InetSocketAddress socketAddress) Instantiates a new file server. -
Method Summary
Modifier and TypeMethodDescriptionvoidabortSession(AbstractSession session, String reason) Abort session.voidaddSession(FileSession session) Adds the session.voiddump(XMLDumpWriter writer) Dump the server into the xml writer.intGets the max sessions.booleanChecks for free session.voidremoveSession(Session session) Removes the session.serverDownloadFile(FileSession session, SCMPMessage message, String remoteFileName, int timeoutSeconds) Server download file.serverGetFileList(String path, String listScriptName, SCMPMessage reqMessage, int timeoutSeconds) Server get file list.serverUploadFile(FileSession session, SCMPMessage message, String remoteFileName, int timeoutMillis) Server upload file.Methods inherited from class org.serviceconnector.server.Server
destroy, getConnectionType, getHost, getMaxConnections, getPortNr, getRequester, getServerKey, getServerTimeoutMillis, getSocketAddress, getTimeout, getTimeouterTask, getType, immediateConnect, isDestroyed, setTimeout, setTimeouterTask, toString
-
Constructor Details
-
FileServer
Instantiates a new file server.- Parameters:
remoteNodeConfiguration- the remote node configurationsocketAddress- the socket address
-
-
Method Details
-
serverUploadFile
public SCMPMessage serverUploadFile(FileSession session, SCMPMessage message, String remoteFileName, int timeoutMillis) throws Exception Server upload file.- Parameters:
session- the sessionmessage- the messageremoteFileName- the remote file nametimeoutMillis- the timeout milliseconds- Returns:
- the sCMP message
- Throws:
Exception- the exception
-
serverDownloadFile
public SCMPMessage serverDownloadFile(FileSession session, SCMPMessage message, String remoteFileName, int timeoutSeconds) throws Exception Server download file.- Parameters:
session- the sessionmessage- the messageremoteFileName- the remote file nametimeoutSeconds- the timeout seconds- Returns:
- the sCMP message
- Throws:
Exception- the exception
-
serverGetFileList
public SCMPMessage serverGetFileList(String path, String listScriptName, SCMPMessage reqMessage, int timeoutSeconds) throws Exception Server get file list.- Parameters:
path- the pathlistScriptName- the list script namereqMessage- the request messagetimeoutSeconds- the timeout seconds- Returns:
- the SCMP message
- Throws:
Exception- the exception
-
abortSession
Abort session.- Parameters:
session- the sessionreason- the reason
-
hasFreeSession
public boolean hasFreeSession()Checks for free session.- Returns:
- true, if successful
-
addSession
Adds the session.- Parameters:
session- the session
-
removeSession
Removes the session.- Parameters:
session- the session
-
getMaxSessions
public int getMaxSessions()Gets the max sessions.- Returns:
- the max sessions
-
dump
Dump the server into the xml writer.- Parameters:
writer- the writer- Throws:
Exception- the exception
-