Class JaxbServiceRegistration
java.lang.Object
org.opencastproject.serviceregistry.api.JaxbServiceRegistration
- All Implemented Interfaces:
ServiceRegistration
A record of a service that creates and manages receipts.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new service registration which is online and not in maintenance mode.JaxbServiceRegistration(String serviceType, String host, String path) Creates a new service registration which is online and not in maintenance mode.JaxbServiceRegistration(String serviceType, String host, String path, boolean jobProducer) Creates a new service registration which is online and not in maintenance mode.JaxbServiceRegistration(ServiceRegistration serviceRegistration) Creates a new JAXB annotated service registration based on an existing service registration -
Method Summary
Modifier and TypeMethodDescriptionbooleanintGets the job signature which changed last time the service state to error.getHost()Gets the last time the service has been declared onlinegetPath()Gets the current state of the serviceGets the last date when state was changedintGets the job signature which changed last time the service state to warninginthashCode()booleanisActive()booleanWhether the service is in maintenance mode.booleanbooleanisOnline()voidsetActive(boolean active) voidsetErrorStateTrigger(int jobSignature) Sets the job which triggered the last error statevoidvoidsetInMaintenanceMode(boolean maintenanceMode) Sets the maintenance status of this service registrationvoidsetJobProducer(boolean jobProducer) Sets whether this service registration is a job producer.voidsetOnline(boolean online) Sets the online status of this service registrationvoidsetOnlineFrom(Date onlineFrom) Sets the last time the service has been declared onlinevoidvoidsetServiceState(ServiceState state) Sets the current state of the service.voidsetServiceState(ServiceState state, int triggerJobSignature) Sets the current state of the service and the trigger Job.voidsetServiceType(String serviceType) voidsetStateChanged(Date stateChanged) Sets the last date when the state was changedvoidsetWarningStateTrigger(int jobSignature) Sets the job which triggered the last warning statetoString()
-
Field Details
-
serviceType
-
host
-
path
-
active
protected boolean active -
online
protected boolean online -
maintenanceMode
protected boolean maintenanceMode -
jobProducer
protected boolean jobProducer -
onlineFrom
The last time the service has been declared online -
serviceState
-
stateChanged
-
errorStateTrigger
protected int errorStateTrigger -
warningStateTrigger
protected int warningStateTrigger
-
-
Constructor Details
-
JaxbServiceRegistration
public JaxbServiceRegistration()Creates a new service registration which is online and not in maintenance mode. -
JaxbServiceRegistration
Creates a new JAXB annotated service registration based on an existing service registration- Parameters:
serviceRegistration-
-
JaxbServiceRegistration
Creates a new service registration which is online and not in maintenance mode.- Parameters:
serviceType- the job typehost- the host
-
JaxbServiceRegistration
Creates a new service registration which is online and not in maintenance mode.- Parameters:
serviceType- the job typehost- the hostjobProducer-
-
-
Method Details
-
getHost
- Specified by:
getHostin interfaceServiceRegistration- Returns:
- the host providing the service endpoint.
- See Also:
-
setHost
- Parameters:
host- the host to set
-
getServiceType
- Specified by:
getServiceTypein interfaceServiceRegistration- Returns:
- the type of service
- See Also:
-
setServiceType
- Parameters:
serviceType- the serviceType to set
-
isInMaintenanceMode
public boolean isInMaintenanceMode()Whether the service is in maintenance mode. If a server was in maintenance mode when shut down, it will remain in maintenance mode when it comes back online- Specified by:
isInMaintenanceModein interfaceServiceRegistration- See Also:
-
setInMaintenanceMode
public void setInMaintenanceMode(boolean maintenanceMode) Sets the maintenance status of this service registration- Parameters:
maintenanceMode-
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceServiceRegistration- Returns:
- Whether the service is active
- See Also:
-
setActive
public void setActive(boolean active) -
isOnline
public boolean isOnline()- Specified by:
isOnlinein interfaceServiceRegistration- Returns:
- Whether the service is online
- See Also:
-
setOnline
public void setOnline(boolean online) Sets the online status of this service registration- Parameters:
online-
-
getPath
- Specified by:
getPathin interfaceServiceRegistration- Returns:
- The relative path to the service endpoint.
- See Also:
-
setPath
- Parameters:
path- the path to set
-
isJobProducer
public boolean isJobProducer()- Specified by:
isJobProducerin interfaceServiceRegistration- Returns:
- Whether the service performs long running operations using Jobs.
- See Also:
-
setJobProducer
public void setJobProducer(boolean jobProducer) Sets whether this service registration is a job producer.- Parameters:
jobProducer- the jobProducer to set
-
getOnlineFrom
Gets the last time the service has been declared online- Specified by:
getOnlineFromin interfaceServiceRegistration- Returns:
- the onlineFrom
- See Also:
-
setOnlineFrom
Sets the last time the service has been declared online- Parameters:
onlineFrom- the onlineFrom to set
-
getServiceState
Gets the current state of the service- Specified by:
getServiceStatein interfaceServiceRegistration- Returns:
- current state
- See Also:
-
setServiceState
Sets the current state of the service.- Parameters:
state- current state
-
setServiceState
Sets the current state of the service and the trigger Job. If the state is set toServiceState.WARNINGorServiceState.ERRORthe triggered job will be set.- Parameters:
state- the service statetriggerJobSignature- the triggered job signature
-
getStateChanged
Gets the last date when state was changed- Specified by:
getStateChangedin interfaceServiceRegistration- Returns:
- last date when state was changed
- See Also:
-
setStateChanged
Sets the last date when the state was changed- Parameters:
stateChanged- last date
-
getErrorStateTrigger
public int getErrorStateTrigger()Gets the job signature which changed last time the service state to error.- Specified by:
getErrorStateTriggerin interfaceServiceRegistration- Returns:
- the signature from error state trigger job
- See Also:
-
setErrorStateTrigger
public void setErrorStateTrigger(int jobSignature) Sets the job which triggered the last error state- Parameters:
jobSignature- the job
-
getWarningStateTrigger
public int getWarningStateTrigger()Gets the job signature which changed last time the service state to warning- Specified by:
getWarningStateTriggerin interfaceServiceRegistration- Returns:
- the signature from warning state trigger job
- See Also:
-
setWarningStateTrigger
public void setWarningStateTrigger(int jobSignature) Sets the job which triggered the last warning state- Parameters:
jobSignature- the job
-
hashCode
public int hashCode() -
equals
-
toString
-