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

com.sas.iquery.dataretrieval
Class SimpleQueryConnector

com.sas.iquery.dataretrieval.SimpleQueryConnector
All Implemented Interfaces:
com.sas.iquery.execution.OverrideLocaleInterface, com.sas.iquery.execution.OverrideStpNamesInterface
Direct Known Subclasses:
QueryConnector

public class SimpleQueryConnector
implements com.sas.iquery.execution.OverrideLocaleInterface, com.sas.iquery.execution.OverrideStpNamesInterface

A basic query connector without result or connection management.

Please don't instantiate this class directly! Consumers should use the QueryConnector subclass or QueryConnectorInterface.

See the package-level documentation for com.sas.iquery.dataretrieval for examples of how to use the query connector.

See Also:
QueryConnectorInterface, QueryConnector

Method Summary
 java.util.Locale getComputationalLocale()
          Returns the Locale to override all query computations submitted or null if the computation locale of the query is not to be overridden.
 java.lang.String getPhysicalQuery(BusinessQuery businessQuery)
          Returns the generated query as a string, excluding connection information.
 java.lang.String getResultSetStructure(BusinessQuery businessQuery)
          Returns information about the structure of a result set.
 RetrievalPolicy getRetrievalPolicy()
          Returns the query connector's current retrieval policy as last set by the setRetrievalPolicy(RetrievalPolicy) method or the default if not explicitly set.
 com.sas.iquery.execution.instructions.StpNames getStpNames()
          Returns the stored process assigned names cache.
 java.util.Map<java.lang.String,ResultSetInterface> retrieveQueryResultMap(java.util.List queries)
          Creates a map of query results (ResultSetInterface), based on a list of input business queries.
 java.util.Map<java.lang.String,ResultSetInterface> retrieveQueryResultMap(java.util.List queries, RetrievalPolicy retrievalPolicy)
          Creates a map of query results, based on a list of input business queries.
 void setComputationalLocale(java.util.Locale overrideComputationalLocale)
          Sets the Locale to override all query computations submitted or if the computation locale of the query is not to be overridden then use null.
 void setRetrievalPolicy(RetrievalPolicy policy)
          Sets a retrieval policy on the query connector.
 void setStpNames(com.sas.iquery.execution.instructions.StpNames stpNames)
          sets the stored process assigned names cache.
 

Method Detail

getRetrievalPolicy

public RetrievalPolicy getRetrievalPolicy()
Returns the query connector's current retrieval policy as last set by the setRetrievalPolicy(RetrievalPolicy) method or the default if not explicitly set.

Returns:
the QueryConnector's current retrieval policy

setRetrievalPolicy

public void setRetrievalPolicy(RetrievalPolicy policy)
Sets a retrieval policy on the query connector.

This retrieval policy will be used if the retrieveQueryResultMap(List) method is called.


retrieveQueryResultMap

@NonNull
public java.util.Map<java.lang.String,ResultSetInterface> retrieveQueryResultMap(java.util.List queries,
                                                                                         RetrievalPolicy retrievalPolicy)
                                                                          throws DataRetrievalException
Creates a map of query results, based on a list of input business queries.

The keys of the resulting map are the ID's of the input business queries. Use the IntelligentQueryInterface.getID() method to determine the id.

The input list must fulfill the following requirements:

Parameters:
queries - a list of business queries to execute
retrievalPolicy - the policy to use for executing
Returns:
A map whose keys are ID's of the executed BusinessQueries and values are ResultSetInterface results
Throws:
DataRetrievalException
See Also:
retrieveQueryResultMap(List)

retrieveQueryResultMap

@NonNull
public java.util.Map<java.lang.String,ResultSetInterface> retrieveQueryResultMap(java.util.List queries)
                                                                          throws DataRetrievalException
Creates a map of query results (ResultSetInterface), based on a list of input business queries.

Uses the retrieval policy returned by getRetrievalPolicy(). BusinessQuery

Parameters:
queries - a list of business queries to execute
Returns:
a map whose keys are ID's of the executed BusinessQueries and values are ResultSetInterface results
Throws:
DataRetrievalException
See Also:
retrieveQueryResultMap(List,RetrievalPolicy)

getPhysicalQuery

public java.lang.String getPhysicalQuery(BusinessQuery businessQuery)
                                  throws com.sas.iquery.intelligentquery.IntelligentQueryException
Returns the generated query as a string, excluding connection information.

Parameters:
businessQuery - The business query to generate code for
Returns:
A string containing the server-specific query generated
Throws:
com.sas.iquery.intelligentquery.IntelligentQueryException

getResultSetStructure

public java.lang.String getResultSetStructure(BusinessQuery businessQuery)
                                       throws com.sas.iquery.intelligentquery.IntelligentQueryException
Returns information about the structure of a result set. The returned values can be one of

Parameters:
businessQuery - The query to examine
Returns:
The type of result set
Throws:
com.sas.iquery.intelligentquery.IntelligentQueryException - If the structure cannot be determined

getComputationalLocale

public java.util.Locale getComputationalLocale()
Returns the Locale to override all query computations submitted or null if the computation locale of the query is not to be overridden.

Specified by:
getComputationalLocale in interface com.sas.iquery.execution.OverrideLocaleInterface
Returns:
Overriding Locale (or null)
See Also:
QueryConnectorInterface.getComputationalLocale(), BusinessModel.getComputationalLocale()

setComputationalLocale

public void setComputationalLocale(java.util.Locale overrideComputationalLocale)
Sets the Locale to override all query computations submitted or if the computation locale of the query is not to be overridden then use null.

Specified by:
setComputationalLocale in interface com.sas.iquery.execution.OverrideLocaleInterface
Parameters:
computationLocale - Locale to override query computation locale or null to not override.
See Also:
QueryConnectorInterface.setComputationalLocale(Locale), BusinessModel.setComputationalLocale(Locale)

getStpNames

public com.sas.iquery.execution.instructions.StpNames getStpNames()
Description copied from interface: OverrideStpNamesInterface
Returns the stored process assigned names cache.

Specified by:
getStpNames in interface com.sas.iquery.execution.OverrideStpNamesInterface
Returns:
StpNames
See Also:
OverrideStpNamesInterface.getStpNames()

setStpNames

public void setStpNames(com.sas.iquery.execution.instructions.StpNames stpNames)
Description copied from interface: OverrideStpNamesInterface
sets the stored process assigned names cache.

Specified by:
setStpNames in interface com.sas.iquery.execution.OverrideStpNamesInterface
See Also:
OverrideStpNamesInterface.setStpNames(com.sas.iquery.execution.instructions.StpNames)

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.