com.softwareag.tamino.db.api.invocation.http
Class THTTPAuthorization

java.lang.Object
  extended by com.softwareag.tamino.db.api.invocation.http.THTTPAuthorization

public class THTTPAuthorization
extends java.lang.Object

THTTPAuthorization provides authorization methods for Http. The prerequesite for the authorization is that the client provides a concrete URLConnection as well as the userdId, password and the requested authorization scheme. If no authorization scheme is provided BASIC scheme with a Base64 encoding is chosen as the default.

Version:
$Revision: 1.16 $
Author:
Marcus Schreyer

Field Summary
static java.lang.String BASIC_SCHEME
          The constant that represents the BASIC scheme.
static java.lang.String DIGEST_SCHEME
          The constant that represents the DIGEST scheme.
 
Constructor Summary
THTTPAuthorization()
          Initializes the authorization.
 
Method Summary
 com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.lang.String scheme, java.net.URLConnection connection, SecurityToken token)
           
 com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.lang.String scheme, java.net.URLConnection requestConnection, java.lang.String userId, java.lang.String password)
          Authorizes the given connection with the given scheme .
 com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.lang.String scheme, java.net.URLConnection requestConnection, java.lang.String domain, java.lang.String userId, java.lang.String password)
          Authorizes the given connection with the given scheme .
 com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.net.URLConnection requestConnection, java.lang.String userId, java.lang.String password)
          Authorizes the given connection with the default scheme which happens to be BASIC.
 com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.net.URLConnection requestConnection, java.lang.String domain, java.lang.String userId, java.lang.String password)
          Authorizes the given connection with the default scheme which happens to be BASIC.
static THTTPAuthorization getInstance()
          Gets the singletion instance.
 void registerEncodingStrategy(java.lang.String scheme, TEncodingStrategy encodingStrategy)
           
 boolean supportsScheme(java.lang.String scheme)
          Indicates if the given scheme is supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASIC_SCHEME

public static final java.lang.String BASIC_SCHEME
The constant that represents the BASIC scheme.

See Also:
Constant Field Values

DIGEST_SCHEME

public static final java.lang.String DIGEST_SCHEME
The constant that represents the DIGEST scheme.

See Also:
Constant Field Values
Constructor Detail

THTTPAuthorization

public THTTPAuthorization()
Initializes the authorization.

Method Detail

getInstance

public static THTTPAuthorization getInstance()
Gets the singletion instance.

Returns:
the THTTPAuthorization singleton instance.

authorize

public com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.net.URLConnection requestConnection,
                                                                                       java.lang.String userId,
                                                                                       java.lang.String password)
Authorizes the given connection with the default scheme which happens to be BASIC. As the result a THTTPAuthorizationStatus instance is given back. This contains the used userId, password and scheme.

Parameters:
requestConnection - is the URLConnection that is supposed to be used for the request.
userId - for the authorization.
password - for the authorization.
Returns:
THTTPAuthorizationStatus indicating the status for the authorization once the request is submitted.

authorize

public com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.net.URLConnection requestConnection,
                                                                                       java.lang.String domain,
                                                                                       java.lang.String userId,
                                                                                       java.lang.String password)
Authorizes the given connection with the default scheme which happens to be BASIC. As the result a THTTPAuthorizationStatus instance is given back. This contains the used userId, password and scheme.

Parameters:
requestConnection - is the URLConnection that is supposed to be used for the request.
domain - for the authorization.
userId - for the authorization.
password - for the authorization.
Returns:
THTTPAuthorizationStatus indicating the status for the authorization once the request is submitted.

authorize

public com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.lang.String scheme,
                                                                                       java.net.URLConnection requestConnection,
                                                                                       java.lang.String userId,
                                                                                       java.lang.String password)
Authorizes the given connection with the given scheme . As the result a THTTPAuthorizationStatus instance is given back. This contains the used userId, password and scheme.

Parameters:
scheme - is the authorization scheme that has to be used.
requestConnection - is the URLConnection that is supposed to be used for the request.
userId - for the authorization.
password - for the authorization.
Returns:
THTTPAuthorizationStatus indicating the status for the authorization once the request is submitted.

authorize

public com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.lang.String scheme,
                                                                                       java.net.URLConnection requestConnection,
                                                                                       java.lang.String domain,
                                                                                       java.lang.String userId,
                                                                                       java.lang.String password)
Authorizes the given connection with the given scheme . As the result a THTTPAuthorizationStatus instance is given back. This contains the used userId, password and scheme.

Parameters:
scheme - is the authorization scheme that has to be used.
requestConnection - is the URLConnection that is supposed to be used for the request.
domain - for the authorization.
userId - for the authorization.
password - for the authorization.
Returns:
THTTPAuthorizationStatus indicating the status for the authorization once the request is submitted.

authorize

public com.softwareag.tamino.db.api.invocation.http.THTTPAuthorizationResult authorize(java.lang.String scheme,
                                                                                       java.net.URLConnection connection,
                                                                                       SecurityToken token)

supportsScheme

public boolean supportsScheme(java.lang.String scheme)
Indicates if the given scheme is supported.

Parameters:
scheme - for which should be indicated if it was supported.
Returns:
true if the scheme is supported, false otherwise.

registerEncodingStrategy

public void registerEncodingStrategy(java.lang.String scheme,
                                     TEncodingStrategy encodingStrategy)


Copyright (c) 2013 Software AG. All Rights Reserved.