Package com.highdeal.hci
Class AdminMessageSender
java.lang.Object
com.highdeal.hci.AdminMessageSender
- All Implemented Interfaces:
MessageSender
- Direct Known Subclasses:
com.highdeal.hci.internal.InternalAdminMessageSender
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.highdeal.hci.MessageSender
MessageSender.IRedirectHandler -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAdminMessageSender(String instanceKey, XMLMapping adminMapping, URL... dispatcherAdminUrl) AdminMessageSender(String instanceKey, XMLMapping adminMapping, SSLSocketFactory sslSocketFactory, URL... dispatcherAdminUrl) -
Method Summary
Modifier and TypeMethodDescriptionvoidActivate the connectionfinal voidaddRedirectHandler(MessageSender.IRedirectHandler redirectHandler) Adds aredirection handlerto thisMessageSender; This handler is notified of redirection events.asyncSend(MessageEnvelope env, ClientMessageListener listener) Sends aHCI messageand receives notification of progress and upon termination of the message process via adedicated listener.static StringextractSystemIdFromUrl(URL dispatcherAdminUrl) Extracts the system identifier from a dispatcher admin URL.getAdminMessageSenderByInstanceType(boolean living, MessageOriginator mo, InstanceType... instanceTypes) getAdminMessageSenderOnLivingUpdater(boolean fresh, MessageOriginator mo) Returns theURLof the server on which the MessageSender is connected.final List<InstanceStatus>getStatus(MessageOriginator ori, InstanceType type, boolean alive) Returns the current system status.final voidremoveRedirectHandler(MessageSender.IRedirectHandler redirectHandler) Removes aMessageSender.IRedirectHandlerfrom thisMessageSender; The handler is not be notified anymore of redirection events.send(MessageEnvelope message) Sends aHCI messageand receives its results via the HCI technical interface; The communications are synchronous.send(MessageEnvelope message, int timeout) Sends aHCI messageand receives its results via the HCI technical interface; this method is protected by a timeout, that means that, if the SAP CC system does not answer within the timeout, a communication failure is sent.static voidupdateSystemStatusForKubernetes(SystemStatus systemStatusToUpdate, URL dispatcherAdminUrl) Updates asystem statusmodel to be compatible with Kubernetes if applicable.
-
Field Details
-
ADMIN_INSTANCE_ID_ADDITIONAL_HEADER
- See Also:
-
-
Constructor Details
-
AdminMessageSender
-
AdminMessageSender
public AdminMessageSender(String instanceKey, XMLMapping adminMapping, SSLSocketFactory sslSocketFactory, URL... dispatcherAdminUrl)
-
-
Method Details
-
asyncSend
public MessageContext asyncSend(MessageEnvelope env, ClientMessageListener listener) throws BadMessageFormatException, CommunicationFailureException Description copied from interface:MessageSenderSends aHCI messageand receives notification of progress and upon termination of the message process via adedicated listener.- Specified by:
asyncSendin interfaceMessageSender- Parameters:
env- The HCI message to sendlistener- Alistenerthat will be notified of progress and upon termination of operations and message- Returns:
- A
message contextthat can be used to cancel the message or retrieve results - Throws:
BadMessageFormatException- if the message is in a bad formatCommunicationFailureException- if the SAP CC system cannot be reached
-
send
public MessageEnvelope send(MessageEnvelope message) throws CommunicationFailureException, BadMessageFormatException Description copied from interface:MessageSenderSends aHCI messageand receives its results via the HCI technical interface; The communications are synchronous.- Specified by:
sendin interfaceMessageSender- Parameters:
message- The message to send- Returns:
- The resulting message
- Throws:
CommunicationFailureException- if the SAP CC system cannot be reachedBadMessageFormatException- if the message received is in a bad format
-
send
public MessageEnvelope send(MessageEnvelope message, int timeout) throws CommunicationFailureException, BadMessageFormatException Description copied from interface:MessageSenderSends aHCI messageand receives its results via the HCI technical interface; this method is protected by a timeout, that means that, if the SAP CC system does not answer within the timeout, a communication failure is sent. Option: You can define a client-side timeout.- Specified by:
sendin interfaceMessageSender- Parameters:
message- The HCI message to sendtimeout- The timeout in millisecond (ms), a negative number means no timeout- Returns:
- The resulting message
- Throws:
CommunicationFailureException- if the SAP CC system cannot be reached or if the timeout expiresBadMessageFormatException- if the message received is in a bad format
-
getServerUrl
Description copied from interface:MessageSenderReturns theURLof the server on which the MessageSender is connected.- Specified by:
getServerUrlin interfaceMessageSender- Returns:
- the
URLof the server on which the MessageSender is connected
-
getInstanceKey
-
getAdminMessageSenderOnLivingUpdater
public AdminMessageSender getAdminMessageSenderOnLivingUpdater(boolean fresh, MessageOriginator mo) throws CommunicationFailureException - Throws:
CommunicationFailureException
-
getAdminMessageSenderByInstanceType
public AdminMessageSender[] getAdminMessageSenderByInstanceType(boolean living, MessageOriginator mo, InstanceType... instanceTypes) throws CommunicationFailureException - Throws:
CommunicationFailureException
-
getSystemStatus
public SystemStatus getSystemStatus(MessageOriginator ori) throws OperationFailureException, CommunicationFailureException Description copied from interface:MessageSenderReturns the current system status.- Specified by:
getSystemStatusin interfaceMessageSender- Parameters:
ori- a validmessage originator.- Returns:
- the current
system status - Throws:
OperationFailureException- if the system status cannot be retrievedCommunicationFailureException- if the server cannot be contacted
-
activate
public void activate(MessageOriginator ori) throws CommunicationFailureException, OperationFailureException Activate the connection- Parameters:
ori- a valid message originator.- Throws:
CommunicationFailureExceptionOperationFailureException
-
getStatus
public final List<InstanceStatus> getStatus(MessageOriginator ori, InstanceType type, boolean alive) throws CommunicationFailureException, OperationFailureException -
addRedirectHandler
Description copied from interface:MessageSenderAdds aredirection handlerto thisMessageSender; This handler is notified of redirection events.- Specified by:
addRedirectHandlerin interfaceMessageSender- Parameters:
redirectHandler- The redirection event handler to add- See Also:
-
removeRedirectHandler
Description copied from interface:MessageSenderRemoves aMessageSender.IRedirectHandlerfrom thisMessageSender; The handler is not be notified anymore of redirection events.- Specified by:
removeRedirectHandlerin interfaceMessageSender- Parameters:
redirectHandler- The redirection event handler to remove
-
updateSystemStatusForKubernetes
public static void updateSystemStatusForKubernetes(SystemStatus systemStatusToUpdate, URL dispatcherAdminUrl) Updates asystem statusmodel to be compatible with Kubernetes if applicable.- Parameters:
systemStatusToUpdate- thesystem statusmodel to updatedispatcherAdminUrl- the dispatcher admin URL
-
extractSystemIdFromUrl
Extracts the system identifier from a dispatcher admin URL.- Parameters:
dispatcherAdminUrl- the dispatcher admin URL- Returns:
- the system identifier extracted from the dispatcher admin URL if the system is deployed in Kubernetes,
nullotherwise
-