org.lexevs.dao.database.service
Class RevisableAbstractDatabaseService<T extends Versionable,I extends RevisableAbstractDatabaseService.CodingSchemeUriVersionBasedEntryId>

java.lang.Object
  extended by org.lexevs.dao.database.service.event.DatabaseServiceEventSupport
      extended by org.lexevs.dao.database.service.AbstractDatabaseService
          extended by org.lexevs.dao.database.service.RevisableAbstractDatabaseService<T,I>
Direct Known Subclasses:
VersionableEventAssociationDataService, VersionableEventAssociationTargetService, VersionableEventCodingSchemeService, VersionableEventEntityService, VersionableEventPropertyService, VersionableEventRelationService

public abstract class RevisableAbstractDatabaseService<T extends Versionable,I extends RevisableAbstractDatabaseService.CodingSchemeUriVersionBasedEntryId>
extends AbstractDatabaseService

The Class RevisableAbstractDatabaseService.

Author:
Kevin Peterson

Nested Class Summary
static class RevisableAbstractDatabaseService.CodingSchemeUriVersionBasedEntryId
          The Class CodingSchemeUriVersionBasedEntryId.
static class RevisableAbstractDatabaseService.ParentUidReferencingId
           
static interface RevisableAbstractDatabaseService.UpdateTemplate
          The Interface UpdateTemplate.
 
Constructor Summary
RevisableAbstractDatabaseService()
           
 
Method Summary
protected abstract  T addDependentAttributesByRevisionId(I id, java.lang.String entryUid, T entry, java.lang.String revisionId)
           
protected abstract  void doInsertDependentChanges(I id, T revisedEntry)
          Do insert dependent changes.
protected abstract  boolean entryStateExists(I id, java.lang.String entryStateUid)
          Entry state exists.
protected  java.lang.String getCodingSchemeUid(RevisableAbstractDatabaseService.CodingSchemeUriVersionBasedEntryId id)
           
protected abstract  T getCurrentEntry(I id, java.lang.String entryUId)
          Gets the current entry.
protected abstract  java.lang.String getCurrentEntryStateUid(I id, java.lang.String entryUid)
          Gets the current entry state uid.
protected abstract  java.lang.String getEntryUid(I id, T entry)
          Gets the entry uid.
protected abstract  T getHistoryEntryByRevisionId(I id, java.lang.String entryUid, java.lang.String revisionId)
           
protected abstract  java.lang.String getLatestRevisionId(I id, java.lang.String entryUId)
           
protected  void insertDependentChanges(I id, T revisedEntry, VersionsDao.EntryStateType type)
          Insert dependent changes.
protected abstract  void insertIntoHistory(I id, T currentEntry, java.lang.String entryUId)
          Insert into history.
protected  void insertVersionableChanges(I id, T revisedEntry, VersionsDao.EntryStateType type)
          Insert versionable changes.
protected  void makeChange(I id, T revisedEntry, VersionsDao.EntryStateType type, org.lexevs.dao.database.service.RevisableAbstractDatabaseService.ChangeDatabaseStateTemplate<I,T> template)
          Make change.
protected  java.lang.String resolveCurrentEntryStateUid(I id, java.lang.String entryUid, VersionsDao.EntryStateType type)
          Resolve current entry state uid.
 T resolveEntryByRevision(I id, java.lang.String entryUid, java.lang.String revisionId)
           
protected  void updateEntry(I id, T updatedEntry, VersionsDao.EntryStateType type, RevisableAbstractDatabaseService.UpdateTemplate updateTemplate)
          Update entry.
protected abstract  java.lang.String updateEntryVersionableAttributes(I id, java.lang.String entryUId, T revisedEntity)
          Update entity versionable attributes.
protected  boolean validRevision(I id, T entry)
           
 
Methods inherited from class org.lexevs.dao.database.service.AbstractDatabaseService
getCodingSchemeUId, getDaoManager, getLogger, isChangeTypeDependent, isChangeTypeRemove, setDaoManager, setLogger
 
Methods inherited from class org.lexevs.dao.database.service.event.DatabaseServiceEventSupport
fireCodingSchemeInsertErrorEvent, fireCodingSchemeUpdateEvent, fireEntityReviseEvent, fireEntityUpdateEvent, firePostBatchEntityInsertEvent, firePostCodingSchemeInsertEvent, firePostEntityInsertEvent, firePostEntityRemoveEvent, firePostPropertyInsertEvent, firePostPropertyRemoveEvent, firePreBatchAssociationInsertEvent, firePreBatchEntityInsertEvent, firePreCodingSchemeInsertEvent, firePreEntityInsertEvent, firePreEntityRemoveEvent, firePropertyUpdateEvent, getListenerRegistry, setListenerRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RevisableAbstractDatabaseService

