Net-AMQP

 view release on metacpan or  search on metacpan

spec/amqp0-10.xml  view on Meta::CPAN

      <implement role="client" handle="MUST" />
      <implement role="server" handle="MUST" />
    </control>

  </class>

  <!-- == Class: session ======================================================================= -->

  <class name="session" code="0x2" label="session controls">
    <doc>
      A session is a named interaction between two peers. Session names are chosen by the upper
      layers and may be used indefinitely. The model layer may associate long-lived or durable state
      with a given session name. The session layer provides transport of commands associated with
      this interaction.
    </doc>

    <doc>
      The controls defined within this class are specified in terms of the "sender" of commands and
      the "receiver" of commands. Since both client and server send and receive commands, the
      overall session dialog is symmetric, however the semantics of the session controls are defined
      in terms of a single sender/receiver pair, and it is assumed that the client and server will
      each contain both a sender and receiver implementation.
    </doc>

    <rule name="attachment">
      <doc>
        The transport MUST be attached in order to use any control other than "attach", "attached",
        "detach", or "detached". A peer receiving any other control on a detached transport MUST
        discard it and send a session.detached with the "not-attached" reason code.
      </doc>
    </rule>

    <role name="server" implement="MUST" />
    <role name="client" implement="MUST" />

    <role name="sender" implement="MUST">
      <doc>
        The sender of commands.
      </doc>
    </role>
    <role name="receiver" implement="MUST">
      <doc>
        The receiver of commands.
      </doc>
    </role>

    <domain name="name" type="vbin16" label="opaque session name">
      <doc>
        The session name uniquely identifies an interaction between two peers. It is scoped to a
        given authentication principal.
      </doc>
    </domain>

    <domain name="detach-code" type="uint8" label="reason for detach">
      <enum>
        <choice name="normal" value="0">
          <doc>
            The session was detached by request.
          </doc>
        </choice>
        <choice name="session-busy" value="1">
          <doc>
            The session is currently attached to another transport.
          </doc>
        </choice>
        <choice name="transport-busy" value="2">
          <doc>
            The transport is currently attached to another session.
          </doc>
        </choice>
        <choice name="not-attached" value="3">
          <doc>
            The transport is not currently attached to any session.
          </doc>
        </choice>
        <choice name="unknown-ids" value="4">
          <doc>
            Command data was received prior to any use of the command-point control.
          </doc>
        </choice>
      </enum>
    </domain>

    <domain name="commands" type="sequence-set" label="identifies a set of commands">
    </domain>

    <struct name="header" size="1" pack="1">
      <doc>
        The session header appears on commands after the class and command id, but prior to command
        arguments.
      </doc>

      <field name="sync" type="bit" label="request notification of completion">
        <doc>
          Request notification of completion for this command.
        </doc>
      </field>
    </struct>

    <struct name="command-fragment" size="0" pack="0" label="byte-ranges within a set of commands">

      <field name="command-id" type="sequence-no" required="true">

      </field>
      <field name="byte-ranges" type="byte-ranges" required="true">

      </field>
    </struct>

    <domain name="command-fragments" type="array" label="an array of values of type
      command-fragment"/>

    <control name="attach" code="0x1" label="attach to the named session">
      <doc>
        Requests that the current transport be attached to the named session. Success or failure
        will be indicated with an attached or detached response. This control is idempotent.
      </doc>

      <rule name="one-transport-per-session">
        <doc>
          A session MUST NOT be attached to more than one transport at a time.
        </doc>
      </rule>

      <rule name="one-session-per-transport">
        <doc>
          A transport MUST NOT be attached to more than one session at a time.
        </doc>
      </rule>

      <rule name="idempotence">
        <doc>
          Attaching a session to its current transport MUST succeed and result in an attached
          response.
        </doc>
      </rule>

      <rule name="scoping">
        <doc>
          Attachment to the same session name from distinct authentication principals MUST succeed.
        </doc>
      </rule>

      <implement role="server" handle="MUST" />
      <implement role="client" handle="MAY" />

      <response name="attached"/>
      <response name="detached"/>

      <field name="name" type="name" label="the session name" required="true">
        <doc>
          Identifies the session to be attached to the current transport.
        </doc>
      </field>

      <field name="force" type="bit" label="force attachment to a busy session">
        <doc>
          If set then a busy session will be forcibly detached from its other transport and
          reattached to the current transport.
        </doc>
      </field>
    </control>

    <control name="attached" code="0x2" label="confirm attachment to the named session">
      <doc>
        Confirms successful attachment of the transport to the named session.
      </doc>

      <implement role="server" handle="MUST" />
      <implement role="client" handle="MUST" />

      <field name="name" type="name" label="the session name" required="true">
        <doc>
          Identifies the session now attached to the current transport.
        </doc>
      </field>
    </control>

    <control name="detach" code="0x3" label="detach from the named session">
      <doc>
        Detaches the current transport from the named session.
      </doc>

      <implement role="server" handle="MUST" />
      <implement role="client" handle="MUST" />

      <response name="detached"/>

      <field name="name" type="name" label="the session name" required="true">
        <doc>
          Identifies the session to detach.
        </doc>
      </field>
    </control>

    <control name="detached" code="0x4" label="confirm detachment from the named session">
      <doc>
        Confirms detachment of the current transport from the named session.
      </doc>

      <implement role="server" handle="MUST" />
      <implement role="client" handle="MUST" />

      <field name="name" type="name" label="the session name" required="true">
        <doc>
          Identifies the detached session.
        </doc>
      </field>
      <field name="code" type="detach-code" label="the reason for detach" required="true">
        <doc>
          Identifies the reason for detaching from the named session.
        </doc>
      </field>
    </control>

    <!--
        Execution state is the set of confirmed, and completed incoming commands, as well as the set
        of outgoing in-doubt commands held for replay.



( run in 3.304 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )