Package org.serviceconnector.web
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.
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, serviceNameFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSCBasePublishServlet(String urlPath) Instantiates a new sC base publish servlet. -
Method Summary
Modifier and TypeMethodDescriptionvoidabortSubscription(org.serviceconnector.api.SCSubscribeMessage scMessage, int operationTimeoutMillis) protected final org.serviceconnector.scmp.SCMPMessagebaseAbortSubscription(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis) Base abort subscription.protected final org.serviceconnector.scmp.SCMPMessagebaseChangeSubscription(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis) Base change subscription.protected final org.serviceconnector.scmp.SCMPMessagebaseSubscribe(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis) Base subscribe.protected final org.serviceconnector.scmp.SCMPMessagebaseUnsubscribe(org.serviceconnector.scmp.SCMPMessage reqMessage, int operationTimeoutMillis) Base unsubscribe.org.serviceconnector.api.SCMessagechangeSubscription(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis) voidexceptionCaught(org.serviceconnector.api.SCServiceException ex) final voidpublish(int operationTimeoutSeconds, org.serviceconnector.api.SCPublishMessage publishMessage) Publish message to SC.final voidpublish(org.serviceconnector.api.SCPublishMessage publishMessage) Publish message to SC.org.serviceconnector.api.SCMessagesubscribe(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis) voidunsubscribe(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis) Methods inherited from class org.serviceconnector.web.SCBaseServlet
checkRegistration, checkRegistration, destroy, doGet, doPost, initMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
SCBasePublishServlet
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:
subscribein interfaceorg.serviceconnector.api.srv.ISCPublishServerCallback
-
changeSubscription
public org.serviceconnector.api.SCMessage changeSubscription(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis) - Specified by:
changeSubscriptionin interfaceorg.serviceconnector.api.srv.ISCPublishServerCallback
-
unsubscribe
public void unsubscribe(org.serviceconnector.api.SCSubscribeMessage message, int operationTimeoutMillis) - Specified by:
unsubscribein interfaceorg.serviceconnector.api.srv.ISCPublishServerCallback
-
abortSubscription
public void abortSubscription(org.serviceconnector.api.SCSubscribeMessage scMessage, int operationTimeoutMillis) - Specified by:
abortSubscriptionin interfaceorg.serviceconnector.api.srv.ISCPublishServerCallback
-
exceptionCaught
public void exceptionCaught(org.serviceconnector.api.SCServiceException ex) - Specified by:
exceptionCaughtin interfaceorg.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 messageoperationTimeoutMillis- 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 messageoperationTimeoutMillis- 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 messageoperationTimeoutMillis- 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 messageoperationTimeoutMillis- 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 SCorg.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 operationpublishMessage- the publish message- Throws:
org.serviceconnector.api.SCServiceException- server not registered yet
publish to SC failed
error message received from SCorg.serviceconnector.cmd.SCMPValidatorException- publish message is not set
-