Class JaxbHostRegistration
java.lang.Object
org.opencastproject.serviceregistry.api.JaxbHostRegistration
- All Implemented Interfaces:
HostRegistration
A record of a host.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new host registration which is online and not in maintenance mode.JaxbHostRegistration(String baseUrl, String address, String nodeName, long memory, int cores, float maxLoad, boolean online, boolean maintenance) Constructs a new HostRegistration with the parameters providedJaxbHostRegistration(HostRegistration hostRegistration) Creates a new JAXB host registration based on an existing host registration -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetCores()getId()Returns an identifier for this host.floatlonginthashCode()booleanisActive()booleanbooleanisOnline()voidsetActive(boolean active) voidsetBaseUrl(String baseUrl) voidsetCores(int cores) voidsetIpAddress(String address) voidsetMaintenanceMode(boolean maintenanceMode) voidsetMaxLoad(float maxLoad) voidsetMemory(long memory) voidsetNodeName(String nodeName) voidsetOnline(boolean online) toString()
-
Field Details
-
baseUrl
The base URL for this host. The length was chosen this short because MySQL complains when trying to create an index larger than this -
address
-
nodeName
-
memory
protected long memory -
cores
protected int cores -
maxLoad
protected float maxLoadThe maximum load this host can run. This is not necessarily 1-to-1 with the number of jobs. -
online
protected boolean online -
active
protected boolean active -
maintenanceMode
protected boolean maintenanceMode
-
-
Constructor Details
-
JaxbHostRegistration
public JaxbHostRegistration()Creates a new host registration which is online and not in maintenance mode. -
JaxbHostRegistration
public JaxbHostRegistration(String baseUrl, String address, String nodeName, long memory, int cores, float maxLoad, boolean online, boolean maintenance) Constructs a new HostRegistration with the parameters provided- Parameters:
baseUrl- the base URL for this hostaddress- the IP address for this hostnodeName- descriptive node name for this hostmemory- the allocated memory of this hostcores- the available cores of this hostmaxLoad- the maximum load that this host can supportonline- whether the host is online and available for serviceonline- whether the host is in maintenance mode
-
JaxbHostRegistration
Creates a new JAXB host registration based on an existing host registration- Parameters:
hostRegistration-
-
-
Method Details
-
getId
Description copied from interface:HostRegistrationReturns an identifier for this host.- Specified by:
getIdin interfaceHostRegistration- Returns:
- Host identifier
-
getBaseUrl
- Specified by:
getBaseUrlin interfaceHostRegistration- Returns:
- the baseUrl for this host
- See Also:
-
setBaseUrl
- Specified by:
setBaseUrlin interfaceHostRegistration- Parameters:
baseUrl- the baseUrl to set- See Also:
-
getIpAddress
- Specified by:
getIpAddressin interfaceHostRegistration- Returns:
- the IP address for this host
- See Also:
-
setIpAddress
- Specified by:
setIpAddressin interfaceHostRegistration- Parameters:
address- the IP address to set- See Also:
-
getMemory
public long getMemory()- Specified by:
getMemoryin interfaceHostRegistration- Returns:
- the allocated memory of this host
- See Also:
-
setMemory
public void setMemory(long memory) - Specified by:
setMemoryin interfaceHostRegistration- Parameters:
memory- the memory to set- See Also:
-
getCores
public int getCores()- Specified by:
getCoresin interfaceHostRegistration- Returns:
- the available cores of this host
- See Also:
-
setCores
public void setCores(int cores) - Specified by:
setCoresin interfaceHostRegistration- Parameters:
cores- the cores to set- See Also:
-
getMaxLoad
public float getMaxLoad()- Specified by:
getMaxLoadin interfaceHostRegistration- Returns:
- the maxLoad
- See Also:
-
setMaxLoad
public void setMaxLoad(float maxLoad) - Specified by:
setMaxLoadin interfaceHostRegistration- Parameters:
maxLoad- the maxLoad to set
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceHostRegistration- Returns:
- whether this host is active
- See Also:
-
setActive
public void setActive(boolean active) - Specified by:
setActivein interfaceHostRegistration- Parameters:
active- the active status to set- See Also:
-
isOnline
public boolean isOnline()- Specified by:
isOnlinein interfaceHostRegistration- Returns:
- whether this host is online
- See Also:
-
setOnline
public void setOnline(boolean online) - Specified by:
setOnlinein interfaceHostRegistration- Parameters:
online- the online status to set- See Also:
-
isMaintenanceMode
public boolean isMaintenanceMode()- Specified by:
isMaintenanceModein interfaceHostRegistration- Returns:
- the maintenanceMode
- See Also:
-
setMaintenanceMode
public void setMaintenanceMode(boolean maintenanceMode) - Specified by:
setMaintenanceModein interfaceHostRegistration- Parameters:
maintenanceMode- the maintenanceMode to set- See Also:
-
hashCode
public int hashCode() -
equals
-
toString
-
getNodeName
- Specified by:
getNodeNamein interfaceHostRegistration- Returns:
- the node name for this host or null, if not set
- See Also:
-
setNodeName
- Specified by:
setNodeNamein interfaceHostRegistration- Parameters:
nodeName- the node name to set- See Also:
-