1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>qmf/engine/Agent.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<table border="0" width="90%" align="center">
<tr>
<td align="left">
<a title="Apache Qpid Project Page" href="http://qpid.apache.org">Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET</a>
</td>
<td align="right">
<a title="Apache Qpid Documentation" href="http://qpid.apache.org/documentation.html">Apache Qpid Documentation</a>
</td>
</tr>
</table>
<!-- Generated by Doxygen 1.7.5 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">qmf/engine/Agent.h</div> </div>
</div>
<div class="contents">
<a href="a00404.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef _QmfEngineAgent_</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define _QmfEngineAgent_</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="comment">/*</span>
<a name="l00005"></a>00005 <span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one</span>
<a name="l00006"></a>00006 <span class="comment"> * or more contributor license agreements. See the NOTICE file</span>
<a name="l00007"></a>00007 <span class="comment"> * distributed with this work for additional information</span>
<a name="l00008"></a>00008 <span class="comment"> * regarding copyright ownership. The ASF licenses this file</span>
<a name="l00009"></a>00009 <span class="comment"> * to you under the Apache License, Version 2.0 (the</span>
<a name="l00010"></a>00010 <span class="comment"> * "License"); you may not use this file except in compliance</span>
<a name="l00011"></a>00011 <span class="comment"> * with the License. You may obtain a copy of the License at</span>
<a name="l00012"></a>00012 <span class="comment"> * </span>
<a name="l00013"></a>00013 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
<a name="l00014"></a>00014 <span class="comment"> * </span>
<a name="l00015"></a>00015 <span class="comment"> * Unless required by applicable law or agreed to in writing,</span>
<a name="l00016"></a>00016 <span class="comment"> * software distributed under the License is distributed on an</span>
<a name="l00017"></a>00017 <span class="comment"> * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span>
<a name="l00018"></a>00018 <span class="comment"> * KIND, either express or implied. See the License for the</span>
<a name="l00019"></a>00019 <span class="comment"> * specific language governing permissions and limitations</span>
<a name="l00020"></a>00020 <span class="comment"> * under the License.</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include <<a class="code" href="a00429.html">qmf/engine/Schema.h</a>></span>
<a name="l00024"></a>00024 <span class="preprocessor">#include <<a class="code" href="a00423.html">qmf/engine/ObjectId.h</a>></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include <<a class="code" href="a00421.html">qmf/engine/Object.h</a>></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include <<a class="code" href="a00416.html">qmf/engine/Event.h</a>></span>
<a name="l00027"></a>00027 <span class="preprocessor">#include <<a class="code" href="a00426.html">qmf/engine/Query.h</a>></span>
<a name="l00028"></a>00028 <span class="preprocessor">#include <<a class="code" href="a00433.html">qmf/engine/Value.h</a>></span>
<a name="l00029"></a>00029 <span class="preprocessor">#include <<a class="code" href="a00418.html">qmf/engine/Message.h</a>></span>
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="keyword">namespace </span>qmf {
<a name="l00032"></a><a class="code" href="a00572.html">00032</a> <span class="keyword">namespace </span>engine {
<a name="l00033"></a>00033
<a name="l00040"></a>00040 <span class="keyword">struct </span><a class="code" href="a00010.html" title="AgentEvent.">AgentEvent</a> {
<a name="l00041"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257">00041</a> <span class="keyword">enum</span> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257">EventKind</a> {
<a name="l00042"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a3f38e18339d4975863a834e7fc41f671">00042</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a3f38e18339d4975863a834e7fc41f671">GET_QUERY</a> = 1,
<a name="l00043"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a72550740d687e6dd4c64e7a8066cd91d">00043</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a72550740d687e6dd4c64e7a8066cd91d">START_SYNC</a> = 2,
<a name="l00044"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a051cfac5a8af94d305c230c74aeb2229">00044</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a051cfac5a8af94d305c230c74aeb2229">END_SYNC</a> = 3,
<a name="l00045"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257aa5b68a83a003e2c7228c38080ef865cd">00045</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257aa5b68a83a003e2c7228c38080ef865cd">METHOD_CALL</a> = 4,
<a name="l00046"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a899258d9114c36a8fc89a70c32481c75">00046</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a899258d9114c36a8fc89a70c32481c75">DECLARE_QUEUE</a> = 5,
<a name="l00047"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a9d18df9f4a33fa424acf459d27b9741f">00047</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a9d18df9f4a33fa424acf459d27b9741f">DELETE_QUEUE</a> = 6,
<a name="l00048"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257ad1e770b2ac7c912dc915a85cbd9dd5e5">00048</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257ad1e770b2ac7c912dc915a85cbd9dd5e5">BIND</a> = 7,
<a name="l00049"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257aca971924978973a8dadde8aabc35ec83">00049</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257aca971924978973a8dadde8aabc35ec83">UNBIND</a> = 8,
<a name="l00050"></a><a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a028171c068f1f5aee19d654b0e1d4a94">00050</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257a028171c068f1f5aee19d654b0e1d4a94">SETUP_COMPLETE</a> = 9
<a name="l00051"></a>00051 };
<a name="l00052"></a>00052
<a name="l00053"></a><a class="code" href="a00010.html#a351c9a169ebc29633202109371f93776">00053</a> <a class="code" href="a00010.html#a6af28ff526149ae20289112a25659257">EventKind</a> <a class="code" href="a00010.html#a351c9a169ebc29633202109371f93776">kind</a>;
<a name="l00054"></a><a class="code" href="a00010.html#a6de579394692ae8f84e39df7f20a0093">00054</a> <a class="code" href="a00556.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> <a class="code" href="a00010.html#a6de579394692ae8f84e39df7f20a0093">sequence</a>; <span class="comment">// Protocol sequence (for all kinds)</span>
<a name="l00055"></a><a class="code" href="a00010.html#a57b2273ac8295b2297a8a34eaea6a019">00055</a> <span class="keywordtype">char</span>* <a class="code" href="a00010.html#a57b2273ac8295b2297a8a34eaea6a019">authUserId</a>; <span class="comment">// Authenticated user ID (for all kinds)</span>
<a name="l00056"></a><a class="code" href="a00010.html#a24cfbd90e4a281c8d69059aff53ab29b">00056</a> <span class="keywordtype">char</span>* <a class="code" href="a00010.html#a24cfbd90e4a281c8d69059aff53ab29b">authToken</a>; <span class="comment">// Authentication token if issued (for all kinds)</span>
<a name="l00057"></a><a class="code" href="a00010.html#aa989009b0adae9fbc876675fed85dd73">00057</a> <span class="keywordtype">char</span>* <a class="code" href="a00010.html#aa989009b0adae9fbc876675fed85dd73">name</a>; <span class="comment">// Name of the method/sync query</span>
<a name="l00058"></a>00058 <span class="comment">// (METHOD_CALL, START_SYNC, END_SYNC, DECLARE_QUEUE, BIND, UNBIND)</span>
<a name="l00059"></a><a class="code" href="a00010.html#a8022d8bb67473edbe17f708e7f9dc75d">00059</a> <a class="code" href="a00233.html">Object</a>* <a class="code" href="a00010.html#a8022d8bb67473edbe17f708e7f9dc75d">object</a>; <span class="comment">// Object involved in method call (METHOD_CALL)</span>
<a name="l00060"></a><a class="code" href="a00010.html#a6da1dba167508872776ec419c2ecce1e">00060</a> <a class="code" href="a00236.html">ObjectId</a>* <a class="code" href="a00010.html#a6da1dba167508872776ec419c2ecce1e">objectId</a>; <span class="comment">// ObjectId for method call (METHOD_CALL)</span>
<a name="l00061"></a><a class="code" href="a00010.html#a2b06fcbbdd9cd82982bada5c10c2e000">00061</a> <a class="code" href="a00258.html">Query</a>* <a class="code" href="a00010.html#a2b06fcbbdd9cd82982bada5c10c2e000">query</a>; <span class="comment">// Query parameters (GET_QUERY, START_SYNC)</span>
<a name="l00062"></a><a class="code" href="a00010.html#a6e94ff5223e0637aaa0d3da563062f58">00062</a> <a class="code" href="a00379.html">Value</a>* <a class="code" href="a00010.html#a6e94ff5223e0637aaa0d3da563062f58">arguments</a>; <span class="comment">// Method parameters (METHOD_CALL)</span>
<a name="l00063"></a><a class="code" href="a00010.html#a340fc0dbe9701d9ae54a3d5143bb8ee2">00063</a> <span class="keywordtype">char</span>* <a class="code" href="a00010.html#a340fc0dbe9701d9ae54a3d5143bb8ee2">exchange</a>; <span class="comment">// Exchange for bind (BIND, UNBIND)</span>
<a name="l00064"></a><a class="code" href="a00010.html#a1148be15d98d06590e560466fef4f35e">00064</a> <span class="keywordtype">char</span>* <a class="code" href="a00010.html#a1148be15d98d06590e560466fef4f35e">bindingKey</a>; <span class="comment">// Key for bind (BIND, UNBIND)</span>
<a name="l00065"></a><a class="code" href="a00010.html#a0138f4312e97262b8574948bbfaa4efb">00065</a> <span class="keyword">const</span> <a class="code" href="a00306.html">SchemaObjectClass</a>* <a class="code" href="a00010.html#a0138f4312e97262b8574948bbfaa4efb">objectClass</a>; <span class="comment">// (METHOD_CALL)</span>
<a name="l00066"></a>00066 };
<a name="l00067"></a>00067
<a name="l00068"></a>00068 <span class="keyword">class </span>AgentImpl;
<a name="l00069"></a>00069
<a name="l00073"></a>00073 <span class="keyword">class </span><a class="code" href="a00005.html" title="Agent - Protocol engine for the QMF agent.">Agent</a> {
<a name="l00074"></a>00074 <span class="keyword">public</span>:
<a name="l00075"></a>00075 <a class="code" href="a00005.html#a44efc142d9c889bb9640cee573cc19fc">Agent</a>(<span class="keywordtype">char</span>* label, <span class="keywordtype">bool</span> internalStore=<span class="keyword">true</span>);
<a name="l00076"></a>00076 <a class="code" href="a00005.html#a4939abdaa0d08dbf23100000d22b3f22">~Agent</a>();
<a name="l00077"></a>00077
<a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a481ccd6a73ced7d1a8e524350f2f09e9" title="Configure the directory path for storing persistent data.">setStoreDir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* path);
<a name="l00085"></a>00085
<a name="l00092"></a>00092 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a489c88f95a56dbf716abaa4b30beda6e" title="Configure the directory path for files transferred over QMF.">setTransferDir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* path);
<a name="l00093"></a>00093
<a name="l00098"></a>00098 <span class="keywordtype">void</span> <a class="code" href="a00005.html#ac3884711b7deb275ade4c29fff567bee" title="Pass messages received from the AMQP session to the Agent engine.">handleRcvMessage</a>(<a class="code" href="a00207.html">Message</a>& message);
<a name="l00099"></a>00099
<a name="l00105"></a>00105 <span class="keywordtype">bool</span> <a class="code" href="a00005.html#acc8b2035af16616624247263ed3ec5ce" title="Get the next message to be sent to the AMQP network.">getXmtMessage</a>(<a class="code" href="a00207.html">Message</a>& item) <span class="keyword">const</span>;
<a name="l00106"></a>00106
<a name="l00110"></a>00110 <span class="keywordtype">void</span> <a class="code" href="a00005.html#aafcde4dd6ea395e5b9f8200310c6d03b" title="Remove and discard one message from the head of the transmit queue.">popXmt</a>();
<a name="l00111"></a>00111
<a name="l00117"></a>00117 <span class="keywordtype">bool</span> <a class="code" href="a00005.html#a15c19f43b28f63a826562d1a1dabd7e7" title="Get the next application event from the agent engine.">getEvent</a>(<a class="code" href="a00010.html" title="AgentEvent.">AgentEvent</a>& event) <span class="keyword">const</span>;
<a name="l00118"></a>00118
<a name="l00122"></a>00122 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a85425603a2456369632069399a29f5fc" title="Remove and discard one event from the head of the event queue.">popEvent</a>();
<a name="l00123"></a>00123
<a name="l00127"></a>00127 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a126d7a08de068af40544a207b1e5c15f" title="A new AMQP session has been established for Agent communication.">newSession</a>();
<a name="l00128"></a>00128
<a name="l00133"></a>00133 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a5e693ba92e2dcc74b6b2ce181f0be34f" title="Start the QMF Agent protocol.">startProtocol</a>();
<a name="l00134"></a>00134
<a name="l00138"></a>00138 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a4796c9caa8b20c770ec4c439f9c03ad2" title="This method is called periodically so the agent can supply a heartbeat.">heartbeat</a>();
<a name="l00139"></a>00139
<a name="l00147"></a>00147 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a1df18fdb59e5f9ed134e90ea65b130f5" title="Respond to a method request.">methodResponse</a>(<a class="code" href="a00556.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> sequence, <a class="code" href="a00556.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> status, <span class="keywordtype">char</span>* text, <span class="keyword">const</span> <a class="code" href="a00379.html">Value</a>& arguments);
<a name="l00148"></a>00148
<a name="l00158"></a>00158 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a069c7ade6ea8606dbb6d5cfb6c3eca63" title="Send a content indication to the QMF bus.">queryResponse</a>(<a class="code" href="a00556.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> sequence, <a class="code" href="a00233.html">Object</a>& <span class="keywordtype">object</span>, <span class="keywordtype">bool</span> prop = <span class="keyword">true</span>, <span class="keywordtype">bool</span> stat = <span class="keyword">true</span>);
<a name="l00159"></a>00159
<a name="l00164"></a>00164 <span class="keywordtype">void</span> <a class="code" href="a00005.html#abb5d659981b2e6bde14d7fe4dcd38d75" title="Indicate the completion of a query.">queryComplete</a>(<a class="code" href="a00556.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> sequence);
<a name="l00165"></a>00165
<a name="l00170"></a>00170 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a9e1adfb2d9558d344df9eb266f961f9b" title="Register a schema class with the Agent.">registerClass</a>(<a class="code" href="a00306.html">SchemaObjectClass</a>* cls);
<a name="l00171"></a>00171
<a name="l00176"></a>00176 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a9e1adfb2d9558d344df9eb266f961f9b" title="Register a schema class with the Agent.">registerClass</a>(<a class="code" href="a00301.html">SchemaEventClass</a>* cls);
<a name="l00177"></a>00177
<a name="l00185"></a>00185 <span class="keyword">const</span> <a class="code" href="a00236.html">ObjectId</a>* <a class="code" href="a00005.html#adb7f72867b184e94f16a0c7c8df10f20" title="Give an object to the Agent for storage and management.">addObject</a>(<a class="code" href="a00233.html">Object</a>& obj, uint64_t persistId);
<a name="l00186"></a>00186 <span class="comment">// const ObjectId* addObject(Object& obj, uint32_t persistIdLo, uint32_t persistIdHi);</span>
<a name="l00187"></a>00187
<a name="l00193"></a>00193 <span class="keyword">const</span> <a class="code" href="a00236.html">ObjectId</a>* <a class="code" href="a00005.html#a7ed1a242f908bb3288fcd7e2050a8a12" title="Allocate an object-id for an object that will be managed by the application.">allocObjectId</a>(uint64_t persistId);
<a name="l00194"></a>00194 <span class="keyword">const</span> <a class="code" href="a00236.html">ObjectId</a>* <a class="code" href="a00005.html#a7ed1a242f908bb3288fcd7e2050a8a12" title="Allocate an object-id for an object that will be managed by the application.">allocObjectId</a>(<a class="code" href="a00556.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> persistIdLo, <a class="code" href="a00556.html#a435d1572bf3f880d55459d9805097f62">uint32_t</a> persistIdHi);
<a name="l00195"></a>00195
<a name="l00200"></a>00200 <span class="keywordtype">void</span> <a class="code" href="a00005.html#a439626a88dad21ae5395a06f2dade862" title="Raise an event into the QMF network.">raiseEvent</a>(<a class="code" href="a00108.html">Event</a>& event);
<a name="l00201"></a>00201
<a name="l00202"></a>00202 <span class="keyword">private</span>:
<a name="l00203"></a>00203 AgentImpl* impl;
<a name="l00204"></a>00204 };
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206 }
<a name="l00207"></a>00207
<a name="l00208"></a>00208 <span class="preprocessor">#endif</span>
<a name="l00209"></a>00209 <span class="preprocessor"></span>
</pre></div></div>
</div>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<hr size="1">
<address style="text-align: left;"><small>
Qpid C++ API Reference</small></address>
<address style="text-align: right;">
<small>
Generated on Thu May 10 2012 for Qpid C++ Client API by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.5</small>
</address>
</body>
</html>
|