com.sap.netweaver.bc.uwl.connect

Interface IProviderConnector

All Known Subinterfaces:
IAlertConnector

public interface IProviderConnector

This interface defines item retrieval methods from Provider systems. The IProviderConnector interface should be implemented by all the Provider system connectors.

IProviderConnector implementations can use any communication mechanism to connect to the systems and reteive the Items. For example: EJB call, JCO, Web Service etc.

IProviderConnector implementations are expected to be stateless and hence thread safe.

IProviderConnector implementation should be registered to IUWLService and systems to which they can connect should be set up in the UWL configuration. Without these Items are not retreived from the connector.
If ProviderConnector implementation supports bundling of items for different users, it should implement IOptimizedPullSupport interface in addition.

See Also:
IUWLService.registerProviderConnector(com.sap.netweaver.bc.uwl.connect.IProviderConnector), IActionHandler, IOptimizedPullSupport, Item, ConnectorResult, ConnectorFilter

Field Summary
static String ACTIONINBOX_CONNECTOR
          Knowledge Management:: Action inbox connector
static String ACTIONINBOX_SYSTEM
           
static String ADHOC_WORKFLOW_CONNECTOR_ID
          Java AdHow Workflow Connector identifier
static String ADHOC_WORKFLOW_SYSTEM
          Java adhoc connector should use this system id
static String ALERT_CONNECTOR_ID
          Alert framework connector id
static String GENERIC_ABAP_CONNECTOR
          Connnector for any Abap application that wants to send items to UWL
static String WEBFLOW_CONNECTOR_ID
          Business Workflow Connector identifier
 
Method Summary
 IActionHandler getActionHandler(String actionHandlerId)
          This method is called to get hold of connector specific implementation of action handler.
 Map getAllActionsForItem(UWLContext ctx, Map currentActions, Item item)
          Passes the current actions defined in the configuration to the provider connector and asks for the final Actions Map.
 Attachment[] getAttachmentHeaders(UWLContext context, Item item)
          This method is called to retreive the attachment headers for the item.
 String getDescription(Item item, UWLContext context)
          This method gets called when description for an item is needed.
 String getId()
          Every IProviderConnector should identify itself with a unique identifer.
 Item getItem(UWLContext ctx, String systemId, String externalId)
          This method gets called if one item needs to be refreshed.
 ConnectorResult getItems(UWLContext context, String itemType, ConnectorFilter connectorFilter, String system)
          Method getItems is called to retreive items from the connector.
 WorkLog getLogData(Locale lc, String processId)
          Return workflow log data of a (sub)process with respect to the locale given.
 WorkLog getLogData(UWLContext context, Item item)
          Return the workflow log data for the requested item, including both the executed steps and the pending step.
 boolean isActionValidForItem(UWLContext ctx, Item item, Action action)
          This method gives the connector an opportunity to say if an action is invalid for an Item.
 boolean isItemValid(UWLContext ctx, Item item)
          Depending upon the configuration settings, this method is called to check if item is still valid for the user before performing any actions on the item.
 boolean isLogRetrievalSupported(UWLContext context, Item item)
          Return true if the provider supports workflow log query from an item.
 boolean needsRemoteConnection(String systemId)
          This method is used to do certain performance optimizations.
 boolean populateHollowItem(UWLContext context, Item item)
          Method for populating the incompletely filled Item.
 boolean supportsCacheClearance(String system)
          By default items are stored in the back end as well as in the UWL cache.
 boolean supportsItemType(String itemType)
          Someof the connectors may support only specific ItemTypes from provider systems.
 

Field Detail

WEBFLOW_CONNECTOR_ID

static final String WEBFLOW_CONNECTOR_ID
Business Workflow Connector identifier

See Also:
Constant Field Values

ADHOC_WORKFLOW_CONNECTOR_ID

static final String ADHOC_WORKFLOW_CONNECTOR_ID
Java AdHow Workflow Connector identifier

See Also:
Constant Field Values

ADHOC_WORKFLOW_SYSTEM

