eu.etaxonomy.cdm.io.common
Class CdmIoBase<STATE extends IoStateBase>

java.lang.Object
  extended by eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration
      extended by eu.etaxonomy.cdm.io.common.CdmIoBase<STATE>
All Implemented Interfaces:
ICdmApplicationConfiguration, ICdmIO<STATE>, IIoObservable, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
CacheUpdater, CdmExportBase, CdmImportBase, DistributionImport, JaxbImport, SDDIoBase, TaxonXDescriptionImport, TaxonXModsImport, TaxonXNomenclatureImport, TcsXmlExportBase

public abstract class CdmIoBase<STATE extends IoStateBase>
extends CdmApplicationDefaultConfiguration
implements ICdmIO<STATE>, IIoObservable

Version:
1.0
Author:
a.mueller

Field Summary
protected  String ioName
           
 
Fields inherited from class eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration
applicationContext
 
Fields inherited from interface eu.etaxonomy.cdm.io.common.ICdmIO
FEATURE_STORE, NOMREF_DETAIL_STORE, NOMREF_STORE, PERSON_STORE, REF_DETAIL_STORE, REFERENCE_STORE, SPECIMEN_STORE, TAXON_STORE, TAXONNAME_STORE, TEAM_STORE, USER_STORE
 
Constructor Summary
CdmIoBase()
           
 
Method Summary
 boolean addObserver(IIoObserver observer)
          Adds a new observer for this object.
 void addObservers(Set<IIoObserver> newObservers)
          Adds a set of new observer for this object.
 boolean check(STATE state)
           
 void commitTransaction(org.springframework.transaction.TransactionStatus txStatus)
           
 int countObservers()
          Returns the number of observers of this Observable object.
 int countSteps()
           
protected abstract  boolean doCheck(STATE state)
           
protected abstract  void doInvoke(STATE state)
          invoke method to be implemented by implementing classes
 void fire(IIoEvent event)
          If this object fires an event then notify all of its observers.
protected  void fireProgressEvent(String message, String location)
           
protected  void fireWarningEvent(String message, String dataLocation, Integer severity)
           
protected  void fireWarningEvent(String message, String dataLocation, Integer severity, int stackDepth)
           
 void flush()
          flush the current session
protected
<T extends CdmBase>
T
getInstance(Class<? extends T> clazz)
           
 Set<IIoObserver> getObservers()
          Sets the observers for this object
protected  String getSuccessString(boolean success)
           
 boolean invoke(STATE state)
           
protected  boolean isBlank(String str)
           
protected abstract  boolean isIgnore(STATE state)
          Returns true if this (IO-)class should be ignored during the import/export process.
protected  boolean isNotBlank(String str)
           
 boolean removeObserver(IIoObserver observer)
          Removes an observer from this object
 void removeObservers()
          Clears the observer list so that this object no longer has any observers.
 void rollbackTransaction(org.springframework.transaction.TransactionStatus txStatus)
           
 org.springframework.transaction.TransactionStatus startTransaction()
           
 org.springframework.transaction.TransactionStatus startTransaction(Boolean readOnly)
           
 void updateProgress(STATE state, String message)
           
 void updateProgress(STATE state, String message, int worked)
           
 void warnProgress(STATE state, String message, Throwable e)
           
 
Methods inherited from class eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration
authenticate, getAgentService, getAuthenticationManager, getBean, getClassificationService, getCollectionService, getCommonService, getDatabaseService, getDescriptionService, getFeatureNodeService, getFeatureTreeService, getGrantedAuthorityService, getGroupService, getIdentificationKeyService, getLocationService, getMainService, getMediaService, getNameService, getOccurrenceService, getPermissionEvaluator, getPolytomousKeyNodeService, getPolytomousKeyService, getReferenceService, getTaxonNodeService, getTaxonService, getTermService, getTransactionManager, getUserService, getVocabularyService, getWorkingSetService, NewConversation, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ioName

protected String ioName
Constructor Detail

CdmIoBase

