public class Host extends Object implements Persistable
Modifier and Type | Field and Description |
---|---|
static String |
DB_KEY
Database keyword for hosts.
|
Constructor and Description |
---|
Host(MACAddress mac,
OVXPort port,
Integer hostId)
Instantiates a new host by setting its MAC address, virtual port,
and host ID.
|
Modifier and Type | Method and Description |
---|---|
HashMap<String,Object> |
convertToPhysical() |
boolean |
equals(Object obj) |
Map<String,Object> |
getDBIndex() |
String |
getDBKey() |
String |
getDBName() |
Map<String,Object> |
getDBObject() |
Integer |
getHostId()
Gets the host ID.
|
OVXIPAddress |
getIp()
Gets the IP address of the host.
|
MACAddress |
getMac()
Gets the MAC address of the host.
|
OVXPort |
getPort()
Gets the port the host is connected to.
|
int |
hashCode() |
void |
register()
Registers the host in persistent storage.
|
void |
setIPAddress(int ip)
Sets the virtual IP address of the host.
|
void |
tearDown()
Tears down the port to which the host is connected.
|
void |
unregister()
Unregisters the host from the persistent storage and removes
all references from the map.
|
public static final String DB_KEY
public Host(MACAddress mac, OVXPort port, Integer hostId)
mac
- the MAC addressport
- the virtual porthostId
- the host IDpublic void setIPAddress(int ip)
ip
- the virtual IP addresspublic OVXIPAddress getIp()
public MACAddress getMac()
public OVXPort getPort()
public void register()
public Map<String,Object> getDBIndex()
getDBIndex
in interface Persistable
public String getDBKey()
getDBKey
in interface Persistable
public String getDBName()
getDBName
in interface Persistable
public Map<String,Object> getDBObject()
getDBObject
in interface Persistable
public Integer getHostId()
public void unregister()
public void tearDown()
Copyright © 2015. All rights reserved.