use of fish.payara.arquillian.container.payara.clientutils.PayaraClientException in project Payara by payara.
the class CommonPayaraManager method undeploy.
public void undeploy(Archive<?> archive) throws DeploymentException {
if (archive == null) {
throw new IllegalArgumentException("archive must not be null");
}
deploymentName = createDeploymentName(archive.getName());
try {
// Build up the POST form to send to Payara
FormDataMultiPart form = new FormDataMultiPart();
form.field("target", configuration.getTarget(), TEXT_PLAIN_TYPE);
form.field("operation", DELETE_OPERATION, TEXT_PLAIN_TYPE);
payaraClient.doUndeploy(deploymentName, form);
} catch (PayaraClientException e) {
throw new DeploymentException("Could not undeploy " + archive.getName(), e);
}
}
use of fish.payara.arquillian.container.payara.clientutils.PayaraClientException in project Payara by payara.
the class CommonPayaraManager method deploy.
public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException {
if (archive == null) {
throw new IllegalArgumentException("archive must not be null");
}
final String archiveName = archive.getName();
final ProtocolMetaData protocolMetaData = new ProtocolMetaData();
try {
InputStream deployment = archive.as(ZipExporter.class).exportAsInputStream();
// Build up the POST form to send to Payara
final FormDataMultiPart form = new FormDataMultiPart();
form.bodyPart(new StreamDataBodyPart("id", deployment, archiveName));
deploymentName = createDeploymentName(archiveName);
addDeployFormFields(deploymentName, form);
// Do Deploy the application on the remote Payara
HTTPContext httpContext = payaraClient.doDeploy(deploymentName, form);
protocolMetaData.addContext(httpContext);
} catch (PayaraClientException e) {
throw new DeploymentException("Could not deploy " + archiveName, e);
}
return protocolMetaData;
}
Aggregations