Class ServiceRegistrationJpaImpl
java.lang.Object
org.opencastproject.serviceregistry.impl.jpa.ServiceRegistrationJpaImpl
- All Implemented Interfaces:
ServiceRegistration
@Entity(name="ServiceRegistration")
public class ServiceRegistrationJpaImpl
extends Object
implements ServiceRegistration
A record of a service that creates and manages receipts.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new service registration which is onlineServiceRegistrationJpaImpl(HostRegistrationJpaImpl hostRegistration, String serviceType, String path) Creates a new service registration which is onlineServiceRegistrationJpaImpl(HostRegistrationJpaImpl hostRegistration, String serviceType, String path, boolean jobProducer) Creates a new service registration which is online and not in maintenance mode. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintGets the job signature which changed last time the service state to error.getHost()Gets the associatedHostRegistrationJpaImplgetId()Gets the primary key for this service registration.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()voidpostLoad()voidsetActive(boolean isActive) voidsetErrorStateTrigger(int errorStateTrigger) voidsetHostRegistration(HostRegistrationJpaImpl hostRegistration) voidSets the primary key identifier.voidsetJobProducer(boolean isJobProducer) voidsetOnline(boolean online) voidsetOnlineFrom(Date onlineFrom) voidvoidsetServiceState(ServiceState serviceState) voidsetServiceState(ServiceState state, int triggerJobSignature) voidsetStateChanged(Date stateChanged) voidsetWarningStateTrigger(int warningStateTrigger) toString()
-
Constructor Details
-
ServiceRegistrationJpaImpl
public ServiceRegistrationJpaImpl()Creates a new service registration which is online -
ServiceRegistrationJpaImpl
public ServiceRegistrationJpaImpl(HostRegistrationJpaImpl hostRegistration, String serviceType, String path) Creates a new service registration which is online- Parameters:
hostRegistration- the host registrationserviceType- the type of job this service handlespath- the URL path on this host to the service endpoint
-
ServiceRegistrationJpaImpl
public ServiceRegistrationJpaImpl(HostRegistrationJpaImpl hostRegistration, String serviceType, String path, boolean jobProducer) Creates a new service registration which is online and not in maintenance mode.- Parameters:
hostRegistration- the host registrationserviceType- the type of job this service handlespath- the URL path on this host to the service endpointjobProducer-
-
-
Method Details
-
getId
Gets the primary key for this service registration.- Returns:
- the primary key
-
setId
Sets the primary key identifier.- Parameters:
id- the identifier
-
getOnlineFrom
Description copied from interface:ServiceRegistrationGets the last time the service has been declared online- Specified by:
getOnlineFromin interfaceServiceRegistration- Returns:
- the onlineFrom
-
setOnlineFrom
-
getServiceType
- Specified by:
getServiceTypein interfaceServiceRegistration- Returns:
- the type of service
-
getPath
- Specified by:
getPathin interfaceServiceRegistration- Returns:
- The relative path to the service endpoint.
-
setPath
-
getServiceState
Description copied from interface:ServiceRegistrationGets the current state of the service- Specified by:
getServiceStatein interfaceServiceRegistration- Returns:
- current state
-
setServiceState
-
setServiceState
-
getStateChanged
Description copied from interface:ServiceRegistrationGets the last date when state was changed- Specified by:
getStateChangedin interfaceServiceRegistration- Returns:
- last date when state was changed
-
setStateChanged
-
getWarningStateTrigger
public int getWarningStateTrigger()Description copied from interface:ServiceRegistrationGets the job signature which changed last time the service state to warning- Specified by:
getWarningStateTriggerin interfaceServiceRegistration- Returns:
- the signature from warning state trigger job
-
setWarningStateTrigger
public void setWarningStateTrigger(int warningStateTrigger) -
getErrorStateTrigger
public int getErrorStateTrigger()Description copied from interface:ServiceRegistrationGets the job signature which changed last time the service state to error.- Specified by:
getErrorStateTriggerin interfaceServiceRegistration- Returns:
- the signature from error state trigger job
-
setErrorStateTrigger
public void setErrorStateTrigger(int errorStateTrigger) -
isActive
public boolean isActive()- Specified by:
isActivein interfaceServiceRegistration- Returns:
- Whether the service is active
-
setActive
public void setActive(boolean isActive) -
isOnline
public boolean isOnline()- Specified by:
isOnlinein interfaceServiceRegistration- Returns:
- Whether the service is online
-
setOnline
public void setOnline(boolean online) -
isJobProducer
public boolean isJobProducer()- Specified by:
isJobProducerin interfaceServiceRegistration- Returns:
- Whether the service performs long running operations using Jobs.
-
setJobProducer
public void setJobProducer(boolean isJobProducer) -
isInMaintenanceMode
public boolean isInMaintenanceMode()Description copied from interface:ServiceRegistrationWhether 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
-
getHost
- Specified by:
getHostin interfaceServiceRegistration- Returns:
- the host providing the service endpoint.
-
getHostRegistration
Gets the associatedHostRegistrationJpaImpl- Returns:
- the host registration
-
setHostRegistration
- Parameters:
hostRegistration- the hostRegistration to set
-
postLoad
public void postLoad() -
hashCode
public int hashCode() -
equals
-
toString
-