com.sap.netweaver.bc.uwl

Class QueryResult

java.lang.Object
  extended bycom.sap.netweaver.bc.uwl.QueryResult

public class QueryResult
extends Object

The QueryResult class provides the result of queries with the key data on item collections and provider providerStatusArray. In addition optionally it also contains the users to whom current logged in user has substituted items on behalf of.

Some times, if aynchronous connections are made from the UWL service and items are still being updated in the background thread, this class indicates the status through isPossiblyOutDated() method.

See Also:
QueryProperties, isPossiblyOutDated()

Constructor Summary
QueryResult()
          This is a default constructor.
QueryResult(ItemCollection items, List providerStatusList)
          This constructor takes two arguments: an instance of ItemCollection and a list of instances of ProviderStatus.
QueryResult(List itemsAsList, List providerStatusList)
          This constructor is simalar to QueryResult#QueryResult(Itemcollection, List) except for the fact that it takes in a list of items instead of an instance of ItemCollection.
 
Method Summary
 void addItems(ItemCollection itemCollection)
          Adds to the existing collection of items.
 void addStatus(List providerStatusList)
          Adds to the existing list if the exsting list is not null.
 void addStatus(ProviderStatus stat)
           
 ItemCollection getItems()
          Returns the items set to the QueryResult
 int getStartingItemNumber()
          Returns the startingRecordNumber.
 List getStatus()
          Status of different provider systems are returned.
 ProviderStatus[] getStatusAsArray()
          This returns the array of Provider objects.
 SubstitutedItemCount[] getSubstitutingUsers()
          Returns for the current View passed, who are users, current user is substituting and has items from them.
 int getTotalNumberOfItems()
          Returns the totalNumberOfItems.
 boolean isPossiblyOutDated()
          Result being dirty i.e, some connection to provider is made in the background and call is still going on.
 void setItems(ItemCollection itemCollection)
           
 void setItems(List listOfItems)
          First, it constructs of the object of ItemCollection and then, assigns the result to items.
 void setPossiblyOutDated(boolean b)
          Internal method used by UWL service to indicate the client that result may be dirty.
 void setStartingItemNumber(int startingItemNumber)
          Sets the startingRecordNumber.
 void setSubstitutingUsers(SubstitutedItemCount[] set)
          For internal use only.
 void setTotalNumberOfItems(int totalNumberOfItems)
          Sets the totalNumberOfItems.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResult

public QueryResult(ItemCollection items,
                   List providerStatusList)
This constructor takes two arguments: an instance of ItemCollection and a list of instances of ProviderStatus.

Parameters:
items - the collection of items.
providerStatusList - the list of ProviderStatus instances.

QueryResult

public QueryResult(List itemsAsList,
                   List providerStatusList)
This constructor is simalar to QueryResult#QueryResult(Itemcollection, List) except for the fact that it takes in a list of items instead of an instance of ItemCollection. Consequently, it creates an object of ItemCollection with the help of the list of items provided.

Parameters:
itemsAsList - the list of items.
providerStatusList - the list of ProviderStatus instances.

QueryResult

public QueryResult()
This is a default constructor. This creates an object of QueryResult with the list of ProviderStatus objects equal to null and the object of ItemCollection equal to null.

Method Detail

getItems

public ItemCollection getItems()
Returns the items set to the QueryResult

Returns:
ItemCollection the instance of ItemCollection. It could be null.

setItems

public void setItems(ItemCollection itemCollection)
Parameters:
itemCollection -

setItems

public void setItems(List listOfItems)
First, it constructs of the object of ItemCollection and then, assigns the result to items.

Parameters:
listOfItems - items as a list.

getStatusAsArray

public ProviderStatus[] getStatusAsArray()
This returns the array of Provider objects. If the private field of this object providerStatusArray is null, it will populate it by calling providerArrayList's toArray method.

Returns:
ProviderStatus[] the array of ProviderStatus objects. Even if the list of ProviderStatus is null, it will not return null but an array of zero length.

getStatus

public List getStatus()
Status of different provider systems are returned.

Returns:
List the list of ProviderStatus. This does return null even if the list is null instead it returns Collections.EMPTY_LIST.
See Also:
ProviderStatus

addItems

public void addItems(ItemCollection itemCollection)
Adds to the existing collection of items. If the existing is null, it creates a new object of ItemCollection and adds it.

Parameters:
itemCollection - the item collection to be added.

addStatus

public void addStatus(List providerStatusList)
Adds to the existing list if the exsting list is not null. Otherwise, it creates a new list, adds to it. In either case, the array of provider status objects is going to be null.

Parameters:
providerStatusList - the provider status list.

addStatus

public void addStatus(ProviderStatus stat)
Parameters:
stat - the new instance that needs to be added.

getTotalNumberOfItems

public int getTotalNumberOfItems()
Returns the totalNumberOfItems.

Returns:
int

setTotalNumberOfItems

public void setTotalNumberOfItems(int totalNumberOfItems)
Sets the totalNumberOfItems.

Parameters:
totalNumberOfItems - The totalNumberOfItems to set

getStartingItemNumber

public int getStartingItemNumber()
Returns the startingRecordNumber.

Returns:
int

setStartingItemNumber

public void setStartingItemNumber(int startingItemNumber)
Sets the startingRecordNumber.


getSubstitutingUsers

public SubstitutedItemCount[] getSubstitutingUsers()
Returns for the current View passed, who are users, current user is substituting and has items from them. For this to be filled by UWL Service, substition count should be enabled in the QueryProperties.

Returns:
not null,not modifiable set of portal user ids
See Also:
QueryProperties#enableSubstitionCount

setSubstitutingUsers

public void setSubstitutingUsers(SubstitutedItemCount[] set)
For internal use only.

Parameters:
set - for internal use. UWL Service sets this.

isPossiblyOutDated

public boolean isPossiblyOutDated()
Result being dirty i.e, some connection to provider is made in the background and call is still going on. Items may be outdated and may not reflect the latest state. Typcial handling of such a scenario is to make another getItems() call within few seconds again so updated items are retrieved.

Returns:
true if the result is dirty, false otherwise

setPossiblyOutDated

public void setPossiblyOutDated(boolean b)
Internal method used by UWL service to indicate the client that result may be dirty.

Parameters:
b -


Copyright 2006 SAP AG Complete Copyright Notice