org.nuiton.topia.replication.model
Class ReplicationLink

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

public class ReplicationLink
extends Object

Pour definir un lien entre deux entites (deux noeuds de replication).

Since:
2.2.0
Author:
tchemit

Field Summary
protected  boolean association
          drapeau positionné à true lorsque le lien est une association.
protected  String name
          nom du lien
protected  Set<ReplicationNode> requires
          liste des noeuds requis.
protected  ReplicationNode source
          le noeud source du lien
protected  ReplicationNode target
          le noeud destination du lien
 
Constructor Summary
ReplicationLink(ReplicationNode source, ReplicationNode target, String name, boolean association)
           
 
Method Summary
 boolean canReattach(Set<ReplicationNode> universe, ReplicationNode currentNode)
          Teste si on peut reattacher le lien en connaissant l'univers des noeuds disponibles.
 String getName()
           
 ReplicationNode getSource()
           
 ReplicationNode getTarget()
           
 boolean isAssociation()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

source

protected final ReplicationNode source
le noeud source du lien


target

protected final ReplicationNode target
le noeud destination du lien


requires

protected final Set<ReplicationNode> requires
liste des noeuds requis.

TODO tchemit 2010-08-14 Expliquer à quoi ça sert vraiment...


name

protected final String name
nom du lien


association

protected final boolean association
drapeau positionné à true lorsque le lien est une association.

Constructor Detail

ReplicationLink

public ReplicationLink(ReplicationNode source,
                       ReplicationNode target,
                       String name,
                       boolean association)
Method Detail

getName

public String getName()

getSource

public ReplicationNode getSource()

getTarget

public ReplicationNode getTarget()

isAssociation

public boolean isAssociation()

canReattach

public boolean canReattach(Set<ReplicationNode> universe,
                           ReplicationNode currentNode)
Teste si on peut reattacher le lien en connaissant l'univers des noeuds disponibles.

On teste si toutes les pre-requis sont disponibles.

Si oui, on peut reattacher.

Parameters:
universe - l'univers des noeuds disponibles
currentNode - le noeud qui vient d'etre replique
Returns:
true si on peut reattacher ce lien

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2012 CodeLutin. All Rights Reserved.