com.sap.netweaver.bc.uwl

Interface IUWLService


public interface IUWLService

IUWLService is the public interface for accessing other interfaces like IUWLConfigurationManager, IUWLItemManager, IUWLAdmin, IUWLViewManager.

IUWLService is a portal service and is accessible by calling PortalRuntime api. IUWLService uwlService=(IUWLService)PortalRuntime.getRuntimeResources().getService(IUWLService.ALIAS_KEY); Alternatively JNDI look up can also be done for the key IUWLService.ALIAS_KEY to get a handle to UWL service.

In order to provide security for the operations, concept of session is used. A client should have a valid logged in user and it has to pass this information through UWLContext to create a UWL session with beginSession() method. A client can end the session with UWL by calling endSession()method. If the session is kept idle for timeout specified in the beginSession() method, session is invalidated.

Typically in a portal environment where different application parts access, UWL they could share the same user's UWL session by accessing a HTTPSession or WebDynpro Session scope variable by name IUWLSession.UWL_SESSION_ID. If UWL UI creates a UWL session for the user, it stores session id which is a String in the HttpSession (for HTMLB clients) or in WebDynpro Session Scope.

It is recommended for the creator of the session to end the Session when user logs out or when user's browser session is invalidated because it is idle for a long time. For a sample code about how Session could be handled refer to IUWLSession

Other components can register plug-ins thro register API variants. The method registerProviderConnector registers an item producer component with UWL. This producer component can then push Items to UWL using IPushChannel interface or support retrieving of items through IProviderConnector interface.

See Also:
UWLContext, IUWLConfigurationManager, IUWLItemManager, IUWLAdmin, IPushChannel, IProviderConnector

Field Summary
static String ALIAS_KEY
          KEY with which UWL Service is registered in the Portal service registry.
 
Method Summary
 IUWLSession beginSession(UWLContext context, int idleTimeOutInSeconds)
          This begins the session with UWL service.
 boolean displaySupportInfo()
          Only for internal usage.
 void endSession(UWLContext context)
          This closes the session with UWL.
 IUWLAdmin getAdmin(UWLContext ctx)
          Obtains the UWL admin.
 IUWLConfigurationManager getConfigurationManager(UWLContext ctx)
          Obtains the UWL Configuration Manager.
 IUWLItemManager getItemManager(UWLContext ctx)
          Obtains the UWL Item Manager.
 IPropertiesManager getPropertiesManager()
          Only for internal usage.
 IPushChannel getPushChannel()
          Returns the push channel that could be used for the Provider to do operations on UWL like sending items, deleting items etc.
 IProviderConnector[] getRegisteredProviderConnectors()
          Returns all the Provider Connectors registered with UWL during runtime.
 IProviderConnector getRegisterProviderConnector(String id)
           
 IUWLSession getSession(String sessionId)
          Returns the session if it is valid.
 IUWLSubstitutionManager getSubstitutionManager(UWLContext ctx)
          Only for internal usage.
 IUWLSession getUwlSessionForWebDynproClient(UWLContext context)
          This method creates a UWL Client exclusively for WebDynpro clients with a timeout value of idle time=10 minutes.
 IUWLViewManager getViewManager(UWLContext ctx)
          Obtains the UWL view manager.
 boolean isTestMode()
          Only for internal usage.
 void registerAttachmentConnector(String ID, IAttachmentConnector ac)
          Registration of Custom Attachment Connector.
 void registerAttributeConnector(String ID, IAttributeAccessConnector ac)
          Registraton of Custom Attribute retrieval interface.
 void registerEventResolutionService(IEventResolutionServiceAdaptor service)
          Register the Event Resolution Service.
 void registerProviderConnector(IProviderConnector pc)
          This method registers the given provider connector with UWL service.
 void registerProviderSubstitutionManager(IProviderSubstitutionManager psm)
          This method registers the substitution manager of a given provider with UWL service.
 

Field Detail

ALIAS_KEY

public static final String ALIAS_KEY
KEY with which UWL Service is registered in the Portal service registry.

See Also:
Constant Field Values
Method Detail

beginSession

public IUWLSession beginSession(UWLContext context,
                                int idleTimeOutInSeconds)
                         throws UWLException
This begins the session with UWL service. Before using UWL Service, a session has to be created with the UWL.

Parameters:
context - the UWL context containing User information. Do note that this has to be the current logged in user for security purposes. The user so passed is validated against SAP J2EE Engine and User Management authentications. In case of authentication failures, exception is thrown.
idleTimeOutInSeconds - indicates when this session expires if kept idle. A value of -1 will keep session alive until endSession is explicitly called. Do note that if -1 is specified and endSession is never called it creates memory leakage.
Returns:
IUWLSession. This could be stored in HTTPSession and reused for further calls to UWL.
Throws:
UWLException - in case of security breach or initialzation failures.

