findAll(connection)
create()
clone()
update()
removeCollectorProperty(property)
delete()
getCollectorId()
getCollectorName()
getProperties()
getProperty(property)
getBuiltIns()
setCollectorId(collectorId)
setCollectorName(collectorId)
BuildForge::Services::DBO::Collector
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); # Getting existing collectors $allCollectors = BuildForge::Services::DBO::Collector->findAll($conn); $oldcollector = BuildForge::Services::DBO::Collector->findById($conn, 'CollectorName');
# Getter / setter functions $id = $oldcollector->getCollectorId(); $name = $oldcollector->getCollectorName(); $property1 = $oldcollector->getProperty(1); $property2 = $oldcollector->getProperty('BF_JOBS'); $allProperties = $oldcollector->getProperties(); $builtInPropertyNames = $oldcollector->getBuiltIns(); $oldcollector->setCollectorId('New Name'); $oldcollector->setCollectorName('Another New Name'); $oldcollector->update(); # Collector creation, modification, deletion $newcollector = new BuildForge::Services::DBO::Collector($conn); $newcollector->setCollectorName('New Collector'); $newcollector->create(); $newcollector2 = $newcollector->clone(); $newcollector2->setCollectorName('Duplicate'); $newcollector2->create(); $newcollector->setCollectorName('New Name For New Collector'); $newcollector->update();
$property = new BuildForge::Services::DBO::CollectorProperty($conn); $property->setPropertyName('PROP_NAME'); $property->setPropertyValue('Value'); $newcollector->addCollectorProperty($property); $newcollector->copyCollectorProperty(1, 2); $newcollector->moveCollectorProperty(2, 1); $newcollector->removeCollectorProperty(2); $newcollector->removeCollectorProperty($property); $newcollector->removeCollectorProperty($property->getPropertyName()); $newcollector->delete(); $conn->logout; $conn->close;
Collector allows you to create and modify collectors for use with servers.
Returns a new instance of the Collector object.
A connected BuildForge::Services::Connection object.
An optional reference to a hash containing any or all of the following fields.
The name/ID of the collector.
findAll(connection)
Returns a reference to an array of BuildForge::Services::DBO::Collector objects, one for each entry in the database that the current user has access to. These objects will not contain their CollectorProperties. To get the properties, use BuildForge::Services::DBO::Collector->findById with the collector's collector ID.
A connected BuildForge::Services::Connection object.
Returns the BuildForge::Services::DBO::Collector object that corresponds to the given ID, or undef if no such Collector exists.
A connected BuildForge::Services::Connection object.
The name/ID of the desired collector, from $collector->getCollectorId().
create()
Creates a record for the collector in the database.
clone()
Returns a copy of the Collector object with all of the same properties. This will not
exist in the database until create()
gets called on the new object.
update()
Updates the collector in the database to correspond to the current state of the Collector object.
Adds the property to the collector. Adding it creates the property in the database.
The BuildForge::Services::DBO::CollectorProperty object to be added.
The optional location at which to add the object. 0 will add the property at the front of the list, 1 will add it after the first property, etc. Not setting a location will add the property to the end of the list.
Moves a collector property within the property list.
The index from which to move the property. 0 moves the first property, 1 moves the second property, etc.
The index to which to move the property. 0 moves it to the first position, 1 moves it to the second position, and so on.
Copies a collector property to somewhere else within the property list.
The index from which to copy the property. 0 copies the first property, 1 copies the second property, etc.
The index to which to copy the property. 0 copies it to the first position, 1 copies it to the second position, and so on.
removeCollectorProperty(property)
Deletes a collector property from the collector.
property may be either a BuildForge::Services::DBO::CollectorProperty object, in which that property gets deleted from the list, an index, in which case the property at that location gets deleted, or a collector property name, in which case that property gets deleted.
delete()
Deletes the collector and its properties from the database.
getCollectorId()
Returns the ID / name for the collector. An alias for $collector->getCollectorName().
getCollectorName()
Returns the ID / name for the collector.
getProperties()
Returns a reference to an array of BuildForge::Services::DBO::CollectorProperty objects for all collector properties in the collector.
getProperty(property)
Returns the BuildForge::Services::DBO::CollectorProperty object for the given property name / location, or undef if no such property exists.
This may be either the name or the index of the property to return.
getBuiltIns()
Returns a reference to an array of all the built-in collector property names.
setCollectorId(collectorId)
Sets the collector name / ID both within the object and (if the collector has been created) within the database. An alias to $collector->setCollectorName(collectorId).
The new name / ID for the collector.
setCollectorName(collectorId)
Sets the collector name / ID both within the object and (if the collector has been created) within the database.
The new name / ID for the collector.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.