com.endeca.portal.data
Class MDEXState

java.lang.Object
  extended by com.endeca.portal.data.MDEXState
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class MDEXState
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Portlet developers should avoid this class. See DataSource instead. Note that with the exception of getQueryState() and setQueryState(QueryState) this class is not thread safe. All other getters and setters provided by this class are not synchronized.

See Also:
Serialized Form

Nested Class Summary
static class MDEXState.APIVersion
           
static class MDEXState.MDEXRecords
           
 
Field Summary
static java.lang.String API_VERSION_PROPERTY
           
static java.lang.String BASEFUNCTIONS_PROPERTY
           
static java.lang.String BASEQUERYOPTIONS_PROPERTY
           
static java.lang.String CURRENTFUNCTIONS_PROPERTY
           
protected  java.lang.String datastoreName
           
static java.lang.String DB_PROPERTY
           
static MDEXState.APIVersion DEFAULT_API_VERSION
           
static com.endeca.portal.data.MDEXState.EngineVersion DEFAULT_ENGINE_VERSION
           
static MDEXState.MDEXRecords DEFAULT_MDEX_RECORDS
           
static java.lang.String DESCRIPTION_PROPERTY
           
 com.endeca.portal.data.MDEXState.EngineVersion engineVersion
           
protected  java.lang.String id
           
static java.lang.String ID_PROPERTY
           
protected  QueryState initialState
           
static java.lang.String MDEX_RECORDS_PROPERTY
           
protected  java.lang.String name
           
static java.lang.String NAME_PROPERTY
           
static java.lang.String PORT_PROPERTY
           
static java.lang.String SERVER_PROPERTY
           
static java.lang.String SSL_CONFIG_PROPERTY
           
protected  QueryState state
           
protected  java.lang.String statusMessage
           
static java.lang.String UPDATE_PORT_PROPERTY
           
static java.lang.String UPDATE_SERVER_PROPERTY
           
static java.lang.String UPDATE_SSL_CONFIG_PROPERTY
           
 
Constructor Summary
MDEXState(org.json.JSONObject configuration)
           
 
Method Summary
 void clearEntityCaches()
          Clear the entities and predefined metrics caches.
 MDEXState clone()
           
 MDEXAttributeList getAttributes()
           
 AttributeSettings getAttributeSettings()
           
 com.endeca.mdex.config.services.config._2010.ConfigPort getConfigServicePort()
          Convenience method for getting the Config service port
 java.lang.String getConfigServiceURL()
          This method is only useful when the data source supports the discovery service.
 java.lang.String getDataSourceNotUpdatableMessage()
           
 java.lang.String getDatastoreName()
           
 java.lang.String getDescription()
           
 com.endeca.mdex.conversation.ConversationPort getDiscoveryServicePort(boolean useMaster)
          Convenience method for getting the Conversation service port
 java.lang.String getDiscoveryServiceURL(boolean useMaster)
           
 java.util.List<com.endeca.mdex.sconfig._2010.types.SemanticEntity> getEntitiesCache(boolean cacheEnabled)
           
 long getEntryVersion()
           
 javax.xml.namespace.QName getEventName()
           
 java.lang.String getId()
           
 org.json.JSONObject getInitialConfiguration()
           
 QueryState getInitialQueryState()
          Returns the initial QueryState associated with this MDEXState, including any valid base functions present in the MDEXState's configuration.
 boolean getIsSSLEnabled()
           
 com.endeca.mdex.lql_parser._2010.ParserPort getLQLParserPort()
          Convenience method for getting the LQL Parser service port
 java.lang.String getLQLParserServiceURL()
           
 MDEXState.MDEXRecords getMdexRecords()
           
 java.lang.String getName()
           
 java.lang.String getPort()
           
 java.util.List<com.endeca.mdex.lql_parser._2010.ParsedMetric> getPredefinedMetricsCache(java.lang.String entity, boolean cacheEnabled)
           
 QueryState getQueryState()
           
 com.endeca.mdex.sconfig._2010.SConfigPort getSConfigPort(boolean canUpdate)
          Convenience method for getting the Semantic Config service port
 java.lang.String getSConfigServiceURL(boolean canUpdate)
           
 java.lang.String getServer()
           
 SSLConfig getSSLConfig()
           
 java.lang.String getStatusMessage()
           
 java.lang.String getUpdatePort()
           
 java.lang.String getUpdateServer()
           
 SSLConfig getUpdateSSLConfig()
           
 MDEXState.APIVersion getVersion()
           
 boolean isAvailable()
           
 boolean isUpdatable()
           
 boolean isUpdateSSLEnabled()
           
 boolean isValid()
           
protected  void setAttributes(MDEXAttributeList mdexAttributes)
           
