update()
clone()
moveTo(location)
delete()
getCollectorName()
getPropertyName()
getPropertyValue()
getRegex()
getUserDefined()
getSequenceNumber()
getParent()
setPropertyName(propertyName)
setPropertyValue(propertyValue)
setRegex(regex)
setUserDefined(isRunCommand)
BuildForge::Services::DBO::CollectorProperty
use BuildForge::Services;
$conn = new BuildForge::Services::Connection($hostname); $token = $conn->authUser($user, $pass); $property = new BuildForge::Services::DBO::CollectorProperty($conn);
# Getter / setter functions $collectorName = $property->getCollectorName(); $propertyName = $property->getPropertyName(); $value = $property->getPropertyValue(); $regex = $property->getRegex(); $userDefined = $property->getUserDefined(); $sequencenumber = $property->getSequenceNumber(); $parentCollector = $property->getParent();
$property->setPropertyName('PROP_NAME'); $property->setPropertyValue('New Value'); $property->setRegex('version: ([0-9\.]+)'); $property->setUserDefined(1); $property->update(); # Collector property creation, modification, and deletion $collector = BuildForge::Services::DBO::Collector->findById($conn, $collId); $newproperty = new BuildForge::Services::DBO::CollectorProperty($conn); $newproperty->setPropertyName('PROPERTY_NAME'); $newproperty->setPropertyValue('Value'); $collector->addCollectorProperty($var);
$newproperty->setPropertyValue('New Value'); $newproperty->update(); $newproperty2 = $newproperty->clone(); $collector->addCollectorProperty($newproperty2); $newproperty->moveTo(2);
$newproperty->delete(); $conn->logout; $conn->close;
CollectorProperty allows you to modify collector properties inside of a Collector. To create
collector properties in the database, see the Collector->addCollectorProperty()
function.
Returns a new instance of a CollectorProperty object.
A connected BuildForge::Services::Connection object.
This should be undef or not passed - it is only used internally.
An optional reference to a hash containing any or all of the following fields.
The name of the collector property.
The collector property value. If this is a ``Run Command'' collector property, this should be the command to run.
For ``Run Command'' collector properties, this is the regular expression to run on the output of the command in order to get the actual value (which will be the contents of the first pair of parentheses in the regular expression). For other types of properties, this should be left blank.
1 to make this a ``Run Command'' collector property, 0 otherwise.
update()
Updates the collector property settings in the database.
clone()
Returns a CollectorProperty object which is a copy of the current one. The new copy will not be created in the database until it is added to a collector with $collector->addCollectorProperty().
moveTo(location)
Moves the collector property within its parent collector.
The index of the new location in the collector. 0 moves it to be the first collector property, 1 makes it the second, and so forth.
delete()
Deletes the collector property from the database.
getCollectorName()
Returns the name/ID of the collector which this property is within.
getPropertyName()
Returns the name of this property.
getPropertyValue()
Returns the value of this property.
getRegex()
Returns the regular expression of this property (which should be an empty string if this property is not a ``Run Command'' property.
getUserDefined()
Returns 1 if the property is a ``Run Command'' property or 0 otherwise.
getSequenceNumber()
Returns the location of the property within its parent collector. 0 means it's the first property, 1 is the second property, etc.
getParent()
Returns the BuildForge::Services::DBO::Collector object containing the collector in which this property is located.
setPropertyName(propertyName)
Sets the name of the collector property.
$collectorProperty->update()
must be run before changes are replicated in the database.
The new name for the property.
setPropertyValue(propertyValue)
Sets the value of the collector property.
$collectorProperty->update()
must be run before changes are replicated in the database.
The new value of the collector property.
setRegex(regex)
Sets the regular expression for ``Run Command'' type collector properties.
$collectorProperty->update()
must be run before changes are replicated in the database.
The regular expression.
setUserDefined(isRunCommand)
Sets whether or not the collector property is a ``Run Command'' property. If so,
the property value is run on the server and the output is used as the actual value
of this field. If regex is also set, the output is filtered with the regular expression.
$collectorProperty->update()
must be run before changes are replicated in the database.
1 for a ``Run Command'' property, 0 otherwise.
Copyright (c)2006-2007 International Business Machines, Inc. All rights reserved.