org.ogf.graap.wsag.wsrf
Class WsrfEngine

java.lang.Object
  extended by org.ogf.graap.wsag.wsrf.WsrfEngine

public class WsrfEngine
extends Object

The WSAGEngine provides access to all agreement factories configured for this engine. The available factories can be retrieved via the agreement factory home interface. The agreement factory home is retrieved by the getAgreementFactoryHome() method. Before the engine can be used it must be initialized. Engine initialization is triggered by the initializeEngine(String) method.

Author:
Oliver Waeldrich

Field Summary
static String WSAG4J_WSRF_ENGINE_FILE_NAME
          Allows to specify an alternate filename for the wsrf-engine configuration via the system properties.
 
Constructor Summary
WsrfEngine()
           
 
Method Summary
static ConfigurationType findWsrfConfiguration(String fileName)
           
static IAgreementFactoryHome getAgreementFactoryHome()
          Returns the agreement factory home
static String getGatewayURL()
           
static LoginContext getLoginContext()
          Returns the WSAG4J engine login context.
static WsagMessageContext getWsagMessageContext()
          Returns the message context for the current invocation (thread).
static WSRFEngineConfigurationType getWSRFConfiguration()
           
static void initializeEngine(String defaultGatewayURL)
          Initializes the WSAG4J Engine.
static boolean isAllowAnonymousAccess()
          Sets if anonymous access to the server is allowed.
static void setAllowAnonymousAccess(boolean allowAnonymousAccess)
          Sets if anonymous access to the server is allowed.
static void setLoginContext(LoginContext context)
          Sets the WSAG4J engine login context.
static void setWsagMessageContext(WsagMessageContext context)
          Sets the message context for the current invocation (thread).
static void shutdownEngine()
          Shutdown of the WSAG4J engine instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WSAG4J_WSRF_ENGINE_FILE_NAME

public static final String WSAG4J_WSRF_ENGINE_FILE_NAME
Allows to specify an alternate filename for the wsrf-engine configuration via the system properties.

See Also:
System.setProperty(String, String), Constant Field Values
Constructor Detail

WsrfEngine

public WsrfEngine()
Method Detail

getWsagMessageContext

public static WsagMessageContext getWsagMessageContext()
Returns the message context for the current invocation (thread).

Returns:
the message context

setWsagMessageContext

public static void setWsagMessageContext(WsagMessageContext context)
Sets the message context for the current invocation (thread).

Parameters:
context - the message context

initializeEngine

public static void initializeEngine(String defaultGatewayURL)
                             throws Exception
Initializes the WSAG4J Engine. During the initialization process the WSRF engine configuration (system configuration) is parsed and the referenced WSAG4J engine configurations (factory configurations) are loaded. The WSAG4J engine must be initialized before making any calls to the system. By default the WSRF engine configuration location is specified by the WsagConstants.WSAG4J_WSRF_ENGINE_CONFIG_FILE constant. This value can be overwritten by the system property "wsag4j.wsrf-engine.config.filename".

Parameters:
defaultGatewayURL - the default gateway URL
Throws:
Exception - indicates an error during engine initialization

shutdownEngine

public static void shutdownEngine()
                           throws Exception
Shutdown of the WSAG4J engine instance.

Throws:
Exception - indicates an error during engine shutdown

getWSRFConfiguration

public static WSRFEngineConfigurationType getWSRFConfiguration()
Returns:
the configuration

getGatewayURL

public static String getGatewayURL()
Returns:
the deploymentAddress

setLoginContext

public static void setLoginContext(LoginContext context)
Sets the WSAG4J engine login context. This login context is used to identify a WSAG4J server instance, e.g. action implementations can use this login context to sign outgoing messages.

Parameters:
context - the login context

getLoginContext

public static LoginContext getLoginContext()
Returns the WSAG4J engine login context. This login context is used to identify a WSAG4J server instance, e.g. action implementations can use this login context to sign outgoing messages.

Returns:
the login context

getAgreementFactoryHome

public static IAgreementFactoryHome getAgreementFactoryHome()
Returns the agreement factory home

Returns:
the agreement factory home

setAllowAnonymousAccess

public static void setAllowAnonymousAccess(boolean allowAnonymousAccess)
Sets if anonymous access to the server is allowed.

Parameters:
allowAnonymousAccess - the allowAnonymousAccess to set

isAllowAnonymousAccess

public static boolean isAllowAnonymousAccess()
Sets if anonymous access to the server is allowed.

Returns:
the allowAnonymousAccess

findWsrfConfiguration

public static ConfigurationType findWsrfConfiguration(String fileName)
                                               throws IOException
Parameters:
fileName - The file name of the requested XML configuration file.
Returns:
The XML configuration file as an XmlObject.
Throws:
IOException - the configuration file could not be read or a related error occurred


Copyright © 2008-2012. All Rights Reserved.