com.sap.netweaver.bc.uwl.connect

Class ConnectorResult

java.lang.Object
  extended by com.sap.netweaver.bc.uwl.connect.ConnectorResult

public final class ConnectorResult
extends Object

ConnectorResult contains the result from IProviderConnector.getItems() method. Connector could return a delta result in which case, only modified and deleted items are be returned. If result is for multiple users as it happens with the case of PullChannel, isMultiUserResult() returns true and the results are accessed thro getItemsMap() which contains the map of user id to ItemCollection.

See Also:
IProviderConnector, IProviderConnector.getItems(com.sap.netweaver.bc.uwl.UWLContext, java.lang.String, com.sap.netweaver.bc.uwl.connect.ConnectorFilter, java.lang.String)

Field Summary
static int TYPE_DELTA
          Indicates that result is delta. i.e. modified and deleted items after a particular time stamp.
static int TYPE_PARTIAL
          Indicates that type of result is partial result.
static int TYPE_SNAPSHOT
          Indiciates that the result is complete snapshot of items for the item type specified.
static int TYPE_UNKNOWN
          This indicates result type doesnt belong to partial, snapshot or delta types.
 
Constructor Summary
ConnectorResult(ItemCollection items, ProviderStatus stat)
          Creates a snapshot type result
ConnectorResult(List items, ProviderStatus stat)
          Creates a snapshot type result
 
Method Summary
static ConnectorResult createDeltaResult(ItemCollection modifiedItems, ProviderStatus stat)
          Creates a ConnectorResult of type DELTA.
static ConnectorResult createMultiUserDeltaResult(Map modifiedItems, ProviderStatus stat)
          Creates a ConnectorResult of type DELTA for multiple users
static ConnectorResult createPartialResult(ItemCollection theItems, ProviderStatus stat)
          Indicates that type of result is partial result.
static ConnectorResult createSnapshotResult(ItemCollection theItems, ProviderStatus stat)
          Creates a ConnectorResult of type SNAPSHOT.
static ConnectorResult createSnapshotResult(List theItems, ProviderStatus stat)
          Creates a ConnectorResult of type SNAPSHOT.
static ConnectorResult createUnknownResult(ItemCollection theItems)
          Creates an unknown type result.
 boolean getCompareGenericAttributes()
           
 String getCookie()
          When Items are pushed in chunks, UWL sets a cookie to track these rfc calls and to maintain timeouts for them.
 List getDeletedItemExternalIds()
          valid only for delta result.
 ConnectorResult[] getExtraResults()
           
 ItemCollection getItems()
          Returns items in the result.
 String getItemTypeRetreived()
          Even though a sub item type is asked for Connector could return items for different item type.
 Map getMultiUserItems()
          Returns multi user items.
 ProviderStatus getStatus()
          Contains any status messages from the Provider.
 String getSystem()
          System from which the results are got
 Date getSystemTimestamp()
          Valid only for delta result.
 Map getUsersToDeletedItemsMap()
          Valid for multi user results.
 boolean isMultiUserResult()
          Indicates if the result is for multiple users.
 boolean isTypeDelta()
          Indicates if result type is delta.
 boolean isTypePartial()
          Indicates if the result type is partial.
 boolean isTypeSnapshot()
          Indicates if the result type is snap shot.
 boolean isTypeUnkown()
          Indicates if the result type is unknown type.
 void setCompareGenericAttributes(boolean compareGenericAttributes)
          Use this method in order to indicate to the UWL cache manager to use the generic attributes when updating the cache.
 void setCookie(String str)
          Used for interal purpose.
 void setDeletedItemExternalIds(List list)
          List of strings, should contain only the external id
 void setExtraResults(ConnectorResult[] extraResults)
           
 void setItemTypeRetreived(String it)
           
 void setStatus(ProviderStatus stat)
          Provider status of which the results are got
 void setSystem(String sys)
          System from which the results are got
 void setSystemTimestamp(Date time)
          Connector could retreive the timestamp from a particular host system and set here.
 void setUsersToDeletedItemsMap(Map map)
          Valid for multi user results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_PARTIAL

public static final int TYPE_PARTIAL
Indicates that type of result is partial result. This is used in case there are too many items to return.

See Also:
Constant Field Values

TYPE_SNAPSHOT

public static final int TYPE_SNAPSHOT
Indiciates that the result is complete snapshot of items for the item type specified.

See Also:
Constant Field Values

TYPE_DELTA

public static final int TYPE_DELTA
Indicates that result is delta. i.e. modified and deleted items after a particular time stamp.

See Also:
Constant Field Values

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
This indicates result type doesnt belong to partial, snapshot or delta types. This type is used to push as and when they are created.

See Also:
Constant Field Values
Constructor Detail

ConnectorResult

public ConnectorResult(ItemCollection items,
                       ProviderStatus stat)
Creates a snapshot type result

Parameters:
items -
stat -

ConnectorResult

public ConnectorResult(List items,
                       ProviderStatus stat)
Creates a snapshot type result

Parameters:
items -
stat -
Method Detail

createSnapshotResult

public static ConnectorResult createSnapshotResult(ItemCollection theItems,
                                                   ProviderStatus stat)
Creates a ConnectorResult of type SNAPSHOT.

Parameters:
theItems - not null
stat - could be null
Returns:
not null

createSnapshotResult

public static ConnectorResult createSnapshotResult(List theItems,
                                                   ProviderStatus stat)
Creates a ConnectorResult of type SNAPSHOT.

Parameters:
theItems - not null
stat - could be null
Returns:
not null

createDeltaResult

public static ConnectorResult createDeltaResult(ItemCollection modifiedItems,
                                                ProviderStatus stat)
Creates a ConnectorResult of type DELTA.

Parameters:
modifiedITems - contains modified or newly created items after a particular timestamp. Can be empty.
stat - could be null
Returns:
not null

createMultiUserDeltaResult

public static ConnectorResult createMultiUserDeltaResult(Map modifiedItems,
                                                         ProviderStatus stat)
Creates a ConnectorResult of type DELTA for multiple users

Parameters:
modifiedITems - contains modified or newly created items after a particular timestamp. Can be empty.
stat - could be null
Returns:
not null

createPartialResult

public static ConnectorResult createPartialResult(ItemCollection theItems,
                                                  ProviderStatus stat)
Indicates that type of result is partial result. This is used in case there are too many items to return and hence only few Items are sent. For example if there are 1000 items in the back end, only few hundred could be sent to UWL.


createUnknownResult

public static ConnectorResult createUnknownResult(ItemCollection theItems)
Creates an unknown type result.

Parameters:
theItems -
Returns:
result object.

isTypeDelta

public boolean isTypeDelta()
Indicates if result type is delta.

Returns:
true if result is of type delta

isTypeSnapshot

public boolean isTypeSnapshot()
Indicates if the result type is snap shot.

Returns:
true if result is a snapshot

isTypePartial

public boolean isTypePartial()
Indicates if the result type is partial.

Returns:
true if result is of partial result

isTypeUnkown

public boolean isTypeUnkown()
Indicates if the result type is unknown type.

Returns:
true if result is of unknown type

isMultiUserResult

public boolean isMultiUserResult()
Indicates if the result is for multiple users.

Returns:
true if multi user result

getMultiUserItems

public Map getMultiUserItems()
Returns multi user items. Can be empty.

Returns:
map of user id to ItemCollection
See Also:
isMultiUserResult()

getItemTypeRetreived

public String getItemTypeRetreived()
Even though a sub item type is asked for Connector could return items for different item type. For example when uwl.task.approval is asked for, connector could return all items of uwl.task. In such cases for optimization, this itemTypeRetreived could be set and is used for cache logging.


setItemTypeRetreived

public void setItemTypeRetreived(String it)

getSystem

public String getSystem()
System from which the results are got

Returns:
system from which the results are got

setSystem

public void setSystem(String sys)
System from which the results are got


getItems

public ItemCollection getItems()
Returns items in the result. For multi user results, getMultiUserItems() should be used.

Returns:
collection of Items,could be null
See Also:
getMultiUserItems()

getStatus

public ProviderStatus getStatus()
Contains any status messages from the Provider.

Returns:
status of connection to back end, could be null

setStatus

public void setStatus(ProviderStatus stat)
Provider status of which the results are got


getDeletedItemExternalIds

public List getDeletedItemExternalIds()
valid only for delta result. Return could be null

Returns:

setDeletedItemExternalIds

public void setDeletedItemExternalIds(List list)
List of strings, should contain only the external id


getSystemTimestamp

public Date getSystemTimestamp()
Valid only for delta result. If provider sets this value, UWL uses it in its cache timestamps. UTC time.

Returns:
could be null

setSystemTimestamp

public void setSystemTimestamp(Date time)
Connector could retreive the timestamp from a particular host system and set here. This timestamp will be given next time to getItems method thro ConnectorFilter parameter. It is optional for the connector to set this timestamp. Alternatively, Connector could also make use of uwl system's time for the delta retreival.
For all practical purposes it is just standard time at Greenwich England. The people in Greenwich use Daylight saving time, so the term GMT or Greenwich time would be ambiguous. In other words, the returned date's getTime() should return number of milliseconds since January 1, 1970, 00:00:00 GMT.

Parameters:
time - java time value , that is number of milliseconds since 1970 Jan 1.
See Also:
ConnectorFilter

getCookie

public String getCookie()
When Items are pushed in chunks, UWL sets a cookie to track these rfc calls and to maintain timeouts for them.

Returns:
could be null

setCookie

public void setCookie(String str)
Used for interal purpose.

Parameters:
str -

getUsersToDeletedItemsMap

public Map getUsersToDeletedItemsMap()
Valid for multi user results.

Returns:
Map of userid to List of deleted items external ids

setUsersToDeletedItemsMap

public void setUsersToDeletedItemsMap(Map map)
Valid for multi user results.

Parameters:
map - Map ofsuer id to List of deleted items external ids.

getCompareGenericAttributes

public boolean getCompareGenericAttributes()
Returns:
Whether the UWL service should use the generic attributes for the cache update

setCompareGenericAttributes

public void setCompareGenericAttributes(boolean compareGenericAttributes)
Use this method in order to indicate to the UWL cache manager to use the generic attributes when updating the cache. The default option is not to compare generic attributes because of the extra database reads and comparisions. If your connector updates generic attributes, you need to set this to true in order to have them updated and visible in the UWL.

Parameters:
compareGenericAttributes - if true, generic attributes will be compared and updated

getExtraResults

public ConnectorResult[] getExtraResults()
Returns:
the extraResults

setExtraResults

public void setExtraResults(ConnectorResult[] extraResults)
Parameters:
extraResults - the extraResults to set
Access Rights

This class can be accessed from:


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


Copyright 2012 SAP AG Complete Copyright Notice