AbstractLauncher.ServiceState (Apache Geode 1.3.0)
Date: 2017-10-26

org.apache.geode.distributed

## Class AbstractLauncher.ServiceState<T extends java.lang.Comparable<T>>

- java.lang.Object
- - org.apache.geode.distributed.AbstractLauncher.ServiceState<T>

- Direct Known Subclasses:
    LocatorLauncher.LocatorState, ServerLauncher.ServerState
  Enclosing class:
    AbstractLauncher<T extends java.lang.Comparable<T>>

      public abstract static class AbstractLauncher.ServiceState<T extends java.lang.Comparable<T>>
      extends java.lang.Object

  The ServiceState is an immutable type representing the state of the specified Locator at any given moment in time. The ServiceState associates the Locator with it's state at the exact moment an instance of this class is constructed.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.lang.String` | `JSON_CLASSPATH`
    `protected static java.lang.String` | `JSON_GEMFIREVERSION`
    `protected static java.lang.String` | `JSON_HOST`
    `protected static java.lang.String` | `JSON_JAVAVERSION`
    `protected static java.lang.String` | `JSON_JVMARGUMENTS`
    `protected static java.lang.String` | `JSON_LOCATION`
    `protected static java.lang.String` | `JSON_LOGFILE`
    `protected static java.lang.String` | `JSON_MEMBERNAME`
    `protected static java.lang.String` | `JSON_PID`
    `protected static java.lang.String` | `JSON_PORT`
    `protected static java.lang.String` | `JSON_STATUS`
    `protected static java.lang.String` | `JSON_STATUSMESSAGE`
    `protected static java.lang.String` | `JSON_TIMESTAMP`
    `protected static java.lang.String` | `JSON_UPTIME`
    `protected static java.lang.String` | `JSON_WORKINGDIRECTORY`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ServiceState(AbstractLauncher.Status status, java.lang.String statusMessage, long timestamp, java.lang.String serviceLocation, java.lang.Integer pid, java.lang.Long uptime, java.lang.String workingDirectory, java.util.List<java.lang.String> jvmArguments, java.lang.String classpath, java.lang.String gemfireVersion, java.lang.String javaVersion, java.lang.String logFile, java.lang.String host, java.lang.String port, java.lang.String memberName)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static java.lang.String` | `format(java.util.Date timestamp)`
    `java.lang.String` | `getClasspath()` Gets the Java classpath used when launching the GemFire service.
    `java.lang.String` | `getGemFireVersion()` Gets the version of GemFire used to launch and run the GemFire service.
    `java.lang.String` | `getHost()` Gets the host or IP address for the process and its service.
    `java.lang.String` | `getJavaVersion()` Gets the version of Java used to launch and run the GemFire service.
    `java.util.List<java.lang.String>` | `getJvmArguments()` Gets the arguments passed to the JVM process that is running the GemFire service.
    `java.lang.String` | `getLogFile()` Gets the path of the log file for the process.
    `java.lang.String` | `getMemberName()` Gets GemFire member's name for the process.
    `java.lang.Integer` | `getPid()` Gets the process ID of the running GemFire service if known, otherwise returns null.
    `java.lang.String` | `getPort()` Gets the port for the process and its service.
    `java.lang.String` | `getServiceLocation()` Gets the location of the GemFire service (usually the host in combination with the port).
    `protected abstract java.lang.String` | `getServiceName()` Gets the name of the GemFire service.
    `AbstractLauncher.Status` | `getStatus()` Gets the state of the GemFire service.
    `java.lang.String` | `getStatusMessage()` Gets description of the the service's current state.
    `java.sql.Timestamp` | `getTimestamp()` The date and time the GemFire service was last in this state.
    `java.lang.Long` | `getUptime()` Gets the amount of time in milliseconds that the JVM process with the GemFire service has been running.
    `java.lang.String` | `getWorkingDirectory()` Gets the directory in which the GemFire service is running.
    `protected static java.lang.Integer` | `identifyPid()`
    `static boolean` | `isStartingNotRespondingOrNull(AbstractLauncher.ServiceState serviceState)`
    `boolean` | `isStartingOrNotResponding()`
    `boolean` | `isVmWithProcessIdRunning()`
    `protected static java.lang.String` | `toDaysHoursMinutesSeconds(java.lang.Long milliseconds)`
    `java.lang.String` | `toJson()` Marshals this state object into a JSON String.
    `java.lang.String` | `toString()` Gets a String describing the state of the GemFire service.
    `protected java.lang.String` | `toString(java.util.Date dateTime)`
    `protected java.lang.String` | `toString(java.lang.Number value)`
    `protected java.lang.String` | `toString(java.lang.Object... values)`
    `protected java.lang.String` | `toString(java.lang.String value)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### JSON_CLASSPATH

          protected static final java.lang.String JSON_CLASSPATH

      See Also:
        Constant Field Values

    - #### JSON_GEMFIREVERSION

          protected static final java.lang.String JSON_GEMFIREVERSION

      See Also:
        Constant Field Values

    - #### JSON_HOST

          protected static final java.lang.String JSON_HOST

      See Also:
        Constant Field Values

    - #### JSON_JAVAVERSION

          protected static final java.lang.String JSON_JAVAVERSION

      See Also:
        Constant Field Values

    - #### JSON_JVMARGUMENTS

          protected static final java.lang.String JSON_JVMARGUMENTS

      See Also:
        Constant Field Values

    - #### JSON_LOCATION

          protected static final java.lang.String JSON_LOCATION

      See Also:
        Constant Field Values

    - #### JSON_LOGFILE

          protected static final java.lang.String JSON_LOGFILE

      See Also:
        Constant Field Values

    - #### JSON_MEMBERNAME

          protected static final java.lang.String JSON_MEMBERNAME

      See Also:
        Constant Field Values

    - #### JSON_PID

          protected static final java.lang.String JSON_PID

      See Also:
        Constant Field Values

    - #### JSON_PORT

          protected static final java.lang.String JSON_PORT

      See Also:
        Constant Field Values

    - #### JSON_STATUS

          protected static final java.lang.String JSON_STATUS

      See Also:
        Constant Field Values

    - #### JSON_STATUSMESSAGE

          protected static final java.lang.String JSON_STATUSMESSAGE

      See Also:
        Constant Field Values

    - #### JSON_TIMESTAMP

          protected static final java.lang.String JSON_TIMESTAMP

      See Also:
        Constant Field Values

    - #### JSON_UPTIME

          protected static final java.lang.String JSON_UPTIME

      See Also:
        Constant Field Values

    - #### JSON_WORKINGDIRECTORY

          protected static final java.lang.String JSON_WORKINGDIRECTORY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ServiceState

          protected ServiceState(AbstractLauncher.Status status,
                                 java.lang.String statusMessage,
                                 long timestamp,
                                 java.lang.String serviceLocation,
                                 java.lang.Integer pid,
                                 java.lang.Long uptime,
                                 java.lang.String workingDirectory,
                                 java.util.List<java.lang.String> jvmArguments,
                                 java.lang.String classpath,
                                 java.lang.String gemfireVersion,
                                 java.lang.String javaVersion,
                                 java.lang.String logFile,
                                 java.lang.String host,
                                 java.lang.String port,
                                 java.lang.String memberName)

  - ### Method Detail

    - #### format

          protected static java.lang.String format(java.util.Date timestamp)

    - #### identifyPid

          protected static java.lang.Integer identifyPid()

    - #### toDaysHoursMinutesSeconds

          protected static java.lang.String toDaysHoursMinutesSeconds(java.lang.Long milliseconds)

    - #### toJson

          public java.lang.String toJson()

      Marshals this state object into a JSON String.
      Returns:
        a String value containing the JSON representation of this state object.

    - #### isStartingNotRespondingOrNull

          public static boolean isStartingNotRespondingOrNull(AbstractLauncher.ServiceState serviceState)

    - #### isStartingOrNotResponding

          public boolean isStartingOrNotResponding()

    - #### isVmWithProcessIdRunning

          public boolean isVmWithProcessIdRunning()

    - #### getClasspath

          public java.lang.String getClasspath()

      Gets the Java classpath used when launching the GemFire service.
      Returns:
        a String value indicating the Java classpath used when launching the GemFire service.
      See Also:
        `with 'java.class.path'`

    - #### getGemFireVersion

          public java.lang.String getGemFireVersion()

      Gets the version of GemFire used to launch and run the GemFire service.
      Returns:
        a String indicating the version of GemFire used in the running GemFire service.

    - #### getJavaVersion

          public java.lang.String getJavaVersion()

      Gets the version of Java used to launch and run the GemFire service.
      Returns:
        a String indicating the version of the Java runtime used in the running GemFire service.
      See Also:
        `with 'java.verson'`

    - #### getJvmArguments

          public java.util.List<java.lang.String> getJvmArguments()

      Gets the arguments passed to the JVM process that is running the GemFire service.
      Returns:
        a List of String value each representing an argument passed to the JVM of the GemFire service.
      See Also:
        `RuntimeMXBean.getInputArguments()`

    - #### getMemberName

          public java.lang.String getMemberName()

      Gets GemFire member's name for the process.
      Returns:
        a String indicating the GemFire member's name for the process.

    - #### getPid

          public java.lang.Integer getPid()

      Gets the process ID of the running GemFire service if known, otherwise returns null.
      Returns:
        a integer value indicating the process ID (PID) of the running GemFire service, or null if the PID cannot be determined.

    - #### getServiceLocation

          public java.lang.String getServiceLocation()

      Gets the location of the GemFire service (usually the host in combination with the port).
      Returns:
        a String indication the location (such as host/port) of the GemFire service.

    - #### getServiceName

          protected abstract java.lang.String getServiceName()

      Gets the name of the GemFire service.
      Returns:
        a String indicating the name of the GemFire service.

    - #### getStatus

          public AbstractLauncher.Status getStatus()

      Gets the state of the GemFire service.
      Returns:
        a Status enumerated type representing the state of the GemFire service.
      See Also:
        `AbstractLauncher.Status`

    - #### getStatusMessage

          public java.lang.String getStatusMessage()

      Gets description of the the service's current state.
      Returns:
        a String describing the service's current state.

    - #### getTimestamp

          public java.sql.Timestamp getTimestamp()

      The date and time the GemFire service was last in this state.
      Returns:
        a Timestamp signifying the last date and time the GemFire service was in this state.
      See Also:
        `Timestamp`

    - #### getUptime

          public java.lang.Long getUptime()

      Gets the amount of time in milliseconds that the JVM process with the GemFire service has been running.
      Returns:
        a long value indicating the number of milliseconds that the GemFire service JVM has been running.
      See Also:
        `RuntimeMXBean.getUptime()`

    - #### getWorkingDirectory

          public java.lang.String getWorkingDirectory()

      Gets the directory in which the GemFire service is running. This is also the location where all GemFire service files (log files, the PID file, and so on) are written.
      Returns:
        a String value indicating the GemFire service's working (running) directory.

    - #### getLogFile

          public java.lang.String getLogFile()

      Gets the path of the log file for the process.
      Returns:
        a String value indicating the path of the log file for the process.

    - #### getHost

          public java.lang.String getHost()

      Gets the host or IP address for the process and its service.
      Returns:
        a String value representing the host or IP address for the process and its service.

    - #### getPort

          public java.lang.String getPort()

      Gets the port for the process and its service.
      Returns:
        an Integer value indicating the port for the process and its service.

    - #### toString

          public java.lang.String toString()

      Gets a String describing the state of the GemFire service.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a String describing the state of the GemFire service.

    - #### toString

          protected java.lang.String toString(java.util.Date dateTime)

    - #### toString

          protected java.lang.String toString(java.lang.Number value)

    - #### toString

          protected java.lang.String toString(java.lang.Object... values)

    - #### toString

          protected java.lang.String toString(java.lang.String value)