/**
  * Render a command
  *
  * @param   IcingaCommand   $command
  *
  * @return  IcingaApiCommand
  */
 public function render(IcingaCommand $command)
 {
     $renderMethod = 'render' . $command->getName();
     if (!method_exists($this, $renderMethod)) {
         die($renderMethod);
     }
     return $this->{$renderMethod}($command);
 }
 /**
  * Render a command
  *
  * @param   IcingaCommand   $command
  * @param   int|null        $now
  *
  * @return  string
  */
 public function render(IcingaCommand $command, $now = null)
 {
     $renderMethod = 'render' . $command->getName();
     if (!method_exists($this, $renderMethod)) {
         die($renderMethod);
     }
     if ($now === null) {
         $now = time();
     }
     return sprintf('[%u] %s', $now, $this->escape($this->{$renderMethod}($command)));
 }
 /**
  * Return whether it is possible to send the given command using the given transport
  *
  * @param   IcingaCommand               $command
  * @param   CommandTransportInterface   $transport
  *
  * @return  bool
  */
 protected function transferPossible($command, $transport)
 {
     if (!method_exists($transport, 'getInstance') || !$command instanceof ObjectCommand) {
         return true;
     }
     $transportInstance = $transport->getInstance();
     if (!$transportInstance || $transportInstance === 'none') {
         return true;
     }
     return strtolower($transportInstance) === strtolower($command->getObject()->instance_name);
 }