getSession

public IUWLSession getSession(String sessionId)
Returns the session if it is valid.

Parameters:
sessionId - not null
Returns:
null if session not found or invalid.

endSession

public void endSession(UWLContext context)
                throws UWLException
This closes the session with UWL. This method has be explicitly called if timeout specified for the session is -1.

Parameters:
context - the UWL context.
Throws:
UWLException

getConfigurationManager

public IUWLConfigurationManager getConfigurationManager(UWLContext ctx)
                                                 throws UWLException
Obtains the UWL Configuration Manager.

Parameters:
ctx - the UWL context.
Returns:
IUWLConfigurationManager
Throws:
UWLException

getItemManager

public IUWLItemManager getItemManager(UWLContext ctx)
                               throws UWLException
Obtains the UWL Item Manager.

Parameters:
ctx - the UWL context.
Returns:
IUWLItemManager
Throws:
UWLException

getAdmin

public IUWLAdmin getAdmin(UWLContext ctx)
                   throws UWLException
Obtains the UWL admin. This Admin interface can be used for cache administration. This is for internal usage only.

Parameters:
ctx - the UWL context.
Returns:
IUWLAdmin
Throws:
UWLException

getViewManager

public IUWLViewManager getViewManager(UWLContext ctx)
                               throws UWLException
Obtains the UWL view manager.

Parameters:
ctx - the UWL context.
Returns:
IUWLViewManager
Throws:
UWLException

getPushChannel

public IPushChannel getPushChannel()
                            throws UWLException
Returns the push channel that could be used for the Provider to do operations on UWL like sending items, deleting items etc.

Returns:
IPushChannel
Throws:
UWLException

registerProviderConnector

public void registerProviderConnector(IProviderConnector pc)
                               throws UWLException
This method registers the given provider connector with UWL service. Without registering the connector, items are not retrieved form that Provider system. Custom implementations of Provider Connector must use use method to inform UWL about them.

Parameters:
pc - the provider connector.
Throws:
UWLException

registerAttributeConnector

public void registerAttributeConnector(String ID,
                                       IAttributeAccessConnector ac)
                                throws UWLException
Registraton of Custom Attribute retrieval interface.

Parameters:
ID - needed, not null
ac - the attribute access connector.
Throws:
UWLException

registerAttachmentConnector

public void registerAttachmentConnector(String ID,
                                        IAttachmentConnector ac)
                                 throws UWLException
Registration of Custom Attachment Connector.

Parameters:
ID - needed, not null
ac - the attachment connector.
Throws:
UWLException

isTestMode

public boolean isTestMode()
Only for internal usage. Always returns false.

Returns:
boolean indicating whether or not the service is in test mode.

displaySupportInfo

public boolean displaySupportInfo()
Only for internal usage. Always returns false.

Returns:
boolean to indicate if the support information page should be displayed or not.

getSubstitutionManager

public IUWLSubstitutionManager getSubstitutionManager(UWLContext ctx)
                                               throws UWLException
Only for internal usage.

Parameters:
ctx -
Returns:
Substitution administration interface.
Throws:
UWLException

registerProviderSubstitutionManager

public void registerProviderSubstitutionManager(IProviderSubstitutionManager psm)
                                         throws UWLException
This method registers the substitution manager of a given provider with UWL service.

Parameters:
psm - the provider substitution manager
Throws:
UWLException

getPropertiesManager

public IPropertiesManager getPropertiesManager()
Only for internal usage.

Returns:
returns the interface for managing UWL properties.

registerEventResolutionService

public void registerEventResolutionService(IEventResolutionServiceAdaptor service)
Register the Event Resolution Service. Called by the Event resolution framework. This is only for internal usage.


getRegisteredProviderConnectors

public IProviderConnector[] getRegisteredProviderConnectors()
Returns all the Provider Connectors registered with UWL during runtime.

Returns:
array of registered connectors.

getRegisterProviderConnector

public IProviderConnector getRegisterProviderConnector(String id)
Parameters:
id - of the Provider Connector to retrieve
Returns:
registered Porvider Connector for a given id

getUwlSessionForWebDynproClient

public IUWLSession getUwlSessionForWebDynproClient(UWLContext context)
                                            throws UWLException
This method creates a UWL Client exclusively for WebDynpro clients with a timeout value of idle time=10 minutes. This also sets the session id in the WebDynpro Client session scope under variable name denoted by the constant IUWLSession.UWL_SESSION_ID. Calling this method also implies, UWL Service takes care of WebDynpro session invalidation handling.

Parameters:
context - required, should have valid authenticated user set
Returns:
not null UWL Session
Throws:
UWLException - if caller is not a WebDynpro client
See Also:
beginSession


Copyright 2006 SAP AG Complete Copyright Notice