Sun Adapter for SAG API

com.stc.connector.sagadapter.sagapi
Interface SAGApi.Services.FileActServer

Enclosing interface:
SAGApi.Services

public static interface SAGApi.Services.FileActServer

It is server component for FileAct. It can do FileAct scenarios like get file, put file, etc. It constructs the responses by use of Configuration. It populates the requests to corresponding Primitives.

Version:
cvs revision: $Revision: 1.4 $ Last Modified: $Date: 2007/10/19 19:48:21 $
Author:
Harry Liu (harry.liu@sun.com)

Method Summary
 void abortFile(java.lang.String transferKey)
          Aborts the file transfer which is against the last get/put/fetch.
 void abortFile(java.lang.String transferRef, java.lang.String transferKey)
          Aborts the file transfer with the specified transfer reference.
 void ackFile(boolean accepted)
          Acks the previously-received file.
 java.lang.String checkFileStatus()
          Checks the state for the file transfer which is against the last get/put/fetch.
 java.lang.String checkFileStatus(java.lang.String transferRef)
          Checks the state for the file transfer with the specified transfer reference.
 java.lang.String checkFinalFileStatus()
          Checks the final state for the file transfer which is against the last get/put/fetch.
 java.lang.String checkFinalFileStatus(java.lang.String transferRef)
          Checks the final state for the file transfer with the specified transfer reference.
 java.lang.String checkFinalFileStatus(java.lang.String transferRef, long interval, int count)
          Checks the final state for the file transfer with the specified transfer reference.
 java.lang.String checkSnFStatus()
          Checks SnF status for the SnF session which is from the last acquire.
 java.lang.String checkSnFStatus(java.lang.String snfSession)
          Checks SnF status for the specified SnF session.
 java.lang.String computeFileDigest(java.lang.String physicalFileFullName)
          Computes File Digest locally using TransferEP from configuration if it exists.
 java.lang.String computeFileDigest(java.lang.String physicalFileFullName, java.lang.String transferEP)
          Computes File Digest locally using specified TransferEP.
 SAGMessage getRequest()
          Gets the current request message.
 java.lang.String getResponse()
          Returns the current Response message which will be sent out.
 SAGMessage.SAGEnvelope getResponseEnvelope()
          Returns SAG envelope of the current Response message which will be sent out.
 java.lang.String getResponseLetter()
          Returns letter of the current Response message which will be sent out.
 long getToken()
          Returns the token number for current transfer.
 boolean isHandleFileEventRequestReceived()
          Checks whether the request received on receiveRequest() is Sw:HandleFileEventRequest.
 boolean isHandleFileRequestReceived()
          Checks whether the request received on receiveRequest() is Sw:HandleFileRequest.
 boolean isHandleInitRequestReceived()
          Checks whether the request received on receiveRequest() is Sw:HandleInitRequest.
 boolean isHandleRequestReceived()
          Checks whether the request received on receiveRequest() is SwInt:HandleRequest.
 boolean isHandleSnFRequestReceived()
          Checks whether the request received on receiveRequest() is Sw:HandleSnFRequest.
 boolean isHandleTermRequestReceived()
          Checks whether the request received on receiveRequest() is Sw:HandleTermRequest.
 boolean isNoRequestReceived()
          Checks whether no request is received on receiveRequest() - timeout happens.
 boolean isRemoteFileHandlerAlive()
          Checks whether Remote File Handler process is alive.
 java.lang.String listFileStatus()
          It allows for several selection criteria.
 void process(long token)
          Analyzes the received request and prepares the response accordingly for the message transfer associated with the specified token.
 void processHandleFileEventRequest(long token)
          Processes the request Sw:HandleFileEventRequest.
 void processHandleFileRequest(long token)
          Processes the request Sw:HandleFileRequest.
 void processHandleInitRequest(long token)
          Processes the request Sw:HandleInitRequest.
 void processHandleRequest(long token)
          Processes the request message SwInt:HandleRequest.
 void processHandleSnFRequest(long token)
          Processes the request Sw:HandleSnFRequest.
 void processHandleTermRequest(long token)
          Processes the request Sw:HandleTermRequest.
 long receiveRequest()
          Receives the request message.
 void sendError(long token, long errorCode, java.lang.String errorData)
          Sends error with the specified token, error code, error data.
 void sendError(long errorCode, java.lang.String errorData)
          Sends error with the specified error code, error data.
 void sendHandleFileEventResponse(long token)
          Sends the response message Sw:HandleFileEventResponse.
 void sendHandleFileResponse(long token)
          Sends the response message Sw:HandleFileResponse.
 void sendHandleInitResponse(long token)
          Sends the response message Sw:HandleInitResponse.
 void sendHandleResponse(long token)
          Sends the response message SwInt:HandleResponse.
 void sendHandleSnFResponse(long token)
          Sends the response message Sw:HandleSnFResponse.
 void sendHandleTermResponse(long token)
          Sends the response message Sw:HandleTermResponse.
 void sendResponse(long token)
          Sends out the current response message with the specified token number.
 void snfAck()
          Acks the previously-fetched file or previously-handled message in current SnF session.
 void snfAck(java.lang.String acceptStatus)
          Acks the previously-fetched file or previously-handled message in current SnF session with specified accept status.
 java.lang.String snfAcquire()
          Acquires SnF queue and opens a SnF session.
 java.lang.String snfFetch()
          Fetches the file from SnF central server in current SnF session.
 void snfRelease()
          Releases SnF queue and closes the SnF session which corresponds to the last acquire.
 void snfRelease(java.lang.String sessionId)
          Releases SnF queue and closes the SnF session.
 java.lang.String startRemoteFileHandler()
          Starts Remote File Handler process with e*Way interlly assigned Transfer EndPoint.
 void startRemoteFileHandler(java.lang.String transferEP)
          Starts Remote File Handler process with the specified Transfer EndPoint.
 void stopRemoteFileHandler()
          Stops the Remote File Handler process which is started from this e*Way instance.
 java.lang.String subscribeFileEvent()
          Subscribes file transfer event with e*Way assigned event endpoint.
 void subscribeFileEvent(java.lang.String eventEP)
          Subscribes file transfer event with the specified event endpoint.
 