public CdmIoBase()
Method Detail

addObserver

public boolean addObserver(IIoObserver observer)
Description copied from interface: IIoObservable
Adds a new observer for this object.

Specified by:
addObserver in interface IIoObservable
Returns:

getObservers

public Set<IIoObserver> getObservers()
Description copied from interface: IIoObservable
Sets the observers for this object

Specified by:
getObservers in interface IIoObservable
Returns:

addObservers

public void addObservers(Set<IIoObserver> newObservers)
Description copied from interface: IIoObservable
Adds a set of new observer for this object.

Specified by:
addObservers in interface IIoObservable

countObservers

public int countObservers()
Description copied from interface: IIoObservable
Returns the number of observers of this Observable object.

Specified by:
countObservers in interface IIoObservable
Returns:
number of observers

removeObserver

public boolean removeObserver(IIoObserver observer)
Description copied from interface: IIoObservable
Removes an observer from this object

Specified by:
removeObserver in interface IIoObservable
Returns:

removeObservers

public void removeObservers()
Description copied from interface: IIoObservable
Clears the observer list so that this object no longer has any observers.

Specified by:
removeObservers in interface IIoObservable

fire

public void fire(IIoEvent event)
Description copied from interface: ICdmIO
If this object fires an event then notify all of its observers.

Specified by:
fire in interface ICdmIO<STATE extends IoStateBase>

countSteps

public int countSteps()

invoke

public boolean invoke(STATE state)
Specified by:
invoke in interface ICdmIO<STATE extends IoStateBase>

doInvoke

protected abstract void doInvoke(STATE state)
invoke method to be implemented by implementing classes

Parameters:
state -

flush

public void flush()
flush the current session


startTransaction

public org.springframework.transaction.TransactionStatus startTransaction()
Specified by:
startTransaction in interface ICdmApplicationConfiguration
Overrides:
startTransaction in class CdmApplicationDefaultConfiguration

startTransaction

public org.springframework.transaction.TransactionStatus startTransaction(Boolean readOnly)
Specified by:
startTransaction in interface ICdmApplicationConfiguration
Overrides:
startTransaction in class CdmApplicationDefaultConfiguration

commitTransaction

public void commitTransaction(org.springframework.transaction.TransactionStatus txStatus)
Specified by:
commitTransaction in interface ICdmApplicationConfiguration
Overrides:
commitTransaction in class CdmApplicationDefaultConfiguration

rollbackTransaction

public void rollbackTransaction(org.springframework.transaction.TransactionStatus txStatus)

check

public boolean check(STATE state)
Specified by:
check in interface ICdmIO<STATE extends IoStateBase>

doCheck

protected abstract boolean doCheck(STATE state)

isIgnore

protected abstract boolean isIgnore(STATE state)
Returns true if this (IO-)class should be ignored during the import/export process. This information is usually stored in the configuration

Parameters:
config -
Returns:

getInstance

protected <T extends CdmBase> T getInstance(Class<? extends T> clazz)

getSuccessString

protected String getSuccessString(boolean success)

updateProgress

public void updateProgress(STATE state,
                           String message)
Specified by:
updateProgress in interface ICdmIO<STATE extends IoStateBase>

updateProgress

public void updateProgress(STATE state,
                           String message,
                           int worked)
Specified by:
updateProgress in interface ICdmIO<STATE extends IoStateBase>

warnProgress

public void warnProgress(STATE state,
                         String message,
                         Throwable e)
Specified by:
warnProgress in interface ICdmIO<STATE extends IoStateBase>

fireProgressEvent

protected void fireProgressEvent(String message,
                                 String location)

fireWarningEvent

protected void fireWarningEvent(String message,
                                String dataLocation,
                                Integer severity)

fireWarningEvent

protected void fireWarningEvent(String message,
                                String dataLocation,
                                Integer severity,
                                int stackDepth)

isBlank

protected boolean isBlank(String str)

isNotBlank

protected boolean isNotBlank(String str)


Copyright © 2007-2013 EDIT. All Rights Reserved.