org.nuiton.topia.replication.model
Class ReplicationNode

java.lang.Object
  extended by org.nuiton.topia.replication.model.ReplicationNode

public class ReplicationNode
extends Object

Model of a replication's node.

The invariant of a replication's node is his contract, means the type of entity to replicate.

Since:
2.2.0
Author:
tchemit

Field Summary
protected  Map<String,ReplicationNode> associations
          dictionnary of associations defined on the node (keys are association name, and values are target node).
protected  Set<String> associationsToDettach
          names of association to dettach while replication.
protected  TopiaEntityEnum contract
          contract of entity of the node.
protected  Map<String,ReplicationNode> dependencies
          compositions defined on the node (keys are association name, and values are target node).
protected  Set<String> dependenciesToDettach
          names of dependency to dettach while replication.
protected  List<ReplicationOperationDef> operations
          operations to fire when replication pass on this node.
protected  EntityOperator<? super TopiaEntity> operator
          entity operator.
protected  Set<ReplicationNode> shell
          shell of the node.
 
Constructor Summary
ReplicationNode(TopiaEntityEnum contract)
           
 
Method Summary
 void addAssociation(String name, ReplicationNode node)
           
 void addAssociationToDettach(String key)
           
 void addDependency(String name, ReplicationNode node)
           
 void addDependencyToDettach(String key)
           
 void addOperation(int index, ReplicationOperationDef op)
           
 void addOperation(ReplicationOperationDef op)
           
 void clearOperations()
          Remove all operation of the node (for example when no data is associated with the type of the node, then no needed operations).
 boolean equals(Object obj)
           
 Map<String,ReplicationNode> getAssociations()
           
 String[] getAssociationsDettached(ReplicationNode node)
           
 Set<String> getAssociationsToDettach()
           
 TopiaEntityEnum getContract()
           
 Map<String,ReplicationNode> getDependencies()
           
 String[] getDependenciesDettached(ReplicationNode node)
           
 Set<String> getDependenciesToDettach()
           
 Class<? extends TopiaEntity> getEntityType()
           
 ReplicationOperationDef[] getOperations()
           
 EntityOperator<? super TopiaEntity> getOperator()
           
 Set<ReplicationNode> getShell()
           
 ReplicationOperationDef[] getUndoableOperations()
           
 boolean hasAssociation()
           
 boolean hasAssociationsToDettach()
           
 boolean hasDependenciesToDettach()
           
 boolean hasDependency()
           
 int hashCode()
           
 void setShell(Set<ReplicationNode> shell)
           
 void sortOperations()
          sort operation by their phase.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

contract

protected final TopiaEntityEnum contract
contract of entity of the node.


operator

protected final EntityOperator<? super TopiaEntity> operator
entity operator.


shell

protected Set<ReplicationNode> shell
shell of the node.


associations

protected final Map<String,ReplicationNode> associations
dictionnary of associations defined on the node (keys are association name, and values are target node).


associationsToDettach

protected final Set<String> associationsToDettach
names of association to dettach while replication.


dependencies

protected final Map<String,ReplicationNode> dependencies
compositions defined on the node (keys are association name, and values are target node).


dependenciesToDettach

protected final Set<String> dependenciesToDettach
names of dependency to dettach while replication.


operations

protected final List<ReplicationOperationDef> operations
operations to fire when replication pass on this node.

Constructor Detail

ReplicationNode

public ReplicationNode(TopiaEntityEnum contract)
Method Detail

addAssociation

public void addAssociation(String name,
                           ReplicationNode node)

addOperation

public void addOperation(int index,
                         ReplicationOperationDef op)

addOperation

public void addOperation(ReplicationOperationDef op)

getOperations

public ReplicationOperationDef[] getOperations()

getUndoableOperations

public ReplicationOperationDef[] getUndoableOperations()

hasAssociation

public boolean hasAssociation()

hasAssociationsToDettach

public boolean hasAssociationsToDettach()

getAssociationsDettached

public String[] getAssociationsDettached(ReplicationNode node)

getDependenciesDettached

public String[] getDependenciesDettached(ReplicationNode node)

hasDependenciesToDettach

public boolean hasDependenciesToDettach()

hasDependency

public boolean hasDependency()

addDependency

public void addDependency(String name,
                          ReplicationNode node)

addAssociationToDettach

public void addAssociationToDettach(String key)

addDependencyToDettach

public void addDependencyToDettach(String key)

getAssociations

public Map<String,ReplicationNode> getAssociations()

getAssociationsToDettach

public Set<String> getAssociationsToDettach()

getDependenciesToDettach

public Set<String> getDependenciesToDettach()

getContract

public TopiaEntityEnum getContract()

getEntityType

public Class<? extends TopiaEntity> getEntityType()

getOperator

public EntityOperator<? super TopiaEntity> getOperator()

getDependencies

public Map<String,ReplicationNode> getDependencies()

getShell

public Set<ReplicationNode> getShell()

setShell

public void setShell(Set<ReplicationNode> shell)

sortOperations

public void sortOperations()
sort operation by their phase.

See Also:
ReplicationOperationPhase

clearOperations

public void clearOperations()
Remove all operation of the node (for example when no data is associated with the type of the node, then no needed operations).


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2011 CodeLutin. All Rights Reserved.