static final String ADHOC_WORKFLOW_SYSTEM
Java adhoc connector should use this system id

See Also:
Constant Field Values

ACTIONINBOX_SYSTEM

static final String ACTIONINBOX_SYSTEM
See Also:
Constant Field Values

ALERT_CONNECTOR_ID

static final String ALERT_CONNECTOR_ID
Alert framework connector id

See Also:
Constant Field Values

GENERIC_ABAP_CONNECTOR

static final String GENERIC_ABAP_CONNECTOR
Connnector for any Abap application that wants to send items to UWL

See Also:
Constant Field Values

ACTIONINBOX_CONNECTOR

static final String ACTIONINBOX_CONNECTOR
Knowledge Management:: Action inbox connector

See Also:
Constant Field Values
Method Detail

getId

String getId()
Every IProviderConnector should identify itself with a unique identifer.

Returns:
not null identifier

supportsItemType

boolean supportsItemType(String itemType)
Someof the connectors may support only specific ItemTypes from provider systems. As an example Alert connector doesnt support uwl.task item types. In such cases this method acts as an optimization to make sure no getItems() is called. In case of unsurity return true and take care in the getItems() method.

Parameters:
itemType - String could be null
Returns:
true if implementation supports retrieving the item type specified.
See Also:
ItemType

supportsCacheClearance

boolean supportsCacheClearance(String system)
By default items are stored in the back end as well as in the UWL cache. However if Adhoc Workflow for example decide to store items in the UWL itself, then Connector can return false for this method. Default return should be true. If return value is true, then administrator can go to UWL cache admin iView and clear the cache and the items are refetched from the Provider Systems.

Returns:
true if clearing of cache is allowed for the items sent/recieved thro this Connector, false otherwise.

getItems

ConnectorResult getItems(UWLContext context,
                         String itemType,
                         ConnectorFilter connectorFilter,
                         String system)
                         throws ConnectorException
Method getItems is called to retreive items from the connector. This method should retreive items for the system value passed. Parameter connectorFilter is used for certain item types like completed tasks, to restrict the number of items.

Typically this method is called in a seperate thread. Timeout may occur if this method implementation consumes more time that time out specified in the UWL configuration. In case of timeout result are ignored.

Parameters:
context - contains information regarding user and application context and portal request object
itemType - specifies what types of items are needed, if null or '*' it means all items
connectorFilter - specifies additional information regarding time intervals for which items are needed, it could be null, if null no delta results are supported
system - specifies the only system from which items are to be retreived, it is non null
Returns:
result object containing the items and system status. If null it is ignored , but it is recommended to send the status of connection to system as ProviderStatus in the result object.
Throws:
ConnectorException - in case of problems from the provider source

populateHollowItem

boolean populateHollowItem(UWLContext context,
                           Item item)
                           throws ConnectorException
Method for populating the incompletely filled Item. When getItems is called, some of the items may be marked as hollow by using item.setHollow() method. Such hollow items could be filled in a second step when populateHollowItem is called. After calling this method, item is no longer hollow if no exceptions are thrown by the connector. Typically item should be marked as hollow in the first step if some of its non critical attributes can not be retreived in a performant way and could be retreived later lazily.

Parameters:
context - not null
item - not null
Returns:
true if item is successfully populated, false otherwise.
Throws:
ConnectorException - in case of problems from the provider source

getDescription

String getDescription(Item item,
                      UWLContext context)
                      throws ConnectorException
This method gets called when description for an item is needed. Description for an item has no size limit. This method doesnt get called if items Description is already filled out.

Parameters:
item - not null
context - not null
Returns:
description for the item, could be null
Throws:
ConnectorException - in case of problems from the provider source

getAttachmentHeaders

Attachment[] getAttachmentHeaders(UWLContext context,
                                  Item item)
                                  throws ConnectorException
This method is called to retreive the attachment headers for the item. Attachments are retrieved typically in two steps, in the first step only their header information is retreived, and next in second step their content is retreived.

