Package org.serviceconnector.api.cln
Class SCFileService
java.lang.Object
org.serviceconnector.api.cln.SCService
org.serviceconnector.api.cln.SCFileService
The Class SCFileService. SCFileService is a remote interface in client API to a file service and provides communication functions. Creating a file service instance for API users
should be done by calling SCClient newFileService().
-
Field Summary
Fields inherited from class org.serviceconnector.api.cln.SCService
messageCallback, pendingRequest, requester, scClient, serviceName, sessionActive, sessionId -
Method Summary
Modifier and TypeMethodDescriptionvoiddownloadFile(int operationTimeoutSeconds, String remoteFileName, OutputStream outStream) Download file.voiddownloadFile(String remoteFileName, OutputStream outStream) Download file with default operation timeout.intGets the echo interval in seconds.intGets the part size.List files with default operation timeout.listFiles(int operationTimeoutSeconds) List available files on server directory.voidsetEchoIntervalSeconds(int echoIntervalSeconds) Sets the echo interval in seconds.voidsetPartSize(int partSize) Sets the part size.voiduploadFile(int operationTimeoutSeconds, String remoteFileName, InputStream inStream) Upload file.voiduploadFile(String remoteFileName, InputStream inStream) Upload file with default operation timeout.Methods inherited from class org.serviceconnector.api.cln.SCService
getSCClient, getServiceName, getSessionId, isActive
-
Method Details
-
setEchoIntervalSeconds
public void setEchoIntervalSeconds(int echoIntervalSeconds) Sets the echo interval in seconds. Interval in seconds between two subsequent ECHO messages sent by the client to SC. The message is sent only when no message is pending.- Parameters:
echoIntervalSeconds- Validation: echoIntervalSeconds > 1 and < 3600
Example: 360
-
getEchoIntervalSeconds
public int getEchoIntervalSeconds()Gets the echo interval in seconds.- Returns:
- the echo interval in seconds
-
getPartSize
public int getPartSize()Gets the part size.- Returns:
- the size of the parts in which message will be broken when it is large
-
setPartSize
public void setPartSize(int partSize) Sets the part size.- Parameters:
partSize- the size in which message will be broken when it is large
-
uploadFile
Upload file with default operation timeout.- Parameters:
remoteFileName- the remote file name to store the fileinStream- stream to upload- Throws:
SCServiceException- create file session to SC failed
upload file to Server failed
error message received from SC
-
uploadFile
public void uploadFile(int operationTimeoutSeconds, String remoteFileName, InputStream inStream) throws SCServiceException Upload file.- Parameters:
operationTimeoutSeconds- the allowed time in seconds to complete the operationremoteFileName- the remote file name to store the fileinStream- stream to upload- Throws:
SCServiceException- create file session to SC failed
upload file to Server failed
error message received from SC
-
downloadFile
Download file with default operation timeout.- Parameters:
remoteFileName- the remote name of the fileoutStream- the out stream to store download- Throws:
SCServiceException- create file session to SC failed
download file from Server failed
error message received from SC
-
downloadFile
public void downloadFile(int operationTimeoutSeconds, String remoteFileName, OutputStream outStream) throws SCServiceException Download file.- Parameters:
operationTimeoutSeconds- the allowed time in seconds to complete the operationremoteFileName- the remote name of the fileoutStream- the out stream to store download- Throws:
SCServiceException- create file session to SC failed
download file from Server failed
writing to OutputStream failed
error message received from SC
-
listFiles
List files with default operation timeout.- Returns:
- the list of files on the remote server
- Throws:
SCServiceException- list files from Server failed
error message received from SC
-
listFiles
List available files on server directory.- Parameters:
operationTimeoutSeconds- the allowed time in seconds to complete the operation- Returns:
- the list of files on the remote server
- Throws:
SCServiceException- list files from Server failed
error message received from SC
-