Class SCPublishServer

java.lang.Object
org.serviceconnector.api.srv.SCSessionServer
org.serviceconnector.api.srv.SCPublishServer

public class SCPublishServer extends SCSessionServer
The Class SCPublishServer. A Server that publishes messages to a SC.
  • Constructor Details

    • SCPublishServer

      public SCPublishServer(SCServer scServer, String serviceName, SCRequester requester)
      Instantiates a new SC publish server.
      Parameters:
      scServer - the SC server
      serviceName - the service name
      requester - the requester
  • Method Details

    • register

      public void register(int maxSessions, int maxConnections, SCPublishServerCallback scCallback) throws SCServiceException, SCMPValidatorException
      Register server on SC with default operation timeout.
      Parameters:
      maxSessions - the max sessions to serve
      maxConnections - the max connections pool uses to connect to SC
      scCallback - the SC callback
      Throws:
      SCServiceException - listener not started yet
      server already registered for service
      register server on SC failed
      error message received from SC
      SCMPValidatorException - callback is not set
    • register

      public void register(int operationTimeoutSeconds, int maxSessions, int maxConnections, SCPublishServerCallback scCallback) throws SCServiceException, SCMPValidatorException
      Register server on SC.
      Parameters:
      operationTimeoutSeconds - the allowed time in seconds to complete the operation
      maxSessions - the max sessions to serve
      maxConnections - the max connections pool uses to connect to SC
      scCallback - the SC callback
      Throws:
      SCServiceException - listener not started yet
      server already registered for service
      register server on SC failed
      error message received from SC
      SCMPValidatorException - callback is not set
    • publish

      public void publish(SCPublishMessage publishMessage) throws SCServiceException, SCMPValidatorException
      Publish message to SC with default operation timeout.
      Parameters:
      publishMessage - the publish message
      Throws:
      SCServiceException - server not registered yet
      publish to SC failed
      error message received from SC
      SCMPValidatorException - publish message is not set
    • publish

      public void publish(int operationTimeoutSeconds, SCPublishMessage publishMessage) throws SCServiceException, SCMPValidatorException
      Publish message to SC.
      Parameters:
      operationTimeoutSeconds - the allowed time in seconds to complete the operation
      publishMessage - the publish message
      Throws:
      SCServiceException - server not registered yet
      publish to SC failed
      error message received from SC
      SCMPValidatorException - publish message is not set