Class SCBasePublishServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.serviceconnector.web.SCBaseServlet
org.serviceconnector.web.SCBasePublishServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable, org.serviceconnector.api.srv.ISCPublishServerCallback

public abstract class SCBasePublishServlet extends SCBaseServlet implements org.serviceconnector.api.srv.ISCPublishServerCallback
The Class SCBasePublishServlet. Base servlet for publish service implementations.

User needs to extend this servlet to implement a publish service. This base servlet implements ISCPublishServerCallback which gets called if client actions are processed. Publishing messages to an SC can be done by publish methods. More information available in super class.

The urlPath passed in constructor is used by the SC to call the servlet(URL). So it must match the mapping in web.xml.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.serviceconnector.web.SCBaseServlet

    SCBaseServlet.SCServerCallback
  • Field Summary

    Fields inherited from class org.serviceconnector.web.SCBaseServlet

    compositeRegistry, registered, requester, serviceName

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Instantiates a new sC base publish servlet.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    abortSubscription(org.serviceconnector.api.SCSubscribeMessage scMessage, int operationTimeoutMillis)
     
    protected final org.serviceconnector.scmp.SCMPMessage
    baseAbortSubscription(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis)
    Base abort subscription.
    protected final org.serviceconnector.scmp.SCMPMessage
    baseChangeSubscription(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis)
    Base change subscription.
    protected final org.serviceconnector.scmp.SCMPMessage
    baseSubscribe(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis)
    Base subscribe.
    protected final org.serviceconnector.scmp.SCMPMessage
    baseUnsubscribe(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis)
    Base unsubscribe.
    org.serviceconnector.api.SCMessage
    changeSubscription(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis)
     
    void
    exceptionCaught(org.serviceconnector.api.SCServiceException ex)
     
    final void
    publish(int operationTimeoutSeconds, org.serviceconnector.api.SCPublishMessage publishMessage)
    Publish message to SC.
    final void
    publish(org.serviceconnector.api.SCPublishMessage publishMessage)
    Publish message to SC.
    org.serviceconnector.api.SCMessage
    subscribe(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis)
     
    void
    unsubscribe(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis)
     

    Methods inherited from class org.serviceconnector.web.SCBaseServlet

    checkRegistration, checkRegistration, destroy, doGet, doPost, init

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SCBasePublishServlet

      protected SCBasePublishServlet(String urlPath)
      Instantiates a new sC base publish servlet.
      Parameters:
      urlPath - the URL path
  • Method Details

    • subscribe

      public org.serviceconnector.api.SCMessage subscribe(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis)
      Specified by:
      subscribe in interface org.serviceconnector.api.srv.ISCPublishServerCallback
    • changeSubscription

      public org.serviceconnector.api.SCMessage changeSubscription(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis)
      Specified by:
      changeSubscription in interface org.serviceconnector.api.srv.ISCPublishServerCallback
    • unsubscribe

      public void unsubscribe(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis)
      Specified by:
      unsubscribe in interface org.serviceconnector.api.srv.ISCPublishServerCallback
    • abortSubscription

      public void abortSubscription(org.serviceconnector.api.SCSubscribeMessage scMessage, int operationTimeoutMillis)
      Specified by:
      abortSubscription in interface org.serviceconnector.api.srv.ISCPublishServerCallback
    • exceptionCaught

      public void exceptionCaught(org.serviceconnector.api.SCServiceException ex)
      Specified by:
      exceptionCaught in interface org.serviceconnector.api.srv.ISCPublishServerCallback
    • baseSubscribe

      protected final org.serviceconnector.scmp.SCMPMessage baseSubscribe(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis)
      Base subscribe.
      Parameters:
      reqMessage - the requester message
      operationTimeoutMillis - the operation timeout milliseconds
      Returns:
      the sCMP message
    • baseUnsubscribe

      protected final org.serviceconnector.scmp.SCMPMessage baseUnsubscribe(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis)
      Base unsubscribe.
      Parameters:
      reqMessage - the requester message
      operationTimeoutMillis - the operation timeout milliseconds
      Returns:
      the sCMP message
    • baseAbortSubscription

      protected final org.serviceconnector.scmp.SCMPMessage baseAbortSubscription(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis)
      Base abort subscription.
      Parameters:
      reqMessage - the requester message
      operationTimeoutMillis - the operation timeout milliseconds
      Returns:
      the sCMP message
    • baseChangeSubscription

      protected final org.serviceconnector.scmp.SCMPMessage baseChangeSubscription(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis)
      Base change subscription.
      Parameters:
      reqMessage - the requester message
      operationTimeoutMillis - the operation timeout milliseconds
      Returns:
      the sCMP message
    • publish

      public final void publish(org.serviceconnector.api.SCPublishMessage publishMessage) throws org.serviceconnector.api.SCServiceException, org.serviceconnector.cmd.SCMPValidatorException
      Publish message to SC.
      Parameters:
      publishMessage - the publish message
      Throws:
      org.serviceconnector.api.SCServiceException - server not registered yet
      publish to SC failed
      error message received from SC
      org.serviceconnector.cmd.SCMPValidatorException - publish message is not set
    • publish

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