input_ = $input; $this->output_ = $output ? $output : $input; } public function listByAppIdAndGroup($appId, $group) { $this->send_listByAppIdAndGroup($appId, $group); return $this->recv_listByAppIdAndGroup(); } public function send_listByAppIdAndGroup($appId, $group) { $args = new \OpenSearch\Generated\Summary\SummaryService_listByAppIdAndGroup_args(); $args->appId = $appId; $args->group = $group; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { thrift_protocol_write_binary($this->output_, 'listByAppIdAndGroup', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); } else { $this->output_->writeMessageBegin('listByAppIdAndGroup', TMessageType::CALL, $this->seqid_); $args->write($this->output_); $this->output_->writeMessageEnd(); $this->output_->getTransport()->flush(); } } public function recv_listByAppIdAndGroup() { $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\OpenSearch\Generated\Summary\SummaryService_listByAppIdAndGroup_result', $this->input_->isStrictRead()); else { $rseqid = 0; $fname = null; $mtype = 0; $this->input_->readMessageBegin($fname, $mtype, $rseqid); if ($mtype == TMessageType::EXCEPTION) { $x = new TApplicationException(); $x->read($this->input_); $this->input_->readMessageEnd(); throw $x; } $result = new \OpenSearch\Generated\Summary\SummaryService_listByAppIdAndGroup_result(); $result->read($this->input_); $this->input_->readMessageEnd(); } if ($result->success !== null) { return $result->success; } if ($result->error !== null) { throw $result->error; } if ($result->e !== null) { throw $result->e; } throw new \Exception("listByAppIdAndGroup failed: unknown result"); } } // HELPER FUNCTIONS AND STRUCTURES class SummaryService_listByAppIdAndGroup_args { static $_TSPEC; /** * @var string */ public $appId = null; /** * @var string */ public $group = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array( 1 => array( 'var' => 'appId', 'type' => TType::STRING, ), 2 => array( 'var' => 'group', 'type' => TType::STRING, ), ); } if (is_array($vals)) { if (isset($vals['appId'])) { $this->appId = $vals['appId']; } if (isset($vals['group'])) { $this->group = $vals['group']; } } } public function getName() { return 'SummaryService_listByAppIdAndGroup_args'; } public function read($input) { $xfer = 0; $fname = null; $ftype = 0; $fid = 0; $xfer += $input->readStructBegin($fname); while (true) { $xfer += $input->readFieldBegin($fname, $ftype, $fid); if ($ftype == TType::STOP) { break; } switch ($fid) { case 1: if ($ftype == TType::STRING) { $xfer += $input->readString($this->appId); } else { $xfer += $input->skip($ftype); } break; case 2: if ($ftype == TType::STRING) { $xfer += $input->readString($this->group); } else { $xfer += $input->skip($ftype); } break; default: $xfer += $input->skip($ftype); break; } $xfer += $input->readFieldEnd(); } $xfer += $input->readStructEnd(); return $xfer; } public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('SummaryService_listByAppIdAndGroup_args'); if ($this->appId !== null) { $xfer += $output->writeFieldBegin('appId', TType::STRING, 1); $xfer += $output->writeString($this->appId); $xfer += $output->writeFieldEnd(); } if ($this->group !== null) { $xfer += $output->writeFieldBegin('group', TType::STRING, 2); $xfer += $output->writeString($this->group); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; } } class SummaryService_listByAppIdAndGroup_result { static $_TSPEC; /** * @var \OpenSearch\Generated\Summary\Summary[] */ public $success = null; /** * @var \OpenSearch\Generated\Common\OpenSearchException */ public $error = null; /** * @var \OpenSearch\Generated\Common\OpenSearchClientException */ public $e = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array( 0 => array( 'var' => 'success', 'type' => TType::LST, 'etype' => TType::STRUCT, 'elem' => array( 'type' => TType::STRUCT, 'class' => '\OpenSearch\Generated\Summary\Summary', ), ), 1 => array( 'var' => 'error', 'type' => TType::STRUCT, 'class' => '\OpenSearch\Generated\Common\OpenSearchException', ), 2 => array( 'var' => 'e', 'type' => TType::STRUCT, 'class' => '\OpenSearch\Generated\Common\OpenSearchClientException', ), ); } if (is_array($vals)) { if (isset($vals['success'])) { $this->success = $vals['success']; } if (isset($vals['error'])) { $this->error = $vals['error']; } if (isset($vals['e'])) { $this->e = $vals['e']; } } } public function getName() { return 'SummaryService_listByAppIdAndGroup_result'; } public function read($input) { $xfer = 0; $fname = null; $ftype = 0; $fid = 0; $xfer += $input->readStructBegin($fname); while (true) { $xfer += $input->readFieldBegin($fname, $ftype, $fid); if ($ftype == TType::STOP) { break; } switch ($fid) { case 0: if ($ftype == TType::LST) { $this->success = array(); $_size0 = 0; $_etype3 = 0; $xfer += $input->readListBegin($_etype3, $_size0); for ($_i4 = 0; $_i4 < $_size0; ++$_i4) { $elem5 = null; $elem5 = new \OpenSearch\Generated\Summary\Summary(); $xfer += $elem5->read($input); $this->success []= $elem5; } $xfer += $input->readListEnd(); } else { $xfer += $input->skip($ftype); } break; case 1: if ($ftype == TType::STRUCT) { $this->error = new \OpenSearch\Generated\Common\OpenSearchException(); $xfer += $this->error->read($input); } else { $xfer += $input->skip($ftype); } break; case 2: if ($ftype == TType::STRUCT) { $this->e = new \OpenSearch\Generated\Common\OpenSearchClientException(); $xfer += $this->e->read($input); } else { $xfer += $input->skip($ftype); } break; default: $xfer += $input->skip($ftype); break; } $xfer += $input->readFieldEnd(); } $xfer += $input->readStructEnd(); return $xfer; } public function write($output) { $xfer = 0; $xfer += $output->writeStructBegin('SummaryService_listByAppIdAndGroup_result'); if ($this->success !== null) { if (!is_array($this->success)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } $xfer += $output->writeFieldBegin('success', TType::LST, 0); { $output->writeListBegin(TType::STRUCT, count($this->success)); { foreach ($this->success as $iter6) { $xfer += $iter6->write($output); } } $output->writeListEnd(); } $xfer += $output->writeFieldEnd(); } if ($this->error !== null) { $xfer += $output->writeFieldBegin('error', TType::STRUCT, 1); $xfer += $this->error->write($output); $xfer += $output->writeFieldEnd(); } if ($this->e !== null) { $xfer += $output->writeFieldBegin('e', TType::STRUCT, 2); $xfer += $this->e->write($output); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); $xfer += $output->writeStructEnd(); return $xfer; } } class SummaryServiceProcessor { protected $handler_ = null; public function __construct($handler) { $this->handler_ = $handler; } public function process($input, $output) { $rseqid = 0; $fname = null; $mtype = 0; $input->readMessageBegin($fname, $mtype, $rseqid); $methodname = 'process_'.$fname; if (!method_exists($this, $methodname)) { $input->skip(TType::STRUCT); $input->readMessageEnd(); $x = new TApplicationException('Function '.$fname.' not implemented.', TApplicationException::UNKNOWN_METHOD); $output->writeMessageBegin($fname, TMessageType::EXCEPTION, $rseqid); $x->write($output); $output->writeMessageEnd(); $output->getTransport()->flush(); return; } $this->$methodname($rseqid, $input, $output); return true; } protected function process_listByAppIdAndGroup($seqid, $input, $output) { $args = new \OpenSearch\Generated\Summary\SummaryService_listByAppIdAndGroup_args(); $args->read($input); $input->readMessageEnd(); $result = new \OpenSearch\Generated\Summary\SummaryService_listByAppIdAndGroup_result(); try { $result->success = $this->handler_->listByAppIdAndGroup($args->appId, $args->group); } catch (\OpenSearch\Generated\Common\OpenSearchException $error) { $result->error = $error; } catch (\OpenSearch\Generated\Common\OpenSearchClientException $e) { $result->e = $e; } $bin_accel = ($output instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { thrift_protocol_write_binary($output, 'listByAppIdAndGroup', TMessageType::REPLY, $result, $seqid, $output->isStrictWrite()); } else { $output->writeMessageBegin('listByAppIdAndGroup', TMessageType::REPLY, $seqid); $result->write($output); $output->writeMessageEnd(); $output->getTransport()->flush(); } } }