Class CascadedSC

java.lang.Object
org.serviceconnector.server.Server
org.serviceconnector.server.CascadedSC
All Implemented Interfaces:
IServer, IStatefulServer

public class CascadedSC extends Server implements IStatefulServer
The Class CascadedSC.
  • Constructor Details

    • CascadedSC

      public CascadedSC(RemoteNodeConfiguration remoteNodeConfiguration, InetSocketAddress socketAddress)
      Instantiates a new cascaded sc.
      Parameters:
      remoteNodeConfiguration - the remote node configuration
      socketAddress - the socket address
  • Method Details

    • createSession

      public void createSession(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis)
      Creates the session.
      Parameters:
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • deleteSession

      public void deleteSession(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis)
      Delete session.
      Parameters:
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • execute

      public void execute(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis)
      Execute.
      Parameters:
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • echo

      public void echo(SCMPMessage msgToForward, ISCMPMessageCallback callback, int timeoutMillis)
      Echo.
      Parameters:
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • serverDownloadFile

      public void serverDownloadFile(SCMPMessage msgToForward, CommandCascCallback callback, int timeoutMillis)
      Server download file.
      Parameters:
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • serverGetFileList

      public void serverGetFileList(SCMPMessage msgToForward, CommandCascCallback callback, int timeoutMillis)
      Server get file list.
      Parameters:
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • serverUploadFile

      public void serverUploadFile(SCMPMessage msgToForward, CommandCascCallback callback, int timeoutMillis)
      Server upload file.
      Parameters:
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - 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 client
      oti - the operation timeout
      callback - 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 client
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • cascadedSCChangeSubscription

      public void cascadedSCChangeSubscription(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis)
      Cascaded SC change subscription.
      Parameters:
      cascClient - the cascaded client
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • cascadedSCUnsubscribe

      public void cascadedSCUnsubscribe(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis)
      Cascaded SC unsubscribe.
      Parameters:
      cascClient - the cascaded client
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • cascadedSCAbortSubscription

      public void cascadedSCAbortSubscription(CascadedClient cascClient, SCMPMessage msgToForward, ISubscriptionCallback callback, int timeoutMillis)
      Cascaded SC abort subscription.
      Parameters:
      cascClient - the cascaded client
      msgToForward - the message to forward
      callback - the callback
      timeoutMillis - the timeout milliseconds
    • unsubscribeCascadedClientInErrorCases

      public void unsubscribeCascadedClientInErrorCases(CascadedClient cascClient)
      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 client
      callback - the callback
      timeoutMillis - the timeout milliseconds
      largeResponsePolling - the large response polling
    • abortSession

      public void abortSession(AbstractSession session, String reason)
      Abort session.
      Specified by:
      abortSession in interface IServer
      Specified by:
      abortSession in interface IStatefulServer
      Parameters:
      session - the session
      reason - the reason the reason
    • addSession

      public void addSession(AbstractSession subscription)
      Adds the session.
      Specified by:
      addSession in interface IStatefulServer
      Parameters:
      subscription - the subscription the session
    • removeSession

      public void removeSession(AbstractSession subscription)
      Removes the session.
      Specified by:
      removeSession in interface IStatefulServer
      Parameters:
      subscription - the subscription the abstract session
    • removeSession

      public void removeSession(String subscriptionId)
      Removes the session.
      Parameters:
      subscriptionId - the subscription id
    • getSessions

      public List<AbstractSession> getSessions()
      Gets the sessions.
      Specified by:
      getSessions in interface IStatefulServer
      Returns:
      the sessions the sessions
    • getSessionCount

      public int getSessionCount()
      Gets the session count.
      Specified by:
      getSessionCount in interface IStatefulServer
      Returns:
      the session count
    • hasFreeSession

      public boolean hasFreeSession()
      Checks for free session.
      Specified by:
      hasFreeSession in interface IStatefulServer
      Returns:
      true, if successful true, if successful
    • getMaxSessions

      public int getMaxSessions()
      Gets the max sessions.
      Specified by:
      getMaxSessions in interface IStatefulServer
      Returns:
      the max sessions the max sessions
    • dump

      public void dump(XMLDumpWriter writer) throws Exception
      Dump the cascaded SC into the xml writer.
      Specified by:
      dump in interface IServer
      Parameters:
      writer - the writer
      Throws:
      Exception - the exception