***  This class is subject to change.  ***

com.sas.iquery.dataretrieval
Class RetrievalPolicy

com.sas.iquery.dataretrieval.RetrievalPolicy

public class RetrievalPolicy

Contains query policy settings.

The RetrievalPolicy contains settings which affect how data is retrieved using the QueryConnector.
None of these settings affect what data is retrieved.

The primary setting contained in this object is the policy:

The policy determines whether the query connector should attempt to retrieve data in the fastest way possible or retrieve the freshest (most recent) data possible.
The exact mechanisms which may be employed for fresh or fast data are currently internal to the SAS Query Services framework and may change in the future.

The default setting is FRESHEST.

Example:

 RetrievalPolicy policy = new RetrievalPolicy();
 policy.setPolicy(RetrievalPolicy.FRESHEST);
 
 
Other settings are contained in the sub-objects ConnectionConfiguration and OfflineResultSetConfiguration.

See Also:
QueryConnectorInterface, QueryConnector

Field Summary
static int FASTEST
          Attempt to use the fastest data available.
static int FRESHEST
          Attempt to use the most recent data available.
 
Constructor Summary
RetrievalPolicy()
          Creates a RetrievalPolicy that controls how data is retrieved using a QueryConnector.
RetrievalPolicy(RetrievalPolicy retrievalPolicy)
          Creates a new retrieval policy with the same settings as the argument.
 
Method Summary
 ConnectionConfiguration getConnectionConfiguration()
          Returns the connection configuration associated with this retrieval policy object.
 OfflineResultSetConfiguration getOfflineResultSetConfiguration()
          Returns the offline configuration associated with this retrieval policy.
 int getPolicyValue()
          Get the retrieval policy to be used when executing a query.
 void setConnectionConfiguration(ConnectionConfiguration connectionConfiguration)
          Sets a new connection configuration to be associated with this retrieval policy.
 void setOfflineResultSetConfiguration(OfflineResultSetConfiguration offlineResultSetConfiguration)
          Sets a new offline configuration object on this retrieval policy.
 void setPolicyValue(int policy)
          Set the retrieval policy to use when executing a query.
 

Field Detail

FRESHEST

public static final int FRESHEST
Attempt to use the most recent data available.

See Also:
setPolicyValue(int), Constant Field Values

FASTEST

public static final int FASTEST
Attempt to use the fastest data available.

See Also:
setPolicyValue(int), Constant Field Values
Constructor Detail

RetrievalPolicy

public RetrievalPolicy()
Creates a RetrievalPolicy that controls how data is retrieved using a QueryConnector.

The default value for the policy attribute is #FRESHEST and the default connection configuration is ConnectionConfiguration#USER_SESSION.


RetrievalPolicy

public RetrievalPolicy(RetrievalPolicy retrievalPolicy)
Creates a new retrieval policy with the same settings as the argument.

Method Detail

setPolicyValue

public void setPolicyValue(int policy)
Set the retrieval policy to use when executing a query.

Valid values are:


getPolicyValue

public int getPolicyValue()
Get the retrieval policy to be used when executing a query.

Returns:
The contained policy value, one of FRESHEST or FASTEST

setOfflineResultSetConfiguration

public void setOfflineResultSetConfiguration(OfflineResultSetConfiguration offlineResultSetConfiguration)
Sets a new offline configuration object on this retrieval policy.

Parameters:
offlineResultSetConfiguration - The configuration to set

getOfflineResultSetConfiguration

public OfflineResultSetConfiguration getOfflineResultSetConfiguration()
Returns the offline configuration associated with this retrieval policy.

Returns:
the offline configuration associated with this retrieval policy.

getConnectionConfiguration

public ConnectionConfiguration getConnectionConfiguration()
Returns the connection configuration associated with this retrieval policy object.

Returns:
the connection configuration associated with this retrieval policy object

setConnectionConfiguration

public void setConnectionConfiguration(ConnectionConfiguration connectionConfiguration)
Sets a new connection configuration to be associated with this retrieval policy.

Parameters:
connectionConfiguration - The configuration to set

***  This class is subject to change.  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.