use of org.jboss.hal.core.deployment.Deployment in project console by hal.
the class StandaloneDeploymentColumn method explodeSubs.
private void explodeSubs(Deployment deployment) {
ResourceAddress address = new ResourceAddress().add(DEPLOYMENT, deployment.getName());
Operation disable = new Operation.Builder(address, UNDEPLOY).build();
Composite op = new Composite(disable);
String id = Ids.deployment(deployment.getName());
ItemMonitor.startProgress(id);
deployment.getSubdeployments().forEach(subdeployment -> {
Operation explode = new Operation.Builder(address, EXPLODE).param(PATH, subdeployment.getName()).build();
op.add(explode);
});
dispatcher.execute(op, (Consumer<CompositeResult>) result -> {
enable(deployment);
MessageEvent.fire(eventBus, Message.success(resources.messages().deploymentExploded(deployment.getName())));
}, (operation, failure) -> {
ItemMonitor.stopProgress(id);
SafeHtml message = failure.contains("WFLYDR0015") ? resources.messages().deploymentSubAlreadyExploded() : resources.messages().lastOperationException();
MessageEvent.fire(eventBus, Message.error(message, failure));
});
}
use of org.jboss.hal.core.deployment.Deployment in project console by hal.
the class StandaloneDeploymentPresenter method reload.
private void reload(int tab) {
ResourceAddress address = new ResourceAddress().add(DEPLOYMENT, deployment);
Operation operation = new Operation.Builder(address, READ_RESOURCE_OPERATION).param(INCLUDE_RUNTIME, true).build();
dispatcher.execute(operation, result -> {
getView().reset();
getView().update(new Deployment(Server.STANDALONE, result), tab);
});
}
use of org.jboss.hal.core.deployment.Deployment in project console by hal.
the class StandaloneDeploymentColumn method uploadDeployment.
private void uploadDeployment() {
Metadata metadata = metadataRegistry.lookup(DEPLOYMENT_TEMPLATE);
Wizard<DeploymentContext, DeploymentState> wizard = new Wizard.Builder<DeploymentContext, DeploymentState>(resources.messages().addResourceTitle(Names.DEPLOYMENT), new DeploymentContext()).addStep(UPLOAD, new UploadDeploymentStep(resources)).addStep(NAMES, new NamesStep(environment, metadata, resources)).onBack((context, currentState) -> currentState == NAMES ? UPLOAD : null).onNext((context, currentState) -> currentState == UPLOAD ? NAMES : null).stayOpenAfterFinish().onFinish((wzd, context) -> {
String name = context.name;
String runtimeName = context.runtimeName;
wzd.showProgress(resources.constants().deploymentInProgress(), resources.messages().deploymentInProgress(name));
series(new FlowContext(progress.get()), new CheckDeployment(dispatcher, name), new UploadOrReplace(environment, dispatcher, name, runtimeName, context.file, context.enabled)).subscribe(new Outcome<FlowContext>() {
@Override
public void onError(FlowContext context, Throwable error) {
wzd.showError(resources.constants().deploymentError(), resources.messages().deploymentError(name), error.getMessage());
}
@Override
public void onSuccess(FlowContext context) {
refresh(Ids.deployment(name));
wzd.showSuccess(resources.constants().uploadSuccessful(), resources.messages().uploadSuccessful(name), resources.messages().view(Names.DEPLOYMENT), cxt -> {
/* nothing to do, deployment is already selected */
});
}
});
}).build();
wizard.show();
}
Aggregations