public class Group extends java.lang.Object implements java.lang.Cloneable, java.lang.Comparable<Group>, com.vordel.api.topology.model.TopologyElement
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) |
void |
deleteLockForUser(java.lang.String userID) |
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. |
com.vordel.api.topology.model.Lock |
getLock()
Get the Lock of this Group.
|
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)
Get list of services running on a certain host 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.
|
<T extends com.vordel.api.topology.model.TopologyElement> |
same(T e) |
void |
setId(java.lang.String id)
Set the group id
|
void |
setLock(com.vordel.api.topology.model.Lock lock)
Set a Lock on this Group
|
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.getId in interface com.vordel.api.topology.model.TopologyElementpublic void setId(java.lang.String id)
id - The group idpublic java.lang.String getName()
getName in interface com.vordel.api.topology.model.TopologyElementpublic void setName(java.lang.String name)
name - The group namepublic void setLock(com.vordel.api.topology.model.Lock lock)
public com.vordel.api.topology.model.Lock getLock()
public 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 nodemanagerpublic java.util.Collection<Service> getServicesOfOtherType(Topology.ServiceType serviceType)
serviceType - Set to gateway or nodemanagerpublic java.util.Collection<Service> getServicesOnHost(java.lang.String hostID, Topology.ServiceType serviceType)
hostID - The host idserviceType - Set to gateway or nodemanagerpublic java.util.Collection<Service> getServicesOnHost(java.lang.String hostID)
hostID - The host idpublic java.util.Set<java.lang.String> getHostIds()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.Objectpublic boolean valid()
public boolean valid(boolean validateServices)
validateServices - True if sevrices should be validatedpublic int compareTo(Group o)
compareTo in interface java.lang.Comparable<Group>public void deleteLockForUser(java.lang.String userID)
public <T extends com.vordel.api.topology.model.TopologyElement> boolean same(T e)
same in interface com.vordel.api.topology.model.TopologyElement
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel