public class RegionModel extends Object implements Region
Constructor and Description |
---|
RegionModel()
Default constructor.
|
RegionModel(RegionModel original)
Copy constructor; makes shallow copies of controller, device, and range
Collection s. |
RegionModel(UUID uid,
String name)
Constructs a
RegionModel with only a UID and name. |
Modifier and Type | Method and Description |
---|---|
boolean |
addController(IpAddress toAdd)
Attempts to add a new controller IP address to the existing
List . |
boolean |
addDevice(IpAddress toAdd)
Attempts to add a new network element IP address to the existing
Set . |
boolean |
addRange(IpRange toAdd)
Attempts to add a new network element IP address range to the existing
Set . |
boolean |
equals(Object toCompare) |
List<IpAddress> |
getControllers()
Retrieves the prioritized list of controllers IP addresses for this
region.
|
Set<IpAddress> |
getDevices()
Retrieves the IP addresses of network elements for this region that were
explicitly configured.
|
Id<Region,UUID> |
getId()
Gets the id of this object.
|
String |
getName()
Retrieves the name of this region.
|
Set<IpRange> |
getRanges()
Retrieves the IP address ranges of network elements for this region that
were explicitly configured.
|
int |
hashCode() |
boolean |
removeController(IpAddress toAdd)
Attempts to remove the specified controller IP address from the existing
List . |
boolean |
removeDevice(IpAddress toRemove)
Attempts to remove a network element IP address from the existing
Set of explicitly configured addresses. |
boolean |
removeRange(IpRange toRemove)
Attempts to remove a network element IP address range from the existing
Set of explicitly configured ranges. |
void |
setId(UUID toSet)
Sets the UID of this region.
|
void |
setName(String toSet)
Sets the name of this region.
|
String |
toString() |
public RegionModel()
public RegionModel(UUID uid, String name)
RegionModel
with only a UID and name. Controller
and device information must be added separately.uid
- UID to assignname
- name to assignpublic RegionModel(RegionModel original)
Collection
s.original
- RegionModel
to copypublic boolean addController(IpAddress toAdd)
List
.
Addresses that already exist in the List
cannot be added.toAdd
- IpAddress
to addtrue
if the address was added, false
otherwisepublic List<IpAddress> getControllers()
Region
getControllers
in interface Region
List
of controller IP addressespublic Set<IpAddress> getDevices()
Region
getDevices
in interface Region
Set
of network element IP addressespublic Id<Region,UUID> getId()
Transportable
A type for the identified must be specified to retrieve the id because
identified objects might be inheritable. For example, assume
Employee
extends from Person
and Person
implements Transportable<Person, Long>
. The following code
would be possible.
Id<Person, Long> id = employee.getId(); Id<Employee, Long> id = employee.getId();
getId
in interface Transportable<Region,UUID>
public String getName()
Region
public Set<IpRange> getRanges()
Region
public boolean removeController(IpAddress toAdd)
List
.toAdd
- IpAddress
to addtrue
if the address was removed, false
otherwisepublic boolean removeDevice(IpAddress toRemove)
Region
Set
of explicitly configured addresses. If a nonexistent address is
specified no Exception
is thrown but a false
value will
be returned to indicate that no change was made.removeDevice
in interface Region
toRemove
- IpAddress
to removetrue
if the address was removed, false
otherwisepublic boolean removeRange(IpRange toRemove)
Region
Set
of explicitly configured ranges. If a nonexistent range is
specified no Exception
is thrown but a false
value will
be returned to indicate that no change was made.removeRange
in interface Region
toRemove
- IpRange
to removetrue
if the range was removed, false
otherwisepublic void setId(UUID toSet)
toSet
- UID to assignpublic void setName(String toSet)
toSet
- name to assignCopyright © 2015. All Rights Reserved.