Class ServerHelper

java.lang.Object
org.wildfly.plugin.tools.ServerHelper

@Deprecated(forRemoval=true, since="1.1") public class ServerHelper extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Use the ServerManager, StandaloneManager and DomainManager utilities as replacements.
Author:
James R. Perkins
See Also:
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    static org.jboss.dmr.ModelNode
    determineHostAddress(org.jboss.as.controller.client.ModelControllerClient client)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determines the address for the host being used.
    static void
    executeReload(org.jboss.as.controller.client.ModelControllerClient client, org.jboss.dmr.ModelNode reloadOp)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Reloads the server and returns immediately.
    getContainerDescription(org.jboss.as.controller.client.ModelControllerClient client)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the description of the running container.
    static boolean
    isDomainRunning(org.jboss.as.controller.client.ModelControllerClient client)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks to see if the domain is running.
    static boolean
    isStandaloneRunning(org.jboss.as.controller.client.ModelControllerClient client)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks to see if a standalone server is running.
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether or not the directory is a valid home directory for a server.
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether or not the directory is a valid home directory for a server.
    static String
    launchType(org.jboss.as.controller.client.ModelControllerClient client)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determines the servers "launch-type".
    static void
    reloadIfRequired(org.jboss.as.controller.client.ModelControllerClient client, long timeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if the container status is "reload-required" and if it's the case executes reload and waits for completion.
    static String
    serverState(org.jboss.as.controller.client.ModelControllerClient client)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the "server-state" for a standalone server.
    static void
    shutdownDomain(org.jboss.as.controller.client.ModelControllerClient client)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Shuts down a managed domain container.
    static void
    shutdownDomain(org.jboss.as.controller.client.ModelControllerClient client, int timeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Shuts down a managed domain container.
    static void
    shutdownStandalone(org.jboss.as.controller.client.ModelControllerClient client)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Shuts down a standalone server.
    static void
    shutdownStandalone(org.jboss.as.controller.client.ModelControllerClient client, int timeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Shuts down a standalone server.
    static void
    waitForDomain(Process process, org.jboss.as.controller.client.ModelControllerClient client, long startupTimeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Waits the given amount of time in seconds for a managed domain to start.
    static void
    waitForDomain(org.jboss.as.controller.client.ModelControllerClient client, long startupTimeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Waits the given amount of time in seconds for a managed domain to start.
    static void
    waitForStandalone(Process process, org.jboss.as.controller.client.ModelControllerClient client, long startupTimeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Waits the given amount of time in seconds for a standalone server to start.
    static void
    waitForStandalone(org.jboss.as.controller.client.ModelControllerClient client, long startupTimeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Waits the given amount of time in seconds for a standalone server to start.

    Methods inherited from class java.lang.Object Link icon

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

    • ServerHelper Link icon

      public ServerHelper()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details Link icon

    • isValidHomeDirectory Link icon

      public static boolean isValidHomeDirectory(Path path)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether or not the directory is a valid home directory for a server.

      This validates the path is not null, exists, is a directory and contains a jboss-modules.jar.

      Parameters:
      path - the path to validate
      Returns:
      true if the path is valid otherwise false
    • isValidHomeDirectory Link icon

      public static boolean isValidHomeDirectory(String path)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether or not the directory is a valid home directory for a server.

      This validates the path is not null, exists, is a directory and contains a jboss-modules.jar.

      Parameters:
      path - the path to validate
      Returns:
      true if the path is valid otherwise false
    • getContainerDescription Link icon

      public static ContainerDescription getContainerDescription(org.jboss.as.controller.client.ModelControllerClient client) throws IOException, OperationExecutionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the description of the running container.
      Parameters:
      client - the client used to query the server
      Returns:
      the description of the running container
      Throws:
      IOException - if an error occurs communicating with the server
      OperationExecutionException - if the operation used to query the container fails
      See Also:
    • reloadIfRequired Link icon

      public static void reloadIfRequired(org.jboss.as.controller.client.ModelControllerClient client, long timeout)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if the container status is "reload-required" and if it's the case executes reload and waits for completion.
      Parameters:
      client - the client used to execute the operation
    • executeReload Link icon

      public static void executeReload(org.jboss.as.controller.client.ModelControllerClient client, org.jboss.dmr.ModelNode reloadOp)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Reloads the server and returns immediately.
      Parameters:
      client - the client used to execute the reload operation
      reloadOp - the reload operation to execute
    • launchType Link icon

      public static String launchType(org.jboss.as.controller.client.ModelControllerClient client)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determines the servers "launch-type".
      Parameters:
      client - the client used to communicate with the server
      Returns:
      the servers launch-type or "unknown" if it could not be determined
    • serverState Link icon

      public static String serverState(org.jboss.as.controller.client.ModelControllerClient client)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the "server-state" for a standalone server.
      Parameters:
      client - the client used to communicate with the server
      Returns:
      the server-state or "failed" if an error occurred. A value of "unknown" is returned if the server is not a standalone server
    • waitForDomain Link icon

      public static void waitForDomain(org.jboss.as.controller.client.ModelControllerClient client, long startupTimeout) throws InterruptedException, RuntimeException, TimeoutException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Waits the given amount of time in seconds for a managed domain to start. A domain is considered started when each of the servers in the domain are started unless the server is disabled.
      Parameters:
      client - the client used to communicate with the server
      startupTimeout - the time, in seconds, to wait for the server start
      Throws:
      InterruptedException - if interrupted while waiting for the server to start
      RuntimeException - if the process has died
      TimeoutException - if the timeout has been reached and the server is still not started
    • waitForDomain Link icon

      public static void waitForDomain(Process process, org.jboss.as.controller.client.ModelControllerClient client, long startupTimeout) throws InterruptedException, RuntimeException, TimeoutException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Waits the given amount of time in seconds for a managed domain to start. A domain is considered started when each of the servers in the domain are started unless the server is disabled.

      If the process is not null and a timeout occurs the process will be destroyed.

      Parameters:
      process - the Java process can be null if no process is available
      client - the client used to communicate with the server
      startupTimeout - the time, in seconds, to wait for the server start
      Throws:
      InterruptedException - if interrupted while waiting for the server to start
      RuntimeException - if the process has died
      TimeoutException - if the timeout has been reached and the server is still not started
    • isDomainRunning Link icon

      public static boolean isDomainRunning(org.jboss.as.controller.client.ModelControllerClient client)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks to see if the domain is running. If the server is not in admin only mode each servers running state is checked. If any server is not in a started state the domain is not considered to be running.
      Parameters:
      client - the client used to communicate with the server
      Returns:
      true if the server is in a running state, otherwise false
    • shutdownDomain Link icon

      public static void shutdownDomain(org.jboss.as.controller.client.ModelControllerClient client) throws IOException, OperationExecutionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Shuts down a managed domain container. The servers are first stopped, then the host controller is shutdown.
      Parameters:
      client - the client used to communicate with the server
      Throws:
      IOException - if an error occurs communicating with the server
      OperationExecutionException - if the operation used to shutdown the managed domain failed
    • shutdownDomain Link icon

      public static void shutdownDomain(org.jboss.as.controller.client.ModelControllerClient client, int timeout) throws IOException, OperationExecutionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Shuts down a managed domain container. The servers are first stopped, then the host controller is shutdown.
      Parameters:
      client - the client used to communicate with the server
      timeout - the graceful shutdown timeout, a value of -1 will wait indefinitely and a value of 0 will not attempt a graceful shutdown
      Throws:
      IOException - if an error occurs communicating with the server
      OperationExecutionException - if the operation used to shutdown the managed domain failed
    • determineHostAddress Link icon

      public static org.jboss.dmr.ModelNode determineHostAddress(org.jboss.as.controller.client.ModelControllerClient client) throws IOException, OperationExecutionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determines the address for the host being used.
      Parameters:
      client - the client used to communicate with the server
      Returns:
      the address of the host
      Throws:
      IOException - if an error occurs communicating with the server
      OperationExecutionException - if the operation used to determine the host name fails
    • waitForStandalone Link icon

      public static void waitForStandalone(org.jboss.as.controller.client.ModelControllerClient client, long startupTimeout) throws InterruptedException, RuntimeException, TimeoutException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Waits the given amount of time in seconds for a standalone server to start.
      Parameters:
      client - the client used to communicate with the server
      startupTimeout - the time, in seconds, to wait for the server start
      Throws:
      InterruptedException - if interrupted while waiting for the server to start
      RuntimeException - if the process has died
      TimeoutException - if the timeout has been reached and the server is still not started
    • waitForStandalone Link icon

      public static void waitForStandalone(Process process, org.jboss.as.controller.client.ModelControllerClient client, long startupTimeout) throws InterruptedException, RuntimeException, TimeoutException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Waits the given amount of time in seconds for a standalone server to start.

      If the process is not null and a timeout occurs the process will be destroyed.

      Parameters:
      process - the Java process can be null if no process is available
      client - the client used to communicate with the server
      startupTimeout - the time, in seconds, to wait for the server start
      Throws:
      InterruptedException - if interrupted while waiting for the server to start
      RuntimeException - if the process has died
      TimeoutException - if the timeout has been reached and the server is still not started
    • isStandaloneRunning Link icon

      public static boolean isStandaloneRunning(org.jboss.as.controller.client.ModelControllerClient client)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks to see if a standalone server is running.
      Parameters:
      client - the client used to communicate with the server
      Returns:
      true if the server is running, otherwise false
    • shutdownStandalone Link icon

      public static void shutdownStandalone(org.jboss.as.controller.client.ModelControllerClient client) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Shuts down a standalone server.
      Parameters:
      client - the client used to communicate with the server
      Throws:
      IOException - if an error occurs communicating with the server
    • shutdownStandalone Link icon

      public static void shutdownStandalone(org.jboss.as.controller.client.ModelControllerClient client, int timeout) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Shuts down a standalone server.
      Parameters:
      client - the client used to communicate with the server
      timeout - the graceful shutdown timeout, a value of -1 will wait indefinitely and a value of 0 will not attempt a graceful shutdown
      Throws:
      IOException - if an error occurs communicating with the server