public class AdminMessageSender extends java.lang.Object implements MessageSender
MessageSender.IRedirectHandler| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ADMIN_INSTANCE_ID_ADDITIONAL_HEADER |
| Constructor and Description |
|---|
AdminMessageSender(java.lang.String instanceKey,
XMLMapping adminMapping,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
java.net.URL... dispatcherAdminUrl) |
AdminMessageSender(java.lang.String instanceKey,
XMLMapping adminMapping,
java.net.URL... dispatcherAdminUrl) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(MessageOriginator ori)
Activate the connection
|
void |
addRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
Adds a
redirection handler to this MessageSender;
This handler is notified of redirection events. |
MessageContext |
asyncSend(MessageEnvelope env,
ClientMessageListener listener)
Sends a
HCI message and receives notification of progress
and upon termination of the message process via a dedicated listener. |
static java.lang.String |
extractSystemIdFromUrl(java.net.URL dispatcherAdminUrl)
Extracts the system identifier from a dispatcher admin URL.
|
AdminMessageSender[] |
getAdminMessageSenderByInstanceType(boolean living,
MessageOriginator mo,
InstanceType... instanceTypes) |
AdminMessageSender |
getAdminMessageSenderOnLivingUpdater(boolean fresh,
MessageOriginator mo) |
java.lang.String |
getInstanceKey() |
java.net.URL |
getServerUrl()
Returns the
URL of the server on which the MessageSender is connected. |
java.util.List<InstanceStatus> |
getStatus(MessageOriginator ori,
InstanceType type,
boolean alive) |
SystemStatus |
getSystemStatus(MessageOriginator ori)
Returns the current system status.
|
void |
removeRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
Removes a
MessageSender.IRedirectHandler from this MessageSender;
The handler is not be notified anymore of redirection events. |
MessageEnvelope |
send(MessageEnvelope message)
Sends a
HCI message and receives its results via the HCI technical interface;
The communications are synchronous. |
MessageEnvelope |
send(MessageEnvelope message,
int timeout)
Sends a
HCI message and 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 void |
updateSystemStatusForKubernetes(SystemStatus systemStatusToUpdate,
java.net.URL dispatcherAdminUrl)
Updates a
system status model to be compatible with Kubernetes if applicable. |
public static final java.lang.String ADMIN_INSTANCE_ID_ADDITIONAL_HEADER
public AdminMessageSender(java.lang.String instanceKey,
XMLMapping adminMapping,
java.net.URL... dispatcherAdminUrl)
public AdminMessageSender(java.lang.String instanceKey,
XMLMapping adminMapping,
javax.net.ssl.SSLSocketFactory sslSocketFactory,
java.net.URL... dispatcherAdminUrl)
public MessageContext asyncSend(MessageEnvelope env, ClientMessageListener listener) throws BadMessageFormatException, CommunicationFailureException
MessageSenderHCI message and receives notification of progress
and upon termination of the message process via a dedicated listener.asyncSend in interface MessageSenderenv - The HCI message to sendlistener - A listener that will be notified of
progress and upon termination of
operations and messagemessage context that can be used to cancel
the message or retrieve resultsBadMessageFormatException - if the message is in
a bad formatCommunicationFailureException - if the SAP CC system
cannot be reachedpublic MessageEnvelope send(MessageEnvelope message) throws CommunicationFailureException, BadMessageFormatException
MessageSenderHCI message and receives its results via the HCI technical interface;
The communications are synchronous.send in interface MessageSendermessage - The message to sendCommunicationFailureException - if the SAP CC system cannot be reachedBadMessageFormatException - if the message received is in a bad formatpublic MessageEnvelope send(MessageEnvelope message, int timeout) throws CommunicationFailureException, BadMessageFormatException
MessageSenderHCI message and 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.send in interface MessageSendermessage - The HCI message to sendtimeout - The timeout in millisecond (ms), a negative number means no timeoutCommunicationFailureException - if the SAP CC system cannot be reached or
if the timeout expiresBadMessageFormatException - if the message received is in a bad formatpublic java.net.URL getServerUrl()
MessageSenderURL of the server on which the MessageSender is connected.getServerUrl in interface MessageSenderURL of the server on which the MessageSender is connectedpublic java.lang.String getInstanceKey()
public AdminMessageSender getAdminMessageSenderOnLivingUpdater(boolean fresh, MessageOriginator mo) throws CommunicationFailureException
CommunicationFailureExceptionpublic AdminMessageSender[] getAdminMessageSenderByInstanceType(boolean living, MessageOriginator mo, InstanceType... instanceTypes) throws CommunicationFailureException
CommunicationFailureExceptionpublic SystemStatus getSystemStatus(MessageOriginator ori) throws OperationFailureException, CommunicationFailureException
MessageSendergetSystemStatus in interface MessageSenderori - a valid message originator.system statusOperationFailureException - if the system status cannot be retrievedCommunicationFailureException - if the server cannot be contactedpublic void activate(MessageOriginator ori) throws CommunicationFailureException, OperationFailureException
ori - a valid message originator.CommunicationFailureExceptionOperationFailureExceptionpublic final java.util.List<InstanceStatus> getStatus(MessageOriginator ori, InstanceType type, boolean alive) throws CommunicationFailureException, OperationFailureException
public final void addRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
MessageSenderredirection handler to this MessageSender;
This handler is notified of redirection events.addRedirectHandler in interface MessageSenderredirectHandler - The redirection event handler to addMessageSender.IRedirectHandlerpublic final void removeRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
MessageSenderMessageSender.IRedirectHandler from this MessageSender;
The handler is not be notified anymore of redirection events.removeRedirectHandler in interface MessageSenderredirectHandler - The redirection event handler to removepublic static void updateSystemStatusForKubernetes(SystemStatus systemStatusToUpdate, java.net.URL dispatcherAdminUrl)
system status model to be compatible with Kubernetes if applicable.systemStatusToUpdate - the system status model to updatedispatcherAdminUrl - the dispatcher admin URLpublic static java.lang.String extractSystemIdFromUrl(java.net.URL dispatcherAdminUrl)
dispatcherAdminUrl - the dispatcher admin URLnull otherwise