Method Detail

process

void process(long token)
             throws SAGApplicationException
Analyzes the received request and prepares the response accordingly for the message transfer associated with the specified token.

Parameters:
token - Token number
Throws:
SAGApplicationException - upon error.

receiveRequest

long receiveRequest()
                    throws SAGApplicationException
Receives the request message.

Returns:
The token number.
Throws:
SAGApplicationException - upon error.

processHandleRequest

void processHandleRequest(long token)
                          throws SAGApplicationException
Processes the request message SwInt:HandleRequest.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

sendHandleResponse

void sendHandleResponse(long token)
                        throws SAGApplicationException
Sends the response message SwInt:HandleResponse.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

processHandleSnFRequest

void processHandleSnFRequest(long token)
                             throws SAGApplicationException
Processes the request Sw:HandleSnFRequest.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

sendHandleSnFResponse

void sendHandleSnFResponse(long token)
                           throws SAGApplicationException
Sends the response message Sw:HandleSnFResponse.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

processHandleFileRequest

void processHandleFileRequest(long token)
                              throws SAGApplicationException
Processes the request Sw:HandleFileRequest.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

sendHandleFileResponse

void sendHandleFileResponse(long token)
                            throws SAGApplicationException
Sends the response message Sw:HandleFileResponse.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

processHandleFileEventRequest

void processHandleFileEventRequest(long token)
                                   throws SAGApplicationException
Processes the request Sw:HandleFileEventRequest.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

sendHandleFileEventResponse

void sendHandleFileEventResponse(long token)
                                 throws SAGApplicationException
Sends the response message Sw:HandleFileEventResponse.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

processHandleInitRequest

void processHandleInitRequest(long token)
                              throws SAGApplicationException
