-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WFCORE-6728] New reload-enhanced operation allowing us to reload to …
…a new stability level This is not available at all stability levels, and has its own RBAC settings
- Loading branch information
Showing
19 changed files
with
219 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; | ||
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; | ||
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OUTCOME; | ||
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RELOAD; | ||
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUCCESS; | ||
import static org.jboss.as.controller.logging.ControllerLogger.MGMT_OP_LOGGER; | ||
import static org.jboss.as.controller.logging.ControllerLogger.ROOT_LOGGER; | ||
|
@@ -42,6 +41,7 @@ | |
import org.jboss.as.controller.client.OperationMessageHandler; | ||
import org.jboss.as.controller.client.OperationResponse; | ||
import org.jboss.as.controller.client.impl.ModelControllerProtocol; | ||
import org.jboss.as.controller.descriptions.ModelDescriptionConstants; | ||
import org.jboss.as.controller.logging.ControllerLogger; | ||
import org.jboss.as.controller.remote.IdentityAddressProtocolUtil.PropagatedIdentity; | ||
import org.jboss.as.protocol.StreamUtils; | ||
|
@@ -69,7 +69,7 @@ | |
* @author <a href="mailto:[email protected]">Darran Lofthouse</a> | ||
*/ | ||
public class TransactionalProtocolOperationHandler implements ManagementRequestHandlerFactory { | ||
private static final Set<String> PREPARED_RESPONSE_OPERATIONS = Set.of(RELOAD); | ||
private static final Set<String> PREPARED_RESPONSE_OPERATIONS = ModelDescriptionConstants.RELOAD_OPERATIONS; | ||
|
||
private final ModelController controller; | ||
private final ManagementChannelAssociation channelAssociation; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ | |
import java.util.Locale; | ||
import java.util.Map; | ||
import java.util.Map.Entry; | ||
import java.util.Set; | ||
|
||
import io.undertow.server.HttpHandler; | ||
import io.undertow.server.HttpServerExchange; | ||
|
@@ -66,7 +67,7 @@ | |
* @author <a href="[email protected]">Kabir Khan</a> | ||
*/ | ||
class DomainApiHandler implements HttpHandler { | ||
|
||
private static final Set<String> PREPARED_RESPONSE_OPERATIONS = ModelDescriptionConstants.RELOAD_OPERATIONS; | ||
private static final String JSON_PRETTY = "json.pretty"; | ||
|
||
/** | ||
|
@@ -309,6 +310,7 @@ private String unescape(String string) { | |
} | ||
} | ||
|
||
|
||
/** | ||
* Determine whether the prepared response should be sent, before the operation completed. This is needed in order | ||
* that operations like :reload() can be executed without causing communication failures. | ||
|
@@ -321,7 +323,7 @@ private boolean sendPreparedResponse(final ModelNode operation) { | |
final String op = operation.get(OP).asString(); | ||
final int size = address.size(); | ||
if (size == 0) { | ||
if (op.equals("reload")) { | ||
if (PREPARED_RESPONSE_OPERATIONS.contains(op)) { | ||
return true; | ||
} else if (op.equals(COMPOSITE)) { | ||
// TODO | ||
|
@@ -331,7 +333,7 @@ private boolean sendPreparedResponse(final ModelNode operation) { | |
} | ||
} else if (size == 1) { | ||
if (address.getLastElement().getKey().equals(HOST)) { | ||
return op.equals("reload"); | ||
return PREPARED_RESPONSE_OPERATIONS.contains(op); | ||
} | ||
} | ||
return false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.