|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.endeca.portal.data.DataSource
public class DataSource
DataSource instances encapsulate a connection to an MDEX Engine, a current 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 Summary | |
---|---|
DataSource(javax.portlet.PortletRequest request,
java.lang.String dataSourceId)
Construct a DataSource instance referring to a particular data source. |
Method Summary | |
---|---|
void |
clearMetadataCaches()
Clears the caches associated with this datasource. |
void |
clearViewCache()
Deprecated. components shouldn't need to manually clear caches anymore |
com.endeca.mdex.transaction.CommitOuterTransactionResponse |
commitOuterTransaction(java.lang.String outerTransactionId)
Commits an outer transaction. |
com.endeca.mdex.conversation.Request |
createDiscoveryServiceQuery(QueryState state)
This method returns a query based on query state. |
com.endeca.mdex.sconfig._2010.types.DeleteAllFilterRulesResponse |
deleteAllFilterRules(java.lang.String outerTransactionId)
Deletes all the filter rules from Endeca Server. |
com.endeca.mdex.sconfig._2010.types.DeleteFilterRulesResponse |
deleteFilterRules(java.util.List<java.lang.String> filterRuleKeysToDelete,
java.lang.String outerTransactionId)
Deletes a set of filter rules from Endeca Server ( outerTransactionId can be left null if this operation is not in a transaction). |
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. |
com.endeca.mdex.config.services.types.Results |
executeConfigServiceUpdateOperation(com.endeca.mdex.config.services.types.ConfigTransaction transaction)
Executes update config service transactions |
java.util.Collection<CollectionBaseView> |
getAllCollections(java.util.Locale locale)
|
java.util.Collection<CollectionBaseView> |
getAllCollections(java.util.Locale locale,
boolean noRequests)
Overriding method to getAllCollections(locale) that will return a null or empty collection rather than call out to an MDEX. |
java.util.Collection<SemanticView> |
getAllCollectionsAndSemanticViews(java.util.Locale locale)
Get the full set of views, including both collection base views and custom semantic views. |
java.util.List<com.endeca.mdex.sconfig._2010.types.FilterRule> |
getAllFilterRules()
Queries the Endeca Server for the full list of Filter Rules. |
java.util.Collection<SemanticView> |
getAllSemanticViews(java.util.Locale locale)
|
CollectionBaseView |
getCollection(java.lang.String collectionKey,
java.util.Locale locale)
Get a CollectionBaseView that represents a collection base view. |
SemanticView |
getCollectionOrSemanticView(java.lang.String viewKey,
java.util.Locale locale)
Get a named SemanticView , which could be either a collection base view or a custom semantic view. |
java.lang.String |
getDescription()
get the DataSource's description |
javax.xml.namespace.QName |
getEventName()
Retrieve the event name that gets fired/listened for when this data source changes. |
AttributeSettings |
getGlobalAttributeSettings()
Deprecated. for temporary support while we migrate components to new Attribute UAM (com.endeca.portal.attributes.viewmodel.Attribute) |
java.lang.String |
getId()
get the DataSource's ID |
java.util.List<IncompleteCollectionState> |
getIncompleteCollections()
|
QueryState |
getInitialQueryState()
Retrieve the base QueryState on this data source, which is the InitialQueryState + baseFilte |
protected MDEXState |
getMDEXState()
|
java.lang.String |
getName()
get the DataSource's name |
java.util.Collection<PredefinedMetric> |
getPredefinedMetrics(java.lang.String viewKey,
java.util.Locale locale)
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,
java.util.Locale locale)
Get a custom SemanticView by the specified viewKey. |
java.lang.String |
getServiceURL()
This method is only used when your data source and portlet support MDEX 7 and the Discovery Service API. |
protected UserSession |
getUserSession()
|
MDEXState.APIVersion |
getVersion()
Get what APIVersion this data source supports. |
boolean |
isAvailable()
|
boolean |
isIdle()
Convenience method to check data domain idle status. |
boolean |
isOnline()
Returns the cached availability of this data domain. |
boolean |
isUpdatable()
|
com.endeca.mdex.transaction.ListOuterTransactionResponse |
listOuterTransaction()
List outer transaction. |
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 LQL Query string and return a parsed object form of that string. |
com.endeca.mdex.sconfig._2010.types.PutFilterRulesResponse |
putFilterRules(java.util.List<com.endeca.mdex.sconfig._2010.types.FilterRule> filterRules,
java.lang.String outerTransactionId)
Adds or updates one or more filter rules on the Endeca Server. |
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. |
com.endeca.mdex.transaction.RollBackOuterTransactionResponse |
rollBackOuterTransaction(java.lang.String outerTransactionId)
Rolls back an outer transaction. |
void |
setQueryState(QueryState newState)
Set the state of this data source. |
java.lang.String |
startOuterTransaction()
Starts a outer transaction. |
boolean |
supportsConfigService()
|
boolean |
supportsDiscoveryService()
|
boolean |
supportsFeature(Feature f)
|
boolean |
supportsLQLParserService()
|
boolean |
supportsSConfigService()
|
java.lang.String |
toString()
|
com.endeca.mdex.sconfig._2010.types.ValidateEntityResponse |
validateView(SemanticView sView)
Validates a custom semantic view. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DataSource(javax.portlet.PortletRequest request, java.lang.String dataSourceId) throws DataSourceException
EndecaPortlet.getDataSource(PortletRequest)
inside your portlet
in most instances.
request
- The current request objectdataSourceId
- The id of the data source to represent
DataSourceException
Method Detail |
---|
protected UserSession getUserSession() throws UserSessionException
UserSessionException
protected MDEXState getMDEXState()
protected RequestIds getRequestIds()
public java.lang.String getName()
public java.lang.String getDescription()
public java.lang.String getId()
public javax.xml.namespace.QName getEventName()
public MDEXState.APIVersion getVersion()
supportsDiscoveryService()
instead of this method.
public boolean supportsDiscoveryService()
public boolean supportsConfigService()
public boolean supportsSConfigService()
public boolean supportsLQLParserService()
public java.lang.String getServiceURL()
public boolean isAvailable()
public boolean isIdle()
MDEXState.isIdle()
public boolean isOnline()
MDEXState.isOnline()
public boolean isUpdatable()
public boolean supportsFeature(Feature f)
public QueryState getQueryState() throws DataSourceException
DataSourceException
public void setQueryState(QueryState newState) throws DataSourceException
newState
- The new state to "push"
DataSourceException
public QueryState getInitialQueryState() throws DataSourceException
DataSourceException
public void resetQueryState() throws DataSourceException
DataSourceException
public void resetVisibleQueryState() throws DataSourceException
DataSourceException
public void resetVisibleQueryState(CollectionBaseView collection) throws DataSourceException
collection
- the CollectionBaseView from whose query state to remove visible filters
DataSourceException
public QueryResults execute() throws DataSourceException
DataSourceException
public QueryResults execute(QueryState queryState) throws DataSourceException
queryState
-
DataSourceException
public void clearMetadataCaches()
public void clearViewCache()
DataSource.clearMetadataCaches
instead
of this method so the attribute group cache is cleared in addition to the entity cache.
public AttributeSettings getGlobalAttributeSettings() throws DataSourceException
AttributeSettings
instance
DataSourceException
public CollectionBaseView getCollection(java.lang.String collectionKey, java.util.Locale locale) throws KeyNotFoundException, DataSourceException
CollectionBaseView
that represents a collection base view. The
collection cache is initialized if necessary.
collectionKey
- key of the mdex collection sought
KeyNotFoundException
- if the collection with the specified key is not found
DataSourceException
- if there was a query error when getting collection metadatapublic java.util.Collection<CollectionBaseView> getAllCollections(java.util.Locale locale) throws DataSourceException
DataSourceException
- if there was a query error when getting collection metadatapublic java.util.Collection<CollectionBaseView> getAllCollections(java.util.Locale locale, boolean noRequests) throws DataSourceException
locale
- noRequests
- boolean to toggle using
DataSourceException
public SemanticView getSemanticView(java.lang.String viewKey, java.util.Locale locale) throws KeyNotFoundException, DataSourceException
SemanticView
by the specified viewKey. The cache of view
information is initialized if necessary.
viewKey
- key of the mdex view sought
KeyNotFoundException
- if the view with the specified key is not found
DataSourceExcpetion
- if there was a query error when getting view metadata
DataSourceException
public java.util.Collection<SemanticView> getAllSemanticViews(java.util.Locale locale) throws DataSourceException
DataSourceException
- if there was a query error when getting view metadatapublic SemanticView getCollectionOrSemanticView(java.lang.String viewKey, java.util.Locale locale) 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 sought
KeyNotFoundException
- if the view with the specified key is not found
DataSourceExcpetion
- if there was a query error when getting view metadata
DataSourceException
public java.util.Collection<SemanticView> getAllCollectionsAndSemanticViews(java.util.Locale locale) throws DataSourceException
DataSourceExcpetion
- if there was a query error when getting view metadata
DataSourceException
public java.util.List<com.endeca.mdex.sconfig._2010.types.FilterRule> getAllFilterRules() throws DataSourceException
DataSourceException
public com.endeca.mdex.sconfig._2010.types.PutFilterRulesResponse putFilterRules(java.util.List<com.endeca.mdex.sconfig._2010.types.FilterRule> filterRules, java.lang.String outerTransactionId) throws DataSourceException
filterRules:
- a list of FilterRule objects to add/update on the serverouterTransactionId:
- outerTransactionId when outer transaction is used; can be left NULL if this operation is not part of a transaction.
DataSourceException
public com.endeca.mdex.sconfig._2010.types.DeleteFilterRulesResponse deleteFilterRules(java.util.List<java.lang.String> filterRuleKeysToDelete, java.lang.String outerTransactionId) throws DataSourceException
filterRuleKeysToDelete:
- list of Strings indicating the keys of the filter rules to delete.outerTransactionId:
- outerTransactionId when outer transaction is used; can be left NULL if this operation is not part of a transaction.
DataSourceException
public com.endeca.mdex.sconfig._2010.types.DeleteAllFilterRulesResponse deleteAllFilterRules(java.lang.String outerTransactionId) throws DataSourceException
outerTransactionId:
- outerTransactionId when outer transaction is used; can be left NULL if this operation is not part of a transaction.
DataSourceException
public java.lang.String startOuterTransaction() throws java.lang.Exception
java.lang.Exception
public com.endeca.mdex.transaction.CommitOuterTransactionResponse commitOuterTransaction(java.lang.String outerTransactionId) throws java.lang.Exception
java.lang.Exception
public com.endeca.mdex.transaction.RollBackOuterTransactionResponse rollBackOuterTransaction(java.lang.String outerTransactionId) throws java.lang.Exception
java.lang.Exception
public com.endeca.mdex.transaction.ListOuterTransactionResponse listOuterTransaction() throws java.lang.Exception
java.lang.Exception
public com.endeca.mdex.config.services.types.Results executeConfigServiceUpdateOperation(com.endeca.mdex.config.services.types.ConfigTransaction transaction) throws DataSourceException
transaction
- the ConfigTransaction
to execute
DataSourceException
public int deleteView(java.lang.String viewKey) throws KeyNotFoundException, DataSourceException
viewKey
- references the view to delete
KeyNotFoundException
DataSourceException
public int putView(SemanticView sView) throws DataSourceException
sView
- a SemanticView or CollectionBaseView to add or update
DataSourceException
public com.endeca.mdex.sconfig._2010.types.ValidateEntityResponse validateView(SemanticView sView) throws DataSourceException
sView
- a SemanticView to validate
DataSourceException
public com.endeca.mdex.eql_parser.types.ExpressionBase parseLQLExpression(java.lang.String expression) throws DataSourceException, LQLException
DataSourceFilter
and
SelectionFilter
QueryFunctions.
This method internally calls parseLQLFilter(String)
.
expression
- String that represents the filter
com.endeca.mdex.eql_parser._2010.ParserFault
- if the filter has a syntax or type-checking error a ParserFault will be thrown
DataSourceException
- any non-expected exception
LQLException
public 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 validation
com.endeca.mdex.eql_parser._2010.ParserFault
- if the filter has a syntax or type-checking error a ParserFault will be thrown
DataSourceException
- any non-expected exception
LQLException
public java.util.Collection<PredefinedMetric> getPredefinedMetrics(java.lang.String viewKey, java.util.Locale locale) throws KeyNotFoundException, DataSourceException
viewKey
- key of a view whose metrics are sought
KeyNotFoundException
- if there is no semantic view matching the provided key
DataSourceException
- if a query error is encountered loading view metadatapublic com.endeca.mdex.conversation.Request createDiscoveryServiceQuery(QueryState state) throws DataSourceException
state
-
DataSourceException
public 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 state
DataSourceException
- if there was a problem retrieving Collections or SemanticViews underpinning this DataSource
KeyNotFoundException
- if the QueryFunction references an unknown view keypublic java.util.List<IncompleteCollectionState> getIncompleteCollections()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |