|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.buildforge.services.client.dbo.Collector
public final class Collector
An object representing a collector within the Build Forge system.
Collectors are assigned to servers, and they gather information from
those servers that can later be used by selectors
when determining which server should be used for running a step.
This class defines the collector itself. Precisely what information
the collector will gather is determined by the
properties
that belong to it.
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<Collector> |
CLASS
|
Constructor Summary | |
---|---|
Collector(APIClientConnection conn)
Define a new collector object. |
Method Summary | |
---|---|
void |
addCollectorProperty(CollectorProperty prop)
Adds a new property to this collector at the end of the property list. |
void |
addCollectorProperty(CollectorProperty prop,
int index)
Adds a new property to this collector at a specified index. |
Collector |
clone()
Clones this Collector, complete with related CollectorProperties (also cloned), but clears the collector name (id) of the cloned object making it ready for a .create() call. |
CollectorProperty |
copyCollectorProperty(int fromIndex)
Copies the property from the specified index and returns the copy for possible addition to another collector. |
CollectorProperty |
copyCollectorProperty(int fromIndex,
int toIndex)
Copies the property from the specified index and inserts the copy into the same collector's property list. |
Collector |
create()
Creates a new collector, as defined by this object. |
void |
delete()
Deletes this collector and all of its properties from the system. |
static java.util.List<Collector> |
findAll(APIClientConnection conn)
Finds all collectors that are defined within the system. |
static Collector |
findById(APIClientConnection conn,
java.lang.String collectorName)
Retrieves a Collector by its unique identifier (name). |
static java.lang.String[] |
getBuiltIns()
Returns an array containing all the collector property names that correspond to built-in properties. |
java.lang.String |
getCollectorName()
The name of this Collector. |
java.util.List<CollectorProperty> |
getProperties()
Returns a copy of the list of Collector Properties. |
CollectorProperty |
getProperty(int index)
Retrieves a collector property by its index into the current list of properties. |
CollectorProperty |
getProperty(java.lang.String propertyName)
Retrieves a collector property by name. |
Collector |
moveCollectorProperty(int fromIndex,
int toIndex)
Moves a property from one index to another. |
CollectorProperty |
removeCollectorProperty(CollectorProperty property)
Removes the specified property from the collector. |
CollectorProperty |
removeCollectorProperty(int index)
Removes the specified property from the collector. |
CollectorProperty |
removeProperty(java.lang.String propertyName)
Removes the first property with the specified property name from this collector. |
void |
setCollectorName(java.lang.String collectorId)
Renames this collector. |
java.lang.String |
toString()
|
Collector |
update()
Updates this existing collector to use the updated values in this object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Class<Collector> CLASS
Constructor Detail |
---|
public Collector(APIClientConnection conn)
create()
method.
conn
- the services layer connection that the collector
object should use when submitting requestsMethod Detail |
---|
public static java.lang.String[] getBuiltIns()
enumeration
that defines them.
public static Collector findById(APIClientConnection conn, java.lang.String collectorName) throws java.io.IOException, ServiceException
conn
- the connection to use for this requestcollectorName
- the name of the collector to find
java.io.IOException
ServiceException
public static java.util.List<Collector> findAll(APIClientConnection conn) throws java.io.IOException, ServiceException
findById(APIClientConnection, String)
to reload
the individual collector of interest.
conn
- the connection to use for this request
java.io.IOException
ServiceException
public Collector create() throws java.io.IOException, ServiceException
properties
attached, then they are
created, as well.
Restrictions: Requires Permission.AddCollector
.
java.io.IOException
ServiceException
public void delete() throws java.io.IOException, ServiceException
Restrictions: Requires Permission.DeleteCollector
. The collector
can not be included by another collector, nor can it be assigned to any
server
.
java.io.IOException
ServiceException
public Collector update() throws java.io.IOException, ServiceException
CollectorProperty.update()
on each of them,
instead.
Restrictions: Requires Permission.EditCollector
.
java.io.IOException
ServiceException
public void addCollectorProperty(CollectorProperty prop) throws java.io.IOException, ServiceException
Restrictions: Requires Permission.EditCollector
if the
collector object is already live.
prop
- the property to add to the collector
java.io.IOException
ServiceException
public void addCollectorProperty(CollectorProperty prop, int index) throws java.io.IOException, ServiceException
Restrictions: Requires Permission.EditCollector
if the
collector object is already live.
prop
- the property to add to the collectorindex
- the 0-based index at which to insert the
new property. If the specified value would place the new
property at or beyond the end of the list, then it is
placed at the end.
java.io.IOException
ServiceException
public Collector moveCollectorProperty(int fromIndex, int toIndex) throws java.io.IOException, ServiceException
Index | |||||||||
---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | Comments | ||||
A | B | C | D | E | Initial state | ||||
A | C | D | E | First, the B property is removed from index 1 | |||||
A | C | D | B | E | Then, it is re-inserted at index 3 |
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |