/**
  * Returns a new CcServiceRegisterQuery object.
  *
  * @param     string $modelAlias The alias of a model in the query
  * @param     Criteria $criteria Optional Criteria to build the query from
  *
  * @return    CcServiceRegisterQuery
  */
 public static function create($modelAlias = null, $criteria = null)
 {
     if ($criteria instanceof CcServiceRegisterQuery) {
         return $criteria;
     }
     $query = new CcServiceRegisterQuery();
     if (null !== $modelAlias) {
         $query->setModelAlias($modelAlias);
     }
     if ($criteria instanceof Criteria) {
         $query->mergeWith($criteria);
     }
     return $query;
 }
 public static function Register($p_componentName, $p_ipAddress)
 {
     $component = CcServiceRegisterQuery::create()->findOneByDbName($p_componentName);
     if (is_null($component)) {
         $component = new CcServiceRegister();
         $component->setDbName($p_componentName);
     }
     // Need to convert ipv6 to ipv4 since Monit server does not appear
     // to allow access via an ipv6 address.
     // http://[::1]:2812 does not respond.
     // Bug: http://savannah.nongnu.org/bugs/?27608
     if ($p_ipAddress == "::1") {
         $p_ipAddress = "127.0.0.1";
     }
     $component->setDbIp($p_ipAddress);
     $component->save();
 }
Exemple #3
0
 public static function GetMediaMonitorStatus()
 {
     $component = CcServiceRegisterQuery::create()->findOneByDbName("media-monitor");
     if (is_null($component)) {
         return null;
     } else {
         $ip = $component->getDbIp();
         $docRoot = self::GetMonitStatus($ip);
         $data = self::ExtractServiceInformation($docRoot, "airtime-media-monitor");
         return $data;
     }
 }
 /**
  * Removes this object from datastore and sets delete attribute.
  *
  * @param      PropelPDO $con
  * @return     void
  * @throws     PropelException
  * @see        BaseObject::setDeleted()
  * @see        BaseObject::isDeleted()
  */
 public function delete(PropelPDO $con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("This object has already been deleted.");
     }
     if ($con === null) {
         $con = Propel::getConnection(CcServiceRegisterPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     $con->beginTransaction();
     try {
         $ret = $this->preDelete($con);
         if ($ret) {
             CcServiceRegisterQuery::create()->filterByPrimaryKey($this->getPrimaryKey())->delete($con);
             $this->postDelete($con);
             $con->commit();
             $this->setDeleted(true);
         } else {
             $con->commit();
         }
     } catch (PropelException $e) {
         $con->rollBack();
         throw $e;
     }
 }