Processes the request Sw:HandleInitRequest.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

sendHandleInitResponse

void sendHandleInitResponse(long token)
                            throws SAGApplicationException
Sends the response message Sw:HandleInitResponse.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

processHandleTermRequest

void processHandleTermRequest(long token)
                              throws SAGApplicationException
Processes the request Sw:HandleTermRequest.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

sendHandleTermResponse

void sendHandleTermResponse(long token)
                            throws SAGApplicationException
Sends the response message Sw:HandleTermResponse.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

isNoRequestReceived

boolean isNoRequestReceived()
Checks whether no request is received on receiveRequest() - timeout happens.

Returns:
true or false

isHandleTermRequestReceived

boolean isHandleTermRequestReceived()
Checks whether the request received on receiveRequest() is Sw:HandleTermRequest.

Returns:
true or false

isHandleInitRequestReceived

boolean isHandleInitRequestReceived()
Checks whether the request received on receiveRequest() is Sw:HandleInitRequest.

Returns:
true or false

isHandleFileEventRequestReceived

boolean isHandleFileEventRequestReceived()
Checks whether the request received on receiveRequest() is Sw:HandleFileEventRequest.

Returns:
true or false

isHandleSnFRequestReceived

boolean isHandleSnFRequestReceived()
Checks whether the request received on receiveRequest() is Sw:HandleSnFRequest.

Returns:
true or false

isHandleFileRequestReceived

boolean isHandleFileRequestReceived()
Checks whether the request received on receiveRequest() is Sw:HandleFileRequest.

Returns:
true or false

isHandleRequestReceived

boolean isHandleRequestReceived()
Checks whether the request received on receiveRequest() is SwInt:HandleRequest.

Returns:
true or false

subscribeFileEvent

java.lang.String subscribeFileEvent()
                                    throws SAGApplicationException
Subscribes file transfer event with e*Way assigned event endpoint.

Returns:
The event endpoint
Throws:
SAGApplicationException - upon error.

subscribeFileEvent

void subscribeFileEvent(java.lang.String eventEP)
                        throws SAGApplicationException
Subscribes file transfer event with the specified event endpoint.

Parameters:
eventEP - The event endpoint
Throws:
SAGApplicationException - upon error.

ackFile

void ackFile(boolean accepted)
             throws SAGApplicationException
Acks the previously-received file. It can be called only after PutFile response.

Parameters:
accepted - true or false
Throws:
SAGApplicationException - upon error.

snfAcquire

java.lang.String snfAcquire()
                            throws SAGApplicationException
Acquires SnF queue and opens a SnF session.

Returns:
String - Returns the SnF session ID.
Throws:
SAGApplicationException - upon error.

snfRelease

void snfRelease()
                throws SAGApplicationException
Releases SnF queue and closes the SnF session which corresponds to the last acquire.

Throws:
SAGApplicationException - upon error.

snfRelease

void snfRelease(java.lang.String sessionId)
                throws SAGApplicationException
Releases SnF queue and closes the SnF session.

Parameters:
SnF - SessionId to release.
Throws:
SAGApplicationException - upon error.

snfAck

void snfAck()
            throws SAGApplicationException
Acks the previously-fetched file or previously-handled message in current SnF session.

Parameters:
None.

Throws:
SAGApplicationException - upon error.

snfAck

void snfAck(java.lang.String acceptStatus)
            throws SAGApplicationException
Acks the previously-fetched file or previously-handled message in current SnF session with specified accept status.

Parameters:
acceptStatus - The accept status.
Throws:
SAGApplicationException - upon error.

snfFetch

java.lang.String snfFetch()
                          throws SAGApplicationException
Fetches the file from SnF central server in current SnF session.

Parameters:
None.

Returns:
String - Returns the transfer reference, or returns null when the current session is Closed or TimedOut.
Throws:
SAGApplicationException - upon error.

checkSnFStatus

java.lang.String checkSnFStatus(java.lang.String snfSession)
                                throws SAGApplicationException
