Package io.openliberty.arquillian.remote
Class WLPRestClient
- java.lang.Object
-
- io.openliberty.arquillian.remote.WLPRestClient
-
public class WLPRestClient extends Object
This is a wrapper around the WebSphere Liberty JMX Rest API.- Author:
- Tony Ayres
-
-
Constructor Summary
Constructors Constructor Description WLPRestClient(WLPRemoteContainerConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeploy(File archive)Uses the rest api to upload an application binary to the dropins folder of WLP to allow the server automatically deploy it.StringgetServerName()Queries the rest api for the servers name.booleanisApplicationStarted(String applicationName)Checks the application State using the WLP rest api.booleanisServerUp()Calls the rest api to determine if the application server is up and running.voidundeploy(String applicationName)Deletes the specified application from the servers dropins directory.
-
-
-
Constructor Detail
-
WLPRestClient
public WLPRestClient(WLPRemoteContainerConfiguration configuration)
-
-
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.ClientProtocolExceptionIOException
-
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.ClientProtocolExceptionIOException
-
isServerUp
public boolean isServerUp() throws org.apache.http.client.ClientProtocolException, IOExceptionCalls 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.ClientProtocolExceptionIOException
-
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:
IOExceptionorg.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
-
-