Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

[JBEAP-12414] - Fixed - Patching via Management Console double-prompt… #442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ public class DMRResponse implements Result<ModelNode> {
private static final String FILTERED_ATTRIBUTES = "filtered-attributes";
private static final String ABSOLUTE_ADDRESS = "absolute-address";
private static final String RELATIVE_ADDRESS = "relative-address";
private static final String RESPONSE_HEADERS = "response-headers";
private static final String PROCESS_STATE = "process-state";
private static final String RESTART_NOT_REQUIRED = "restart-not-required";

private String method;
private String responseText;
private String contentType;
private boolean ignoreRestartHeader = false;

private ResponseProcessorDelegate processor;

Expand All @@ -51,6 +55,10 @@ public DMRResponse(String method, String responseText, String contentType) {
this.processor = new ResponseProcessorDelegate();
}

public void setIgnoreRestartHeader(boolean ignoreRestartHeader) {
this.ignoreRestartHeader = ignoreRestartHeader;
}

@Override
public ModelNode get() {

Expand Down Expand Up @@ -113,6 +121,11 @@ else if(ModelType.OBJECT == response.get(RESULT).getType())
response = err;
}

//Do not show a restart modal window when an ignoreRestart is set to true
if (ignoreRestartHeader) {
response.get(RESPONSE_HEADERS).get(PROCESS_STATE).set(RESTART_NOT_REQUIRED);
}

processor.process(response);

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public interface MyView extends View, HasPresenter<PatchManagementPresenter>, Up
private abstract class GetRunningServersCallback implements AsyncCallback<DMRResponse> {
@Override
public void onSuccess(DMRResponse result) {
result.setIgnoreRestartHeader(true);
ModelNode response = result.get();
List<String> runningServers = new LinkedList<String>();
if (!response.isFailure()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void onFailure(final Throwable caught) {

@Override
public void onSuccess(final DMRResponse response) {
response.setIgnoreRestartHeader(true);
ModelNode result = response.get();
if (!result.hasDefined(OUTCOME) || result.isFailure()) {
callback.onFailure(new RuntimeException(result.getFailureDescription()));
Expand Down Expand Up @@ -173,6 +174,7 @@ public void onFailure(final Throwable caught) {

@Override
public void onSuccess(final DMRResponse response) {
response.setIgnoreRestartHeader(true);
ModelNode result = response.get();
if (!result.hasDefined(OUTCOME) || result.isFailure()) {
callback.onFailure(new RuntimeException(result.getFailureDescription()));
Expand Down Expand Up @@ -248,6 +250,7 @@ public void onFailure(Throwable caught) {
}

public void onSuccess(DMRResponse result) {
result.setIgnoreRestartHeader(true);
final ModelNode readResult = result.get().get(RESULT);
final Patches patches = new Patches(host);
//extract latest patch
Expand Down Expand Up @@ -296,6 +299,7 @@ public void onFailure(Throwable caught) {
}

public void onSuccess(DMRResponse result) {
result.setIgnoreRestartHeader(true);
final ModelNode compResult = result.get().get(RESULT);
for (int index = 0; index < patchStreamIDs.length; index++) {
String streamId = patchStreamIDs[index];
Expand Down