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 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 registration
      serviceType - the type of job this service handles
      path - 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 registration
      serviceType - the type of job this service handles
      path - the URL path on this host to the service endpoint
      jobProducer -
  • Method Details

    • getId

      public Long getId()
      Gets the primary key for this service registration.
      Returns:
      the primary key
    • setId

      public void setId(Long id)
      Sets the primary key identifier.
      Parameters:
      id - the identifier
    • getOnlineFrom

      public Date getOnlineFrom()
      Description copied from interface: ServiceRegistration
      Gets the last time the service has been declared online
      Specified by:
      getOnlineFrom in interface ServiceRegistration
      Returns:
      the onlineFrom
    • setOnlineFrom

      public void setOnlineFrom(Date onlineFrom)
    • getServiceType

      public String getServiceType()
      Specified by:
      getServiceType in interface ServiceRegistration
      Returns:
      the type of service
    • getPath

      public String getPath()
      Specified by:
      getPath in interface ServiceRegistration
      Returns:
      The relative path to the service endpoint.
    • setPath

      public void setPath(String path)
    • getServiceState

      public ServiceState getServiceState()
      Description copied from interface: ServiceRegistration
      Gets the current state of the service
      Specified by:
      getServiceState in interface ServiceRegistration
      Returns:
      current state
    • setServiceState

      public void setServiceState(ServiceState serviceState)
    • setServiceState

      public void setServiceState(ServiceState state, int triggerJobSignature)
    • getStateChanged

      public Date getStateChanged()
      Description copied from interface: ServiceRegistration
      Gets the last date when state was changed
      Specified by:
      getStateChanged in interface ServiceRegistration
      Returns:
      last date when state was changed
    • setStateChanged

      public void setStateChanged(Date stateChanged)
    • getWarningStateTrigger

      public int getWarningStateTrigger()
      Description copied from interface: ServiceRegistration
      Gets the job signature which changed last time the service state to warning
      Specified by:
      getWarningStateTrigger in interface ServiceRegistration
      Returns:
      the signature from warning state trigger job
    • setWarningStateTrigger

      public void setWarningStateTrigger(int warningStateTrigger)
    • getErrorStateTrigger

      public int getErrorStateTrigger()
      Description copied from interface: ServiceRegistration
      Gets the job signature which changed last time the service state to error.
      Specified by:
      getErrorStateTrigger in interface ServiceRegistration
      Returns:
      the signature from error state trigger job
    • setErrorStateTrigger

      public void setErrorStateTrigger(int errorStateTrigger)
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface ServiceRegistration
      Returns:
      Whether the service is active
    • setActive

      public void setActive(boolean isActive)
    • isOnline

      public boolean isOnline()
      Specified by:
      isOnline in interface ServiceRegistration
      Returns:
      Whether the service is online
    • setOnline

      public void setOnline(boolean online)
    • isJobProducer

      public boolean isJobProducer()
      Specified by:
      isJobProducer in interface ServiceRegistration
      Returns:
      Whether the service performs long running operations using Jobs.
    • setJobProducer

      public void setJobProducer(boolean isJobProducer)
    • isInMaintenanceMode

      public boolean isInMaintenanceMode()
      Description copied from interface: ServiceRegistration
      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:
      isInMaintenanceMode in interface ServiceRegistration
    • getHost

      public String getHost()
      Specified by:
      getHost in interface ServiceRegistration
      Returns:
      the host providing the service endpoint.
    • getHostRegistration

      public HostRegistrationJpaImpl getHostRegistration()
      Gets the associated HostRegistrationJpaImpl
      Returns:
      the host registration
    • setHostRegistration

      public void setHostRegistration(HostRegistrationJpaImpl hostRegistration)
      Parameters:
      hostRegistration - the hostRegistration to set
    • postLoad

      public void postLoad()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object