Class WLPRestClient


  • public class WLPRestClient
    extends Object
    This is a wrapper around the WebSphere Liberty JMX Rest API.
    Author:
    Tony Ayres
    • Method Detail

      • deploy

        public void deploy​(File archive)
                    throws org.apache.http.client.ClientProtocolException,
                           IOException
        Uses the rest api to upload an application binary to the dropins folder of WLP to allow the server automatically deploy it.
        Parameters:
        archive -
        Throws:
        org.apache.http.client.ClientProtocolException
        IOException
      • undeploy

        public void undeploy​(String applicationName)
                      throws org.apache.http.client.ClientProtocolException,
                             IOException
        Deletes the specified application from the servers dropins directory. WLP will detect this and then undeploy it.
        Parameters:
        applicationName -
        Throws:
        org.apache.http.client.ClientProtocolException
        IOException
      • isServerUp

        public boolean isServerUp()
                           throws org.apache.http.client.ClientProtocolException,
                                  IOException
        Calls the rest api to determine if the application server is up and running.
        Returns:
        boolean - true if the server is running
        Throws:
        org.apache.http.client.ClientProtocolException
        IOException
      • getServerName

        public String getServerName()
                             throws org.apache.http.client.ClientProtocolException,
                                    IOException
        Queries the rest api for the servers name.
        Returns:
        the name of the running server e.g. defaultServer
        Throws:
        IOException
        org.apache.http.client.ClientProtocolException
      • isApplicationStarted

        public boolean isApplicationStarted​(String applicationName)
        Checks the application State using the WLP rest api.
        Parameters:
        applicationName -
        Returns:
        true if the application is in STARTED state