Package org.serviceconnector.server
Class CascadedSC
java.lang.Object
org.serviceconnector.server.Server
org.serviceconnector.server.CascadedSC
- All Implemented Interfaces:
IServer,IStatefulServer
The Class CascadedSC.
-
Field Summary
Fields inherited from class org.serviceconnector.server.Server
destroyed, operationTimeoutMultiplier, remoteNodeConfiguration, requester, serverKey, serverTimeoutMillis, socketAddress -
Constructor Summary
ConstructorsConstructorDescriptionCascadedSC(RemoteNodeConfiguration remoteNodeConfiguration, InetSocketAddress socketAddress) Instantiates a new cascaded sc. -
Method Summary
Modifier and TypeMethodDescriptionvoidabortSession(AbstractSession session, String reason) Abort session.voidaddSession(AbstractSession subscription) Adds the session.voidcascadedSCAbortSubscription(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis) Cascaded SC abort subscription.voidcascadedSCChangeSubscription(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis) Cascaded SC change subscription.voidcascadedSCSubscribe(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis) Cascaded SC subscribe.voidcascadedSCUnsubscribe(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis) Cascaded SC unsubscribe.voidcreateSession(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis) Creates the session.voiddeleteSession(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis) Delete session.voiddump(XMLDumpWriter writer) Dump the cascaded SC into the xml writer.voidecho(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis) Echo.voidexecute(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis) Execute.intGets the max sessions.intGets the session count.Gets the sessions.booleanChecks for free session.voidreceivePublication(CascadedClient cascClient, ISCMPMessageCallback callback, int timeoutMillis, boolean largeResponsePolling) Receive publication.voidremoveSession(String subscriptionId) Removes the session.voidremoveSession(AbstractSession subscription) Removes the session.voidserverDownloadFile(SCMPMessage msgToForward, CommandCascCallback callback, int timeoutMillis) Server download file.voidserverGetFileList(SCMPMessage msgToForward, CommandCascCallback callback, int timeoutMillis) Server get file list.voidserverUploadFile(SCMPMessage msgToForward, CommandCascCallback callback, int timeoutMillis) Server upload file.booleantryAcquirePermitOnCascClientSemaphore(CascadedClient cascClient, int oti, ISCMPMessageCallback callback) Try acquire permit on cascaded client semaphore.voidunsubscribeCascadedClientInErrorCases(CascadedClient cascClient) Unsubscribe cascaded client in error cases.Methods inherited from class org.serviceconnector.server.Server
destroy, getConnectionType, getHost, getMaxConnections, getPortNr, getRequester, getServerKey, getServerTimeoutMillis, getSocketAddress, getTimeout, getTimeouterTask, getType, immediateConnect, isDestroyed, setTimeout, setTimeouterTask, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.serviceconnector.server.IStatefulServer
getType
-
Constructor Details
-
CascadedSC
Instantiates a new cascaded sc.- Parameters:
remoteNodeConfiguration- the remote node configurationsocketAddress- the socket address
-
-
Method Details
-
createSession
public void createSession(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis) Creates the session.- Parameters:
msgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
deleteSession
public void deleteSession(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis) Delete session.- Parameters:
msgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
execute
Execute.- Parameters:
msgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
echo
Echo.- Parameters:
msgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
serverDownloadFile
public void serverDownloadFile(SCMPMessage msgToForward, CommandCascCallback callback, int timeoutMillis) Server download file.- Parameters:
msgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
serverGetFileList
public void serverGetFileList(SCMPMessage msgToForward, CommandCascCallback callback, int timeoutMillis) Server get file list.- Parameters:
msgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
serverUploadFile
public void serverUploadFile(SCMPMessage msgToForward, CommandCascCallback callback, int timeoutMillis) Server upload file.- Parameters:
msgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
tryAcquirePermitOnCascClientSemaphore
public boolean tryAcquirePermitOnCascClientSemaphore(CascadedClient cascClient, int oti, ISCMPMessageCallback callback) Try acquire permit on cascaded client semaphore. This method is used to get permit to continue. Only one permit is available per cascaded client. If no permit is available thread waits inside the semaphore. Operation breaks if OTI times out. After receiving a valid permit cascaded client will be checked to be active. Operation stops if client got destroyed in the meantime. Important: Pay attention an acquired permit must be released as fast as possible!!! Other threads are blocked.- Parameters:
cascClient- the cascaded clientoti- the operation timeoutcallback- the callback- Returns:
- true, if successful
-
cascadedSCSubscribe
public void cascadedSCSubscribe(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis) Cascaded SC subscribe.- Parameters:
cascClient- the cascaded clientmsgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
cascadedSCChangeSubscription
public void cascadedSCChangeSubscription(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis) Cascaded SC change subscription.- Parameters:
cascClient- the cascaded clientmsgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
cascadedSCUnsubscribe
public void cascadedSCUnsubscribe(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis) Cascaded SC unsubscribe.- Parameters:
cascClient- the cascaded clientmsgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
cascadedSCAbortSubscription
public void cascadedSCAbortSubscription(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis) Cascaded SC abort subscription.- Parameters:
cascClient- the cascaded clientmsgToForward- the message to forwardcallback- the callbacktimeoutMillis- the timeout milliseconds
-
unsubscribeCascadedClientInErrorCases
Unsubscribe cascaded client in error cases.- Parameters:
cascClient- the cascaded client
-
receivePublication
public void receivePublication(CascadedClient cascClient, ISCMPMessageCallback callback, int timeoutMillis, boolean largeResponsePolling) Receive publication.- Parameters:
cascClient- the cascaded clientcallback- the callbacktimeoutMillis- the timeout millisecondslargeResponsePolling- the large response polling
-
abortSession
Abort session.- Specified by:
abortSessionin interfaceIServer- Specified by:
abortSessionin interfaceIStatefulServer- Parameters:
session- the sessionreason- the reason the reason
-
addSession
Adds the session.- Specified by:
addSessionin interfaceIStatefulServer- Parameters:
subscription- the subscription the session
-
removeSession
Removes the session.- Specified by:
removeSessionin interfaceIStatefulServer- Parameters:
subscription- the subscription the abstract session
-
removeSession
Removes the session.- Parameters:
subscriptionId- the subscription id
-
getSessions
Gets the sessions.- Specified by:
getSessionsin interfaceIStatefulServer- Returns:
- the sessions the sessions
-
getSessionCount
public int getSessionCount()Gets the session count.- Specified by:
getSessionCountin interfaceIStatefulServer- Returns:
- the session count
-
hasFreeSession
public boolean hasFreeSession()Checks for free session.- Specified by:
hasFreeSessionin interfaceIStatefulServer- Returns:
- true, if successful true, if successful
-
getMaxSessions
public int getMaxSessions()Gets the max sessions.- Specified by:
getMaxSessionsin interfaceIStatefulServer- Returns:
- the max sessions the max sessions
-
dump
Dump the cascaded SC into the xml writer.
-