glassfish
  1. glassfish
  2. GLASSFISH-20215

No endpoint for creating SSL for protocol

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b83
    • Fix Version/s: 4.0_b85
    • Component/s: rest-interface
    • Labels:
      None

      Description

      In fixing GLASSFISH-18111, Ryan has added an option for type to take in protocol , so that SSL can be created for the protocol.
      For example, one can create a protocol and then create the <ssl> for it.

      %asadmin create-protocol TEST1
      %asadmin create-ssl --certname s1as --type protocol TEST1

      However, there is no endpoint for creating ssl for a protocol.
      There is one for creating ssl for network-listener
      http://localhost:4848/management/domain/configs/config/server-config/network-config/network-listeners/network-listener/http-listener-1/create-ssl

      but not something like this:
      http://localhost:4848/management/domain/configs/config/server-config/network-config/protocols/protocol/myProtocol/create-ssl

        Activity

        Hide
        Jason Lee added a comment -

        I've added the @RestEndpoint mappings. I'll run tests and start change control in the morning.

        Show
        Jason Lee added a comment - I've added the @RestEndpoint mappings. I'll run tests and start change control in the morning.
        Hide
        Jason Lee added a comment -
        • What is the impact on the customer of the bug?
          Without this change, parts of the console will not work
        • What is the cost/risk of fixing the bug?
          Minimal. The change just adds metadata annotations
        • How risky is the fix? How much work is the fix? Is the fix complicated?
          Not very.
        • Is there an impact on documentation or message strings?
          No.
        • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?
          Admin Dev Tests
        • Which is the targeted build of 4.0 for this fix?
          b86
        Index: admin/util/src/main/java/com/sun/enterprise/admin/commands/CreateSsl.java
        ===================================================================
        --- admin/util/src/main/java/com/sun/enterprise/admin/commands/CreateSsl.java	(revision 61229)
        +++ admin/util/src/main/java/com/sun/enterprise/admin/commands/CreateSsl.java	(working copy)
        @@ -104,6 +104,14 @@
                 params={
                     @RestParam(name="id", value="$parent"),
                     @RestParam(name="type", value="http-listener")
        +        }),
        +    @RestEndpoint(configBean=Protocol.class,
        +        opType=RestEndpoint.OpType.POST, 
        +        path="create-ssl", 
        +        description="create-ssl",
        +        params={
        +            @RestParam(name="id", value="$parent"),
        +            @RestParam(name="type", value="protocol")
                 })
         })
         public class CreateSsl implements AdminCommand {
        @@ -146,6 +154,7 @@
              *
              * @param context information
              */
        +    @Override
             public void execute(AdminCommandContext context) {
                 final ActionReport report = context.getActionReport();
                 Target targetUtil = habitat.getService(Target.class);
        @@ -198,6 +207,7 @@
                 Protocol protocol = networkConfig.findProtocol(name);
                 if (protocol == null && create) {
                     protocol = (Protocol) ConfigSupport.apply(new SingleConfigCode<Protocols>() {
        +                @Override
                         public Object run(Protocols param) throws TransactionFailure {
                             Protocol newProtocol = param.createChild(Protocol.class);
                             newProtocol.setName(name);
        @@ -241,6 +251,7 @@
                 }
                 try {
                     ConfigSupport.apply(new SingleConfigCode<JmxConnector>() {
        +                @Override
                         public Object run(JmxConnector param)
                             throws PropertyVetoException, TransactionFailure {
                             Ssl newSsl = param.createChild(Ssl.class);
        
        Show
        Jason Lee added a comment - What is the impact on the customer of the bug? Without this change, parts of the console will not work What is the cost/risk of fixing the bug? Minimal. The change just adds metadata annotations How risky is the fix? How much work is the fix? Is the fix complicated? Not very. Is there an impact on documentation or message strings? No. Which tests should QA (re)run to verify the fix did not destabilize GlassFish? Admin Dev Tests Which is the targeted build of 4.0 for this fix? b86 Index: admin/util/src/main/java/com/sun/enterprise/admin/commands/CreateSsl.java =================================================================== --- admin/util/src/main/java/com/sun/enterprise/admin/commands/CreateSsl.java (revision 61229) +++ admin/util/src/main/java/com/sun/enterprise/admin/commands/CreateSsl.java (working copy) @@ -104,6 +104,14 @@ params={ @RestParam(name= "id" , value= "$parent" ), @RestParam(name= "type" , value= "http-listener" ) + }), + @RestEndpoint(configBean=Protocol.class, + opType=RestEndpoint.OpType.POST, + path= "create-ssl" , + description= "create-ssl" , + params={ + @RestParam(name= "id" , value= "$parent" ), + @RestParam(name= "type" , value= "protocol" ) }) }) public class CreateSsl implements AdminCommand { @@ -146,6 +154,7 @@ * * @param context information */ + @Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); Target targetUtil = habitat.getService(Target.class); @@ -198,6 +207,7 @@ Protocol protocol = networkConfig.findProtocol(name); if (protocol == null && create) { protocol = (Protocol) ConfigSupport.apply( new SingleConfigCode<Protocols>() { + @Override public Object run(Protocols param) throws TransactionFailure { Protocol newProtocol = param.createChild(Protocol.class); newProtocol.setName(name); @@ -241,6 +251,7 @@ } try { ConfigSupport.apply( new SingleConfigCode<JmxConnector>() { + @Override public Object run(JmxConnector param) throws PropertyVetoException, TransactionFailure { Ssl newSsl = param.createChild(Ssl.class);
        Hide
        Tom Mueller added a comment -

        Approved for 4.0.

        Show
        Tom Mueller added a comment - Approved for 4.0.
        Hide
        Jason Lee added a comment -

        Change committed (r61249).

        Show
        Jason Lee added a comment - Change committed (r61249).

          People

          • Assignee:
            Jason Lee
            Reporter:
            Anissa Lam
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: