public class Group extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<Group>
Service
objects which represents
API Servers or Node Manager. A group can only contain services of a single type
i.e. API Server (gateway) or Node Manager (nodemanager).
Each group has a unique id within the topology assigned by the Node Manager when it
is created, e.g. group-1
.Constructor and Description |
---|
Group()
Default constructor.
|
Group(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addService(Service service)
Add a service to the group.
|
void |
addTag(java.lang.String key,
java.lang.String value)
Add a tag for the group.
|
java.lang.Object |
clone() |
int |
compareTo(Group o) |
boolean |
equals(java.lang.Object other) |
java.util.Set<java.lang.String> |
getHostIds()
Get a list of host ids on which this group runs.
|
java.lang.String |
getId()
Get the id of the group, for example
group-2 . |
java.lang.String |
getName()
Get the group name.
|
Service |
getService(java.lang.String id)
Get a service from the group.
|
Service |
getServiceByName(java.lang.String name)
Get a service from the group.
|
java.util.Collection<Service> |
getServices()
Get all the services in the group.
|
java.util.Collection<Service> |
getServicesByType(Topology.ServiceType serviceType)
Get a list services of a certain type from the group.
|
java.util.Collection<Service> |
getServicesOfOtherType(Topology.ServiceType serviceType)
Get a list services not of a certain type from the group.
|
java.util.Collection<Service> |
getServicesOnHost(java.lang.String hostID,
Topology.ServiceType serviceType)
Get list of services of a certain type running on a certain host from the group.
|
java.util.Map<java.lang.String,java.lang.String> |
getTags()
Get the tags for the group.
|
int |
hashCode() |
void |
removeService(java.lang.String id)
Delete a service from the group.
|
void |
setId(java.lang.String id)
Set the group id
|
void |
setName(java.lang.String name)
Set the name of the group.
|
void |
setServices(java.util.Collection<Service> services)
Set the list of services in the gorup.
|
void |
setTags(java.util.Map<java.lang.String,java.lang.String> tags)
Set the tags for the group
|
boolean |
valid() |
boolean |
valid(boolean validateServices)
Is this a valid group.
|
public Group()
public Group(java.lang.String name)
name
- The name of the group.public java.lang.String getId()
group-2
.public void setId(java.lang.String id)
id
- The group idpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- The group namepublic java.util.Collection<Service> getServices()
public void setServices(java.util.Collection<Service> services)
services
- The list of servicespublic 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 keyvalue
- Tag valuepublic void addService(Service service)
service
- The service to addpublic Service getServiceByName(java.lang.String name)
name
- The name of the servicepublic Service getService(java.lang.String id)
id
- The id of the servicepublic void removeService(java.lang.String id)
id
- The service idpublic java.util.Collection<Service> getServicesByType(Topology.ServiceType serviceType)
serviceType
- Set to gateway
or nodemanager
public java.util.Collection<Service> getServicesOfOtherType(Topology.ServiceType serviceType)
serviceType
- Set to gateway
or nodemanager
public java.util.Collection<Service> getServicesOnHost(java.lang.String hostID, Topology.ServiceType serviceType)
hostID
- The host idserviceType
- Set to gateway
or nodemanager
public java.util.Set<java.lang.String> getHostIds()
public 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()
public boolean valid(boolean validateServices)
validateServices
- True if sevrices should be validated
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel