public class Service extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<Service>
instance-1
for an API Server, and nodemanager-1
for a Node Manager.Modifier and Type | Field and Description |
---|---|
protected boolean |
enabled
Enabled falg.
|
protected java.lang.String |
hostID
The id of the host that the service runs on.
|
protected java.lang.String |
id
The unique id of the service.
|
protected int |
managementPort
The port that this services receives management requests on.
|
protected java.lang.String |
name
The name of the service.
|
protected java.lang.String |
scheme
The scheme of the service for management request, "http" or "https".
|
protected java.util.Map<java.lang.String,java.lang.String> |
tags
Name-value pair tags.
|
protected Topology.ServiceType |
type
The service type.
|
Constructor and Description |
---|
Service()
Default constructor.
|
Service(java.lang.String name,
java.lang.String scheme,
int managementPort,
java.util.HashMap<java.lang.String,java.lang.String> tags,
boolean enabled)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addTag(java.lang.String key,
java.lang.String value)
Add a tag.
|
java.lang.Object |
clone() |
int |
compareTo(Service s) |
boolean |
equals(java.lang.Object other) |
boolean |
getEnabled()
Get the enabled flag.
|
java.lang.String |
getHostID()
Get the id of the host that the service runs on.
|
java.lang.String |
getId()
Get the service id.
|
int |
getManagementPort()
Get the management port for the service
|
java.lang.String |
getName()
Get the service name
|
java.lang.String |
getScheme()
Get the service scheme.
|
java.util.Map<java.lang.String,java.lang.String> |
getTags()
Get the service's tags
|
Topology.ServiceType |
getType()
Get the type of the service.
|
int |
hashCode() |
void |
setEnabled(boolean enabled)
Set the enabled flag.
|
void |
setHostID(java.lang.String hostID)
Set the id of the host that the service runs on.
|
void |
setId(java.lang.String id)
Set the service id.
|
void |
setManagementPort(int managementPort)
Set the management port.
|
void |
setName(java.lang.String name)
Set the service name
|
void |
setScheme(java.lang.String scheme)
Set the service scheme.
|
void |
setTags(java.util.Map<java.lang.String,java.lang.String> tags)
Set the service tags.
|
void |
setType(Topology.ServiceType type)
Set the type of a service.
|
boolean |
valid()
Check validity of service.
|
protected java.lang.String id
protected java.lang.String name
protected java.lang.String scheme
protected java.lang.String hostID
protected int managementPort
protected java.util.Map<java.lang.String,java.lang.String> tags
protected Topology.ServiceType type
protected boolean enabled
public Service()
public Service(java.lang.String name, java.lang.String scheme, int managementPort, java.util.HashMap<java.lang.String,java.lang.String> tags, boolean enabled)
name
- The name of the servicescheme
- The scheme of the service for management requests i.e. http or https.managementPort
- The management porttags
- Tagsenabled
- Enabled flagpublic java.lang.String getId()
public void setId(java.lang.String id)
id
- The idpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- The namepublic java.lang.String getScheme()
public void setScheme(java.lang.String scheme)
scheme
- The schemepublic java.lang.String getHostID()
host-1
public void setHostID(java.lang.String hostID)
hostID
- The host id, e.g. host-1
public int getManagementPort()
public void setManagementPort(int managementPort)
managementPort
- The portpublic java.util.Map<java.lang.String,java.lang.String> getTags()
public void setTags(java.util.Map<java.lang.String,java.lang.String> tags)
tags
- Map of tagspublic void addTag(java.lang.String key, java.lang.String value)
key
- Tag namevalue
- Tag valuepublic Topology.ServiceType getType()
gateway
or nodemanager
public void setType(Topology.ServiceType type)
type
- The type, i.e. gateway
or nodemanager
public boolean getEnabled()
public void setEnabled(boolean enabled)
enabled
- True if enabledpublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean valid()
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel