|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.buildforge.services.client.dbo.Selector
public class Selector
Selectors are used to test the data gathered by Collectors from agents running
on Server
s. These tests will determine whether or not a given Server
is a fit and desirable platform for the execution of a particular Project
.
The property name of each child SelectorProperty will be used to locate values
stored in the Server
's manifest (the values stored will be defined by
the Collector
defined for that Server) and those values will be used
as the left-hand side of the comparison. For example, if Server 'localhost' had
a Collector associated with it that stored the 'NUM_CPU' built-in property (the
number of CPUs on a Server), then that Server's manifest would be stored with the
number of CPUs found on the physical box, say 2. If a Selector were defined with
a SelectorProperty with a Property Name of 'NUM_CPU', an Operator of Operator.GE
(Greater Than Or Equal To), and a value of 2, then Server 'localhost' would be
found to be a suitable host to execute a Project associated with that Selector.
A full list of pre-defined, built-in properties that may be collected
(such as NUM_CPU, MEM_FREE, etc.) can be obtained via #getBuiltIns()
.
Field Summary | |
---|---|
static java.lang.Class<Selector> |
CLASS
|
Constructor Summary | |
---|---|
Selector(APIClientConnection conn)
Defines a new Selector object |
Method Summary | |
---|---|
void |
addProperty(SelectorProperty prop)
Adds a new SelectorProperty to this Selector. |
Selector |
clone()
Clones this Selector, complete with related SelectorProperties (also cloned), but clears the selector id of the cloned object making it ready for a .create() call. |
Selector |
create()
Creates this new Selector in the database |
void |
delete()
Removes this Selector from the database |
boolean |
equals(java.lang.Object other)
|
static java.util.List<Selector> |
findAll(APIClientConnection conn)
Returns the list of all Selectors in the system. |
static Selector |
findById(APIClientConnection conn,
java.lang.String selectorId)
Retrives a Selector by name |
int |
getLevel()
Returns the security access level required for permission to access this Selector |
java.util.Collection<SelectorProperty> |
getProperties()
Returns a List with every SelectorProperty associated with this Selector |
java.lang.String |
getSelectorId()
Returns the unique identifier for this Selector (its name). |
boolean |
removeProperty(SelectorProperty prop)
Removes the provided SelectorProperty from both this parent object
as well as the database |
void |
setLevel(int newLevel)
Assigns a new access level that will required to access this object |
void |
setSelectorId(java.lang.String selectorId)
Sets the unique identifier (name) of this Selector |
java.lang.String |
toString()
|
Selector |
update()
Commits the latest changes to this Selector to the database |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Class<Selector> CLASS
Constructor Detail |
---|
public Selector(APIClientConnection conn)
conn
- Method Detail |
---|
public static java.util.List<Selector> findAll(APIClientConnection conn) throws java.io.IOException, ServiceException
findById(APIClientConnection conn, String selectorId)
conn
-
java.io.IOException
ServiceException
public static Selector findById(APIClientConnection conn, java.lang.String selectorId) throws java.io.IOException, ServiceException
conn
- selectorId
- The name of the Selector
java.io.IOException
ServiceException
public Selector create() throws java.io.IOException, ServiceException
java.io.IOException
ServiceException
public Selector update() throws java.io.IOException, ServiceException
java.io.IOException
ServiceException
public void delete() throws java.io.IOException, ServiceException
java.io.IOException
ServiceException
public void addProperty(SelectorProperty prop) throws java.io.IOException, ServiceException
.create()
ed or obtained via a finder method,
then the new SelectorProperty will immediately also be created in the
database. Otherwise all SelectorProperties will be created in tandem
with a call to .create()
on this parent object.
prop
-
java.io.IOException
ServiceException
public boolean removeProperty(SelectorProperty prop) throws java.io.IOException, ServiceException
SelectorProperty
from both this parent object
as well as the database
prop
- The property to remove
java.io.IOException
ServiceException
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public Selector clone()
clone
in class java.lang.Object
public java.lang.String getSelectorId()
public int getLevel()
public java.util.Collection<SelectorProperty> getProperties()
SelectorProperty
associated with this Selector
public void setSelectorId(java.lang.String selectorId)
selectorId
- public void setLevel(int newLevel)
newLevel
- public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |