protected static class FileAuditLogHandlerResourceDefinition.HandlerWriteAttributeHandler extends AbstractWriteAttributeHandler<Void>
AbstractWriteAttributeHandler.HandbackHolder<T>| Constructor and Description |
|---|
HandlerWriteAttributeHandler(ManagedAuditLogger auditLogger,
PathManagerService pathManager,
AttributeDefinition... attributeDefinitions) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
applyUpdateToRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
String attributeName,
org.jboss.dmr.ModelNode resolvedValue,
org.jboss.dmr.ModelNode currentValue,
AbstractWriteAttributeHandler.HandbackHolder<Void> handbackHolder)
Hook to allow subclasses to make runtime changes to effect the attribute value change.
|
protected AbstractFileAuditLogHandler |
createHandler(PathManagerService pathManager,
OperationContext context,
org.jboss.dmr.ModelNode operation) |
protected void |
finishModelStage(OperationContext context,
org.jboss.dmr.ModelNode operation,
String attributeName,
org.jboss.dmr.ModelNode newValue,
org.jboss.dmr.ModelNode oldValue,
Resource model)
Hook to allow subclasses to do any final
OperationContext.Stage.MODEL processing following the
application of the new attribute value. |
protected boolean |
requiresRuntime(OperationContext context)
Gets whether a
OperationContext.Stage.RUNTIME handler should be added. |
protected void |
revertUpdateToRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
String attributeName,
org.jboss.dmr.ModelNode valueToRestore,
org.jboss.dmr.ModelNode valueToRevert,
Void handback)
Hook to allow subclasses to revert runtime changes made in
AbstractWriteAttributeHandler.applyUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, HandbackHolder). |
execute, getAttributeDefinition, recordCapabilitiesAndRequirements, validateUpdatedModelpublic HandlerWriteAttributeHandler(ManagedAuditLogger auditLogger, PathManagerService pathManager, AttributeDefinition... attributeDefinitions)
protected boolean requiresRuntime(OperationContext context)
AbstractWriteAttributeHandlerOperationContext.Stage.RUNTIME handler should be added. This default implementation
returns true if the process is a normal server and the process
is not booting. The rationale for the latter check is if the process is
booting, the resource being modified will have been added as a previous step in the same context, and
the Stage.RUNTIME handling for that add will see a model the reflects the changes made by this handler and
will apply them to the runtime.requiresRuntime in class AbstractWriteAttributeHandler<Void>context - operation contexttrue if a runtime stage handler should be added; false otherwise.protected AbstractFileAuditLogHandler createHandler(PathManagerService pathManager, OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
OperationFailedExceptionprotected boolean applyUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode resolvedValue, org.jboss.dmr.ModelNode currentValue, AbstractWriteAttributeHandler.HandbackHolder<Void> handbackHolder) throws OperationFailedException
AbstractWriteAttributeHandlerapplyUpdateToRuntime in class AbstractWriteAttributeHandler<Void>context - the context of the operationoperation - the operationattributeName - the name of the attribute being modifiedresolvedValue - the new value for the attribute, after ModelNode.resolve() has been called on itcurrentValue - the existing value for the attributehandbackHolder - holder for an arbitrary object to pass to
AbstractWriteAttributeHandler.revertUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, Object) if
the operation needs to be rolled backtrue if the server requires reload to effect the attribute
value change; false if notOperationFailedExceptionprotected void revertUpdateToRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode valueToRestore, org.jboss.dmr.ModelNode valueToRevert, Void handback) throws OperationFailedException
AbstractWriteAttributeHandlerAbstractWriteAttributeHandler.applyUpdateToRuntime(OperationContext, ModelNode, String, ModelNode, ModelNode, HandbackHolder).revertUpdateToRuntime in class AbstractWriteAttributeHandler<Void>context - the context of the operationoperation - the operationattributeName - the name of the attribute being modifiedvalueToRestore - the previous value for the attribute, before this operation was executedvalueToRevert - the new value for the attribute that should be revertedhandback - an object, if any, passed in to the handbackHolder by the applyUpdateToRuntime
implementationOperationFailedExceptionprotected void finishModelStage(OperationContext context, org.jboss.dmr.ModelNode operation, String attributeName, org.jboss.dmr.ModelNode newValue, org.jboss.dmr.ModelNode oldValue, Resource model) throws OperationFailedException
AbstractWriteAttributeHandlerOperationContext.Stage.MODEL processing following the
application of the new attribute value. This default implementation calls
AbstractWriteAttributeHandler.validateUpdatedModel(OperationContext, Resource).
NOTE: Implementations must not call
OperationContext.completeStep(OperationContext.ResultHandler) or any of its variants. The method that
calls this one handles step completion.
finishModelStage in class AbstractWriteAttributeHandler<Void>context - the operation contextoperation - the operationattributeName - the name of the attribute being modifiednewValue - the new value for the attributeoldValue - the previous value for the attributemodel - the updated model resourceOperationFailedExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.