com.endeca.portal.metadata.datasource
Class MDEXStateVersionManager

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

public class MDEXStateVersionManager
extends AbstractMetadataManager<MDEXStateVersion>
implements MetadataManager<MDEXStateVersion>

Encapsulates DB-interaction methods specific to Studio Core MDEX State version. This is a mechanism that allows the cached MDEX State's on each node of a Latitude Studio install to detect changes and refresh their state.


Field Summary
static java.lang.String MDEX_VERSION_KEY
           
static java.lang.String MDEX_VERSION_TYPE
           
 
Method Summary
 long fetchMDEXStateVersion()
          Retrieves the version number of the currently persisted MDEX State version.
static MDEXStateVersionManager getInstance()
          Return an instance of the MDEXStateVersionManager.
 boolean hasProperties()
          Return true to indicate that this MetadataManager class works with MetadataObjects that have associated MetadataProperties.
 void incrementMDEXStateVersion()
          This increases the persisted MDEX State version by 1.
 MDEXStateVersion objectFromMetadataRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataRecord record)
          Given a base Liferay record, return a Metadata Object; subclasses must implement this method.
 MDEXStateVersion persist(MDEXStateVersion 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_VERSION_KEY

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

MDEX_VERSION_TYPE

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

getInstance

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

Returns:
MDEXStateVersionManager

fetchMDEXStateVersion

public long fetchMDEXStateVersion()
Retrieves the version number of the currently persisted MDEX State version.

Returns:
long

incrementMDEXStateVersion

public void incrementMDEXStateVersion()
This increases the persisted MDEX State version by 1.


persist

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

Overrides:
persist in class AbstractMetadataManager<MDEXStateVersion>
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 MDEXStateVersion 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<MDEXStateVersion>
Specified by:
objectFromMetadataRecord in class AbstractMetadataManager<MDEXStateVersion>
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<MDEXStateVersion>
Specified by:
propertyFromMetadataPropertyRecord in class AbstractMetadataManager<MDEXStateVersion>
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<MDEXStateVersion>
Returns:
true to work with associated properties; false to bypass associated property code paths