当前位置: 首页>>代码示例>>PHP>>正文


PHP Agent::bufferSizeAllowed方法代码示例

本文整理汇总了PHP中Agent::bufferSizeAllowed方法的典型用法代码示例。如果您正苦于以下问题:PHP Agent::bufferSizeAllowed方法的具体用法?PHP Agent::bufferSizeAllowed怎么用?PHP Agent::bufferSizeAllowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Agent的用法示例。


在下文中一共展示了Agent::bufferSizeAllowed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processRequest

 private function processRequest($m)
 {
     $dom = $m->dom;
     $this->originalSourceId = $m->sourceId;
     $originalSourceId = $m->sourceId;
     $this->originalMsgId = $m->msgId;
     $originalMsgId = $m->msgId;
     $headerNode = $m->headerNode;
     $this->headerNode = $headerNode;
     $validSourceId = Agent::checkSourceId($originalSourceId);
     if (!$validSourceId) {
         RegisterError::invalidSourceId($agent->sourceId, $originalMsgId);
         exit;
     } else {
         $agent = new Agent($originalSourceId);
         if (!$agent->isRegistered()) {
             RegisterError::notRegisteredError($originalSourceId, $originalMsgId);
             exit;
         } else {
             $sentBufferSize = $dom->getElementsByTagName('SIF_MaxBufferSize')->item(0)->nodeValue;
             if (!Agent::bufferSizeAllowed($sentBufferSize, $agent->agentId)) {
                 $timestamp = Utility::createTimestamp();
                 $msgId = Utility::createMessageId();
                 XmlHelper::buildSuccessMessage($msgId, $timestamp, $this->originalSourceId, $this->originalMsgId, 0, $originalMsg = null, $desc = null);
             } else {
                 $messageNode = $dom->getElementsByTagName('SIF_Message');
                 $len = $messageNode->item(0)->childNodes->item(0)->childNodes->length - 1;
                 $Mode = $messageNode->item(0)->childNodes->item(0)->childNodes->item($len)->nodeName;
                 if ($Mode == 'SIF_Query') {
                     $sifObjectNode = $dom->getElementsByTagName('SIF_QueryObject')->item(0);
                     $objectName = $sifObjectNode->getAttribute('ObjectName');
                 } else {
                     $sifObjectNode = $dom->getElementsByTagName('SIF_From')->item(0);
                     $objectName = $sifObjectNode->getAttribute('ObjectName');
                 }
                 if (!DataObject::objectExists($objectName)) {
                     RequestError::invalidObject($originalSourceId, $originalMsgId, $objectName);
                     exit;
                 } else {
                     if (!DataObject::allowedToRequest($agent->agentId, $objectName)) {
                         ProvisionError::invalidPermissionToRequest($originalSourceId, $originalMsgId, $objectName);
                         exit;
                     } else {
                         $sifDestinationId = $dom->getElementsByTagName('SIF_DestinationId');
                         if ($sifDestinationId->length != 0) {
                             $sourceId = $sifDestinationId->item(0)->nodeValue;
                             if (!DataObject::validResponder($objectName, $sourceId)) {
                                 RequestError::invalidProvider($originalSourceId, $originalMsgId);
                             } else {
                                 $this->setupRequest($objectName, $sourceId, $agent);
                             }
                             //check if destination id is valid
                         } else {
                             $this->setupRequest($objectName, $sourceId = null, $agent);
                         }
                         //check if there is a destination id
                     }
                     //check if allowed to request
                 }
                 //check if allowed to request
             }
             //check object exist
         }
         //check if registered
     }
     //check sourceId
 }
开发者ID:neilberget,项目名称:OpenZIS,代码行数:67,代码来源:Request.php

示例2: processRequest

 private function processRequest($m)
 {
     try {
         $dom = $m->dom;
         $this->originalSourceId = $m->sourceId;
         $originalSourceId = $m->sourceId;
         $this->originalMsgId = $m->msgId;
         $originalMsgId = $m->msgId;
         $headerNode = $m->headerNode;
         $this->headerNode = $headerNode;
         $validSourceId = Agent::checkSourceId($originalSourceId);
         if (!$validSourceId) {
             RegisterError::invalidSourceId($agent->sourceId, $originalMsgId);
             exit;
         } else {
             $agent = new Agent($originalSourceId);
             if (!$agent->isRegistered()) {
                 RegisterError::notRegisteredError($originalSourceId, $originalMsgId);
                 exit;
             } else {
                 $sentBufferSize = $dom->getElementsByTagName('SIF_MaxBufferSize')->item(0)->nodeValue;
                 if (!Agent::bufferSizeAllowed($sentBufferSize, $agent->agentId)) {
                     $timestamp = Utility::createTimestamp();
                     $msgId = Utility::createMessageId();
                     XmlHelper::buildSuccessMessage($msgId, $timestamp, $this->originalSourceId, $this->originalMsgId, 0, $originalMsg = null, $desc = null);
                 } else {
                     $messageNode = $dom->getElementsByTagName('SIF_Message');
                     $len = $messageNode->item(0)->childNodes->item(0)->childNodes->length - 1;
                     $Mode = $messageNode->item(0)->childNodes->item(0)->childNodes->item($len)->nodeName;
                     if ($Mode == 'SIF_Query') {
                         $sifObjectNode = $dom->getElementsByTagName('SIF_QueryObject')->item(0);
                         $objectName = $sifObjectNode->getAttribute('ObjectName');
                     } else {
                         $sifObjectNode = $dom->getElementsByTagName('SIF_From')->item(0);
                         $objectName = $sifObjectNode->getAttribute('ObjectName');
                     }
                     if (!DataObject::objectExists($objectName)) {
                         /*
                         This is a temporary fix that needs to be evaluated for correctness.
                         */
                         if ($objectName == 'SIF_ZoneStatus') {
                             require_once 'main_lib/systemcontrol/SystemControl.php';
                             $systemControl = new SystemControl($m, false, true);
                             exit;
                         }
                         RequestError::invalidObject($originalSourceId, $originalMsgId, $objectName);
                         exit;
                     } else {
                         if (!DataObject::allowedToRequest($agent->agentId, $objectName)) {
                             ProvisionError::invalidPermissionToRequest($originalSourceId, $originalMsgId, $objectName);
                             exit;
                         } else {
                             $sifDestinationId = $dom->getElementsByTagName('SIF_DestinationId');
                             if ($sifDestinationId->length != 0) {
                                 $sourceId = $sifDestinationId->item(0)->nodeValue;
                                 if (!DataObject::validResponder($objectName, $sourceId)) {
                                     RequestError::invalidProvider($originalSourceId, $originalMsgId);
                                 } else {
                                     $this->setupRequest($objectName, $sourceId, $agent);
                                 }
                                 //check if destination id is valid
                             } else {
                                 $this->setupRequest($objectName, $sourceId = null, $agent);
                             }
                             //check if there is a destination id
                         }
                         //check if allowed to request
                     }
                     //check if allowed to request
                 }
                 //check object exist
             }
             //check if registered
         }
         //check sourceId
     } catch (Exception $e) {
         ZitLog::writeToErrorLog("[processRequest]", "Errors:{$e->getTraceAsString}()", "Main Loop", $_SESSION['ZONE_ID']);
     }
 }
开发者ID:Koulio,项目名称:OpenZIS,代码行数:79,代码来源:Request.php


注:本文中的Agent::bufferSizeAllowed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。