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

Nested Class Summary
static class IUWLService.Mode
          UWL can be set up to run in MYSAP or A1S or COMBINED or TEST modes.
 
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 bindUwlSessionToHttpSession(UWLContext uwlContext)
          Only for internal usage!
 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.
 IUWLService.Mode getMode()
          UWL can be set up to run in MYSAP or A1S or COMBINED or TEST modes.
 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.
 void unRegisterProviderConnector(IProviderConnector connector)
          This method unregisters the given provider connector from the UWL service.
 void unRegisterProviderConnector(String providerId)
          This method unregisters the given provider connector from the UWL service.
 

Field Detail

ALIAS_KEY

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

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

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

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

endSession

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

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

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

getItemManager

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

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

getAdmin

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

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

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

getPushChannel

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

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

getRegisterProviderConnector

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

registerAttributeConnector

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

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

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

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

displaySupportInfo

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

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

getSubstitutionManager

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

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

registerProviderSubstitutionManager

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

IPropertiesManager getPropertiesManager()
Only for internal usage.

Returns:
returns the interface for managing UWL properties.

registerEventResolutionService

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


getRegisteredProviderConnectors

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

Returns:
array of registered connectors.

unRegisterProviderConnector

void unRegisterProviderConnector(IProviderConnector connector)
This method unregisters the given provider connector from the UWL service. When you unregister the connector, items are not retrieved form that Provider system.

Parameters:
connector - The interface of the Provider system.

unRegisterProviderConnector

void unRegisterProviderConnector(String providerId)
This method unregisters the given provider connector from the UWL service. When you unregister the connector, items are not retrieved form that Provider system.

Parameters:
providerId - The Id of the Provider system.

getUwlSessionForWebDynproClient

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

getMode

IUWLService.Mode getMode()
UWL can be set up to run in MYSAP or A1S or COMBINED or TEST modes. Depending upon these modes, Administration UI or end user UI may enable, disable certain features.

  • If set up in A1S mode, only BTM Connector and ActionInbox Connector are registered
  • If set up in MYSAP mode, BTM Connector is disabled
  • If set up in DEFAULT mode, all connectors are registered
  • Test mode is for internal purposes only and shouldnt be relied upon
  • Returns:
    Mode in which UWL is running.

    bindUwlSessionToHttpSession

    boolean bindUwlSessionToHttpSession(UWLContext uwlContext)
    Only for internal usage! Binds the uwl session to the actual http session of the user. If the http session will time out, the uwl session will be destroyed as well.

    Parameters:
    uwlContext - required, should have valid uwlSession and should have a request object (HttpSerlvetRequest) which contains the http session
    Returns:
    boolean to indicate if the binding was successful
    See Also:
    UWLContext.getSession(), UWLContext.getOriginRequest()
    Access Rights

    This class can be accessed from:

    
    
    SC DC Public Part ACH
    [sap.com] UWLJWF [sap.com] tc/kmc/bc.uwl/api default EP-BC-UWL
    [sap.com] UWLJWF [sap.com] tc/kmc/bc.uwl/api - EP-BC-UWL


    Copyright 2012 SAP AG Complete Copyright Notice