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 void
addApplication(ApplicationDescriptor descriptor)
void
addApplication(ApplicationInfo info)
void
addHttpPort(int httpPort)
void
addHttpsPort(int httpsPort)
boolean
equals(Object obj)
Overrides equals purely based on the UUID valueint
getAdminPort()
Gets the admin port number for this instance descriptorList<URL>
getApplicationURLS()
Collection<ApplicationDescriptor>
getDeployedApplications()
int
getHazelcastPort()
Gets the Hazelcast port number of this instance descriptorInetAddress
getHostName()
List<Integer>
getHttpPorts()
List<Integer>
getHttpsPorts()
String
getInstanceGroup()
Gets the instance group nameString
getInstanceName()
String
getInstanceType()
Gets the instance type that this descriptor describeslong
getLastHearbeat()
UUID
getMemberUUID()
int
hashCode()
Overrides hashcode based purely on the UUID hashcodeboolean
isLiteMember()
Checks whether or not this instance is described as a Lite Hazelcast memberboolean
isMicroInstance()
Checks whether or not this descriptor describes a Payara Micro instanceboolean
isPayaraInstance()
Checks whether or not this descriptor describes a Payara Server instance or the DASvoid
removeApplication(ApplicationDescriptor applicationInfo)
void
setAdminPort(int adminPort)
Sets the admin port number for this instance descriptorvoid
setHazelcastPort(int hazelcastPort)
Sets the Hazelcast port number for this instance descriptorvoid
setHostName(InetAddress hostName)
void
setInstanceGroup(String instanceGroup)
Sets the instance group namevoid
setInstanceName(String instanceName)
void
setInstanceType(String instanceType)
Sets what instance type this descriptor describesvoid
setLastHeartBeat(long val)
void
setLiteMember(boolean isLiteMember)
Sets whether or not this descriptor describes a Hazelcast Lite memberString
toJsonString(boolean verbose)
String
toString()
-
-
-
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:
getInstanceName
in interfaceInstanceDescriptor
-
setInstanceName
public void setInstanceName(String instanceName)
-
getMemberUUID
public UUID getMemberUUID()
- Specified by:
getMemberUUID
in interfaceInstanceDescriptor
- Returns:
- the memberUUID
-
getHttpPorts
public List<Integer> getHttpPorts()
- Specified by:
getHttpPorts
in interfaceInstanceDescriptor
- Returns:
- the httpPorts
-
addHttpPort
public void addHttpPort(int httpPort)
- Parameters:
httpPort
- the httpPort to add
-
getHostName
public InetAddress getHostName()
- Specified by:
getHostName
in interfaceInstanceDescriptor
- Returns:
- the hostName
-
setHostName
public void setHostName(InetAddress hostName)
- Parameters:
hostName
- the hostName to set
-
getDeployedApplications
public Collection<ApplicationDescriptor> getDeployedApplications()
- Specified by:
getDeployedApplications
in interfaceInstanceDescriptor
- Returns:
- the deployedApplications
-
getHttpsPorts
public List<Integer> getHttpsPorts()
- Specified by:
getHttpsPorts
in 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:
equals
in interfaceInstanceDescriptor
- Overrides:
equals
in 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:
isLiteMember
in 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:
isMicroInstance
in 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:
isPayaraInstance
in 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:
getInstanceType
in 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:
getHazelcastPort
in 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:
getAdminPort
in interfaceInstanceDescriptor
- Returns:
- the admin port number in use by this instance
-
toJsonString
public String toJsonString(boolean verbose)
- Specified by:
toJsonString
in 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:
getApplicationURLS
in interfaceInstanceDescriptor
-
getInstanceGroup
public String getInstanceGroup()
Gets the instance group name- Specified by:
getInstanceGroup
in 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:
getLastHearbeat
in interfaceInstanceDescriptor
- Returns:
- the timestamp of the last heartbeat this instance updated
-
-