You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by st...@apache.org on 2004/06/15 14:22:30 UTC

cvs commit: ws-axis/java/src/org/apache/axis/utils Admin.java

stevel      2004/06/15 05:22:30

  Modified:    java/src/org/apache/axis/utils Admin.java
  Log:
  factor out caller validation so that multiple soapactons on this endpoint could share the same code
  
  Revision  Changes    Path
  1.136     +21 -12    ws-axis/java/src/org/apache/axis/utils/Admin.java
  
  Index: Admin.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/Admin.java,v
  retrieving revision 1.135
  retrieving revision 1.136
  diff -u -r1.135 -r1.136
  --- Admin.java	25 Feb 2004 14:02:48 -0000	1.135
  +++ Admin.java	15 Jun 2004 12:22:30 -0000	1.136
  @@ -148,6 +148,27 @@
                                    null, null);
            */
   
  +        verifyHostAllowed(msgContext);
  +
  +        String rootNS = root.getNamespaceURI();
  +        AxisEngine engine = msgContext.getAxisEngine();
  +
  +        // If this is WSDD, process it correctly.
  +        if (rootNS != null && rootNS.equals(WSDDConstants.URI_WSDD)) {
  +            return processWSDD(msgContext, engine, root);
  +        }
  +
  +        // Else fault
  +        // TODO: Better handling here
  +        throw new Exception(Messages.getMessage("adminServiceNoWSDD"));
  +    }
  +
  +    /**
  +     * host validation logic goes here
  +     * @param msgContext
  +     * @throws AxisFault
  +     */
  +    private void verifyHostAllowed(MessageContext msgContext) throws AxisFault {
           /** For now, though - make sure we can only admin from our own
            * IP, unless the remoteAdmin option is set.
            */
  @@ -182,18 +203,6 @@
                   }
               }
           }
  -
  -        String rootNS = root.getNamespaceURI();
  -        AxisEngine engine = msgContext.getAxisEngine();
  -
  -        // If this is WSDD, process it correctly.
  -        if (rootNS != null && rootNS.equals(WSDDConstants.URI_WSDD)) {
  -            return processWSDD(msgContext, engine, root);
  -        }
  -
  -        // Else fault
  -        // TODO: Better handling here
  -        throw new Exception(Messages.getMessage("adminServiceNoWSDD"));
       }
   
       /** Get an XML document representing this engine's configuration.