CONTENTS
[ Back ] [ Next ]
Click Here to visit the home page belonging to
the creator of DCP and get access to other downloads, including a
white paper on forward compatible
design for the Internet.
| |
SESSION MANAGEMENT
DCP makes use of special request header fields and
response
status codes for managing sessions. Sessions may be managed explicitly and
implicitly, friendly and unfriendly, and as an initiator or as a target.
The semantics for the various methods of opening and closing sessions follow.
Opening Sessions
Explicit Open:
-
Either party makes a request against the other.
The request must carry the Session message header with a
value of "Open" and, optionally, the Session-ID message
header with a valid uniqueId.
-
The target responds with a 200 OK
or 201 OK, Pending status code followed by
the Session-ID message
header.
-
If the request had a valid uniqueId,
then the target must assign the same uniqueId
to the Session-ID message
header and process the transaction.
-
If there was not a valid uniqueId
present, then the Target must assign one and process the transaction. The
target may associate the transaction with an already active session.
-
If the request had a valid uniqueId
that corresponds to an active session between the two resources
then the target must associate the request with the session (rather than
opening a new session) and process the transaction.
Note: If for any reason the target wishes to refrain from
processing the transaction because of the uniqueId
identified by the Session-ID message
header in the request or due to an inability to open a session, the 402 Session Error
response status code should be used.
Implicit Open:
-
Either party initiates a request against the other which
does not include Session message header.
-
The target responds with a 200 OK
or 201 OK, Pending status code followed by
the Session-ID message
header.
-
If the request did not include a valid uniqueId,
then the
target must create a session, assign a uniqueId
to the Session-ID message
header and processes the
transaction. The target may associate the transaction with an
already active session.
-
If the request included a valid uniqueId
that does not correspond to an active session, then the target must
create a session, assign the unrecognized uniqueId
to the Session-ID message
header and process the transaction.
-
If the request included a valid uniqueId
that corresponds to an active session, then the
target must associate the request with the session (rather than opening a
new session) and process the transaction.
Note: If for any reason the target wishes to refrain from
processing the transaction because of the uniqueId
identified by the Session-ID message
header in the request or due to an inability to open a session, the 402 Session Error
response status code should be used.
Closing Sessions
Friendly Close as a Target:
Note: There is not a friendly method for closing a session
as a target. However, after the target completes a transaction, it may
generate a request against the other party and close the session in a
friendly manner as an initiator.
Unfriendly Close as a Target:
-
The target processes a transaction and responds to a request with
the 203 Release status
code followed by the Session-ID message
header with corresponding uniqueId.
Note: The target may assume that unfriendly closes are
acceptable etiquette in the following situations:
-
The initiator should consider that the session is closed
after the transaction is complete.
Session Etiquette
Initiator Guidelines (these are not requirements):
-
For saving target resources:
-
For cooperating with the target:
-
When a response includes a 203
Release status code, the initiator should treat the session as
closed.
-
When a response includes a 202 Keep-Alive
status code as a result of a friendly initiator close, the initiator
should keep the session open.
-
For being friendly:
-
For being straight-forward:
Target Guidelines (these are not requirements):
-
For saving initiator resources:
-
For cooperating with the initiator:
-
When requests include the Session message header
with a value of "Open", the target should assume that the
initiator wishes to keep the session open after the transaction.
-
When requests include the Session message header
with a value of "Close" or "Closing", the target should assume that the
initiator wishes to close the session after the transaction.
-
For being friendly:
-
For being straight-forward:
|
|