com.endeca.portal.metadata.datasource
Class MDEXStateMetadataManager

java.lang.Object
  extended by com.endeca.portal.metadata.AbstractMetadataManager<MDEXStateMetadataObject>
      extended by com.endeca.portal.metadata.datasource.MDEXStateMetadataManager
All Implemented Interfaces:
MetadataManager<MDEXStateMetadataObject>

public class MDEXStateMetadataManager
extends AbstractMetadataManager<MDEXStateMetadataObject>
implements MetadataManager<MDEXStateMetadataObject>

This class manages the persistence management of the MDEXState objects.


Field Summary
static java.lang.String MDEX_STATE_TYPE
           
 
Method Summary
 boolean addOrUpdateMDEXState(java.lang.String id, java.lang.String mdexStateInitialConfig)
          This method stores an MDEXState's initial configuration string in the database.
 boolean deleteMDEXState(java.lang.String id)
          This method removes an MDEXState from the database based on its data source id.
 java.util.List<MDEXStateMetadataObject> getAllDatasources()
          This method returns all the MDEXStateMetadataObject directly from the database in a List.
static MDEXStateMetadataManager getInstance()
          Return an instance of the MDEXStateMetadataManager.
 MDEXStateMetadataObject getMDEXStateMetadataObject(java.lang.String key)
          This method returns the MDEXStateMetadataObject based on the passed data source Id from the database.
 boolean hasDataSources()
          This method will return true if there are 1 or more data sources persisted, and false if no data sources exist.
 boolean hasProperties()
          Return true to indicate that this MetadataManager class works with MetadataObjects that have associated MetadataProperties.
 MDEXStateMetadataObject objectFromMetadataRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataRecord record)
          Given a base Liferay record, return a Metadata Object; subclasses must implement this method.
 MDEXStateMetadataObject persist(MDEXStateMetadataObject incoming)
          Persists a Metadata Object to the database
<S extends MetadataProperty>
S
propertyFromMetadataPropertyRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)
          Given a base Liferay record, return a Metadata Property; subclasses must implement this method.
 
Methods inherited from class com.endeca.portal.metadata.AbstractMetadataManager
getMetadataPropertyRecords, getObject, getObjectById, getObjects, getProperties, getProperty, handleObjectPropertyPersistence, objectsFromMetadataRecords, persist, persistProperties, persistProperty, propertiesFromMetadataPropertyRecords, removeObjectById, removePropertyById, setupPropertyQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MDEX_STATE_TYPE

public static final java.lang.String MDEX_STATE_TYPE
See Also:
Constant Field Values
Method Detail

getInstance

public static MDEXStateMetadataManager getInstance()
Return an instance of the MDEXStateMetadataManager.

Returns:
MDEXStateMetadataManager

addOrUpdateMDEXState

public boolean addOrUpdateMDEXState(java.lang.String id,
                                    java.lang.String mdexStateInitialConfig)
This method stores an MDEXState's initial configuration string in the database. If the MDEXState already exists in the database, it overwrites what is there.

Parameters:
id -
mdexStateInitialConfig -
Returns:
boolean

deleteMDEXState

public boolean deleteMDEXState(java.lang.String id)
                        throws MetadataException
This method removes an MDEXState from the database based on its data source id.

Parameters:
id -
Returns:
boolean
Throws:
MetadataException

getAllDatasources

public java.util.List<MDEXStateMetadataObject> getAllDatasources()
This method returns all the MDEXStateMetadataObject directly from the database in a List.

Returns:
List

hasDataSources

public boolean hasDataSources()
This method will return true if there are 1 or more data sources persisted, and false if no data sources exist.

Returns:
boolean

getMDEXStateMetadataObject

public MDEXStateMetadataObject getMDEXStateMetadataObject(java.lang.String key)
This method returns the MDEXStateMetadataObject based on the passed data source Id from the database.

Parameters:
key -
Returns:
MDEXStateMetadataObject

persist

public MDEXStateMetadataObject persist(MDEXStateMetadataObject incoming)
                                throws MetadataException
Description copied from class: AbstractMetadataManager
Persists a Metadata Object to the database

Overrides:
persist in class AbstractMetadataManager<MDEXStateMetadataObject>
Parameters:
incoming - the Metadata Object representing the record to be persisted
Returns:
the persisted Metadata Object
Throws:
MetadataException - if there was an error persisting the data

objectFromMetadataRecord

public MDEXStateMetadataObject objectFromMetadataRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataRecord record)
Description copied from class: AbstractMetadataManager
Given a base Liferay record, return a Metadata Object; subclasses must implement this method.

Specified by:
objectFromMetadataRecord in interface MetadataManager<MDEXStateMetadataObject>
Specified by:
objectFromMetadataRecord in class AbstractMetadataManager<MDEXStateMetadataObject>
Parameters:
record - the base Liferay record
Returns:
the Metadata Object
See Also:
MetadataManager.objectFromMetadataRecord(MetadataRecord)

propertyFromMetadataPropertyRecord

public <S extends MetadataProperty> S propertyFromMetadataPropertyRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)
Description copied from class: AbstractMetadataManager
Given a base Liferay record, return a Metadata Property; subclasses must implement this method.

Specified by:
propertyFromMetadataPropertyRecord in interface MetadataManager<MDEXStateMetadataObject>
Specified by:
propertyFromMetadataPropertyRecord in class AbstractMetadataManager<MDEXStateMetadataObject>
Type Parameters:
S - an instance of a Metadata Property extension
Parameters:
record - the base Liferay record
Returns:
the Metadata Property
See Also:
MetadataManager.propertyFromMetadataPropertyRecord(MetadataPropertyRecord)

hasProperties

public boolean hasProperties()
Description copied from class: AbstractMetadataManager
Return true to indicate that this MetadataManager class works with MetadataObjects that have associated MetadataProperties. Return false to bypass the additional database queries required to work with associated MetadataProperties.

Specified by:
hasProperties in class AbstractMetadataManager<MDEXStateMetadataObject>
Returns:
true to work with associated properties; false to bypass associated property code paths