Skip Headers
Oracle® Communications Services Gatekeeper RESTful Application Developer's Guide
Release 5.0

Part Number E16621-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

14 Session Manager

This chapter describes the operations in the Session Manager interface of the RESTful Web Services provided in Oracle Communications Services Gatekeeper.

About the Session Manager Service

Applications use the RESTful Session Manager interface to access the Session Manager Web Service to get a unique session ID. Each application then add this session ID to the header of all its requests. Services Gatekeeper uses this value to keep track of all the traffic that an application sends for the duration of the session, and to destroy a session.

The GeneralException error will be thrown when any operation in the RESTful Session Manager interface fails.

REST Service Descriptions Available at Run-time

When the Administration Server for your Services Gatekeeper domain is in the running state, the REST service descriptions of these operations can be found at

http://host:port/rest/session_manager/index.html

where host and port are the host name and port of the machine on which Services Gatekeeper is installed.


Get Session

The Get Session operation creates a session with an ID.

If the Get Session operation is successful, the response body will contain the session ID. This string value is used by the application in the X-Session-ID header of all subsequent traffic requests.

Authorization

Basic

HTTP Method

POST

URI

http://host:port/rest/session_manager/sessions

where host and port are the host name and port of the machine on which Services Gatekeeper is installed.

Request Header

The MIME-type for the Content-Type header field is application/json.

Request Body

There is no request body.

Response Header

Standard header fields. If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Errors and Exceptions".

Response Body

The response body is a JSON object containing the getSession Return attribute whose value is the session Id, returned as a string.

{"getSessionReturn":"String"}

Get Session Remaining Lifetime

The Get Session Remaining Lifetime operation retrieves the time remaining in this session, in milliseconds.

The Request-URI for the GET method contains the session ID.

If the Get Session Remaining Lifetime operation is successful, the response body will contain the time remaining in this session, in milliseconds.

Authorization

Basic

HTTP Method

GET

URI

http://host:port/rest/session_manager/session/${sessionId}

where:

Request Header

The MIME-type for the Content-Type header field is application/json.

Request Body

There is no request body.

Response Header

Standard header fields. If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Errors and Exceptions".

Response Body

The response body is a JSON object containing the getSessionRemainingLifeTimeReturn attribute whose value is an integer representing the time remaining in this session, in milliseconds.

{"getSessionRemainingLifeTimeReturn":"Integer"}

Destroy Session

The Destroy Session operation destroys this session.

To do so, provide the appropriate session Id in the Request-URI for this operation. This identifier should have been obtained by the initial setup for this session.

There is no request or response body for Destroy Session. If the request fails, the body of the error response will contain the call identifier and the type of exception.

Authorization

Basic

HTTP Method

DELETE

URI

http://host:port/rest/session_manager/session/${sessionId}

where:

Request Header

The MIME-type for the Content-Type header field is application/json.

Request Body

There is no request body.

Response Body

The response body is a JSON object containing the destroySessionReturn attribute whose value is a boolean.

{"destroySessionReturn":"Boolean"}

If the value for destroySessionReturn is true, the session was destroyed.