protected  void setAttributeSettings(AttributeSettings attributeSettings)
          This should only ever be used by the DataSource to store AttributeSettings for the purposes of caching.
 void setEntitiesCache(java.util.List<com.endeca.mdex.sconfig._2010.types.SemanticEntity> entitiesCache, boolean cacheEnabled)
           
 void setEntryVersion(long entryVersion)
           
 void setPredefinedMetricsCache(java.lang.String entity, java.util.List<com.endeca.mdex.lql_parser._2010.ParsedMetric> predefinedMetrics, boolean cacheEnabled)
           
 void setQueryState(QueryState dss)
          Deprecated. 
 boolean supportsConfigService()
           
 boolean supportsDiscoveryService()
           
 boolean supportsFeature(Feature f)
           
 boolean supportsLQLParserService()
           
 boolean supportsSConfigService()
           
 org.json.JSONObject toJSON()
           
 java.lang.String toString()
           
 boolean updateStatus()
          Updates the status of this MDEXState.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

name

protected java.lang.String name

datastoreName

protected java.lang.String datastoreName

engineVersion

public com.endeca.portal.data.MDEXState.EngineVersion engineVersion

state

protected QueryState state

initialState

protected QueryState initialState

statusMessage

protected java.lang.String statusMessage

SERVER_PROPERTY

public static final java.lang.String SERVER_PROPERTY
See Also:
Constant Field Values

PORT_PROPERTY

public static final java.lang.String PORT_PROPERTY
See Also:
Constant Field Values

UPDATE_SERVER_PROPERTY

public static final java.lang.String UPDATE_SERVER_PROPERTY
See Also:
Constant Field Values

UPDATE_PORT_PROPERTY

public static final java.lang.String UPDATE_PORT_PROPERTY
See Also:
Constant Field Values

UPDATE_SSL_CONFIG_PROPERTY

public static final java.lang.String UPDATE_SSL_CONFIG_PROPERTY
See Also:
Constant Field Values

SSL_CONFIG_PROPERTY

public static final java.lang.String SSL_CONFIG_PROPERTY
See Also:
Constant Field Values

NAME_PROPERTY

public static final java.lang.String NAME_PROPERTY
See Also:
Constant Field Values

DESCRIPTION_PROPERTY

public static final java.lang.String DESCRIPTION_PROPERTY
See Also:
Constant Field Values

ID_PROPERTY

public static final java.lang.String ID_PROPERTY
See Also:
Constant Field Values

DB_PROPERTY

public static final java.lang.String DB_PROPERTY
See Also:
Constant Field Values

BASEQUERYOPTIONS_PROPERTY

public static final java.lang.String BASEQUERYOPTIONS_PROPERTY
See Also:
Constant Field Values

BASEFUNCTIONS_PROPERTY

public static final java.lang.String BASEFUNCTIONS_PROPERTY
See Also:
Constant Field Values

CURRENTFUNCTIONS_PROPERTY

public static final java.lang.String CURRENTFUNCTIONS_PROPERTY
See Also:
Constant Field Values

API_VERSION_PROPERTY

public static final java.lang.String API_VERSION_PROPERTY
See Also:
Constant Field Values

MDEX_RECORDS_PROPERTY

public static final java.lang.String MDEX_RECORDS_PROPERTY
See Also:
Constant Field Values

DEFAULT_API_VERSION

public static final MDEXState.APIVersion DEFAULT_API_VERSION

DEFAULT_ENGINE_VERSION

public static final com.endeca.portal.data.MDEXState.EngineVersion DEFAULT_ENGINE_VERSION

DEFAULT_MDEX_RECORDS

public static final MDEXState.MDEXRecords DEFAULT_MDEX_RECORDS
Constructor Detail

MDEXState

public MDEXState(org.json.JSONObject configuration)
          throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException
Method Detail

getEntryVersion

public long getEntryVersion()

getId

public java.lang.String getId()

getName

public java.lang.String getName()

getDatastoreName

public java.lang.String getDatastoreName()

getServer

public java.lang.String getServer()

getPort

public java.lang.String getPort()

getUpdatePort

public java.lang.String getUpdatePort()

getUpdateServer

public java.lang.String getUpdateServer()

getVersion

public MDEXState.APIVersion getVersion()

supportsDiscoveryService

public boolean supportsDiscoveryService()

supportsConfigService

public boolean supportsConfigService()

supportsSConfigService

public boolean supportsSConfigService()

supportsLQLParserService

public boolean supportsLQLParserService()

supportsFeature

public boolean supportsFeature(Feature f)

getMdexRecords

public MDEXState.MDEXRecords getMdexRecords()

getUpdateSSLConfig

public SSLConfig getUpdateSSLConfig()

isUpdateSSLEnabled

public boolean isUpdateSSLEnabled()

getSSLConfig

public SSLConfig getSSLConfig()

getIsSSLEnabled

public boolean getIsSSLEnabled()

isAvailable

public boolean isAvailable()

isUpdatable

public boolean isUpdatable()

isValid

public boolean isValid()

getDescription

public java.lang.String getDescription()

getStatusMessage

public java.lang.String getStatusMessage()

getEventName

public javax.xml.namespace.QName getEventName()

getInitialConfiguration

public org.json.JSONObject getInitialConfiguration()

