Package org.onosproject.net.region
Class DefaultRegion
- java.lang.Object
-
- org.onosproject.net.AbstractAnnotated
-
- org.onosproject.net.region.DefaultRegion
-
public final class DefaultRegion extends AbstractAnnotated implements Region
Default implementation of a region.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.onosproject.net.region.Region
Region.Type
-
-
Constructor Summary
Constructors Constructor Description DefaultRegion(RegionId id, java.lang.String name, Region.Type type, Annotations annots, java.util.List<java.util.Set<NodeId>> masters)
Creates a region using the supplied information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
hashCode()
RegionId
id()
Returns the unique identifier of the region.java.util.List<java.util.Set<NodeId>>
masters()
Returns the list of master node sets.java.lang.String
name()
Returns the friendly region name that can be used for display purposes.java.lang.String
toString()
Region.Type
type()
Returns the region type.-
Methods inherited from class org.onosproject.net.AbstractAnnotated
annotations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.net.Annotated
annotations
-
-
-
-
Constructor Detail
-
DefaultRegion
public DefaultRegion(RegionId id, java.lang.String name, Region.Type type, Annotations annots, java.util.List<java.util.Set<NodeId>> masters)
Creates a region using the supplied information.- Parameters:
id
- region identifiername
- friendly nametype
- region typeannots
- annotationsmasters
- list of sets of cluster node identifiers; in order of mastership
-
-
Method Detail
-
id
public RegionId id()
Description copied from interface:Region
Returns the unique identifier of the region.
-
name
public java.lang.String name()
Description copied from interface:Region
Returns the friendly region name that can be used for display purposes.
-
type
public Region.Type type()
Description copied from interface:Region
Returns the region type.
-
masters
public java.util.List<java.util.Set<NodeId>> masters()
Description copied from interface:Region
Returns the list of master node sets. The sets of cluster node identifiers should be listed in the order of preferred mastership. Nodes specified in each sets should be considered with equally priority and devices in the region can be balanced between them based on other criteria, e.g. load.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-