Implementation of this method need not set the attachments to item using item.setAttachmentInfo. Caller of this method takes care of it.

Parameters:
context - not null
item - not null
Returns:
attachment headers, if no attachments return null or array of size zero.
Throws:
ConnectorException - in case of problems from the provider source
See Also:
IAttachmentConnector

getActionHandler

IActionHandler getActionHandler(String actionHandlerId)
This method is called to get hold of connector specific implementation of action handler. If actionHandlerId is unknown to the connector it should simply return null. If Connector returns null, then action handlers are searched in the UWL shipped action handlers. UWL ships with certain action handlers which are documented in the help portal. This method gives Connector a chance to override any action handler.

Parameters:
actionHandlerId - not null, identifier for the action handler
Returns:
action handler instance if it is a connector specific Action handler
See Also:
Action

getAllActionsForItem

Map getAllActionsForItem(UWLContext ctx,
                         Map currentActions,
                         Item item)
                         throws ConnectorException
Passes the current actions defined in the configuration to the provider connector and asks for the final Actions Map. If any dynamic actions are to be retreived, it is possible to do it in this method. Connector could add or remove actions from this map. If Connector doesnt care, it should just return the currentActions.

Parameters:
ctx - not null
currentActions - as defined in the configuration XML, not null
item - not null
Returns:
Map containing the final actions allowed for the item, should not be null
Throws:
ConnectorException - in case of problems from the provider source

isActionValidForItem

boolean isActionValidForItem(UWLContext ctx,
                             Item item,
                             Action action)
This method gives the connector an opportunity to say if an action is invalid for an Item. By default return value should be true. This method shouldnt make any remote connection for performance usage.

Parameters:
ctx - not null contains user info.
item - not null item under usage
action - not null, typically taken from the XML
Returns:
true if action is valid or unknown. false if it is definite that action is not valid for the item because of backend versions, or item status etc..

isItemValid

boolean isItemValid(UWLContext ctx,
                    Item item)
                    throws ConnectorException
Depending upon the configuration settings, this method is called to check if item is still valid for the user before performing any actions on the item.

Parameters:
ctx - contains user information
item - not null
Returns:
true if item is valid for the user, false otherwise.
Throws:
ConnectorException - in case of problems from the provider source
See Also:
IActionHandler.needsItemValidation()

getItem

Item getItem(UWLContext ctx,
             String systemId,
             String externalId)
             throws ConnectorException
This method gets called if one item needs to be refreshed. Connector may optionally fill the attachment headers.

Parameters:
ctx - not null
systemId - system from which to retreive the item
externalId - externalId of the item in the system
Returns:
could be null, if item is not found. If null is returned, then old item is deleted from UWL.
Throws:
ConnectorException - in case of problems from the provider source. In this case old item in the cache is used.

needsRemoteConnection

boolean needsRemoteConnection(String systemId)
This method is used to do certain performance optimizations. Connection Implementation should return true if a JCO/RFC/WebService/RMI connection needs to be made to retrieve Item or Item related information.

Parameters:
systemId - system which UWL is dealing with.
Returns:
true or false depending upon if a remote network connection is made

isLogRetrievalSupported

boolean isLogRetrievalSupported(UWLContext context,
                                Item item)
Return true if the provider supports workflow log query from an item.


getLogData

WorkLog getLogData(UWLContext context,
                   Item item)
                   throws ConnectorException
Return the workflow log data for the requested item, including both the executed steps and the pending step.

Parameters:
context - UWL context
item - Item to be queried
Throws:
ConnectorException - in case of problems from the provider source.

getLogData

WorkLog getLogData(Locale lc,
                   String processId)
                   throws ConnectorException
Return workflow log data of a (sub)process with respect to the locale given. Owner of the item is not taken into account.

Parameters:
lc - Locale to retrieve the log data
processId - Process id recognized by the provider
Throws:
ConnectorException - Not supported by the provider or in case of problems from the provider


Copyright 2009 SAP AG Complete Copyright Notice