Package com.highdeal.admin.hci
Class InstanceInfoImpl
java.lang.Object
com.highdeal.admin.hci.InstanceInfoImpl
- All Implemented Interfaces:
InstanceInfo,XMLMarshallable,Comparable<InstanceInfo>
This class represents an instance information that includes the communication settings of a server instance of the connected SAP CC Core Server system;
It contains the configuration of the different technical interfaces that are enabled.
- Instance ID (as specified by
InstanceId) - Hostname of the machine that hosts the instance of the SAP CC system
- HCI Address (Address of the HTTP Communication Interface technical interface:
com.highdeal.hci) - HCI Port
- HCI Secure
- WS Address (Address of the Web Services technical interface)
- WS Port
- WS Secure
- Public external Address
- Public external Port
- Public external Secure
- Private internal Address
- Private internal Port
- Private internal Secure
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="instanceInfo">
<xs:complexType>
<xs:attribute name="instanceId" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="((dispatcher|updater|rater|guider|bulkLoader|taxer)#\d)"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="hostname" type="xs:string" use="required"/>
<xs:attribute name="hciAddr" type="xs:string" />
<xs:attribute name="hciPort" type="xs:integer" />
<xs:attribute name="hciSecure" type="xs:integer" />
<xs:attribute name="wsAddr" type="xs:string" />
<xs:attribute name="wsPort" type="xs:integer" />
<xs:attribute name="wsSecure" type="xs:integer" />
<xs:attribute name="externalAddr" type="xs:string" />
<xs:attribute name="externalPort" type="xs:integer" />
<xs:attribute name="externalSecure" type="xs:integer" />
<xs:attribute name="internalAddr" type="xs:string" />
<xs:attribute name="internalPort" type="xs:integer" />
<xs:attribute name="internalSecure" type="xs:integer" />
</xs:complexType>
</xs:element>
-
Field Summary
Fields inherited from interface com.highdeal.admin.hci.InstanceInfo
TAG_NAME -
Constructor Summary
ConstructorsConstructorDescriptionBuilds an emptyInstanceInfoinstance.InstanceInfoImpl(InstanceId instanceId, String hostname) Initializes a newInstanceInfoinstance with its parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.intcompareTo(InstanceInfo other) Compares two instance info object according to their instance ID; It returns-1if the instance is smaller than o2,0if they are equals,1otherwise.Copies this InstanceInfo into a new instance of InstanceInfo.getAddress(ServiceInfo.ServiceInfoType serviceInfoType) Gets the address defined for the service.getCSV()getFullHost(ServiceInfo.ServiceInfoType serviceInfoType) Gets the host name defined for the service with the multi-homing information.getHost(ServiceInfo.ServiceInfoType serviceInfoType) Gets the host name defined for the service.Gets the instance host name.Deprecated.intDeprecated.Deprecated.Returns the value of the instance ID.static InstanceInfoImplgetInstanceName(boolean full) Returns the name (string representation of theInstanceId) or the full name ([<HTTP_HOST_NAME>]<INSTANCE_ID>) of the instance of the SAP CC systemstatic final StringgetLocalInstanceNameFromInstanceId(InstanceId instanceId, String ipAddress, boolean fullname) Returns the name of the instance specified with its instance ID and running on the localhost.intgetPort(ServiceInfo.ServiceInfoType serviceInfoType) Gets the port defined for the service.getSecurity(ServiceInfo.ServiceInfoType serviceInfoType) Gets the security defined for the service.getSecurityAsString(ServiceInfo.ServiceInfoType serviceInfoType) Returns the service information value, containing host value and port number.getURL(ServiceInfo.ServiceInfoType serviceType) Returns the URL for the service.booleanhasSame(InstanceId instanceId) booleanhasSame(InstanceType instanceType) booleanDeprecated.booleanDeprecated.booleanisMultipleBinding(ServiceInfo.ServiceInfoType serviceInfoType) Returnstrueif the service is bound to all available addresses.booleanisServiceAvailable(ServiceInfo.ServiceInfoType serviceType) Returnstrueif the service is available.booleanisServiceEnabled(ServiceInfo.ServiceInfoType serviceType) Returnstrueif the service is available and enabled.voidisValid()Throws an InvalidInstanceInfoException if the instance info is malformed or invalid.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidputServiceInfo(ServiceInfo serviceInfo) putServiceInfo(ServiceInfo.ServiceInfoType serviceInfoType, String host, int port, ServiceInfo.ServiceInfoSecurity security) voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetFullHost(ServiceInfo.ServiceInfoType serviceInfoType, String fullHost) Sets the host name defined for the service with the multi-homing information.voidsetHost(ServiceInfo.ServiceInfoType serviceInfoType, String host) Sets the host name defined for the service.voidsetHostname(String hostname) voidsetHTTPSecurityEnable(boolean flag) Deprecated.voidsetInstanceId(InstanceId instanceId) voidsetInstanceName(String instanceName) voidsetPort(ServiceInfo.ServiceInfoType serviceInfoType, int port) Sets the port defined for the service.voidsetSecurity(ServiceInfo.ServiceInfoType serviceInfoType, ServiceInfo.ServiceInfoSecurity security) Sets the security policy defined for the service.toString()Returns a printable form of the instance map.
-
Constructor Details
-
InstanceInfoImpl
public InstanceInfoImpl()Builds an emptyInstanceInfoinstance. -
InstanceInfoImpl
Initializes a newInstanceInfoinstance with its parameters.- Parameters:
instanceId- The instance IDhostname- The instance host name
-
-
Method Details
-
duplicate
Description copied from interface:InstanceInfoCopies this InstanceInfo into a new instance of InstanceInfo.- Specified by:
duplicatein interfaceInstanceInfo- Returns:
- A new instance of InstanceInfo that is an exact copy of this instance
-
putServiceInfo
public ServiceInfo putServiceInfo(ServiceInfo.ServiceInfoType serviceInfoType, String host, int port, ServiceInfo.ServiceInfoSecurity security) -
putServiceInfo
-
getServiceInfo
Description copied from interface:InstanceInfoReturns the service information value, containing host value and port number.- Specified by:
getServiceInfoin interfaceInstanceInfo- Parameters:
type- The service type, which is one amongservice info list- Returns:
- The service information
-
removeServiceInfo
-
hasSame
-
hasSame
-
isServiceEnabled
Description copied from interface:InstanceInfoReturnstrueif the service is available and enabled.- Specified by:
isServiceEnabledin interfaceInstanceInfo- Parameters:
serviceType- The service value amongservice info list- Returns:
trueif the service is enabled,falseotherwise
-
isServiceAvailable
Description copied from interface:InstanceInfoReturnstrueif the service is available.- Specified by:
isServiceAvailablein interfaceInstanceInfo- Parameters:
serviceType- A service value amongservice info list- Returns:
trueif the service is available,falseotherwise
-
getHttpHost
Deprecated. -
getHttpPort
Deprecated. -
compareTo
Compares two instance info object according to their instance ID; It returns-1if the instance is smaller than o2,0if they are equals,1otherwise.- Specified by:
compareToin interfaceComparable<InstanceInfo>
-
getInstanceId
Description copied from interface:InstanceInfoReturns the value of the instance ID.- Specified by:
getInstanceIdin interfaceInstanceInfo- Returns:
- The
InstanceIdinstance ID) of the instance in the SAP CC system
-
getAddress
Description copied from interface:InstanceInfoGets the address defined for the service.- Specified by:
getAddressin interfaceInstanceInfo- Parameters:
serviceInfoType- value amongservice info list- Returns:
- The address host name
-
getFullHost
Description copied from interface:InstanceInfoGets the host name defined for the service with the multi-homing information.- Specified by:
getFullHostin interfaceInstanceInfo- Parameters:
serviceInfoType- A value amongservice info list- Returns:
- The service host name
-
getHost
Description copied from interface:InstanceInfoGets the host name defined for the service.- Specified by:
getHostin interfaceInstanceInfo- Parameters:
serviceInfoType- A value amongservice info list- Returns:
- The service host name
-
getPort
Description copied from interface:InstanceInfoGets the port defined for the service.- Specified by:
getPortin interfaceInstanceInfo- Parameters:
serviceInfoType- A value amongservice info list- Returns:
- The service port
-
getSecurity
Description copied from interface:InstanceInfoGets the security defined for the service.- Specified by:
getSecurityin interfaceInstanceInfo- Parameters:
serviceInfoType- A value amongservice info list- Returns:
- The
security
-
setFullHost
Description copied from interface:InstanceInfoSets the host name defined for the service with the multi-homing information.- Specified by:
setFullHostin interfaceInstanceInfo- Parameters:
serviceInfoType- A value amongservice info listfullHost- The new service host name
-
setHost
Description copied from interface:InstanceInfoSets the host name defined for the service.- Specified by:
setHostin interfaceInstanceInfo- Parameters:
serviceInfoType- A value amongservice info listhost- The new service host name
-
setPort
Description copied from interface:InstanceInfoSets the port defined for the service.- Specified by:
setPortin interfaceInstanceInfo- Parameters:
serviceInfoType- A value amongservice info listport- The new service port
-
setSecurity
public void setSecurity(ServiceInfo.ServiceInfoType serviceInfoType, ServiceInfo.ServiceInfoSecurity security) Description copied from interface:InstanceInfoSets the security policy defined for the service.- Specified by:
setSecurityin interfaceInstanceInfo- Parameters:
serviceInfoType- A value amongservice info listsecurity- The newsecurity
-
isHTTPSecurityEnabled
Deprecated.Description copied from interface:InstanceInfoReturnstrueif the HTTP service security is enabled.- Specified by:
isHTTPSecurityEnabledin interfaceInstanceInfo- Returns:
trueindicates that HTTP service is secured; this is the default
-
setHTTPSecurityEnable
Deprecated.Description copied from interface:InstanceInfoControls whether HTTP service secured or not.- Specified by:
setHTTPSecurityEnablein interfaceInstanceInfo- Parameters:
flag-trueif the HTTP service security is enabled
-
getHTTPURL
Deprecated.Description copied from interface:InstanceInfoReturns the HTTP URL.- Specified by:
getHTTPURLin interfaceInstanceInfo- Returns:
- The HTTP URL
-
getURL
Description copied from interface:InstanceInfoReturns the URL for the service.- Specified by:
getURLin interfaceInstanceInfo- Parameters:
serviceType- A service value amongservice info list- Returns:
- The URL of the service
-
getInstanceName
Description copied from interface:InstanceInfoReturns the name (string representation of theInstanceId) or the full name ([<HTTP_HOST_NAME>]<INSTANCE_ID>) of the instance of the SAP CC system- The full name has the following grammar: [<HTTP_HOST_NAME>]<INSTANCE_ID>
- The name is the string representation of the
InstanceId
- Specified by:
getInstanceNamein interfaceInstanceInfo- Parameters:
full-trueto return the full name,falseto return the string representation of the instance identifier- Returns:
- The (full) name of this instance
-
getHostname
Description copied from interface:InstanceInfoGets the instance host name.- Specified by:
getHostnamein interfaceInstanceInfo- Returns:
- The instance host name
-
setInstanceId
-
setHostname
-
setInstanceName
-
isHttpMultipleBinding
Deprecated.Description copied from interface:InstanceInfoReturns true if the HTTP server is bound to all available addresses.- Specified by:
isHttpMultipleBindingin interfaceInstanceInfo- Returns:
trueif the HTTP server is bound to all available addresses,falseotherwise
-
isMultipleBinding
Description copied from interface:InstanceInfoReturnstrueif the service is bound to all available addresses.- Specified by:
isMultipleBindingin interfaceInstanceInfo- Parameters:
serviceInfoType- A serviceType service value amongservice info list- Returns:
trueif the service is bound to all available addresses,falseotherwise
-
isValid
Description copied from interface:InstanceInfoThrows an InvalidInstanceInfoException if the instance info is malformed or invalid.- Specified by:
isValidin interfaceInstanceInfo- Throws:
InvalidInstanceException- If theinstance mapis not valid
-
getSecurityAsString
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- TheXML attributesof the current element
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-
toString
Returns a printable form of the instance map.- Overrides:
toStringin classObject- Returns:
- The printable
instance map
-
getCSV
-
getInstanceInfoFromCSV
-
getLocalInstanceNameFromInstanceId
public static final String getLocalInstanceNameFromInstanceId(InstanceId instanceId, String ipAddress, boolean fullname) Returns the name of the instance specified with its instance ID and running on the localhost.- Parameters:
instanceId- The identifier of the instance to be namedipAddress- The IP address of the instancefullname-trueif the full name is expected,falseif only the name is expected.- Returns:
- The name of the instance
-