public RevisableAbstractDatabaseService()
Method Detail

resolveCurrentEntryStateUid

protected java.lang.String resolveCurrentEntryStateUid(I id,
                                                       java.lang.String entryUid,
                                                       VersionsDao.EntryStateType type)
Resolve current entry state uid.

Parameters:
id - the id
entryUid - the entry uid
type - the type
Returns:
the string

makeChange

protected void makeChange(I id,
                          T revisedEntry,
                          VersionsDao.EntryStateType type,
                          org.lexevs.dao.database.service.RevisableAbstractDatabaseService.ChangeDatabaseStateTemplate<I,T> template)
                   throws LBException
Make change.

Parameters:
id - the id
revisedEntry - the revised entry
type - the type
template - the template
Throws:
LBException - the LB exception

insertVersionableChanges

protected void insertVersionableChanges(I id,
                                        T revisedEntry,
                                        VersionsDao.EntryStateType type)
                                 throws LBException
Insert versionable changes.

Parameters:
id - the id
revisedEntry - the revised entry
type - the type
Throws:
LBException - the LB exception

updateEntry

protected void updateEntry(I id,
                           T updatedEntry,
                           VersionsDao.EntryStateType type,
                           RevisableAbstractDatabaseService.UpdateTemplate updateTemplate)
                    throws LBException
Update entry.

Parameters:
id - the id
updatedEntry - the updated entry
type - the type
updateTemplate - the update template
Throws:
LBException - the LB exception

insertDependentChanges

protected void insertDependentChanges(I id,
                                      T revisedEntry,
                                      VersionsDao.EntryStateType type)
                               throws LBException
Insert dependent changes.

Parameters:
id - the id
revisedEntry - the revised entry
type - the type
Throws:
LBException - the LB exception

resolveEntryByRevision

public T resolveEntryByRevision(I id,
                                java.lang.String entryUid,
                                java.lang.String revisionId)
                                             throws LBRevisionException
Throws:
LBRevisionException

validRevision

protected boolean validRevision(I id,
                                T entry)
                         throws LBException
Throws:
LBException

addDependentAttributesByRevisionId

protected abstract T addDependentAttributesByRevisionId(I id,
                                                        java.lang.String entryUid,
                                                        T entry,
                                                        java.lang.String revisionId)

insertIntoHistory

protected abstract void insertIntoHistory(I id,
                                          T currentEntry,
                                          java.lang.String entryUId)
Insert into history.

Parameters:
id - the id
currentEntry - the current entry
entryUId - the entry u id

doInsertDependentChanges

protected abstract void doInsertDependentChanges(I id,
                                                 T revisedEntry)
                                          throws LBException
Do insert dependent changes.

Parameters:
id - the id
revisedEntry - the revised entry
Throws:
LBException - the LB exception

updateEntryVersionableAttributes

protected abstract java.lang.String updateEntryVersionableAttributes(I id,
                                                                     java.lang.String entryUId,
                                                                     T revisedEntity)
Update entity versionable attributes.

Parameters:
id - the id
entryUId - the entry u id
revisedEntity - the revised entity
Returns:
the string

getCurrentEntry

protected abstract T getCurrentEntry(I id,
                                     java.lang.String entryUId)
Gets the current entry.

Parameters:
id - the id
entryUId - the entry u id
Returns:
the current entry

getHistoryEntryByRevisionId

protected abstract T getHistoryEntryByRevisionId(I id,
                                                 java.lang.String entryUid,
                                                 java.lang.String revisionId)

getLatestRevisionId

protected abstract java.lang.String getLatestRevisionId(I id,
                                                        java.lang.String entryUId)

getEntryUid

protected abstract java.lang.String getEntryUid(I id,
                                                T entry)
Gets the entry uid.

Parameters:
id - the id
entry - the entry
Returns:
the entry uid

entryStateExists

protected abstract boolean entryStateExists(I id,
                                            java.lang.String entryStateUid)
Entry state exists.

Parameters:
id - the id
entryStateUid - the entry state uid
Returns:
true, if successful

getCurrentEntryStateUid

protected abstract java.lang.String getCurrentEntryStateUid(I id,
                                                            java.lang.String entryUid)
Gets the current entry state uid.

Parameters:
id - the id
entryUid - the entry uid
Returns:
the current entry state uid

getCodingSchemeUid

protected java.lang.String getCodingSchemeUid(RevisableAbstractDatabaseService.CodingSchemeUriVersionBasedEntryId id)

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.