cvs: phpdoc /en/reference/sam/functions SAM-Connection-commit.xml SAM-Connection-connect.xml SAM-Connection-constructor.xml
SAM-Connection-disconnect.xml SAM-Connection-errno.xml SAM-Connection-error.xml SAM-Connection-isConnected.xml SAM-Connection-peek.xml
SAM-Connection-receive.xml SAM-Connection-remove.xml SAM-Connection-rollback.xml SAM-Connection-send.xml SAM-Connection-subscribe.xml
SAM-Connection-unsubscribe.xml SAM-Message-body.xml SAM-Message-constructor.xml SAM-Message-header.xml
| From: | Dave Renshaw | Date: | Mon, 13 Nov 2006 16:57:51 +0000 |
| Subject: | cvs: phpdoc /en/reference/sam/functions SAM-Connection-commit.xml SAM-Connection-connect.xml SAM-Connection-constructor.xml SAM-Connection-disconnect.xml SAM-Connection-errno.xml SAM-Connection-error.xml SAM-Connection-isConnected.xml SAM-Connection-peek.xml SAM-Connection-receive.xml SAM-Connection-remove.xml SAM-Connection-rollback.xml SAM-Connection-send.xml SAM-Connection-subscribe.xml SAM-Connection-unsubscribe.xml SAM-Message-body.xml SAM-Message-constructor.xml SAM-Message-header.xml |
||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969374383@lists.php.net to get a copy of this message | ||
dsr Mon Nov 13 16:57:51 2006 UTC
Added files:
/phpdoc/en/reference/sam/functions SAM-Connection-commit.xml
SAM-Connection-connect.xml
SAM-Connection-constructor.xml
SAM-Connection-disconnect.xml
SAM-Connection-errno.xml
SAM-Connection-error.xml
SAM-Connection-isConnected.xml
SAM-Connection-peek.xml
SAM-Connection-receive.xml
SAM-Connection-remove.xml
SAM-Connection-rollback.xml
SAM-Connection-send.xml
SAM-Connection-subscribe.xml
SAM-Connection-unsubscribe.xml
SAM-Message-body.xml
SAM-Message-constructor.xml
SAM-Message-header.xml
Log:
Initial versions
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-commit.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-commit.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-commit.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-commit'> <refnamediv> <refname>SAMConnection::commit()</refname> <refpurpose> Commits (completes) the current unit of work. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Calling the "commit" method on a Connection object commits (completes) all in-flight transactions that are part of the current unit of work. </para> <para> Warning: This method is not currently implemented. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>commit</methodname><void/> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Committing the current unit of work</title> <programlisting role="php"> <![CDATA[ <?php if (!$conn->commit()) { // The commit failed! echo "Commit failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-connect.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-connect.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-connect'> <refnamediv> <refname>SAMConnection::connect()</refname> <refpurpose> Establishes a connection to a Messaging Server </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Calling the "connect" method on a SAMConnection object connects the PHP script to a messaging server. No messages can be sent or received until a connection is made. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>connect</methodname> <methodparam><type>string</type><parameter>protocol</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>protocol</parameter></term> <listitem> <para> A structured string identifying the protocol to be used when attempting to connect to the messaging server. The supported protocols are represented by constants which are normally used but if required the string may be composed dynamically by the script. The string is made up of 2 parts, the first being the protocol identifier and the second a protocol option. The two parts are seperated by a colon (:) character. Acceptable values are described by the following table: <informaltable> <tgroup cols="2"> <thead> <row> <entry>Protocol string</entry> <entry>Constant</entry> <entry>Usage</entry> </row> </thead> <tbody> <row> <entry>wmq</entry> <entry>SAM_WMQ</entry> <entry>Use the IBM MQSeries protocol connecting as a client to a remote messaging server. This is equivalent to "wmq:client" (SAM_WMQ_CLIENT). At least a broker name (SAM_BROKER) must be specified in the options array.</entry> </row> <row> <entry>wmq:client</entry> <entry>SAM_WMQ_CLIENT</entry> <entry>Use the IBM MQSeries protocol connecting as a client to a remote messaging server. At least a broker name (SAM_BROKER) must be specified in the options array. </entry> </row> <row> <entry>wmq:bindings</entry> <entry>SAM_WMQ_BINDINGS</entry> <entry>Use the IBM MQSeries protocol connecting to a local messaging server and communicating via shared memory. At least a broker name (SAM_BROKER) must be specified in the options array.</entry> </row> <row> <entry>wpm</entry> <entry>SAM_WPM</entry> <entry>Use the IBM WebSphere Platform Messaging protocol to connect to the messaging infrastructure of a WebSphere Application server or cluster. A bus name must be specified in the options array (SAM_BUS) and endpoint and target chain may also be specified.</entry> </row> <row> <entry>rtt</entry> <entry>SAM_RTT</entry> <entry>Use the IBM Realtime transport protocol to connect to the messaging infrastructure.</entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties to describe the details of the connection required. The following table lists the available property names and accepted values: <informaltable> <tgroup cols="3"> <thead> <row> <entry>Property name</entry> <entry>default</entry> <entry>Usage</entry> </row> </thead> <tbody> <row> <entry>SAM_BROKER</entry> <entry>none</entry> <entry> The name of the broker or queue manager running on the messaging server. <para> This property must be set if using one of the variants of the WebSphere MQSeries protocol (SAM_WMQ, SAM_WMQ_CLIENT, SAM_WMQ_BINDINGS). </para> </entry> </row> <row> <entry>SAM_HOST</entry> <entry>localhost</entry> <entry> The hostname of the machine on which the messaging server is running. </entry> </row> <row> <entry>SAM_PORT</entry> <entry>1414 for SAM_WMQ or 1506 for SAM_WPM </entry> <entry> The port number on which to attempt communication with the messaging server. </entry> </row> <row> <entry>SAM_CLIENT_ID</entry> <entry>none</entry> <entry> A string used to uniquely identify the client when accessing subscriptions. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_EXPIRE_AFTER</entry> <entry>0</entry> <entry> Time in milliseconds after which a message is deemed to have expired and can be deleted from queues. The default value is 0 indicating the message never expires. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_MESSAGE_PERSISTENCE</entry> <entry>none</entry> <entry> Selects whether messages are made persistent during delivery. The value may be SAM_PERSISTENT or SAM_NON_PERSISTENT. The default is dependant on the connection type and capabilities of the Messaging Server to which the connection is made. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_PASSWORD</entry> <entry>none</entry> <entry> The password to be used when the Messaging Server to which the connection is being made requires authentication. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_TRANSACTIONS</entry> <entry>SAM_AUTO</entry> <entry> Indicates how transactions are handled on this connection. The value may be SAM_AUTO (the default) to allow automatic handling on a per operation basis or SAM_MANUAL to allow the PHP script to control the transaction boundaries. If SAM_MANUAL is used any in-flight transactions will be rolled back if the script is terminated or the connection is closed without a commit being executed. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_USERID</entry> <entry>none</entry> <entry> The user id to be used when the Messaging Server to which the connection is being made requires authentication. <para> Warning: Not yet implemented! </para> </entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Creating a connection to a Messaging Server using the IBM MQSeries protocol (WMQ)</title> <programlisting role="php"> <![CDATA[ <?php $conn->connect(SAM_WMQ, array(SAM_HOST => 'Myhost.myco.com', SAM_PORT => 1506, SAM_BROKER => 'MyBroker')); ?> ]]> </programlisting> </example> </para> <para> <example> <title>Creating a connection with application transaction control and default host and port values</title> <programlisting role="php"> <![CDATA[ <?php $conn->connect(SAM_WMQ, array(SAM_BROKER => 'MyBroker', SAM_TRANSACTIONS => SAM_MANUAL)); ?> ]]> </programlisting> </example> </para> <para> <example> <title>Creating a connection to a Messaging Server using the IBM WebSphere Platform Messaging protocol (WPM)</title> <programlisting role="php"> <![CDATA[ <?php $conn->connect(SAM_WPM, array(SAM_ENDPOINTS => 'localhost:7278:BootstrapBasicMessaging', SAM_BUS => 'Bus1', SAM_TARGETCHAIN => 'InboundBasicMessaging')); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-constructor.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-constructor.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-constructor.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-constructor'> <refnamediv> <refname>SAMConnection::SAMConnection()</refname> <refpurpose> Creates a new connection to a Messaging Server </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <constructorsynopsis> <methodname>SAMConnection</methodname> <methodparam ><type>null</type><parameter></parameter></methodparam> </constructorsynopsis> </classsynopsis> <para> Creates a new <classname>SAMConnection</classname> object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Creating a connection object and connecting to a Messaging Server</title> <programlisting role="php"> <![CDATA[ <?php $conn = new SAMConnection(); $conn->connect(SAM_WMQ, array(SAM_HOST => localhost, SAM_PORT => 1414, SAM_BROKER => 'bull')); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-disconnect.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-disconnect.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-disconnect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-disconnect'> <refnamediv> <refname>SAMConnection::disconnect()</refname> <refpurpose> Disconnects from a Messaging Server </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Calling the "disconnect" method on a SAMConnection object disconnects the PHP script from a messaging server. No messages can be sent or received after a connection has been disconnected. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>disconnect</methodname><void/> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Disconnecting from a Messaging Server</title> <programlisting role="php"> <![CDATA[ <?php $conn->disconnect(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-errno.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-errno.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-errno.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.SAM-Connection-errno"> <refnamediv> <refname>SAMConnection->errno</refname> <refpurpose>Contains the unique numeric error code of the last executed SAM operation.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis> </classsynopsis> <para> <function>errno</function> Contains the numeric error code of the last executed SAM operation on this connection. If the last operation completed successfully this property contains 0. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> An integer greater than zero indicates the last error type encountered on the connection. Zero indicates that the last operation on this connection completed successfully. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>SAMConnection->error</function> </para> </refsect1> <refsect1> &reftitle.examples; <para> <example> <title>Using the error number and description properties</title> <programlisting role="php"> <![CDATA[ <?php $conn = new SAMConnection(); $conn->connect(SAM_WMQ, array(SAM_HOST => 'localhost', SAM_PORT => 1506)); $msg = new SAMMessage('This is a simple text item'); if (!$conn->send('topic://test', $msg)) { // The Send failed! echo "Send failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-error.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-error.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-error.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.SAM-Connection-error"> <refnamediv> <refname>SAMConnection->error</refname> <refpurpose>Contains the text description of the last failed SAM operation.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <fieldsynopsis><type>string</type><varname>error</varname></fieldsynopsis> </classsynopsis> <para> <function>error</function> Contains the text description of the last failed SAM operation on this connection. If the last operation completed successfully this property contains an empty string. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> A string containing the text description of the last error type encountered on the connection. An empty string indicates that the last operation on this connection completed successfully. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>SAMConnection->errno</function> </para> </refsect1> <refsect1> &reftitle.examples; <para> <example> <title>Using the error number and description properties</title> <programlisting role="php"> <![CDATA[ <?php $conn = new SAMConnection(); $conn->connect(SAM_WMQ, array(SAM_HOST => 'localhost', SAM_PORT => 1506)); $msg = new SAMMessage('This is a simple text item'); if (!$conn->send('topic://test', $msg)) { // The Send failed! echo "Send failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-isConnected.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-isConnected.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-isConnected.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-isConnected'> <refnamediv> <refname>SAMConnection::isConnected()</refname> <refpurpose> Queries whether a connection is established to a Messaging Server </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Calling the "isConnected" method on a Connection object will check whether the PHP script is connected to a messaging server. The method returns &true; if the SAMConnection object is successfully connected to a Messaging server or &false; otherwise. No messages can be sent or received unless a connection has been established with a Messaging server. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>isConnected</methodname><void/> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Checking whether there us a connection to a Messaging Server</title> <programlisting role="php"> <![CDATA[ <?php if ($conn->isConnected()) { echo 'Connection is active.' } else { echo 'No active connection!' } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-peek.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-peek.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-peek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-peek'> <refnamediv> <refname>SAMConnection::peek()</refname> <refpurpose> Read a message from a queue without removing it from the queue. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>SAMMessage</type><methodname>peek</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>target</parameter></term> <listitem> <para> The identity of the queue from which to peek the message. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties describing other parameters to control the peek operation. <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_SELECT</entry> <entry>String selector used to select messages from the queue. Typically this the correlation id string returned by a "send" request.</entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns a SAMMessage object or &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Retrieve the next message from a queue without removing it</title> <programlisting role="php"> <![CDATA[ <?php $msg = $conn->peek('queue://receive/test'); if (!$msg) { // The peek failed! echo "Peek failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> <para> <example> <title>Retrieve a specific message from a queue without removing it from the queue</title> <programlisting role="php"> <![CDATA[ <?php $msg = $conn->peek('queue://receive/test', array(SAM_SELECT => $token)); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-receive.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-receive.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-receive.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-receive'> <refnamediv> <refname>SAMConnection::receive()</refname> <refpurpose> Receive a message from a queue or subscription. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>SAMMessage</type><methodname>receive</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>target</parameter></term> <listitem> <para> The identity of the queue from which to receive the message. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties describing other parameters to control the receive operation. <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_SELECT</entry> <entry> String selector used to select messages from the queue. Typically this the correlation id string returned by a "send" request. </entry> </row> <row> <entry>SAM_WAIT</entry> <entry> Timeout value in milliseconds to control how long the request should block waiting to receive a message before returning with a failure if no message is available on the queue or topic. The default value is 0 meaning wait indefinitely and should be used with caution as the request may wait until the overall PHP script processing time limit has expired if no message becomes available. </entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns a SAMMessage object or &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Receiving a message from a queue</title> <programlisting role="php"> <![CDATA[ <?php $msg = $conn->receive('queue://receive/test'); if (!$msg) { // The receive failed! echo "Receive failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> <para> <example> <title>Receiving a message from a queue with options</title> <para> In this example the SAM_SELECT option is used to specify a selector string to be used to identify the message to receive and also a wait timeout of 10 seconds is specified. </para> <programlisting role="php"> <![CDATA[ <?php $msg = $conn->receive('queue://receive/test', array(SAM_SELECT => $token, SAM_WAIT => 10000)); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-remove.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-remove.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-remove.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-remove'> <refnamediv> <refname>SAMConnection::remove()</refname> <refpurpose> Remove a message from a queue. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>SAMMessage</type><methodname>remove</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>target</parameter></term> <listitem> <para> The identity of the queue from which to remove the message. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties describing other parameters to control the remove operation. <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_SELECT</entry> <entry>String selector used to select messages from the queue. Typically this the correlation id string returned by a "send" request.</entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Removing a message from a queue with options</title> <programlisting role="php"> <![CDATA[ <?php if (!$conn->remove('queue://receive/test', array(SAM_SELECT => $token))) { // The remove failed! echo "Remove failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-rollback.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-rollback.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-rollback.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-rollback'> <refnamediv> <refname>SAMConnection::rollback()</refname> <refpurpose> Cancels (rolls back) an in-flight unit of work. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>rollback</methodname><void/> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Cancelling an in-flight unit of work</title> <programlisting role="php"> <![CDATA[ <?php if (!$conn->rollback()) { // The rollback failed! echo "Rollback failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-send.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-send.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-send.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-send'> <refnamediv> <refname>SAMConnection::send()</refname> <refpurpose> Send a message to a queue or publish an item to a topic. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "send" method is used to send a message to a specific queue or to publish to a specific topic. The method returns a correlation id that can be used as a selector to identify reply or response messages when these are requested. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>string</type><methodname>send</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam><type>SAMMessage</type><parameter>msg</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>target</parameter></term> <listitem> <para> If sending a message, the identity of the queue (queue://queuename) or if publishing to a topic the identity of the topic (topic://topicname) to which the message is to be delivered. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>msg</parameter></term> <listitem> <para> The message to be sent or published. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties describing other parameters to control the receive operation. <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_DELIVERYMODE</entry> <entry> Indicates whether the messaging server should enusre delivery or whether it is acceptable for messages to be lost in the case of system failures. The value of this property may be set to either SAM_PERSISTENT, to indicate that message loss is not acceptable, or SAM_NON_PERSISTENT, if message loss is acceptable. The resulting behaviour of the send will vary depending on the capabilities of the messaging server the PHP script is currently connected to. If the server does not support persistent messages and SAM_PERSISTENT is specified the send request will fail with an error indication showing the capability is not available. </entry> </row> <row> <entry>SAM_PRIORITY</entry> <entry> A numeric value between 0 and 9 indicating the desired message delivery priority. A priority value of 0 indicates the lowest priority while 9 indicates highest priority. If no priority is specified a default will be assigned which is dependent on the messaging server being used. </entry> </row> <row> <entry>SAM_SELECT</entry> <entry> A string to be assigned as a correlation id for this message. If no value is given the messaging server may assign automatically. </entry> </row> <row> <entry>SAM_TIMETOLIVE</entry> <entry> A time in milliseconds indicating how long the messaging server should retain the message on a queue before discarding it. The default value is 0 indicating the message should be retained indefinitely. </entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> A correlation id string that can be used in a subsequent receive call as a selector to obtain any reply or response that has been requested or &false; if an error occurred. Note: a correlation id will only be returned for a successful send to a queue destination (queue://xxxx) in which case it will reflect the message identitiy of the message on the queue. In the case of a send being used to publish data to a topic the return value will be &true; as no correlation id is availabe for return. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Send a message to a queue</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a simple text message'); $correlId = $conn->send('queue://send/test', $msg); if (!$correlId) { // The send failed! echo "Send failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> <para> <example> <title>Publish a message to a topic</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a simple text item'); if (!$conn->send('topic://test', $msg)) { // The Send failed! echo "Send failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> <example> <title>Send a request and receive a response</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a simple text message'); $msg->header->SAM_REPLY_TO = 'queue://receive/test'; $correlid = $conn->send('queue://send/test', $msg); if (!$correlid) { // The Send failed! echo "Send failed ($conn->errno) $conn->error"; } else { $resp = $conn->receive('queue://receive/test', array(SAM_SELECT => $correlid)); } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-subscribe.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-subscribe.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-subscribe.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-subscribe'> <refnamediv> <refname>SAMConnection::subscribe()</refname> <refpurpose> Create a subscription to one or more topics. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "subscribe" method is used to create a new subscription to one or more topics. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>string</type><methodname>subscribe</methodname> <methodparam><type>string</type><parameter>targetTopic</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>targetTopic</parameter></term> <listitem> <para> The identity of the topic (topic://topicname) to subscribe to. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> A subscription identifier that can be used in a subsequent receive call as a selector to obtain any topic data or &false; if an error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Subscribe to a single topic</title> <programlisting role="php"> <![CDATA[ <?php $subid = $conn->subscribe('topic://A'); if (!$subid) { // The subscribe failed! echo "Subscribe failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-unsubscribe.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-unsubscribe.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-unsubscribe.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-unsubscribe'> <refnamediv> <refname>SAMConnection::unsubscribe()</refname> <refpurpose> Cancel a subscription to one or more topics. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "unsubscribe" method is used to delete an existing subscription to one or more topics. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>unsubscribe</methodname> <methodparam><type>string</type><parameter>subscriptionId</parameter></methodparam> <methodparam choice='opt'><type>string</type><parameter>targetTopic</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>subscriptionId</parameter></term> <listitem> <para> The identifier of an existing subscription as returned by a call to the subscribe method. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>targetTopic</parameter></term> <listitem> <para> An optional topic identifier of the topic for which the subscription is to be cancelled. If this value is not specified the subscription will be cancelled for all topics currently subscribed to. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Unsubscribe from a single topic</title> <programlisting role="php"> <![CDATA[ <?php if (!$conn->unsubscribe($subid, 'topic://A')) { // The unsubscribe failed! echo "Unsubscribe failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Message-body.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Message-body.xml +++ phpdoc/en/reference/sam/functions/SAM-Message-body.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Message-body'> <refnamediv> <refname>SAMMessage::body</refname> <refpurpose> The body of the message. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "body" property contains the actual body of the message. It may not always be set. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Setting a text string into the body of a message</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage(); $msg->body = 'This is a simple message'; ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Message-constructor.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Message-constructor.xml +++ phpdoc/en/reference/sam/functions/SAM-Message-constructor.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Message-constructor'> <refnamediv> <refname>SAMMessage::SAMMessage()</refname> <refpurpose> Creates a new Message object </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMMessage</classname></ooclass> <constructorsynopsis> <methodname>SAMMessage</methodname> <methodparam choice='opt'><type>any</type><parameter>body</parameter></methodparam> </constructorsynopsis> </classsynopsis> <para> Creates a new <classname>SAMMessage</classname> object optionally specifying a message body. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>body</parameter></term> <listitem> <para> The optional body for the message. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Creating a message</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage(); ?> ]]> </programlisting> </example> </para> <para> <example> <title>Creating a message with a simple text payload</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a simple text message'); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Message-header.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Message-header.xml +++ phpdoc/en/reference/sam/functions/SAM-Message-header.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Message-header'> <refnamediv> <refname>SAMMessage::header</refname> <refpurpose> The header properties of the message. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "header" property is a container for any system or user properties that area associated with the message. Properties may be assigned by the sender of a message to control the way the messaging systems handles it or may be assigned by the messaging system itself to tell the recipient extra information about the message or the way in which it has been handled. </para> <para> Some properties are understood by SAM in which case constants have been defined for them. The majority of properties however are ignored by the SAM implementation and simply passed through to the underlying messaging systems allowing the application to use messaging specific property names or to define its own "user" properties. </para> <para> The SAM defined properties are as follows: <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_REPLY_TO</entry> <entry> A string providing the identity of the queue on to which responses to this message should be posted. </entry> </row> <row> <entry>SAM_TYPE</entry> <entry> <para> An indication of the type of message to be sent. The value may be SAM_TEXT indicating the contents of the message body is a text string, or SAM_BYTES indicating the contents of the message body are some application defined format. </para> <para> The way in which this property is used may depend on the underlying messaging server. For instance a messaging server that supports the JMS (Java Message Service) specification may interpret this value and send messages of type "jms_text" and "jms_bytes". In addition, if the SAM_TYPE property is set to SAM_TEXT the data provided for the message body is expected to be a UTF8 encoded string. </para> </entry> </row> </tbody> </tgroup> </informaltable> </para> <para> When setting the values of properties it is often useful to give a hint as to the format in which the property should be delivered to the messaging system. By default property values are delivered as text and the following simple syntax may be used to set a value: </para> <para> <example> <title>Setting a text format property using the default syntax</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage(); $msg->header->myPropertyName = 'textData'; ?> ]]> </programlisting> </example> </para> <para> If it is desired to pass type information an alternative syntax may be used where the value and the type hint are passed in an associative array: </para> <para> <example> <title>Setting a text format property using a type hint</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage(); $msg->header->myPropertyName = ('textData', SAM_STRING); ?> ]]> </programlisting> </example> </para> <para> When passing a type hint the type entry should be one of the SAM defined constant values as defined by the following table: <informaltable> <tgroup cols="2"> <thead> <row> <entry>Constant</entry> <entry>Type description</entry> </row> </thead> <tbody> <row> <entry>SAM_BOOLEAN</entry> <entry> Any value passed will be interpreted as logical true or false. If the value cannot be interpreted as a PHP boolean value the value passed to the messaging system is undefined. </entry> </row> <row> <entry>SAM_BYTE</entry> <entry> An 8-bit signed integer value. SAM will attempt to convert the property value specified into a single byte value to pass to the messaging system. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the numeric value cannot be expressed as an 8-bit signed binary value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_DOUBLE</entry> <entry> A long floating point value. SAM will attempt to convert the property value specified into a floating point value with 15 digits of precision. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the passed value cannot be expressed as a 15 digit floating point value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_FLOAT</entry> <entry> A short floating point value. SAM will attempt to convert the property value specified into a floating point value with 7 digits of precision. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the passed value cannot be expressed as a 7 digit floating point value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_INT</entry> <entry> An 32-bit signed integer value. SAM will attempt to convert the property value specified into a 32-bit value to pass to the messaging system. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the numeric value cannot be expressed as an 32-bit signed binary value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_LONG</entry> <entry> An 64-bit signed integer value. SAM will attempt to convert the property value specified into a 64-bit value to pass to the messaging system. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the numeric value cannot be expressed as an 64-bit signed binary value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_STRING</entry> <entry> SAM will interpret the property value specified as a string and pass it to the messaging system accordingly. </entry> </row> </tbody> </tgroup> </informaltable> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Setting properties as the sender of a message</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a test message'); // defining SAM specific properties... $msg->header->SAM_REPLY_TO = 'queue://test/replyQueue'; // defining arbitrary properties... // // a default string property $msg->header->myStringProp1 = 'a string property'; // a string property with a type hint $msg->header->myStringProp2 = array('another string property', SAM_STRING); // a boolean property $msg->header->myBoolProp = array(FALSE, SAM_BOOL); // numeric format properties $msg->header->myIntProp = array(32768, SAM_INT); $msg->header->myLongProp = array(9876543, SAM_LONG); $msg->header->myByteProp1 = array(123, SAM_BYTE); $msg->header->myByteProp2 = array('12', SAM_BYTE); $msg->header->myFloatProp = array(3.141592, SAM_FLOAT); $msg->header->myDoubleProp = array(3.14159265358979, SAM_DOUBLE); ?> ]]> </programlisting> </example> </para> <para> <example> <title>Retreiving property values from a message</title> <programlisting role="php"> <![CDATA[ <?php // accessing an application specifc property $intProp = $msg->header->'MyIntProp'; // accessing a messaging system specific property $encoding = $msg->header->'JMS_IBM_Msgtype'; ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-commit.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-commit.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-commit.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-commit'> <refnamediv> <refname>SAMConnection::commit()</refname> <refpurpose> Commits (completes) the current unit of work. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Calling the "commit" method on a Connection object commits (completes) all in-flight transactions that are part of the current unit of work. </para> <para> Warning: This method is not currently implemented. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>commit</methodname><void/> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Committing the current unit of work</title> <programlisting role="php"> <![CDATA[ <?php if (!$conn->commit()) { // The commit failed! echo "Commit failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-connect.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-connect.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-connect'> <refnamediv> <refname>SAMConnection::connect()</refname> <refpurpose> Establishes a connection to a Messaging Server </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Calling the "connect" method on a SAMConnection object connects the PHP script to a messaging server. No messages can be sent or received until a connection is made. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>connect</methodname> <methodparam><type>string</type><parameter>protocol</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>protocol</parameter></term> <listitem> <para> A structured string identifying the protocol to be used when attempting to connect to the messaging server. The supported protocols are represented by constants which are normally used but if required the string may be composed dynamically by the script. The string is made up of 2 parts, the first being the protocol identifier and the second a protocol option. The two parts are seperated by a colon (:) character. Acceptable values are described by the following table: <informaltable> <tgroup cols="2"> <thead> <row> <entry>Protocol string</entry> <entry>Constant</entry> <entry>Usage</entry> </row> </thead> <tbody> <row> <entry>wmq</entry> <entry>SAM_WMQ</entry> <entry>Use the IBM MQSeries protocol connecting as a client to a remote messaging server. This is equivalent to "wmq:client" (SAM_WMQ_CLIENT). At least a broker name (SAM_BROKER) must be specified in the options array.</entry> </row> <row> <entry>wmq:client</entry> <entry>SAM_WMQ_CLIENT</entry> <entry>Use the IBM MQSeries protocol connecting as a client to a remote messaging server. At least a broker name (SAM_BROKER) must be specified in the options array. </entry> </row> <row> <entry>wmq:bindings</entry> <entry>SAM_WMQ_BINDINGS</entry> <entry>Use the IBM MQSeries protocol connecting to a local messaging server and communicating via shared memory. At least a broker name (SAM_BROKER) must be specified in the options array.</entry> </row> <row> <entry>wpm</entry> <entry>SAM_WPM</entry> <entry>Use the IBM WebSphere Platform Messaging protocol to connect to the messaging infrastructure of a WebSphere Application server or cluster. A bus name must be specified in the options array (SAM_BUS) and endpoint and target chain may also be specified.</entry> </row> <row> <entry>rtt</entry> <entry>SAM_RTT</entry> <entry>Use the IBM Realtime transport protocol to connect to the messaging infrastructure.</entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties to describe the details of the connection required. The following table lists the available property names and accepted values: <informaltable> <tgroup cols="3"> <thead> <row> <entry>Property name</entry> <entry>default</entry> <entry>Usage</entry> </row> </thead> <tbody> <row> <entry>SAM_BROKER</entry> <entry>none</entry> <entry> The name of the broker or queue manager running on the messaging server. <para> This property must be set if using one of the variants of the WebSphere MQSeries protocol (SAM_WMQ, SAM_WMQ_CLIENT, SAM_WMQ_BINDINGS). </para> </entry> </row> <row> <entry>SAM_HOST</entry> <entry>localhost</entry> <entry> The hostname of the machine on which the messaging server is running. </entry> </row> <row> <entry>SAM_PORT</entry> <entry>1414 for SAM_WMQ or 1506 for SAM_WPM </entry> <entry> The port number on which to attempt communication with the messaging server. </entry> </row> <row> <entry>SAM_CLIENT_ID</entry> <entry>none</entry> <entry> A string used to uniquely identify the client when accessing subscriptions. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_EXPIRE_AFTER</entry> <entry>0</entry> <entry> Time in milliseconds after which a message is deemed to have expired and can be deleted from queues. The default value is 0 indicating the message never expires. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_MESSAGE_PERSISTENCE</entry> <entry>none</entry> <entry> Selects whether messages are made persistent during delivery. The value may be SAM_PERSISTENT or SAM_NON_PERSISTENT. The default is dependant on the connection type and capabilities of the Messaging Server to which the connection is made. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_PASSWORD</entry> <entry>none</entry> <entry> The password to be used when the Messaging Server to which the connection is being made requires authentication. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_TRANSACTIONS</entry> <entry>SAM_AUTO</entry> <entry> Indicates how transactions are handled on this connection. The value may be SAM_AUTO (the default) to allow automatic handling on a per operation basis or SAM_MANUAL to allow the PHP script to control the transaction boundaries. If SAM_MANUAL is used any in-flight transactions will be rolled back if the script is terminated or the connection is closed without a commit being executed. <para> Warning: Not yet implemented! </para> </entry> </row> <row> <entry>SAM_USERID</entry> <entry>none</entry> <entry> The user id to be used when the Messaging Server to which the connection is being made requires authentication. <para> Warning: Not yet implemented! </para> </entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Creating a connection to a Messaging Server using the IBM MQSeries protocol (WMQ)</title> <programlisting role="php"> <![CDATA[ <?php $conn->connect(SAM_WMQ, array(SAM_HOST => 'Myhost.myco.com', SAM_PORT => 1506, SAM_BROKER => 'MyBroker')); ?> ]]> </programlisting> </example> </para> <para> <example> <title>Creating a connection with application transaction control and default host and port values</title> <programlisting role="php"> <![CDATA[ <?php $conn->connect(SAM_WMQ, array(SAM_BROKER => 'MyBroker', SAM_TRANSACTIONS => SAM_MANUAL)); ?> ]]> </programlisting> </example> </para> <para> <example> <title>Creating a connection to a Messaging Server using the IBM WebSphere Platform Messaging protocol (WPM)</title> <programlisting role="php"> <![CDATA[ <?php $conn->connect(SAM_WPM, array(SAM_ENDPOINTS => 'localhost:7278:BootstrapBasicMessaging', SAM_BUS => 'Bus1', SAM_TARGETCHAIN => 'InboundBasicMessaging')); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-constructor.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-constructor.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-constructor.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-constructor'> <refnamediv> <refname>SAMConnection::SAMConnection()</refname> <refpurpose> Creates a new connection to a Messaging Server </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <constructorsynopsis> <methodname>SAMConnection</methodname> <methodparam ><type>null</type><parameter></parameter></methodparam> </constructorsynopsis> </classsynopsis> <para> Creates a new <classname>SAMConnection</classname> object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Creating a connection object and connecting to a Messaging Server</title> <programlisting role="php"> <![CDATA[ <?php $conn = new SAMConnection(); $conn->connect(SAM_WMQ, array(SAM_HOST => localhost, SAM_PORT => 1414, SAM_BROKER => 'bull')); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-disconnect.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-disconnect.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-disconnect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-disconnect'> <refnamediv> <refname>SAMConnection::disconnect()</refname> <refpurpose> Disconnects from a Messaging Server </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Calling the "disconnect" method on a SAMConnection object disconnects the PHP script from a messaging server. No messages can be sent or received after a connection has been disconnected. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>disconnect</methodname><void/> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Disconnecting from a Messaging Server</title> <programlisting role="php"> <![CDATA[ <?php $conn->disconnect(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-errno.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-errno.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-errno.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.SAM-Connection-errno"> <refnamediv> <refname>SAMConnection->errno</refname> <refpurpose>Contains the unique numeric error code of the last executed SAM operation.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <fieldsynopsis><type>int</type><varname>errno</varname></fieldsynopsis> </classsynopsis> <para> <function>errno</function> Contains the numeric error code of the last executed SAM operation on this connection. If the last operation completed successfully this property contains 0. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> An integer greater than zero indicates the last error type encountered on the connection. Zero indicates that the last operation on this connection completed successfully. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>SAMConnection->error</function> </para> </refsect1> <refsect1> &reftitle.examples; <para> <example> <title>Using the error number and description properties</title> <programlisting role="php"> <![CDATA[ <?php $conn = new SAMConnection(); $conn->connect(SAM_WMQ, array(SAM_HOST => 'localhost', SAM_PORT => 1506)); $msg = new SAMMessage('This is a simple text item'); if (!$conn->send('topic://test', $msg)) { // The Send failed! echo "Send failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-error.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-error.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-error.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.SAM-Connection-error"> <refnamediv> <refname>SAMConnection->error</refname> <refpurpose>Contains the text description of the last failed SAM operation.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <fieldsynopsis><type>string</type><varname>error</varname></fieldsynopsis> </classsynopsis> <para> <function>error</function> Contains the text description of the last failed SAM operation on this connection. If the last operation completed successfully this property contains an empty string. </para> </refsect1> <refsect1> &reftitle.returnvalues; <para> A string containing the text description of the last error type encountered on the connection. An empty string indicates that the last operation on this connection completed successfully. </para> </refsect1> <refsect1> &reftitle.seealso; <para> <function>SAMConnection->errno</function> </para> </refsect1> <refsect1> &reftitle.examples; <para> <example> <title>Using the error number and description properties</title> <programlisting role="php"> <![CDATA[ <?php $conn = new SAMConnection(); $conn->connect(SAM_WMQ, array(SAM_HOST => 'localhost', SAM_PORT => 1506)); $msg = new SAMMessage('This is a simple text item'); if (!$conn->send('topic://test', $msg)) { // The Send failed! echo "Send failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-isConnected.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-isConnected.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-isConnected.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-isConnected'> <refnamediv> <refname>SAMConnection::isConnected()</refname> <refpurpose> Queries whether a connection is established to a Messaging Server </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> Calling the "isConnected" method on a Connection object will check whether the PHP script is connected to a messaging server. The method returns &true; if the SAMConnection object is successfully connected to a Messaging server or &false; otherwise. No messages can be sent or received unless a connection has been established with a Messaging server. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>isConnected</methodname><void/> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Checking whether there us a connection to a Messaging Server</title> <programlisting role="php"> <![CDATA[ <?php if ($conn->isConnected()) { echo 'Connection is active.' } else { echo 'No active connection!' } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-peek.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-peek.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-peek.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-peek'> <refnamediv> <refname>SAMConnection::peek()</refname> <refpurpose> Read a message from a queue without removing it from the queue. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>SAMMessage</type><methodname>peek</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>target</parameter></term> <listitem> <para> The identity of the queue from which to peek the message. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties describing other parameters to control the peek operation. <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_SELECT</entry> <entry>String selector used to select messages from the queue. Typically this the correlation id string returned by a "send" request.</entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns a SAMMessage object or &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Retrieve the next message from a queue without removing it</title> <programlisting role="php"> <![CDATA[ <?php $msg = $conn->peek('queue://receive/test'); if (!$msg) { // The peek failed! echo "Peek failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> <para> <example> <title>Retrieve a specific message from a queue without removing it from the queue</title> <programlisting role="php"> <![CDATA[ <?php $msg = $conn->peek('queue://receive/test', array(SAM_SELECT => $token)); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-receive.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-receive.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-receive.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-receive'> <refnamediv> <refname>SAMConnection::receive()</refname> <refpurpose> Receive a message from a queue or subscription. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>SAMMessage</type><methodname>receive</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>target</parameter></term> <listitem> <para> The identity of the queue from which to receive the message. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties describing other parameters to control the receive operation. <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_SELECT</entry> <entry> String selector used to select messages from the queue. Typically this the correlation id string returned by a "send" request. </entry> </row> <row> <entry>SAM_WAIT</entry> <entry> Timeout value in milliseconds to control how long the request should block waiting to receive a message before returning with a failure if no message is available on the queue or topic. The default value is 0 meaning wait indefinitely and should be used with caution as the request may wait until the overall PHP script processing time limit has expired if no message becomes available. </entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns a SAMMessage object or &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Receiving a message from a queue</title> <programlisting role="php"> <![CDATA[ <?php $msg = $conn->receive('queue://receive/test'); if (!$msg) { // The receive failed! echo "Receive failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> <para> <example> <title>Receiving a message from a queue with options</title> <para> In this example the SAM_SELECT option is used to specify a selector string to be used to identify the message to receive and also a wait timeout of 10 seconds is specified. </para> <programlisting role="php"> <![CDATA[ <?php $msg = $conn->receive('queue://receive/test', array(SAM_SELECT => $token, SAM_WAIT => 10000)); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-remove.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-remove.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-remove.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-remove'> <refnamediv> <refname>SAMConnection::remove()</refname> <refpurpose> Remove a message from a queue. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>SAMMessage</type><methodname>remove</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>target</parameter></term> <listitem> <para> The identity of the queue from which to remove the message. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties describing other parameters to control the remove operation. <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_SELECT</entry> <entry>String selector used to select messages from the queue. Typically this the correlation id string returned by a "send" request.</entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Removing a message from a queue with options</title> <programlisting role="php"> <![CDATA[ <?php if (!$conn->remove('queue://receive/test', array(SAM_SELECT => $token))) { // The remove failed! echo "Remove failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-rollback.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-rollback.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-rollback.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-rollback'> <refnamediv> <refname>SAMConnection::rollback()</refname> <refpurpose> Cancels (rolls back) an in-flight unit of work. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>rollback</methodname><void/> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Cancelling an in-flight unit of work</title> <programlisting role="php"> <![CDATA[ <?php if (!$conn->rollback()) { // The rollback failed! echo "Rollback failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-send.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-send.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-send.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-send'> <refnamediv> <refname>SAMConnection::send()</refname> <refpurpose> Send a message to a queue or publish an item to a topic. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "send" method is used to send a message to a specific queue or to publish to a specific topic. The method returns a correlation id that can be used as a selector to identify reply or response messages when these are requested. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>string</type><methodname>send</methodname> <methodparam><type>string</type><parameter>target</parameter></methodparam> <methodparam><type>SAMMessage</type><parameter>msg</parameter></methodparam> <methodparam choice='opt'><type>array</type><parameter>properties</parameter></methodparam> </methodsynopsis> </classsynopsis> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>target</parameter></term> <listitem> <para> If sending a message, the identity of the queue (queue://queuename) or if publishing to a topic the identity of the topic (topic://topicname) to which the message is to be delivered. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>msg</parameter></term> <listitem> <para> The message to be sent or published. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>properties</parameter></term> <listitem> <para> An optional associative array of properties describing other parameters to control the receive operation. <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_DELIVERYMODE</entry> <entry> Indicates whether the messaging server should enusre delivery or whether it is acceptable for messages to be lost in the case of system failures. The value of this property may be set to either SAM_PERSISTENT, to indicate that message loss is not acceptable, or SAM_NON_PERSISTENT, if message loss is acceptable. The resulting behaviour of the send will vary depending on the capabilities of the messaging server the PHP script is currently connected to. If the server does not support persistent messages and SAM_PERSISTENT is specified the send request will fail with an error indication showing the capability is not available. </entry> </row> <row> <entry>SAM_PRIORITY</entry> <entry> A numeric value between 0 and 9 indicating the desired message delivery priority. A priority value of 0 indicates the lowest priority while 9 indicates highest priority. If no priority is specified a default will be assigned which is dependent on the messaging server being used. </entry> </row> <row> <entry>SAM_SELECT</entry> <entry> A string to be assigned as a correlation id for this message. If no value is given the messaging server may assign automatically. </entry> </row> <row> <entry>SAM_TIMETOLIVE</entry> <entry> A time in milliseconds indicating how long the messaging server should retain the message on a queue before discarding it. The default value is 0 indicating the message should be retained indefinitely. </entry> </row> </tbody> </tgroup> </informaltable> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> A correlation id string that can be used in a subsequent receive call as a selector to obtain any reply or response that has been requested or &false; if an error occurred. Note: a correlation id will only be returned for a successful send to a queue destination (queue://xxxx) in which case it will reflect the message identitiy of the message on the queue. In the case of a send being used to publish data to a topic the return value will be &true; as no correlation id is availabe for return. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Send a message to a queue</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a simple text message'); $correlId = $conn->send('queue://send/test', $msg); if (!$correlId) { // The send failed! echo "Send failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> <para> <example> <title>Publish a message to a topic</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a simple text item'); if (!$conn->send('topic://test', $msg)) { // The Send failed! echo "Send failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> <example> <title>Send a request and receive a response</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a simple text message'); $msg->header->SAM_REPLY_TO = 'queue://receive/test'; $correlid = $conn->send('queue://send/test', $msg); if (!$correlid) { // The Send failed! echo "Send failed ($conn->errno) $conn->error"; } else { $resp = $conn->receive('queue://receive/test', array(SAM_SELECT => $correlid)); } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-subscribe.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-subscribe.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-subscribe.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-subscribe'> <refnamediv> <refname>SAMConnection::subscribe()</refname> <refpurpose> Create a subscription to one or more topics. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "subscribe" method is used to create a new subscription to one or more topics. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>string</type><methodname>subscribe</methodname> <methodparam><type>string</type><parameter>targetTopic</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>targetTopic</parameter></term> <listitem> <para> The identity of the topic (topic://topicname) to subscribe to. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> A subscription identifier that can be used in a subsequent receive call as a selector to obtain any topic data or &false; if an error occurred. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Subscribe to a single topic</title> <programlisting role="php"> <![CDATA[ <?php $subid = $conn->subscribe('topic://A'); if (!$subid) { // The subscribe failed! echo "Subscribe failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Connection-unsubscribe.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Connection-unsubscribe.xml +++ phpdoc/en/reference/sam/functions/SAM-Connection-unsubscribe.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Connection-unsubscribe'> <refnamediv> <refname>SAMConnection::unsubscribe()</refname> <refpurpose> Cancel a subscription to one or more topics. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "unsubscribe" method is used to delete an existing subscription to one or more topics. </para> <classsynopsis> <ooclass><classname>SAMConnection</classname></ooclass> <methodsynopsis> <type>bool</type><methodname>unsubscribe</methodname> <methodparam><type>string</type><parameter>subscriptionId</parameter></methodparam> <methodparam choice='opt'><type>string</type><parameter>targetTopic</parameter></methodparam> </methodsynopsis> </classsynopsis> <para> Warning: This method is not currently implemented. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>subscriptionId</parameter></term> <listitem> <para> The identifier of an existing subscription as returned by a call to the subscribe method. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>targetTopic</parameter></term> <listitem> <para> An optional topic identifier of the topic for which the subscription is to be cancelled. If this value is not specified the subscription will be cancelled for all topics currently subscribed to. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This method returns &false; if an error occurs. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Unsubscribe from a single topic</title> <programlisting role="php"> <![CDATA[ <?php if (!$conn->unsubscribe($subid, 'topic://A')) { // The unsubscribe failed! echo "Unsubscribe failed ($conn->errno) $conn->error"; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Message-body.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Message-body.xml +++ phpdoc/en/reference/sam/functions/SAM-Message-body.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Message-body'> <refnamediv> <refname>SAMMessage::body</refname> <refpurpose> The body of the message. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "body" property contains the actual body of the message. It may not always be set. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Setting a text string into the body of a message</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage(); $msg->body = 'This is a simple message'; ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Message-constructor.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Message-constructor.xml +++ phpdoc/en/reference/sam/functions/SAM-Message-constructor.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Message-constructor'> <refnamediv> <refname>SAMMessage::SAMMessage()</refname> <refpurpose> Creates a new Message object </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <classsynopsis> <ooclass><classname>SAMMessage</classname></ooclass> <constructorsynopsis> <methodname>SAMMessage</methodname> <methodparam choice='opt'><type>any</type><parameter>body</parameter></methodparam> </constructorsynopsis> </classsynopsis> <para> Creates a new <classname>SAMMessage</classname> object optionally specifying a message body. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>body</parameter></term> <listitem> <para> The optional body for the message. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Creating a message</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage(); ?> ]]> </programlisting> </example> </para> <para> <example> <title>Creating a message with a simple text payload</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a simple text message'); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sam/functions/SAM-Message-header.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/sam/functions/SAM-Message-header.xml +++ phpdoc/en/reference/sam/functions/SAM-Message-header.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id='function.SAM-Message-header'> <refnamediv> <refname>SAMMessage::header</refname> <refpurpose> The header properties of the message. </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> The "header" property is a container for any system or user properties that area associated with the message. Properties may be assigned by the sender of a message to control the way the messaging systems handles it or may be assigned by the messaging system itself to tell the recipient extra information about the message or the way in which it has been handled. </para> <para> Some properties are understood by SAM in which case constants have been defined for them. The majority of properties however are ignored by the SAM implementation and simply passed through to the underlying messaging systems allowing the application to use messaging specific property names or to define its own "user" properties. </para> <para> The SAM defined properties are as follows: <informaltable> <tgroup cols="2"> <thead> <row> <entry>Property name</entry> <entry>Possible values</entry> </row> </thead> <tbody> <row> <entry>SAM_REPLY_TO</entry> <entry> A string providing the identity of the queue on to which responses to this message should be posted. </entry> </row> <row> <entry>SAM_TYPE</entry> <entry> <para> An indication of the type of message to be sent. The value may be SAM_TEXT indicating the contents of the message body is a text string, or SAM_BYTES indicating the contents of the message body are some application defined format. </para> <para> The way in which this property is used may depend on the underlying messaging server. For instance a messaging server that supports the JMS (Java Message Service) specification may interpret this value and send messages of type "jms_text" and "jms_bytes". In addition, if the SAM_TYPE property is set to SAM_TEXT the data provided for the message body is expected to be a UTF8 encoded string. </para> </entry> </row> </tbody> </tgroup> </informaltable> </para> <para> When setting the values of properties it is often useful to give a hint as to the format in which the property should be delivered to the messaging system. By default property values are delivered as text and the following simple syntax may be used to set a value: </para> <para> <example> <title>Setting a text format property using the default syntax</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage(); $msg->header->myPropertyName = 'textData'; ?> ]]> </programlisting> </example> </para> <para> If it is desired to pass type information an alternative syntax may be used where the value and the type hint are passed in an associative array: </para> <para> <example> <title>Setting a text format property using a type hint</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage(); $msg->header->myPropertyName = ('textData', SAM_STRING); ?> ]]> </programlisting> </example> </para> <para> When passing a type hint the type entry should be one of the SAM defined constant values as defined by the following table: <informaltable> <tgroup cols="2"> <thead> <row> <entry>Constant</entry> <entry>Type description</entry> </row> </thead> <tbody> <row> <entry>SAM_BOOLEAN</entry> <entry> Any value passed will be interpreted as logical true or false. If the value cannot be interpreted as a PHP boolean value the value passed to the messaging system is undefined. </entry> </row> <row> <entry>SAM_BYTE</entry> <entry> An 8-bit signed integer value. SAM will attempt to convert the property value specified into a single byte value to pass to the messaging system. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the numeric value cannot be expressed as an 8-bit signed binary value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_DOUBLE</entry> <entry> A long floating point value. SAM will attempt to convert the property value specified into a floating point value with 15 digits of precision. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the passed value cannot be expressed as a 15 digit floating point value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_FLOAT</entry> <entry> A short floating point value. SAM will attempt to convert the property value specified into a floating point value with 7 digits of precision. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the passed value cannot be expressed as a 7 digit floating point value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_INT</entry> <entry> An 32-bit signed integer value. SAM will attempt to convert the property value specified into a 32-bit value to pass to the messaging system. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the numeric value cannot be expressed as an 32-bit signed binary value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_LONG</entry> <entry> An 64-bit signed integer value. SAM will attempt to convert the property value specified into a 64-bit value to pass to the messaging system. If a string value is passed an attempt will be made to interpret the string as a numeric value. If the numeric value cannot be expressed as an 64-bit signed binary value data may be lost in the conversion. </entry> </row> <row> <entry>SAM_STRING</entry> <entry> SAM will interpret the property value specified as a string and pass it to the messaging system accordingly. </entry> </row> </tbody> </tgroup> </informaltable> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Setting properties as the sender of a message</title> <programlisting role="php"> <![CDATA[ <?php $msg = new SAMMessage('This is a test message'); // defining SAM specific properties... $msg->header->SAM_REPLY_TO = 'queue://test/replyQueue'; // defining arbitrary properties... // // a default string property $msg->header->myStringProp1 = 'a string property'; // a string property with a type hint $msg->header->myStringProp2 = array('another string property', SAM_STRING); // a boolean property $msg->header->myBoolProp = array(FALSE, SAM_BOOL); // numeric format properties $msg->header->myIntProp = array(32768, SAM_INT); $msg->header->myLongProp = array(9876543, SAM_LONG); $msg->header->myByteProp1 = array(123, SAM_BYTE); $msg->header->myByteProp2 = array('12', SAM_BYTE); $msg->header->myFloatProp = array(3.141592, SAM_FLOAT); $msg->header->myDoubleProp = array(3.14159265358979, SAM_DOUBLE); ?> ]]> </programlisting> </example> </para> <para> <example> <title>Retreiving property values from a message</title> <programlisting role="php"> <![CDATA[ <?php // accessing an application specifc property $intProp = $msg->header->'MyIntProp'; // accessing a messaging system specific property $encoding = $msg->header->'JMS_IBM_Msgtype'; ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->