Class NOOPSDNotify

java.lang.Object
de.afoo.sdnotify.NOOPSDNotify
All Implemented Interfaces:
SDNotify

public class NOOPSDNotify extends Object implements SDNotify
NOOP Implementation of the SDNotify interface to be used when we are not running under systemd.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Notify systemd that a D-Bus error has occurred.
    boolean
    errno(int errno)
    Notify systemd that an error has occurred.
    boolean
    Tells the service manager to extend the startup, runtime or shutdown service timeout corresponding the current state.
    boolean
    mainPid(int pid)
    Inform systemd of the main pid of the service.
    boolean
    Notify systemd that the service has started successfully.
    boolean
    Notify systemd that the service is currently reloading.
    boolean
    status(String message)
    Send a free form status message to systemd.
    boolean
    Notify systemd that the service is stopping.
    boolean
    Update the watchdog timestamp for services with WatchDogSec enabled.
    boolean
    An error that should be handled by the watchdog options occured.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NOOPSDNotify

      public NOOPSDNotify()
  • Method Details

    • ready

      public boolean ready()
      Description copied from interface: SDNotify
      Notify systemd that the service has started successfully. This has to be sent for services of Type=notify to be considered running by systemd.
      Specified by:
      ready in interface SDNotify
      Returns:
      if the message was successfully sent
    • status

      public boolean status(String message)
      Description copied from interface: SDNotify
      Send a free form status message to systemd.
      Specified by:
      status in interface SDNotify
      Parameters:
      message - the message to be sent
      Returns:
      if the message was successfully sent
    • reloading

      public boolean reloading()
      Description copied from interface: SDNotify
      Notify systemd that the service is currently reloading. SDNotify.ready() must be called once this reloading has finished.
      Specified by:
      reloading in interface SDNotify
      Returns:
      if the message was successfully sent
    • stopping

      public boolean stopping()
      Description copied from interface: SDNotify
      Notify systemd that the service is stopping.
      Specified by:
      stopping in interface SDNotify
      Returns:
      if the message was successfully sent
    • errno

      public boolean errno(int errno)
      Description copied from interface: SDNotify
      Notify systemd that an error has occurred.
      Specified by:
      errno in interface SDNotify
      Parameters:
      errno - the ERRNO of the error
      Returns:
      if the message was successfully sent
    • busError

      public boolean busError(String error)
      Description copied from interface: SDNotify
      Notify systemd that a D-Bus error has occurred.
      Specified by:
      busError in interface SDNotify
      Parameters:
      error - a description of the error
      Returns:
      if the message was successfully sent
    • mainPid

      public boolean mainPid(int pid)
      Description copied from interface: SDNotify
      Inform systemd of the main pid of the service. This is only necessary under special circumstances.
      Specified by:
      mainPid in interface SDNotify
      Parameters:
      pid - the main pic
      Returns:
      if the message was successfully sent
    • watchdog

      public boolean watchdog()
      Description copied from interface: SDNotify
      Update the watchdog timestamp for services with WatchDogSec enabled.
      Specified by:
      watchdog in interface SDNotify
      Returns:
      if the message was successfully sent
    • watchdogTrigger

      public boolean watchdogTrigger()
      Description copied from interface: SDNotify
      An error that should be handled by the watchdog options occured.
      Specified by:
      watchdogTrigger in interface SDNotify
      Returns:
      if the message was successfully sent
    • extendTimeout

      public boolean extendTimeout(Duration duration)
      Description copied from interface: SDNotify
      Tells the service manager to extend the startup, runtime or shutdown service timeout corresponding the current state.
      Specified by:
      extendTimeout in interface SDNotify
      Parameters:
      duration - the new value of the timeout
      Returns:
      if the message was successfully sent