Class InstanceDescriptorImpl
- java.lang.Object
-
- fish.payara.appserver.micro.services.data.InstanceDescriptorImpl
-
- All Implemented Interfaces:
InstanceDescriptor,Serializable
public class InstanceDescriptorImpl extends Object implements InstanceDescriptor
- Author:
- steve
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InstanceDescriptorImpl(UUID uuid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddApplication(ApplicationDescriptor descriptor)voidaddApplication(ApplicationInfo info)voidaddHttpPort(int httpPort)voidaddHttpsPort(int httpsPort)booleanequals(Object obj)Overrides equals purely based on the UUID valueintgetAdminPort()Gets the admin port number for this instance descriptorList<URL>getApplicationURLS()Collection<ApplicationDescriptor>getDeployedApplications()intgetHazelcastPort()Gets the Hazelcast port number of this instance descriptorInetAddressgetHostName()List<Integer>getHttpPorts()List<Integer>getHttpsPorts()StringgetInstanceGroup()Gets the instance group nameStringgetInstanceName()StringgetInstanceType()Gets the instance type that this descriptor describeslonggetLastHearbeat()UUIDgetMemberUUID()inthashCode()Overrides hashcode based purely on the UUID hashcodebooleanisLiteMember()Checks whether or not this instance is described as a Lite Hazelcast memberbooleanisMicroInstance()Checks whether or not this descriptor describes a Payara Micro instancebooleanisPayaraInstance()Checks whether or not this descriptor describes a Payara Server instance or the DASvoidremoveApplication(ApplicationDescriptor applicationInfo)voidsetAdminPort(int adminPort)Sets the admin port number for this instance descriptorvoidsetHazelcastPort(int hazelcastPort)Sets the Hazelcast port number for this instance descriptorvoidsetHostName(InetAddress hostName)voidsetInstanceGroup(String instanceGroup)Sets the instance group namevoidsetInstanceName(String instanceName)voidsetInstanceType(String instanceType)Sets what instance type this descriptor describesvoidsetLastHeartBeat(long val)voidsetLiteMember(boolean isLiteMember)Sets whether or not this descriptor describes a Hazelcast Lite memberStringtoJsonString(boolean verbose)StringtoString()
-
-
-
Constructor Detail
-
InstanceDescriptorImpl
public InstanceDescriptorImpl(UUID uuid) throws UnknownHostException
- Throws:
UnknownHostException
-
-
Method Detail
-
addApplication
public void addApplication(ApplicationInfo info)
-
addApplication
public void addApplication(ApplicationDescriptor descriptor)
-
getInstanceName
public String getInstanceName()
- Specified by:
getInstanceNamein interfaceInstanceDescriptor
-
setInstanceName
public void setInstanceName(String instanceName)
-
getMemberUUID
public UUID getMemberUUID()
- Specified by:
getMemberUUIDin interfaceInstanceDescriptor- Returns:
- the memberUUID
-
getHttpPorts
public List<Integer> getHttpPorts()
- Specified by:
getHttpPortsin interfaceInstanceDescriptor- Returns:
- the httpPorts
-
addHttpPort
public void addHttpPort(int httpPort)
- Parameters:
httpPort- the httpPort to add
-
getHostName
public InetAddress getHostName()
- Specified by:
getHostNamein interfaceInstanceDescriptor- Returns:
- the hostName
-
setHostName
public void setHostName(InetAddress hostName)
- Parameters:
hostName- the hostName to set
-
getDeployedApplications
public Collection<ApplicationDescriptor> getDeployedApplications()
- Specified by:
getDeployedApplicationsin interfaceInstanceDescriptor- Returns:
- the deployedApplications
-
getHttpsPorts
public List<Integer> getHttpsPorts()
- Specified by:
getHttpsPortsin interfaceInstanceDescriptor- Returns:
- the httpsPorts
-
addHttpsPort
public void addHttpsPort(int httpsPort)
- Parameters:
httpsPort- the httpsPort to add
-
removeApplication
public void removeApplication(ApplicationDescriptor applicationInfo)
-
equals
public boolean equals(Object obj)
Overrides equals purely based on the UUID value- Specified by:
equalsin interfaceInstanceDescriptor- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
Overrides hashcode based purely on the UUID hashcode
-
isLiteMember
public boolean isLiteMember()
Checks whether or not this instance is described as a Lite Hazelcast member- Specified by:
isLiteMemberin interfaceInstanceDescriptor- Returns:
- true if this instance describes a Hazelcast Lite member
-
setLiteMember
public void setLiteMember(boolean isLiteMember)
Sets whether or not this descriptor describes a Hazelcast Lite member- Parameters:
isLiteMember- true if this descriptor describes a Hazelcast Lite member
-
isMicroInstance
public boolean isMicroInstance()
Checks whether or not this descriptor describes a Payara Micro instance- Specified by:
isMicroInstancein interfaceInstanceDescriptor- Returns:
- true if this descriptor describes a Payara Micro instances
-
isPayaraInstance
public boolean isPayaraInstance()
Checks whether or not this descriptor describes a Payara Server instance or the DAS- Specified by:
isPayaraInstancein interfaceInstanceDescriptor- Returns:
- true if this descriptor describes a Payara Server instance or the DAS
-
setInstanceType
public void setInstanceType(String instanceType)
Sets what instance type this descriptor describes- Parameters:
instanceType- the instance type that this descriptor should describe
-
getInstanceType
public String getInstanceType()
Gets the instance type that this descriptor describes- Specified by:
getInstanceTypein interfaceInstanceDescriptor- Returns:
- the instance type that this descriptor describes
-
setHazelcastPort
public void setHazelcastPort(int hazelcastPort)
Sets the Hazelcast port number for this instance descriptor- Parameters:
hazelcastPort- the port number in use by Hazelcast
-
getHazelcastPort
public int getHazelcastPort()
Gets the Hazelcast port number of this instance descriptor- Specified by:
getHazelcastPortin interfaceInstanceDescriptor- Returns:
- the port number in use by Hazelcast
-
setAdminPort
public void setAdminPort(int adminPort)
Sets the admin port number for this instance descriptor- Parameters:
adminPort- the admin port number in use by this instance
-
getAdminPort
public int getAdminPort()
Gets the admin port number for this instance descriptor- Specified by:
getAdminPortin interfaceInstanceDescriptor- Returns:
- the admin port number in use by this instance
-
toJsonString
public String toJsonString(boolean verbose)
- Specified by:
toJsonStringin interfaceInstanceDescriptor- Parameters:
verbose- whether to include servlet mappings in the returned object.- Returns:
- a JSON formatted string representing the instance.
-
getApplicationURLS
public List<URL> getApplicationURLS()
- Specified by:
getApplicationURLSin interfaceInstanceDescriptor
-
getInstanceGroup
public String getInstanceGroup()
Gets the instance group name- Specified by:
getInstanceGroupin interfaceInstanceDescriptor- Returns:
- The instance group name
-
setInstanceGroup
public void setInstanceGroup(String instanceGroup)
Sets the instance group name- Parameters:
instanceGroup- The instance group name
-
setLastHeartBeat
public void setLastHeartBeat(long val)
-
getLastHearbeat
public long getLastHearbeat()
- Specified by:
getLastHearbeatin interfaceInstanceDescriptor- Returns:
- the timestamp of the last heartbeat this instance updated
-
-