Some doc fixes and other improvements

refs #4580
This commit is contained in:
Johannes Meyer 2013-09-05 10:54:48 +02:00 committed by Eric Lippmann
parent c09dad98f9
commit 8022bf57af
5 changed files with 37 additions and 13 deletions

View File

@ -145,7 +145,8 @@ class CommandPipe
public function sendCommand(CommandType $command, array $objects) public function sendCommand(CommandType $command, array $objects)
{ {
foreach ($objects as $object) { foreach ($objects as $object) {
if (isset($object->service_description)) { $objectType = $this->getObjectType($object);
if ($objectType === self::TYPE_SERVICE) {
$this->transport->send($command->getServiceCommand($object->host_name, $object->service_description)); $this->transport->send($command->getServiceCommand($object->host_name, $object->service_description));
} else { } else {
$this->transport->send($command->getHostCommand($object->host_name)); $this->transport->send($command->getHostCommand($object->host_name));

View File

@ -100,7 +100,7 @@ class ScheduleDowntimeForm extends WithChildrenCommandForm
)->fetchAll(); )->fetchAll();
$options = array( $options = array(
'0' => 'No Triggered Downtime ' '0' => 'No Triggered Downtime'
); );
foreach ($downtimes as $downtime) { foreach ($downtimes as $downtime) {
$dt = DateTimeFactory::create($downtime->downtime_scheduled_start_time); $dt = DateTimeFactory::create($downtime->downtime_scheduled_start_time);

View File

@ -83,6 +83,7 @@ class AcknowledgeCommand extends BaseCommand
* Set the time when this acknowledgement should expire * Set the time when this acknowledgement should expire
* *
* @param int $expireTime The time as UNIX timestamp or -1 if it shouldn't expire * @param int $expireTime The time as UNIX timestamp or -1 if it shouldn't expire
*
* @return self * @return self
*/ */
public function setExpire($expireTime) public function setExpire($expireTime)
@ -95,6 +96,7 @@ class AcknowledgeCommand extends BaseCommand
* Set the comment for this acknowledgement * Set the comment for this acknowledgement
* *
* @param Comment $comment * @param Comment $comment
*
* @return self * @return self
*/ */
public function setComment(Comment $comment) public function setComment(Comment $comment)
@ -107,6 +109,7 @@ class AcknowledgeCommand extends BaseCommand
* Set whether the notify flag of this acknowledgment should be set * Set whether the notify flag of this acknowledgment should be set
* *
* @param bool $state * @param bool $state
*
* @return self * @return self
*/ */
public function setNotify($state) public function setNotify($state)
@ -119,6 +122,7 @@ class AcknowledgeCommand extends BaseCommand
* Set whether this acknowledgement is of type sticky * Set whether this acknowledgement is of type sticky
* *
* @param bool $state * @param bool $state
*
* @return self * @return self
*/ */
public function setSticky($state) public function setSticky($state)
@ -131,6 +135,8 @@ class AcknowledgeCommand extends BaseCommand
* Return this command's parameters properly arranged in an array * Return this command's parameters properly arranged in an array
* *
* @return array * @return array
*
* @see BaseCommand::getParameters()
*/ */
public function getParameters() public function getParameters()
{ {
@ -150,9 +156,12 @@ class AcknowledgeCommand extends BaseCommand
} }
/** /**
* @param String $hostname The name of the host to create the command for for * Return the command as a string with the given host being inserted
*
* @param string $hostname The name of the host to insert
*
* @return string The string representation of the command
* *
* @return String The command string to return for the host
* @see BaseCommand::getHostCommand() * @see BaseCommand::getHostCommand()
*/ */
public function getHostCommand($hostname) public function getHostCommand($hostname)
@ -163,10 +172,13 @@ class AcknowledgeCommand extends BaseCommand
} }
/** /**
* @param String $hostname The name of the host to create the command for * Return the command as a string with the given host and service being inserted
* @param String $servicename The name of the service to create the command for *
* @param string $hostname The name of the host to insert
* @param string $servicename The name of the service to insert
*
* @return string The string representation of the command
* *
* @return String The command string to return for the service
* @see BaseCommand::getServiceCommand() * @see BaseCommand::getServiceCommand()
*/ */
public function getServiceCommand($hostname, $servicename) public function getServiceCommand($hostname, $servicename)

View File

@ -58,6 +58,7 @@ class AddCommentCommand extends BaseCommand
* Set the comment for this command * Set the comment for this command
* *
* @param Comment $comment * @param Comment $comment
*
* @return self * @return self
*/ */
public function setComment(Comment $comment) public function setComment(Comment $comment)
@ -67,9 +68,12 @@ class AddCommentCommand extends BaseCommand
} }
/** /**
* @param String $hostname The name of the host to create the command for for * Return the command as a string with the given host being inserted
*
* @param string $hostname The name of the host to insert
*
* @return string The string representation of the command
* *
* @return String The command string to return for the host
* @see BaseCommand::getHostCommand() * @see BaseCommand::getHostCommand()
*/ */
public function getHostCommand($hostname) public function getHostCommand($hostname)
@ -78,10 +82,13 @@ class AddCommentCommand extends BaseCommand
} }
/** /**
* @param String $hostname The name of the host to create the command for * Return the command as a string with the given host and service being inserted
* @param String $servicename The name of the service to create the command for *
* @param string $hostname The name of the host to insert
* @param string $servicename The name of the service to insert
*
* @return string The string representation of the command
* *
* @return String The command string to return for the service
* @see BaseCommand::getServiceCommand() * @see BaseCommand::getServiceCommand()
*/ */
public function getServiceCommand($hostname, $servicename) public function getServiceCommand($hostname, $servicename)

