public class DataSource
extends java.lang.Object
QueryState on the connection, handles the logic of
executing a query on an MDEX to get results, and handles the logic of altering the QueryState.QueryState| Constructor and Description |
|---|
DataSource(javax.portlet.PortletRequest request) |
DataSource(javax.portlet.PortletRequest request,
long groupId) |
DataSource(javax.portlet.PortletRequest request,
com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier collectionId) |
DataSource(javax.portlet.PortletRequest request,
MDEXState mdexState) |
DataSource(javax.portlet.PortletRequest request,
java.lang.String[] boundDataSets) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCollectionData(java.lang.String collectionKey,
java.util.List<Record> recordList)
Add records to a collection One of the assignments in each 'Record' object should have the unique identifier property key/value.
|
void |
clearMetadataCaches()
Clears the caches associated with this datasource.
|
void |
clearMetadataCaches(boolean refresh) |
void |
clearViewCache()
Deprecated.
components shouldn't need to manually clear caches anymore
|
boolean |
collectionExists(java.lang.String collectionKey) |
java.lang.String |
convertEQLToString(com.endeca.mdex.eql_parser.types.Query queryAST)
Converts a full EQL Query AST into a readable EQL string.
|
java.lang.String |
convertEQLToString(com.endeca.mdex.eql_parser.types.StandaloneFilter filterAST)
Converts an EQL Filter AST into a readable EQL string.
|
java.lang.String |
convertEQLToString(com.endeca.mdex.eql_parser.types.Statement eqlStatement)
Converts an single EQL Statement into a readable EQL string.
|
com.endeca.mdex.conversation.types.Request |
createDiscoveryServiceQuery(QueryState state)
This method returns a query based on query state.
|
int |
deleteView(java.lang.String viewKey)
Deletes the view referenced by the passed keys.
|
java.lang.String |
determineStateName(QueryFunction f)
Determines the correct state name for the given
QueryFunction for use when applying the QueryFunction to the Request. |
QueryResults |
execute()
Executes a query representing the data source's QueryState.
|
QueryResults |
execute(QueryState queryState)
Executes a query representing the QueryState.
|
QueryResults |
execute(QueryState queryState,
java.lang.String logMsg)
Executes a query representing the QueryState.
|
com.endeca.mdex.conversation.types.Results |
execute(com.endeca.mdex.conversation.types.Request query)
Applies security and executes query against the current request's State.
|
com.endeca.mdex.conversation.types.Results |
execute(com.endeca.mdex.conversation.types.Request query,
java.lang.String logMsg)
Applies security and executes query against the current request's State.
|
QueryResults |
execute(java.lang.String logMsg)
Executes a query representing the data source's QueryState.
|
com.endeca.mdex.config.services.types.Results |
executeConfigServiceOperation(com.endeca.mdex.config.services.types.Request configRequest)
Executes config service operations
|
java.util.Collection<CollectionBaseView> |
getAllCollections() |
java.util.Collection<SemanticView> |
getAllCollectionsAndSemanticViews()
Get the full set of views, including both collection base views and custom semantic views.
|
java.util.Collection<SemanticView> |
getAllCollectionsAndSemanticViews(boolean includeNonActive)
Get the full set of views, including both collection base views and custom semantic views.
|
java.util.Set<java.lang.String> |
getAllNativeCollectionIds() |
java.util.Collection<SemanticView> |
getAllSemanticViews() |
java.util.Collection<SemanticView> |
getAllSemanticViews(boolean includeNonActive) |
CollectionBaseView |
getCollection(com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier collectionId)
Get a
CollectionBaseView from an MdexCollectionIdentifier. |
CollectionBaseView |
getCollection(java.lang.String collectionKey)
Get a
CollectionBaseView that represents a collection base view. |
SemanticView |
getCollectionOrSemanticView(java.lang.String viewKey)
Get a named
SemanticView, which could be either a collection base view or a custom semantic view. |
long |
getGroupId() |
java.util.List<IncompleteCollectionState> |
getIncompleteCollections() |
QueryState |
getInitialQueryState()
Retrieve the base QueryState on this data source, which is the InitialQueryState + baseFilte
|
protected MDEXState |
getMDEXState() |
java.util.Collection<PredefinedMetric> |
getPredefinedMetrics(java.lang.String viewKey)
Get all predefined metrics for a given view.
|
QueryState |
getQueryState()
Retrieve the current query state on this data source.
|
protected RequestIds |
getRequestIds() |
SemanticView |
getSemanticView(java.lang.String viewKey)
Get a custom
SemanticView by the specified viewKey. |
java.lang.String |
getServiceURL()
Return the service URL state for this data source.
|
java.util.List<java.lang.String> |
getTypeAheadTags()
Returns list of tags for this project.
|
protected UserSession |
getUserSession() |
boolean |
isAvailable() |
boolean |
isOnline()
Returns the cached availability of this data domain.
|
com.endeca.mdex.eql_parser.types.ExpressionBase |
parseLQLExpression(java.lang.String expression)
Parse an LQL Filter string and return a parsed ExpressionBase object form of that string.
|
com.endeca.mdex.eql_parser.types.Query |
parseLQLQuery(java.lang.String query,
boolean validationEnabled)
Parse an EQL Query string and return a parsed object form of that string.
|
int |
putView(SemanticView sView)
Adds or updates a custom semantic view or a collection.
|
void |
resetQueryState()
Reset the data source's query state to what it's initial state was.
|
void |
resetVisibleQueryState()
Removes only "visible" query filters from all collections.
|
void |
resetVisibleQueryState(CollectionBaseView collection)
Removes only "visible" query filters from a single collection.
|
boolean |
semanticViewExists(java.lang.String viewKey) |
void |
setQueryState(QueryState newState)
Set the state of this data source.
|
void |
updateCollectionData(java.lang.String collectionKey,
java.util.List<Record> recordList)
Update records in a collection The 'recordSpecifier' in 'Record' objects should have the unique identifier property key/value.
|
com.endeca.endeca_server.sconfig.types.ValidateEntitiesResponse |
validateView(SemanticView sView)
Validates a custom semantic view.
|
public DataSource(javax.portlet.PortletRequest request)
throws DataSourceException
DataSourceExceptionpublic DataSource(javax.portlet.PortletRequest request,
MDEXState mdexState)
throws DataSourceException
DataSourceExceptionpublic DataSource(javax.portlet.PortletRequest request,
java.lang.String[] boundDataSets)
throws DataSourceException
DataSourceExceptionpublic DataSource(javax.portlet.PortletRequest request,
com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier collectionId)
throws DataSourceException
DataSourceExceptionpublic DataSource(javax.portlet.PortletRequest request,
long groupId)
throws DataSourceException
DataSourceExceptionprotected UserSession getUserSession() throws UserSessionException
UserSessionExceptionprotected MDEXState getMDEXState()
protected RequestIds getRequestIds()
public java.lang.String getServiceURL()
public boolean isAvailable()
public boolean isOnline()
MDEXState.isOnline()public QueryState getQueryState() throws DataSourceException
DataSourceExceptionpublic void setQueryState(QueryState newState) throws DataSourceException
newState - The new state to "push"DataSourceExceptionpublic QueryState getInitialQueryState() throws DataSourceException
DataSourceExceptionpublic void resetQueryState()
throws DataSourceException
DataSourceExceptionpublic void resetVisibleQueryState()
throws DataSourceException
DataSourceExceptionpublic void resetVisibleQueryState(CollectionBaseView collection) throws DataSourceException
collection - the CollectionBaseView from whose query state to remove visible filtersDataSourceExceptionpublic QueryResults execute() throws DataSourceException
DataSourceExceptionpublic QueryResults execute(java.lang.String logMsg) throws DataSourceException
logMsg - - additional message used for performance metrics logDataSourceExceptionpublic QueryResults execute(QueryState queryState) throws DataSourceException
queryState - DataSourceExceptionpublic QueryResults execute(QueryState queryState, java.lang.String logMsg) throws DataSourceException
queryState - logMsg - - additional message used for performance metrics logDataSourceExceptionpublic void clearMetadataCaches()
public void clearMetadataCaches(boolean refresh)
throws DataSourceAccessException,
DataSourceException
@Deprecated public void clearViewCache()
DataSource.clearMetadataCaches instead of this method so the attribute group
cache is cleared in addition to the entity cache.public boolean collectionExists(java.lang.String collectionKey)
public boolean semanticViewExists(java.lang.String viewKey)
public CollectionBaseView getCollection(java.lang.String collectionKey) throws KeyNotFoundException, DataSourceAccessException, DataSourceException
CollectionBaseView that represents a collection base view. The collection cache is initialized if necessary.collectionKey - key of the mdex collection soughtKeyNotFoundException - if the collection with the specified key is not foundDataSourceException - if there was a query error when getting collection metadataDataSourceAccessExceptionpublic CollectionBaseView getCollection(com.oracle.endeca.pdi.concepts.mdex.MdexCollectionIdentifier collectionId) throws KeyNotFoundException, DataSourceException
CollectionBaseView from an MdexCollectionIdentifier.collectionId - KeyNotFoundExceptionDataSourceExceptionpublic java.util.Collection<CollectionBaseView> getAllCollections() throws DataSourceAccessException, DataSourceException
DataSourceException - if there was a query error when getting collection metadataDataSourceAccessExceptionpublic java.util.Set<java.lang.String> getAllNativeCollectionIds()
public SemanticView getSemanticView(java.lang.String viewKey) throws KeyNotFoundException, DataSourceException
SemanticView by the specified viewKey. The cache of view information is initialized if necessary.request - TODOviewKey - key of the mdex view soughtKeyNotFoundException - if the view with the specified key is not foundDataSourceExcpetion - if there was a query error when getting view metadataDataSourceExceptionpublic java.util.Collection<SemanticView> getAllSemanticViews() throws DataSourceAccessException, DataSourceException
DataSourceException - if there was a query error when getting view metadataDataSourceAccessExceptionpublic java.util.Collection<SemanticView> getAllSemanticViews(boolean includeNonActive) throws DataSourceAccessException, DataSourceException
Whether - to include non-active views or not.DataSourceException - if there was a query error when getting view metadataDataSourceAccessExceptionpublic SemanticView getCollectionOrSemanticView(java.lang.String viewKey) throws KeyNotFoundException, DataSourceException
SemanticView, which could be either a collection base view or a custom semantic view.viewKey - key of the collection or semantic view soughtKeyNotFoundException - if the view with the specified key is not foundDataSourceExcpetion - if there was a query error when getting view metadataDataSourceExceptionpublic java.util.Collection<SemanticView> getAllCollectionsAndSemanticViews() throws DataSourceException
DataSourceExcpetion - if there was a query error when getting view metadataDataSourceExceptionpublic java.util.Collection<SemanticView> getAllCollectionsAndSemanticViews(boolean includeNonActive) throws DataSourceException
Whether - to include non-active views or not.DataSourceExcpetion - if there was a query error when getting view metadataDataSourceExceptionpublic com.endeca.mdex.conversation.types.Results execute(com.endeca.mdex.conversation.types.Request query)
throws DataSourceException
query - The query to executeDataSourceExceptionpublic com.endeca.mdex.conversation.types.Results execute(com.endeca.mdex.conversation.types.Request query,
java.lang.String logMsg)
throws DataSourceException
query - The query to executelogMsg - additional log message for performance metrics logDataSourceExceptionpublic com.endeca.mdex.config.services.types.Results executeConfigServiceOperation(com.endeca.mdex.config.services.types.Request configRequest)
throws DataSourceException
configRequest - the Request to executeDataSourceExceptionpublic int deleteView(java.lang.String viewKey)
throws KeyNotFoundException,
DataSourceException
viewKey - references the view to deleteKeyNotFoundExceptionDataSourceExceptionpublic void updateCollectionData(java.lang.String collectionKey,
java.util.List<Record> recordList)
throws KeyNotFoundException,
DataSourceException
collectionKey - recordList - KeyNotFoundExceptionDataSourceExceptionpublic void addCollectionData(java.lang.String collectionKey,
java.util.List<Record> recordList)
throws KeyNotFoundException,
DataSourceException
collectionKey - recordList - KeyNotFoundExceptionDataSourceExceptionpublic int putView(SemanticView sView) throws DataSourceException
sView - a SemanticView or CollectionBaseView to add or updateDataSourceExceptionpublic com.endeca.endeca_server.sconfig.types.ValidateEntitiesResponse validateView(SemanticView sView) throws DataSourceException
sView - a SemanticView to validateDataSourceExceptionpublic com.endeca.mdex.eql_parser.types.ExpressionBase parseLQLExpression(java.lang.String expression)
throws LQLException
DataSourceFilter and
SelectionFilter QueryFunctions.
This method internally calls parseLQLFilter(String).expression - String that represents the filterLqlExceptionLQLExceptionpublic com.endeca.mdex.eql_parser.types.Query parseLQLQuery(java.lang.String query,
boolean validationEnabled)
throws DataSourceException,
LQLException
query - String that represents the queryvalidationEnabled - boolean to enable/disable query validationLQLException - if the filter has a syntax or type-checking error a LQLException will be thrownDataSourceException - any non-expected exceptionpublic java.lang.String convertEQLToString(com.endeca.mdex.eql_parser.types.Query queryAST)
queryAST - a full EQL Query (list of Statements)com.endeca.mdex.eql_parser.EqlExceptionpublic java.lang.String convertEQLToString(com.endeca.mdex.eql_parser.types.Statement eqlStatement)
eqlStatement - public java.lang.String convertEQLToString(com.endeca.mdex.eql_parser.types.StandaloneFilter filterAST)
filterAST - a filter expressionpublic java.util.Collection<PredefinedMetric> getPredefinedMetrics(java.lang.String viewKey) throws KeyNotFoundException, DataSourceException
viewKey - key of a view whose metrics are soughtKeyNotFoundException - if there is no semantic view matching the provided keyDataSourceException - if a query error is encountered loading view metadatapublic com.endeca.mdex.conversation.types.Request createDiscoveryServiceQuery(QueryState state) throws DataSourceException
state - DataSourceExceptionpublic java.lang.String determineStateName(QueryFunction f) throws DataSourceException, KeyNotFoundException
QueryFunction for use when applying the QueryFunction to the Request.f - a QueryFunction to potentially associate with a named stateDataSourceException - if there was a problem retrieving Collections or SemanticViews underpinning this DataSourceKeyNotFoundException - if the QueryFunction references an unknown view keypublic java.util.List<IncompleteCollectionState> getIncompleteCollections()
public java.util.List<java.lang.String> getTypeAheadTags()
throws DataSourceException
DataSourceExceptionpublic long getGroupId()
Copyright 2003, 2014, Oracle and/or its affiliates. All rights reserved.