Checks SnF status for the specified SnF session.

Parameters:
snfSession - SnF session Id
Returns:
String - Returns the SnF status.
Throws:
SAGApplicationException - upon error.

checkSnFStatus

java.lang.String checkSnFStatus()
                                throws SAGApplicationException
Checks SnF status for the SnF session which is from the last acquire.

Parameters:
None.

Returns:
String - Returns the SnF status.
Throws:
SAGApplicationException - upon error.

checkFileStatus

java.lang.String checkFileStatus(java.lang.String transferRef)
                                 throws SAGApplicationException
Checks the state for the file transfer with the specified transfer reference. Returns one of following states:
 In progress:
      INITIATED
      ACCEPTED
      ONGOING
 Final state:
      COMPLETED 
      DUPLICATED 
      UNKNOWN
      ABORTED
      FAILED
      REJECTED
 

Parameters:
transferRef - File transfer reference.
Returns:
String - Returns the file transfer status.
Throws:
SAGApplicationException - upon error.

checkFileStatus

java.lang.String checkFileStatus()
                                 throws SAGApplicationException
Checks the state for the file transfer which is against the last get/put/fetch. Returns one of following states:
 In progress:
      INITIATED
      ACCEPTED
      ONGOING
 Final state:
      COMPLETED 
      DUPLICATED 
      UNKNOWN
      ABORTED
      FAILED
      REJECTED
 

Parameters:
None.

Returns:
String - Returns the file transfer status.
Throws:
SAGApplicationException - upon error.

checkFinalFileStatus

java.lang.String checkFinalFileStatus(java.lang.String transferRef,
                                      long interval,
                                      int count)
                                      throws SAGApplicationException
Checks the final state for the file transfer with the specified transfer reference. It keeps checking the file transfer status based on interval/count until a final state is returned or maximum count is reached.
 The final state is one of following:
 - COMPLETED
 - DUPLICATED
 - UNKNOWN
 - ABORTED
 - FAILED
 - REJECTED
 

Parameters:
transferRef - File transfer reference
interval - Check interval
count - Check maximum count
Returns:
String - Returns the file transfer status.
Throws:
SAGApplicationException - upon error.

checkFinalFileStatus

java.lang.String checkFinalFileStatus(java.lang.String transferRef)
                                      throws SAGApplicationException
Checks the final state for the file transfer with the specified transfer reference. It keeps checking the file transfer status until a final state is returned.
 The final state is one of following:
 - COMPLETED
 - DUPLICATED
 - UNKNOWN
 - ABORTED
 - FAILED
 - REJECTED
 

Parameters:
transferRef - File transfer reference
Returns:
String - Returns the file transfer status.
Throws:
SAGApplicationException - upon error.

checkFinalFileStatus

java.lang.String checkFinalFileStatus()
                                      throws SAGApplicationException
Checks the final state for the file transfer which is against the last get/put/fetch. It keeps checking the file transfer status until a final state is returned.
 The final state is one of following:
 - COMPLETED
 - DUPLICATED
 - UNKNOWN
 - ABORTED
 - FAILED
 - REJECTED
 

Parameters:
None.

Returns:
String - Returns the file transfer status.
Throws:
SAGApplicationException - upon error.

listFileStatus

java.lang.String listFileStatus()
                                throws SAGApplicationException
It allows for several selection criteria. When present, the selection criteria Sw:Partition, Sw:TransferStatus, Sw:StoredTransferRef and Sw:MsgId are linked together with the AND relation.

Parameters:
None.

Returns:
String - Returns Sw:EndOfList. TRUE or FALSE to indicate whether the end of the list has been reached.
Throws:
SAGApplicationException - upon error.

abortFile

void abortFile(java.lang.String transferRef,
               java.lang.String transferKey)
               throws SAGApplicationException
Aborts the file transfer with the specified transfer reference.

Parameters:
transferRef - File transfer reference.
transferRef - File transfer key.
Throws:
SAGApplicationException - upon error.

