Class ConfigDependencyAnalyzer<T extends ICloneableConfig<T>>
- java.lang.Object
-
- lumis.portal.serialization.operation.ConfigDependencyAnalyzer<T>
-
- Type Parameters:
T
- object being deserialized
- Direct Known Subclasses:
AclDependencyAnalyzer
,PageDependencyAnalyzer
,ServiceInterfaceInstanceConfigDependencyAnalyzer
public class ConfigDependencyAnalyzer<T extends ICloneableConfig<T>> extends java.lang.Object
Responsible for analyze foreign key dependencies of a portal object being deserialized.- Since:
- 4.0.9
- Version:
- $Revision$ $Date$
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
canPersist
protected java.util.List<ConfigForeignKey>
configForeignKeys
protected java.util.Collection<java.lang.String>
dependencyKeys
protected DeserializationContext
deserializationContext
protected boolean
hasViolation
protected T
originalConfig
protected T
persistableConfig
-
Constructor Summary
Constructors Constructor Description ConfigDependencyAnalyzer(DeserializationContext deserializationContext, java.util.List<ConfigForeignKey> configForeignKeys, T originalConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addDependentConfigOperation(IConfigPersister configPersister)
void
analyze(IConfigPersister configPersister)
Analyze the original config, generating a persistable config and scheduling the persistence of original config to be performed after the dependencies were resolved.protected void
analyzeForeignKeys()
Analyze the original config, generating a persistable config.boolean
foreignKeysExists()
Verify that all foreign key mapped values match persisted objectsboolean
getCanPersist()
protected ConfigPersistence
getConfigPersistence(IConfigPersister configPersister)
java.util.Collection<java.lang.String>
getDependencyKeys()
boolean
getHasViolation()
T
getMappedPersistableConfig()
Returns a mapped cloned of the persistable config, which, in turn, represents a clone of original config, with its foreign keys updated to be non-violated.T
getOriginalConfig()
T
getPersistableConfig()
Returns the persistable config, which represents a clone of original config, with its foreign keys updated to be non-violated.void
persist(IConfigPersister configPersister, boolean firstPersistenceIsRequired)
void
setHasViolation(boolean hasViolation)
-
-
-
Field Detail
-
deserializationContext
protected final DeserializationContext deserializationContext
-
configForeignKeys
protected final java.util.List<ConfigForeignKey> configForeignKeys
-
originalConfig
protected final T extends ICloneableConfig<T> originalConfig
-
persistableConfig
protected T extends ICloneableConfig<T> persistableConfig
-
hasViolation
protected boolean hasViolation
-
dependencyKeys
protected final java.util.Collection<java.lang.String> dependencyKeys
-
canPersist
protected boolean canPersist
-
-
Constructor Detail
-
ConfigDependencyAnalyzer
public ConfigDependencyAnalyzer(DeserializationContext deserializationContext, java.util.List<ConfigForeignKey> configForeignKeys, T originalConfig)
-
-
Method Detail
-
getHasViolation
public boolean getHasViolation()
-
setHasViolation
public void setHasViolation(boolean hasViolation)
-
getOriginalConfig
public T getOriginalConfig()
-
getPersistableConfig
public T getPersistableConfig()
Returns the persistable config, which represents a clone of original config, with its foreign keys updated to be non-violated.- Returns:
- persistable config
-
getMappedPersistableConfig
public T getMappedPersistableConfig()
Returns a mapped cloned of the persistable config, which, in turn, represents a clone of original config, with its foreign keys updated to be non-violated.- Returns:
- mapped cloned of the persistable config
-
getDependencyKeys
public java.util.Collection<java.lang.String> getDependencyKeys()
-
getCanPersist
public boolean getCanPersist()
- Returns:
- true, if the persistable config can be persisted.
-
persist
public void persist(IConfigPersister configPersister, boolean firstPersistenceIsRequired) throws PortalException
- Throws:
PortalException
-
analyze
public void analyze(IConfigPersister configPersister)
Analyze the original config, generating a persistable config and scheduling the persistence of original config to be performed after the dependencies were resolved. It also determines if the persistable config can be persisted.- Parameters:
configPersister
-- Throws:
PortalException
-
analyzeForeignKeys
protected void analyzeForeignKeys()
Analyze the original config, generating a persistable config. It also determines if the persistable config can be persisted.
-
addDependentConfigOperation
protected void addDependentConfigOperation(IConfigPersister configPersister)
-
getConfigPersistence
protected ConfigPersistence getConfigPersistence(IConfigPersister configPersister)
-
foreignKeysExists
public boolean foreignKeysExists()
Verify that all foreign key mapped values match persisted objects- Returns:
- true, if all foreign key mapped values match persisted objects.
-
-