[jboss-jira] [JBoss JIRA] (AS7-3561) change validate-address operation contract

Alexey Loubyansky (JIRA) jira-events at lists.jboss.org
Fri Feb 17 12:43:36 EST 2012


    [ https://issues.jboss.org/browse/AS7-3561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668979#comment-12668979 ] 

Alexey Loubyansky commented on AS7-3561:
----------------------------------------

Sorry for the trouble and thanks for letting us know.

The new implementation works fine. Here is an example of a DMR validate-address operation request:

        ModelNode op = new ModelNode();
        op.get("operation").set("validate-address");
        // root address
        op.get("address").setEmptyList();

        // to validate the root (which is unlikely useful but as an example)
        // op.get("value").setEmptyList();
        // or a non-root address
        ModelNode address = op.get("value").setEmptyList();
        address.add("deployment", "my-app.war");
        // if your path is deeper, just add all of them
        // address.add("child-type", "child-name");

Now you can execute the op.

>From the command line, since it's an operation, arguments are accepted in the DMR toString() format. E.g. for /subsystem=datasources/data-source=ExampleDS

[standalone at localhost:9999 /] :validate-address(value=[{"subsystem"=>"datasources"},{"data-source"=>"ExampleDS"}])
{
    "outcome" => "success",
    "result" => {"valid" => true}
}

Which isn't a friendly syntax. But for operations, I think, it'll stay this way. If needed, we can add a command with a native node address syntax.
                
> change validate-address operation contract
> ------------------------------------------
>
>                 Key: AS7-3561
>                 URL: https://issues.jboss.org/browse/AS7-3561
>             Project: Application Server 7
>          Issue Type: Task
>          Components: Domain Management
>            Reporter: Alexey Loubyansky
>            Assignee: Alexey Loubyansky
>             Fix For: 7.1.0.Final
>
>
> Current implementation is not safe in a sense that the operation fails if the address is not valid. There is no safe way, i.e. a boolean result, not a failure, to check whether an address is valid.
> The idea is to change the current validate-address so that:
> - it's only a root operation, not inherited like the current impl;
> - add an address argument (the current impl has no arguments), which will be the address to check;
> - the result type should be a boolean value;
> - in case of failure, include a message into the response describing which part of the address is wrong.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list