setEntryVersion

public void setEntryVersion(long entryVersion)

getQueryState

public QueryState getQueryState()
Returns:
a copy of the QueryState object

setQueryState

@Deprecated
public void setQueryState(QueryState dss)
Deprecated. 

Set the QueryState. In general, this should *ONLY* be called from the DataSource facade, but may need to be accessible for things like reloading bookmarks from a stored state, etc. This method isn't really deprecated... the flag is used to force compile time warnings. TODO: This needs to be undeprecated and made protected. Because the Bookmarks Portlet legitimately needs this functionality, a wrapper for this method should probably be exposed by the DataSource

Parameters:
dss -

getInitialQueryState

public QueryState getInitialQueryState()
Returns the initial QueryState associated with this MDEXState, including any valid base functions present in the MDEXState's configuration.

Returns:
initial QueryState

setAttributes

protected void setAttributes(MDEXAttributeList mdexAttributes)

getAttributes

public MDEXAttributeList getAttributes()

setAttributeSettings

protected void setAttributeSettings(AttributeSettings attributeSettings)
This should only ever be used by the DataSource to store AttributeSettings for the purposes of caching. Modifying the stored AttributeSettings has no effect since it will not be persisted anywhere. Hence, even though attributeSettings has a setter, it is immutable in practice.

Parameters:
attributeSettings - the attributeSettings to set

getAttributeSettings

public AttributeSettings getAttributeSettings()
Returns:
the attributeSettings

getEntitiesCache

public java.util.List<com.endeca.mdex.sconfig._2010.types.SemanticEntity> getEntitiesCache(boolean cacheEnabled)
Returns:
null if the cache is empty, otherwise the cached entities for this MDEX.

setEntitiesCache

public void setEntitiesCache(java.util.List<com.endeca.mdex.sconfig._2010.types.SemanticEntity> entitiesCache,
                             boolean cacheEnabled)
Parameters:
entitiesCache - the entities to be cached for retrieval by calls to getEntitiesCache.

getPredefinedMetricsCache

public java.util.List<com.endeca.mdex.lql_parser._2010.ParsedMetric> getPredefinedMetricsCache(java.lang.String entity,
                                                                                               boolean cacheEnabled)
Returns:
null if the cache is empty, otherwise the cached entities for this MDEX.

setPredefinedMetricsCache

public void setPredefinedMetricsCache(java.lang.String entity,
                                      java.util.List<com.endeca.mdex.lql_parser._2010.ParsedMetric> predefinedMetrics,
                                      boolean cacheEnabled)
Parameters:
entity - the key of the entity whose metrics are being cached
predefinedMetrics - the metrics to cache
cacheEnabled - whether or not to cache metrics

clearEntityCaches

public void clearEntityCaches()
Clear the entities and predefined metrics caches. Should be called for put operations which affect entities. Note that this only affects the current user's session, so other users in the system potentially have old entity information cached.


getDiscoveryServiceURL

public java.lang.String getDiscoveryServiceURL(boolean useMaster)

getConfigServiceURL

public java.lang.String getConfigServiceURL()
                                     throws java.lang.UnsupportedOperationException
This method is only useful when the data source supports the discovery service.

Returns:
the URL of the Conversation Service associated with this data source.
Throws:
java.lang.UnsupportedOperationException

getSConfigServiceURL

public java.lang.String getSConfigServiceURL(boolean canUpdate)
Returns:
the URL of the Semantic Config Service associated with this data source.

getLQLParserServiceURL

public java.lang.String getLQLParserServiceURL()
Returns:
the URL of the LQL Parser Service associated with this data source.

getDiscoveryServicePort

public com.endeca.mdex.conversation.ConversationPort getDiscoveryServicePort(boolean useMaster)
Convenience method for getting the Conversation service port


getConfigServicePort

public com.endeca.mdex.config.services.config._2010.ConfigPort getConfigServicePort()
                                                                             throws java.lang.UnsupportedOperationException
Convenience method for getting the Config service port

Throws:
java.lang.UnsupportedOperationException

getSConfigPort

public com.endeca.mdex.sconfig._2010.SConfigPort getSConfigPort(boolean canUpdate)
                                                         throws DataSourceException
Convenience method for getting the Semantic Config service port

Throws:
DataSourceException

getLQLParserPort

public com.endeca.mdex.lql_parser._2010.ParserPort getLQLParserPort()
                                                             throws DataSourceException
Convenience method for getting the LQL Parser service port

Throws:
DataSourceException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toJSON

public org.json.JSONObject toJSON()
                           throws org.json.JSONException
Throws:
org.json.JSONException

clone

public MDEXState clone()
Overrides:
clone in class java.lang.Object

updateStatus

public boolean updateStatus()
Updates the status of this MDEXState. Only the DataSourceConfigHelper has the global reference for MDEXStates. All other utilities get a clone. Obviously, updating the clone won't update the global reference.


getDataSourceNotUpdatableMessage

public java.lang.String getDataSourceNotUpdatableMessage()