com.highdeal.hci
Class AdminMessageSender

java.lang.Object
  extended by com.highdeal.hci.AdminMessageSender
All Implemented Interfaces:
MessageSender
Direct Known Subclasses:
UpdaterMessageSender

public class AdminMessageSender
extends java.lang.Object
implements MessageSender


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.highdeal.hci.MessageSender
MessageSender.IRedirectHandler
 
Field Summary
static java.lang.String ADMIN_INSTANCE_ID_ADDITIONAL_HEADER
           
 
Constructor Summary
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)
           
 
Method Summary
 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.
 AdminMessageSender[] getAdminMessageSenderByInstanceType(boolean living, MessageOriginator mo, InstanceType... instanceTypes)
           
 AdminMessageSender getAdminMessageSenderOnLivingUpdater(boolean fresh, MessageOriginator mo)
           
protected  InstanceType getDestinationInstanceType()
           
 java.lang.String getInstanceKey()
           
protected  java.lang.String getPath()
           
protected  java.util.List<MessageSender.IRedirectHandler> getRedirectHandlers()
           
protected  HttpMessageSender getSender(MessageOriginator ori)
           
 java.net.URL getServerUrl()
           
protected  javax.net.ssl.SSLSocketFactory getSSLSocketFactory()
           
 java.util.List<InstanceStatus> getStatus(MessageOriginator ori, InstanceType type, boolean alive)
           
 SystemStatus getSystemStatus(MessageOriginator ori)
          Returns the current system status.
protected  java.net.URL getURL(MessageOriginator ori)
           
protected  XMLMapping getXMLMapping()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADMIN_INSTANCE_ID_ADDITIONAL_HEADER

public static final java.lang.String ADMIN_INSTANCE_ID_ADDITIONAL_HEADER
See Also:
Constant Field Values
Constructor Detail

AdminMessageSender

public AdminMessageSender(java.lang.String instanceKey,
                          XMLMapping adminMapping,
                          java.net.URL... dispatcherAdminUrl)

AdminMessageSender

public AdminMessageSender(java.lang.String instanceKey,
                          XMLMapping adminMapping,
                          javax.net.ssl.SSLSocketFactory sslSocketFactory,
                          java.net.URL... dispatcherAdminUrl)
Method Detail

asyncSend

public MessageContext asyncSend(MessageEnvelope env,
                                ClientMessageListener listener)
                         throws BadMessageFormatException,
                                CommunicationFailureException
Description copied from interface: MessageSender
Sends a HCI message and receives notification of progress and upon termination of the message process via a dedicated listener.

Specified by:
asyncSend in interface MessageSender
Parameters:
env - The HCI message to send
listener - A listener that will be notified of progress and upon termination of operations and message
Returns:
A message context that can be used to cancel the message or retrieve results
Throws:
BadMessageFormatException - if the message is in a bad format
CommunicationFailureException - if the SAP CC system cannot be reached

send

public MessageEnvelope send(MessageEnvelope message)
                     throws CommunicationFailureException,
                            BadMessageFormatException
Description copied from interface: MessageSender
Sends a HCI message and receives its results via the HCI technical interface; The communications are synchronous.

Specified by:
send in interface MessageSender
Parameters:
message - The message to send
Returns:
The resulting message
Throws:
CommunicationFailureException - if the SAP CC system cannot be reached
BadMessageFormatException - if the message received is in a bad format

send

public MessageEnvelope send(MessageEnvelope message,
                            int timeout)
                     throws CommunicationFailureException,
                            BadMessageFormatException
Description copied from interface: MessageSender
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. Option: You can define a client-side timeout.

Specified by:
send in interface MessageSender
Parameters:
message - The HCI message to send
timeout - 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 expires
BadMessageFormatException - if the message received is in a bad format

getServerUrl

public java.net.URL getServerUrl()

getInstanceKey

public java.lang.String 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
Returns the current system status.

Parameters:
ori - a valid message originator.
Returns:
the current system status
Throws:
OperationFailureException - if the system status cannot be retrieved
CommunicationFailureException - 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:
CommunicationFailureException
OperationFailureException

getSender

protected final HttpMessageSender getSender(MessageOriginator ori)
                                     throws CommunicationFailureException,
                                            OperationFailureException
Throws:
CommunicationFailureException
OperationFailureException

getURL

protected final java.net.URL getURL(MessageOriginator ori)
                             throws CommunicationFailureException,
                                    OperationFailureException
Throws:
CommunicationFailureException
OperationFailureException

getStatus

public final java.util.List<InstanceStatus> getStatus(MessageOriginator ori,
                                                      InstanceType type,
                                                      boolean alive)
                                               throws CommunicationFailureException,
                                                      OperationFailureException
Throws:
CommunicationFailureException
OperationFailureException

getXMLMapping

protected XMLMapping getXMLMapping()

getSSLSocketFactory

protected javax.net.ssl.SSLSocketFactory getSSLSocketFactory()

getDestinationInstanceType

protected InstanceType getDestinationInstanceType()

getPath

protected java.lang.String getPath()

addRedirectHandler

public final void addRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
Description copied from interface: MessageSender
Adds a redirection handler to this MessageSender; This handler is notified of redirection events.

Specified by:
addRedirectHandler in interface MessageSender
Parameters:
redirectHandler - The redirection event handler to add
See Also:
MessageSender.IRedirectHandler

removeRedirectHandler

public final void removeRedirectHandler(MessageSender.IRedirectHandler redirectHandler)
Description copied from interface: MessageSender
Removes a MessageSender.IRedirectHandler from this MessageSender; The handler is not be notified anymore of redirection events.

Specified by:
removeRedirectHandler in interface MessageSender
Parameters:
redirectHandler - The redirection event handler to remove

getRedirectHandlers

protected final java.util.List<MessageSender.IRedirectHandler> getRedirectHandlers()

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)