public class HttpMessageSenderFactory extends MessageSenderFactory
Java class defines a factory API that enables your client applications (using the
HCI technical interface) to create a generic HTTP message sender necessary for HCI communications; You can
also develop a message sender
dedicated to administration and connected to a dispatcher instance of the SAP CC system
or develop a message sender
dedicated to the communications with the updater instance of the SAP CC system.| Modifier and Type | Field and Description |
|---|---|
static XMLMapping |
DEFAULT_ADMIN_XML_MAPPING
Returns a default
XML mapping for the administration purpose; It includes both the AdminXMLMapping and the HCIMapping. |
static java.lang.String |
HCI_HTTP_URL
The property name needed to be initialized with properties describing the HTTP URL to be connected to:
"hci.http.url" |
| Constructor and Description |
|---|
HttpMessageSenderFactory() |
| Modifier and Type | Method and Description |
|---|---|
MessageSender |
createAdminMessageSender()
Creates a new
AdminMessageSender for communications via HCI to the administration services of a dispatcher instance. |
MessageSender |
createAdminMessageSender(java.lang.String instanceKey)
Creates a new
AdminMessageSender for communications via HCI and
connected to the administration services of the distant SAP CC system. |
MessageSender |
createMessageSender()
Creates a new
UpdaterMessageSender for communications via HCI. |
MessageSender |
createSimpleMessageSender()
Creates a new
HttpMessageSender for communications via HCI. |
java.lang.String |
getHttpUrl()
Returns the HTTP URL the new
message senders will be connected to. |
javax.net.ssl.SSLSocketFactory |
getSSLSocketFactory()
Gets the
SSLSocketFactory used to create socket for HTTPS connections.If not set, the default factory is used. |
void |
init(java.util.Properties props)
Initializes an
HttpMessageSenderFactory with properties. |
void |
init(java.net.URL... dipatcherUrls)
Initializes an
HttpMessageSenderFactory from the list of URLs of the dispatcher instance(s) of the distant SAP CC system. |
void |
setHttpUrl(java.lang.String host,
int port)
Sets the main HTTP URL of the distant SAP CC system to which the new
message senders will be connected to;
The resulting URL includes the "/admin" path. |
void |
setHttpUrl(java.lang.String host,
int port,
boolean securityEnabled)
Sets the main HTTP URL to which the new
message senders will be connected to;
The resulting URL includes the "/admin" path. |
void |
setSSLSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)
Sets the
SSLSocketFactory used to create socket for HTTPS connections.If not set, the default factory is used. |
newInstance, setXMLMappingpublic static final java.lang.String HCI_HTTP_URL
"hci.http.url"public static final XMLMapping DEFAULT_ADMIN_XML_MAPPING
XML mapping for the administration purpose; It includes both the AdminXMLMapping and the HCIMapping.public void init(java.util.Properties props)
throws BadConfigurationException
HttpMessageSenderFactory with properties.
It expects the property named HCI_HTTP_URL describing the HTTP URL to which
the new message senders will be connected to.
The value of this property must have the
format: "http://hostname:port" where hostname is the host address of the distant SAP CC system and port,
its listening communication port for HTTP protocol dedicated to HCI.
init in class MessageSenderFactoryprops - The properties containing a property HCI_HTTP_URLBadConfigurationException - When props is null or when the property HCI_HTTP_URL does not existpublic void init(java.net.URL... dipatcherUrls)
throws BadConfigurationException
HttpMessageSenderFactory from the list of URLs of the dispatcher instance(s) of the distant SAP CC system.init in class MessageSenderFactorydipatcherUrls - The list of URLs of the dispatcher (with /admin path) used to initialize this factoryBadConfigurationException - If parameters are not correct or emptypublic javax.net.ssl.SSLSocketFactory getSSLSocketFactory()
SSLSocketFactory used to create socket for HTTPS connections.default factory is used.SSLSocketFactory used for HTTPS connectionspublic void setSSLSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)
SSLSocketFactory used to create socket for HTTPS connections.default factory is used.sslSocketFactory - The SSLSocketFactory to use for HTTPS connectionspublic java.lang.String getHttpUrl()
message senders will be connected to.null otherwisesetHttpUrl(String, int),
init(Properties)public void setHttpUrl(java.lang.String host,
int port)
throws java.lang.IllegalArgumentException
message senders will be connected to;
The resulting URL includes the "/admin" path.
null then it uses the wildcard address
host - The name of the HTTP server hostport - The communication port of the machine hosting the server instancejava.lang.IllegalArgumentException - If port is out of rangepublic void setHttpUrl(java.lang.String host,
int port,
boolean securityEnabled)
throws java.lang.IllegalArgumentException
message senders will be connected to;
The resulting URL includes the "/admin" path.
If host is null then it uses the wildcard address. A valid value of port is a number in [1-65535].
host - The hostname of a dispatcher instance of the distant SAP CC systemport - The distant port dedicated to HCI communicationssecurityEnabled - Specifies to use HTTPS for secured communicationsjava.lang.IllegalArgumentException - If port is out of rangepublic MessageSender createAdminMessageSender(java.lang.String instanceKey)
AdminMessageSender for communications via HCI and
connected to the administration services of the distant SAP CC system.
The URL of the MessageSender is "http://dispatcher_hostname:port/admin/instanceKey"
createAdminMessageSender in class MessageSenderFactoryinstanceKey - The instance identifier in the distant SAP CC system which must finally receive the administration message forwarded by a dispatcher instance of the SAP CC systemmessage sendersetHttpUrl(String, int),
init(Properties)public MessageSender createAdminMessageSender()
AdminMessageSender for communications via HCI to the administration services of a dispatcher instance.
The URL of the MessageSender is "http://dispatcher_hostname:port/admin"
createAdminMessageSender in class MessageSenderFactorymessage sendersetHttpUrl(String, int),
init(Properties)public MessageSender createMessageSender()
UpdaterMessageSender for communications via HCI.
The new message sender is connected to the initialization HTTP URL.
createMessageSender in class MessageSenderFactorymessage sendersetHttpUrl(String, int),
init(Properties)public MessageSender createSimpleMessageSender()
HttpMessageSender for communications via HCI.
The new message sender is connected to the initialization HTTP URL.
createSimpleMessageSender in class MessageSenderFactorysetHttpUrl(String, int),
init(Properties)