deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.portal.wac
Class WAClient

java.lang.Object
  extended by org.deegree.portal.wac.WAClient

public class WAClient
extends java.lang.Object

The class offers methods to enable a using program/class to act as a client to a Web Security Service (WSS) as specified in GDI-NRW. This implementation just supports authentication through sessionIDs and user/password. If other authentication mechanisms are needed this class should be extended by defining additional performDoService methods.

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Andreas Poth , last edited by: $Author: mschneider $

Constructor Summary
WAClient(java.lang.String host, java.lang.String path)
          The constructor assumes that the the certificate to be used is set by starting the java VM using -Djavax.net.ssl.trustStore parameter.
WAClient(java.lang.String host, java.lang.String path, int port)
          The constructor assumes that the the certificate to be used is set by starting the java VM using -Djavax.net.ssl.trustStore parameter.
WAClient(java.lang.String host, java.lang.String path, int port, java.lang.String trustStore)
           
 
Method Summary
 java.lang.String getContentType()
          returns the name of the content type of the result to the last performed request
 org.w3c.dom.Document performCloseSession(java.lang.String sessionID)
          closes a Session by sending a CloseSession request against the WSS that is assigned to a client.
 java.io.InputStream performDoService(java.lang.String request, java.lang.String sessionID)
          performs a DoService request against the WSS that is assigned to a client.
 java.io.InputStream performDoService(java.lang.String request, java.lang.String user, java.lang.String password)
          performs a DoService request against the WSS that is assigned to a client.
 org.w3c.dom.Document performGetCapabilities()
          performs a GetCapabilities request against the WSS that is assigned to a client
 java.lang.String performGetSession(java.lang.String user, java.lang.String password)
          performs a GetSession request against the WSS that is assigned to a client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WAClient

public WAClient(java.lang.String host,
                java.lang.String path)
The constructor assumes that the the certificate to be used is set by starting the java VM using -Djavax.net.ssl.trustStore parameter. The port to be used is set to SSL standard 443

Parameters:
host -
path -

WAClient

public WAClient(java.lang.String host,
                java.lang.String path,
                int port)
The constructor assumes that the the certificate to be used is set by starting the java VM using -Djavax.net.ssl.trustStore parameter.

Parameters:
host -
path -
port -

WAClient

public WAClient(java.lang.String host,
                java.lang.String path,
                int port,
                java.lang.String trustStore)
Parameters:
host -
path -
port -
trustStore -
Method Detail

getContentType

public java.lang.String getContentType()
returns the name of the content type of the result to the last performed request

Returns:
name of the content type

performGetCapabilities

public org.w3c.dom.Document performGetCapabilities()
                                            throws WACException
performs a GetCapabilities request against the WSS that is assigned to a client

Returns:
Capabilities document if request was successful otherwise an exception document will be returned
Throws:
WACException

performGetSession

public java.lang.String performGetSession(java.lang.String user,
                                          java.lang.String password)
                                   throws WACException
performs a GetSession request against the WSS that is assigned to a client. The method assumed that user/password (urn:x-gdi-nrw:authnMethod:1.0:password) is used for authentication

Parameters:
user - name of the user who like to get a session
password - password of the user
Returns:
GetSession result string if request was successful, otherwise ?
Throws:
WACException

performCloseSession

public org.w3c.dom.Document performCloseSession(java.lang.String sessionID)
                                         throws WACException
closes a Session by sending a CloseSession request against the WSS that is assigned to a client. If the passed sessionID is not valid an WSS exception document will be returned instead of the success message/answer.

Parameters:
sessionID -
Returns:
document that indicates that session has been closed otherwise an exception document will be returned
Throws:
WACException

performDoService

public java.io.InputStream performDoService(java.lang.String request,
                                            java.lang.String user,
                                            java.lang.String password)
                                     throws WACException
performs a DoService request against the WSS that is assigned to a client. According to the WSS specification the request will be send using HTTP POST.
The method uses a user/password authentification

Parameters:
request - request to perform
user - name of the user who like to get a session
password - password of the user
Returns:
result of the passed request. the type depends on target service and request
Throws:
WACException
See Also:
performDoService(String, String)

performDoService

public java.io.InputStream performDoService(java.lang.String request,
                                            java.lang.String sessionID)
                                     throws WACException
performs a DoService request against the WSS that is assigned to a client. According to the WSS specification the request will be send using HTTP POST.
The method uses an authentification through a sessionID

Parameters:
request - request to perform
sessionID - id to authentificate a user
Returns:
result of the passed request. the type depends on target service and request
Throws:
WACException
See Also:
performDoService(String, String, String)

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org