Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-2865

AttributeTransformationRule "ignored" if op is discarded

    Details

      Description

      Imagine a scenario like the following:

      ```
      parent.addChildResource(RemotingEndpointResource.ENDPOINT_PATH)
      .getAttributeBuilder()
      .setDiscard(DiscardAttributeChecker.UNDEFINED, RemotingEndpointResource.ATTRIBUTES)
      .addRejectCheck(RejectAttributeChecker.DEFINED, RemotingEndpointResource.ATTRIBUTES.toArray(new AttributeDefinition[RemotingEndpointResource.ATTRIBUTES.size()]))
      .end() .addOperationTransformationOverride(ModelDescriptionConstants.ADD)
      .inheritResourceAttributeDefinitions() .setCustomOperationTransformer(OperationTransformer.DISCARD)
      .end()
      ```

      The idea is to discard "add" if any parameter is defined, reject otherwise. The legacy slave can ignore the whole resource if it isn't really configured by the user, but any detail config by the user must result in failure.

      Problem is AttributeTransformationRule will do a "reject" when it gets a prepared response from the slave, but using setCustomOperationTransformer(OperationTransformer.DISCARD) means the op will be discarded, so there will be no prepared response and thus no rejection.

      Solution is to have AttributeTransformationRule register a OperationResultTransformer that deals with this situation.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                brian.stansberry Brian Stansberry
                Reporter:
                brian.stansberry Brian Stansberry
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: