Class ModelTestKernelServicesImpl<T extends ModelTestKernelServices<T>>

java.lang.Object
org.jboss.as.model.test.ModelTestKernelServicesImpl<T>
All Implemented Interfaces:
ModelTestKernelServices<T>

public abstract class ModelTestKernelServicesImpl<T extends ModelTestKernelServices<T>> extends Object implements ModelTestKernelServices<T>
Author:
Kabir Khan
  • Constructor Details

    • ModelTestKernelServicesImpl

      protected ModelTestKernelServicesImpl(org.jboss.msc.service.ServiceContainer container, ModelTestModelControllerService controllerService, StringConfigurationPersister persister, org.jboss.as.controller.registry.ManagementResourceRegistration rootRegistration, org.jboss.as.controller.operations.validation.OperationValidator operationValidator, org.jboss.as.controller.ModelVersion legacyModelVersion, boolean successfulBoot, Throwable bootError)
  • Method Details

    • isSuccessfulBoot

      public boolean isSuccessfulBoot()
      Get whether the controller booted successfully
      Specified by:
      isSuccessfulBoot in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Returns:
      true if the controller booted successfully
    • getBootError

      public Throwable getBootError()
      Get any errors thrown on boot
      Specified by:
      getBootError in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Returns:
      the boot error
    • getLegacyServices

      public T getLegacyServices(org.jboss.as.controller.ModelVersion modelVersion)
      Gets the legacy controller services for the controller containing the passed in model version
      Specified by:
      getLegacyServices in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Parameters:
      modelVersion - the model version of the legacy model controller
      Throws:
      IllegalStateException - if this is not the test's main model controller
      IllegalStateException - if there is no legacy controller containing the version
    • checkIsMainController

      protected void checkIsMainController()
    • readWholeModel

      public org.jboss.dmr.ModelNode readWholeModel()
      Reads the whole model from the model controller without aliases or runtime attributes/resources
      Specified by:
      readWholeModel in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Returns:
      the whole model
    • readWholeModel

      public org.jboss.dmr.ModelNode readWholeModel(boolean includeAliases)
      Reads the whole model from the model controller without runtime attributes/resources
      Specified by:
      readWholeModel in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Parameters:
      includeAliases - whether to include aliases
      Returns:
      the whole model
    • readWholeModel

      public org.jboss.dmr.ModelNode readWholeModel(boolean includeAliases, boolean includeRuntime)
      Reads the whole model from the model controller
      Specified by:
      readWholeModel in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Parameters:
      includeAliases - whether to include aliases
      includeRuntime - whether to include runtime attributes/resources
      Returns:
      the whole model
    • getContainer

      public org.jboss.msc.service.ServiceContainer getContainer()
      Gets the service container
      Specified by:
      getContainer in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Returns:
      the service container
    • executeOperation

      public org.jboss.dmr.ModelNode executeOperation(org.jboss.dmr.ModelNode operation, InputStream... inputStreams)
      Execute an operation in the model controller
      Specified by:
      executeOperation in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Parameters:
      operation - the operation to execute
      inputStreams - Input Streams for the operation
      Returns:
      the whole result of the operation
    • executeOperation

      public org.jboss.dmr.ModelNode executeOperation(org.jboss.dmr.ModelNode operation, org.jboss.as.controller.ModelController.OperationTransactionControl txControl)
      Specified by:
      executeOperation in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
    • executeForResult

      public org.jboss.dmr.ModelNode executeForResult(org.jboss.dmr.ModelNode operation, InputStream... inputStreams) throws org.jboss.as.controller.OperationFailedException
      Specified by:
      executeForResult in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Throws:
      org.jboss.as.controller.OperationFailedException
    • executeForFailure

      public void executeForFailure(org.jboss.dmr.ModelNode operation, InputStream... inputStreams)
      Execute an operation in the model controller, expecting failure.
      Specified by:
      executeForFailure in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Parameters:
      operation - the operation to execute
    • getPersistedSubsystemXml

      public String getPersistedSubsystemXml()
      Reads the persisted subsystem xml
      Specified by:
      getPersistedSubsystemXml in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Returns:
      the xml
    • validateOperations

      public void validateOperations(List<org.jboss.dmr.ModelNode> operations)
      Validates the operations against the description providers in the model controller
      Specified by:
      validateOperations in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Parameters:
      operations - the operations to validate
    • validateOperation

      public void validateOperation(org.jboss.dmr.ModelNode operation)
      Validates the operation against the description providers in the model controller
      Specified by:
      validateOperation in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
      Parameters:
      operation - the operation to validate
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
    • getRootRegistration

      public org.jboss.as.controller.registry.ImmutableManagementResourceRegistration getRootRegistration()
      Specified by:
      getRootRegistration in interface ModelTestKernelServices<T extends ModelTestKernelServices<T>>
    • addLegacyKernelService

      protected void addLegacyKernelService(org.jboss.as.controller.ModelVersion modelVersion, T legacyServices)
    • internalExecute

      protected org.jboss.dmr.ModelNode internalExecute(org.jboss.dmr.ModelNode operation, org.jboss.as.controller.OperationStepHandler handler)
    • createTransformationContext

      protected org.jboss.as.controller.transform.TransformationContext createTransformationContext(org.jboss.as.controller.transform.TransformationTarget target, org.jboss.as.controller.transform.TransformerOperationAttachment attachment)
    • getTransformersRegistry

      protected org.jboss.as.controller.transform.TransformerRegistry getTransformersRegistry()