abortFile

void abortFile(java.lang.String transferKey)
               throws SAGApplicationException
Aborts the file transfer which is against the last get/put/fetch.

Parameters:
transferRef - File transfer key.
Throws:
SAGApplicationException - upon error.

computeFileDigest

java.lang.String computeFileDigest(java.lang.String physicalFileFullName)
                                   throws SAGApplicationException
Computes File Digest locally using TransferEP from configuration if it exists.

Parameters:
physicalFileFullName - The file to be computed
Returns:
String - Returns the File Digest.
Throws:
SAGApplicationException - upon error.
See Also:
com.stc.connector.sagadapter.sagapi.SAGApi.Services.FileActClient#computeFileDigest()

computeFileDigest

java.lang.String computeFileDigest(java.lang.String physicalFileFullName,
                                   java.lang.String transferEP)
                                   throws SAGApplicationException
Computes File Digest locally using specified TransferEP.

Parameters:
physicalFileFullName - The file to be computed
transferEP - The file transfer endpoint.
Returns:
String - Returns the File Digest.
Throws:
SAGApplicationException - upon error.
See Also:
com.stc.connector.sagadapter.sagapi.SAGApi.Services.FileActClient#computeFileDigest()

isRemoteFileHandlerAlive

boolean isRemoteFileHandlerAlive()
Checks whether Remote File Handler process is alive.

Returns:
true or false

startRemoteFileHandler

java.lang.String startRemoteFileHandler()
                                        throws SAGApplicationException
Starts Remote File Handler process with e*Way interlly assigned Transfer EndPoint.

Returns:
The Transfer EndPoint used for this Remote File Handler
Throws:
SAGApplicationException - upon error.

startRemoteFileHandler

void startRemoteFileHandler(java.lang.String transferEP)
                            throws SAGApplicationException
Starts Remote File Handler process with the specified Transfer EndPoint. param transferEP The Transfer EndPoint used for this Remote File Handler

Throws:
SAGApplicationException - upon error.

stopRemoteFileHandler

void stopRemoteFileHandler()
                           throws SAGApplicationException
Stops the Remote File Handler process which is started from this e*Way instance.

Throws:
SAGApplicationException - upon error.

sendError

void sendError(long token,
               long errorCode,
               java.lang.String errorData)
               throws SAGApplicationException
Sends error with the specified token, error code, error data.

Parameters:
token - The token number.
errorCode - The error code, eg. 0 - Local Authentication Error; 1 - No Server Business Response.
errorData - The error data.
Throws:
SAGApplicationException - upon error.

sendError

void sendError(long errorCode,
               java.lang.String errorData)
               throws SAGApplicationException
Sends error with the specified error code, error data. The token number is from the working context.

Parameters:
errorCode - The error code, eg. 0 - Local Authentication Error; 1 - No Server Business Response.
errorData - The error data.
Throws:
SAGApplicationException - upon error.

sendResponse

void sendResponse(long token)
                  throws SAGApplicationException
Sends out the current response message with the specified token number.

Parameters:
token - The token number along with the transfer.
Throws:
SAGApplicationException - upon error.

getRequest

SAGMessage getRequest()
Gets the current request message.

Parameters:
None.

Returns:
SAGMessage - Returns the SAG message.
Throws:
None.

getToken

long getToken()
Returns the token number for current transfer.

Returns:
The token number.

getResponse

java.lang.String getResponse()
Returns the current Response message which will be sent out.

Parameters:
None.

Returns:
The Response message

getResponseEnvelope

SAGMessage.SAGEnvelope getResponseEnvelope()
Returns SAG envelope of the current Response message which will be sent out.

Parameters:
None.

Returns:
The SAG envelope of the Response message

getResponseLetter

java.lang.String getResponseLetter()
Returns letter of the current Response message which will be sent out.

Parameters:
None.

Returns:
The letter of the Response message

Sun Adapter for SAG API

Copyright © 2008 Sun Microsystems, Inc. All rights reserved.