View File

@ -40,7 +40,7 @@ use Icinga\Protocol\Commandpipe\CommandType;
class BaseCommand implements CommandType class BaseCommand implements CommandType
{ {
/** /**
* Return the parameters in the right order for this command * Return this command's parameters properly arranged in an array
* *
* @return array * @return array
*/ */
@ -53,6 +53,7 @@ class BaseCommand implements CommandType
* Return the command as a string with the given host being inserted * Return the command as a string with the given host being inserted
* *
* @param string $hostname The name of the host to insert * @param string $hostname The name of the host to insert
*
* @return string The string representation of the command * @return string The string representation of the command
*/ */
public function getHostCommand($hostname) public function getHostCommand($hostname)
@ -65,6 +66,7 @@ class BaseCommand implements CommandType
* *
* @param string $hostname The name of the host to insert * @param string $hostname The name of the host to insert
* @param string $servicename The name of the service to insert * @param string $servicename The name of the service to insert
*
* @return string The string representation of the command * @return string The string representation of the command
*/ */
public function getServiceCommand($hostname, $servicename) public function getServiceCommand($hostname, $servicename)
@ -76,6 +78,7 @@ class BaseCommand implements CommandType
* Return the command as a string with the given hostgroup being inserted * Return the command as a string with the given hostgroup being inserted
* *
* @param string $hostgroup The name of the hostgroup to insert * @param string $hostgroup The name of the hostgroup to insert
*
* @return string The string representation of the command * @return string The string representation of the command
*/ */
public function getHostgroupCommand($hostgroup) public function getHostgroupCommand($hostgroup)
@ -87,6 +90,7 @@ class BaseCommand implements CommandType
* Return the command as a string with the given servicegroup being inserted * Return the command as a string with the given servicegroup being inserted
* *
* @param string $servicegroup The name of the servicegroup to insert * @param string $servicegroup The name of the servicegroup to insert
*
* @return string The string representation of the command * @return string The string representation of the command
*/ */
public function getServicegroupCommand($servicegroup) public function getServicegroupCommand($servicegroup)