org.aselect.server.request.handler.aselect.authentication
Class RequestParser

java.lang.Object
  extended by org.aselect.server.request.handler.aselect.authentication.RequestParser

public class RequestParser
extends java.lang.Object

The RequestParser determines the type, origin, and protocol of any request arriving at the A-Select Server. The A-Select Server routes the request through its request handlers based on the classification made by the RequestParser. Therefore, this class must be able to recognize all types of incoming requests and classify them correctly.
Use the parseRequest() method to parse an incoming request. After that, use the getX() methods to determine the type of the request.

Author:
Alfa & Ariss

Field Summary
static int ORIGIN_APPLICATION
          Request originated from an application (or the Agent)
static int ORIGIN_ASELECTSERVER
          Request originated from another A-Select Server (cross)
static int ORIGIN_AUTHSP
          Request originated from an AuthSP (or application acting as an AuthSP)
static int ORIGIN_UNKNOWN
          Unknown origin
static int ORIGIN_USER
          Request originated directly from the user, or is a redirect from the application to the logout page
static int PROTOCOL_CGI
          CGI protocol
static int PROTOCOL_SOAP11
          Soap 1.1 Protocol
static int PROTOCOL_SOAP12
          Soap 1.2 Protocol
static int PROTOCOL_UNKNOWN
          Unknown protocol
static int REQTYPE_API_CALL
          API call (server to server communication)
static int REQTYPE_BROWSER
          Request via browser (client to server communication)
static int REQTYPE_UNKNOWN
          Unknown request type
 
Constructor Summary
RequestParser(javax.servlet.http.HttpServletRequest request)
          Constructor.
 
Method Summary
 java.lang.String getRequest()
          Retrieve the value of the request parameter.
 int getRequestOrigin()
          Retrieve the origin of the request (one of ORIGIN_xxx).
 int getRequestProtocol()
          Retrieve protocol used to send the request (one of PROTOCOL_xxx).
 int getRequestType()
          Retrieve the request type (one of REQTYPE_xxx).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQTYPE_UNKNOWN

public static final int REQTYPE_UNKNOWN
Unknown request type

See Also:
Constant Field Values

REQTYPE_API_CALL

public static final int REQTYPE_API_CALL
API call (server to server communication)

See Also:
Constant Field Values

REQTYPE_BROWSER

public static final int REQTYPE_BROWSER
Request via browser (client to server communication)

See Also:
Constant Field Values

ORIGIN_UNKNOWN

public static final int ORIGIN_UNKNOWN
Unknown origin

See Also:
Constant Field Values

ORIGIN_APPLICATION

public static final int ORIGIN_APPLICATION
Request originated from an application (or the Agent)

See Also:
Constant Field Values

ORIGIN_AUTHSP

public static final int ORIGIN_AUTHSP
Request originated from an AuthSP (or application acting as an AuthSP)

See Also:
Constant Field Values

ORIGIN_ASELECTSERVER

public static final int ORIGIN_ASELECTSERVER
Request originated from another A-Select Server (cross)

See Also:
Constant Field Values

ORIGIN_USER

public static final int ORIGIN_USER
Request originated directly from the user, or is a redirect from the application to the logout page

See Also:
Constant Field Values

PROTOCOL_UNKNOWN

public static final int PROTOCOL_UNKNOWN
Unknown protocol

See Also:
Constant Field Values

PROTOCOL_CGI

public static final int PROTOCOL_CGI
CGI protocol

See Also:
Constant Field Values

PROTOCOL_SOAP11

public static final int PROTOCOL_SOAP11
Soap 1.1 Protocol

See Also:
Constant Field Values

PROTOCOL_SOAP12

public static final int PROTOCOL_SOAP12
Soap 1.2 Protocol

See Also:
Constant Field Values
Constructor Detail

RequestParser

public RequestParser(javax.servlet.http.HttpServletRequest request)
Constructor.

Description:
Constructs a RequestParser object from a HttpServletRequest object.

Parameters:
request -
Method Detail

getRequestType

public int getRequestType()
Retrieve the request type (one of REQTYPE_xxx).

Returns:
the request type (REQTYPE_xxx).

getRequestOrigin

public int getRequestOrigin()
Retrieve the origin of the request (one of ORIGIN_xxx).

Returns:
the request origin (ORIGIN_xxx).

getRequestProtocol

public int getRequestProtocol()
Retrieve protocol used to send the request (one of PROTOCOL_xxx).

Returns:
the request protocol (PROTOCOL_xxx).

getRequest

public java.lang.String getRequest()
Retrieve the value of the request parameter. If the request parameter is not present, an empty string (not null!) is returned.

Returns:
The value of the request parameter as a String


Copyright © 2008 SURFnet BV. All Rights Reserved.