public class InstanceInfoImpl extends Object implements InstanceInfo
InstanceId)
com.highdeal.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>
TAG_NAME| Constructor and Description |
|---|
InstanceInfoImpl()
Builds an empty
InstanceInfo instance. |
InstanceInfoImpl(InstanceId instanceId,
String hostname)
Initializes a new
InstanceInfo instance with its parameters. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
int |
compareTo(InstanceInfo other)
Compares two instance info object according to their instance ID;
It returns
-1 if the instance is smaller than o2, 0 if they are equals, 1 otherwise. |
InstanceInfo |
duplicate()
Copies this InstanceInfo into a new instance of InstanceInfo.
|
ServiceInfo.Address |
getAddress(ServiceInfo.ServiceInfoType serviceInfoType)
Gets the address defined for the service.
|
String |
getFullHost(ServiceInfo.ServiceInfoType serviceInfoType)
Gets the host name defined for the service with the multi-homing information.
|
String |
getHost(ServiceInfo.ServiceInfoType serviceInfoType)
Gets the host name defined for the service.
|
String |
getHostname()
Gets the instance host name.
|
String |
getHttpHost()
Deprecated.
|
int |
getHttpPort()
Deprecated.
|
String |
getHTTPURL()
Deprecated.
|
InstanceId |
getInstanceId()
Returns the value of the instance ID.
|
String |
getInstanceName(boolean full)
Returns the name (string representation of the
InstanceId) or the full name ([<HTTP_HOST_NAME>]<INSTANCE_ID>) of the instance of the SAP CC system |
static String |
getLocalInstanceNameFromInstanceId(InstanceId instanceId,
String ipAddress,
boolean fullname)
Returns the name of the instance specified with its instance ID and running on the localhost.
|
int |
getPort(ServiceInfo.ServiceInfoType serviceInfoType)
Gets the port defined for the service.
|
ServiceInfo.ServiceInfoSecurity |
getSecurity(ServiceInfo.ServiceInfoType serviceInfoType)
Gets the security defined for the service.
|
String |
getSecurityAsString(ServiceInfo.ServiceInfoType serviceInfoType) |
ServiceInfo |
getServiceInfo(ServiceInfo.ServiceInfoType type)
Returns the service information value, containing host value and port number.
|
String |
getURL(ServiceInfo.ServiceInfoType serviceType)
Returns the URL for the service.
|
boolean |
hasSame(InstanceId instanceId) |
boolean |
hasSame(InstanceType instanceType) |
boolean |
isHttpMultipleBinding()
Deprecated.
|
boolean |
isHTTPSecurityEnabled()
Deprecated.
|
boolean |
isMultipleBinding(ServiceInfo.ServiceInfoType serviceInfoType)
Returns
true if the service is bound to all available addresses. |
boolean |
isServiceAvailable(ServiceInfo.ServiceInfoType serviceType)
Returns
true if the service is available. |
boolean |
isServiceEnabled(ServiceInfo.ServiceInfoType serviceType)
Returns
true if the service is available and enabled. |
void |
isValid()
Throws an InvalidInstanceInfoException if the instance info is malformed or invalid.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
ServiceInfo |
putServiceInfo(ServiceInfo.ServiceInfoType serviceInfoType,
String host,
int port,
ServiceInfo.ServiceInfoSecurity security) |
void |
putServiceInfo(ServiceInfo serviceInfo) |
ServiceInfo |
removeServiceInfo(ServiceInfo.ServiceInfoType type) |
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setFullHost(ServiceInfo.ServiceInfoType serviceInfoType,
String fullHost)
Sets the host name defined for the service with the multi-homing information.
|
void |
setHost(ServiceInfo.ServiceInfoType serviceInfoType,
String host)
Sets the host name defined for the service.
|
void |
setHostname(String hostname) |
void |
setHTTPSecurityEnable(boolean flag)
Deprecated.
|
void |
setInstanceId(InstanceId instanceId) |
void |
setInstanceName(String instanceName) |
void |
setPort(ServiceInfo.ServiceInfoType serviceInfoType,
int port)
Sets the port defined for the service.
|
void |
setSecurity(ServiceInfo.ServiceInfoType serviceInfoType,
ServiceInfo.ServiceInfoSecurity security)
Sets the security policy defined for the service.
|
String |
toString()
Returns a printable form of the instance map.
|
public InstanceInfoImpl()
InstanceInfo instance.public InstanceInfoImpl(InstanceId instanceId, String hostname)
InstanceInfo instance with its parameters.instanceId - The instance IDhostname - The instance host namepublic InstanceInfo duplicate()
InstanceInfoduplicate in interface InstanceInfopublic ServiceInfo putServiceInfo(ServiceInfo.ServiceInfoType serviceInfoType, String host, int port, ServiceInfo.ServiceInfoSecurity security)
public void putServiceInfo(ServiceInfo serviceInfo)
public ServiceInfo getServiceInfo(ServiceInfo.ServiceInfoType type)
InstanceInfogetServiceInfo in interface InstanceInfotype - The service type, which is one among service info listpublic ServiceInfo removeServiceInfo(ServiceInfo.ServiceInfoType type)
public boolean hasSame(InstanceType instanceType)
public boolean hasSame(InstanceId instanceId)
public boolean isServiceEnabled(ServiceInfo.ServiceInfoType serviceType)
InstanceInfotrue if the service is available and enabled.isServiceEnabled in interface InstanceInfoserviceType - The service value among service info listtrue if the service is enabled, false otherwisepublic boolean isServiceAvailable(ServiceInfo.ServiceInfoType serviceType)
InstanceInfotrue if the service is available.isServiceAvailable in interface InstanceInfoserviceType - A service value among service info listtrue if the service is available, false otherwise@Deprecated public String getHttpHost()
@Deprecated public int getHttpPort()
public int compareTo(InstanceInfo other)
-1 if the instance is smaller than o2, 0 if they are equals, 1 otherwise.compareTo in interface Comparable<InstanceInfo>public InstanceId getInstanceId()
InstanceInfogetInstanceId in interface InstanceInfoInstanceId instance ID) of the instance in the SAP CC systempublic ServiceInfo.Address getAddress(ServiceInfo.ServiceInfoType serviceInfoType)
InstanceInfogetAddress in interface InstanceInfoserviceInfoType - value among service info listpublic String getFullHost(ServiceInfo.ServiceInfoType serviceInfoType)
InstanceInfogetFullHost in interface InstanceInfoserviceInfoType - A value among service info listpublic String getHost(ServiceInfo.ServiceInfoType serviceInfoType)
InstanceInfogetHost in interface InstanceInfoserviceInfoType - A value among service info listpublic int getPort(ServiceInfo.ServiceInfoType serviceInfoType)
InstanceInfogetPort in interface InstanceInfoserviceInfoType - A value among service info listpublic ServiceInfo.ServiceInfoSecurity getSecurity(ServiceInfo.ServiceInfoType serviceInfoType)
InstanceInfogetSecurity in interface InstanceInfoserviceInfoType - A value among service info listsecuritypublic void setFullHost(ServiceInfo.ServiceInfoType serviceInfoType, String fullHost)
InstanceInfosetFullHost in interface InstanceInfoserviceInfoType - A value among service info listfullHost - The new service host namepublic void setHost(ServiceInfo.ServiceInfoType serviceInfoType, String host)
InstanceInfosetHost in interface InstanceInfoserviceInfoType - A value among service info listhost - The new service host namepublic void setPort(ServiceInfo.ServiceInfoType serviceInfoType, int port)
InstanceInfosetPort in interface InstanceInfoserviceInfoType - A value among service info listport - The new service portpublic void setSecurity(ServiceInfo.ServiceInfoType serviceInfoType, ServiceInfo.ServiceInfoSecurity security)
InstanceInfosetSecurity in interface InstanceInfoserviceInfoType - A value among service info listsecurity - The new security@Deprecated public boolean isHTTPSecurityEnabled()
InstanceInfotrue if the HTTP service security is enabled.isHTTPSecurityEnabled in interface InstanceInfotrue indicates that HTTP service is secured; this is the default@Deprecated public void setHTTPSecurityEnable(boolean flag)
InstanceInfosetHTTPSecurityEnable in interface InstanceInfoflag - true if the HTTP service security is enabled@Deprecated public String getHTTPURL()
InstanceInfogetHTTPURL in interface InstanceInfopublic String getURL(ServiceInfo.ServiceInfoType serviceType)
InstanceInfogetURL in interface InstanceInfoserviceType - A service value among service info listpublic String getInstanceName(boolean full)
InstanceInfoInstanceId) or the full name ([<HTTP_HOST_NAME>]<INSTANCE_ID>) of the instance of the SAP CC system
InstanceId
getInstanceName in interface InstanceInfofull - true to return the full name, false to return the string representation of the instance identifierpublic String getHostname()
InstanceInfogetHostname in interface InstanceInfopublic void setInstanceId(InstanceId instanceId)
public void setHostname(String hostname)
public void setInstanceName(String instanceName)
@Deprecated public boolean isHttpMultipleBinding()
InstanceInfoisHttpMultipleBinding in interface InstanceInfotrue if the HTTP server is bound to all available addresses, false otherwisepublic boolean isMultipleBinding(ServiceInfo.ServiceInfoType serviceInfoType)
InstanceInfotrue if the service is bound to all available addresses.isMultipleBinding in interface InstanceInfoserviceInfoType - A serviceType service value among service info listtrue if the service is bound to all available addresses, false otherwisepublic void isValid()
throws InvalidInstanceException
InstanceInfoisValid in interface InstanceInfoInvalidInstanceException - If the instance map is not validpublic String getSecurityAsString(ServiceInfo.ServiceInfoType serviceInfoType)
public void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(String tagName, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic String toString()
toString in class Objectinstance mappublic static final String getLocalInstanceNameFromInstanceId(InstanceId instanceId, String ipAddress, boolean fullname)
instanceId - The identifier of the instance to be namedipAddress - The IP address of the instancefullname - true if the full name is expected, false if only the name is expected.