manveen     02/04/25 19:13:48

  Modified:    webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector
                        AddConnectorAction.java DeleteConnectorAction.java
  Log:
  Do not display the connector on which the admin app runs in the list of connectors 
that can be deleted.
  This operation is prohibited from the admin tool.
  
  Revision  Changes    Path
  1.3       +7 -25     
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/AddConnectorAction.java
  
  Index: AddConnectorAction.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/AddConnectorAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AddConnectorAction.java   25 Apr 2002 23:27:59 -0000      1.2
  +++ AddConnectorAction.java   26 Apr 2002 02:13:48 -0000      1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/AddConnectorAction.java,v
 1.2 2002/04/25 23:27:59 manveen Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/04/25 23:27:59 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/AddConnectorAction.java,v
 1.3 2002/04/26 02:13:48 manveen Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/26 02:13:48 $
    *
    * ====================================================================
    *
  @@ -82,7 +82,7 @@
    * The <code>Action</code> that sets up <em>Add Connector</em> transactions.
    *
    * @author Manveen Kaur
  - * @version $Revision: 1.2 $ $Date: 2002/04/25 23:27:59 $
  + * @version $Revision: 1.3 $ $Date: 2002/04/26 02:13:48 $
    */
   
   public class AddConnectorAction extends Action {
  @@ -135,7 +135,6 @@
           connectorFm.setConnectorName("");
           String type = request.getParameter("type");
           if (type == null)
  -            //type = "CoyoteConnector";    // default type is CoyoteConnector
               type = "HTTP";    // default type is HTTP
           connectorFm.setConnectorType(type);
           connectorFm.setDebugLvl("0");
  @@ -154,21 +153,13 @@
           connectorFm.setKeyStoreFileName("");
           connectorFm.setKeyStorePassword("");
                          
  -        // should be set only for Coyote, not supported by all connector types      
  -        if ("CoyoteConnector".equalsIgnoreCase(type)) {
  -            connectorFm.setProxyName("");
  -            connectorFm.setProxyPortText("0");        
  -        }
  +        // supported by both JK2 and Coyote
  +        connectorFm.setProxyName("");
  +        connectorFm.setProxyPortText("0");        
           
           connectorFm.setDebugLvlVals(Lists.getDebugLevels());
           connectorFm.setBooleanVals(Lists.getBooleanValues());                
           
  -        /*
  -        String connectorTypes[] = new String[2];
  -        connectorTypes[0] = "CoyoteConnector";
  -        connectorTypes[1] = "Ajp13Connector";
  -        */
  -        
           String schemeTypes[]= new String[2];
           schemeTypes[0] = "HTTP";
           schemeTypes[1] = "HTTPS";
  @@ -184,15 +175,6 @@
                   "/admin/AddConnector.do?serviceName=" + 
URLEncoder.encode(serviceName)
                   + "&type=" + schemeTypes[i]));        
               }
  -        /*
  -         for (int i=0; i< connectorTypes.length; i++) {
  -            if (!type.equalsIgnoreCase(connectorTypes[i])) {
  -                types.add(new LabelValueBean(schemeTypes[i],
  -                "/admin/AddConnector.do?serviceName=" + 
URLEncoder.encode(serviceName)
  -                + "&type=" + connectorTypes[i]));        
  -            }
  -         */
  -        
           }
           connectorFm.setConnectorTypeVals(types);
           
  
  
  
  1.2       +10 -5     
jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/DeleteConnectorAction.java
  
  Index: DeleteConnectorAction.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/DeleteConnectorAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeleteConnectorAction.java        4 Apr 2002 00:38:19 -0000       1.1
  +++ DeleteConnectorAction.java        26 Apr 2002 02:13:48 -0000      1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/DeleteConnectorAction.java,v
 1.1 2002/04/04 00:38:19 manveen Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/04/04 00:38:19 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/connector/DeleteConnectorAction.java,v
 1.2 2002/04/26 02:13:48 manveen Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/26 02:13:48 $
    *
    * ====================================================================
    *
  @@ -95,7 +95,7 @@
    * The <code>Action</code> that sets up <em>Delete Connectors</em> transactions.
    *
    * @author Manveen Kaur
  - * @version $Revision: 1.1 $ $Date: 2002/04/04 00:38:19 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/26 02:13:48 $
    */
   
   public class DeleteConnectorAction extends Action {
  @@ -182,7 +182,12 @@
               Iterator items =
                   mBServer.queryNames(new ObjectName(pattern), null).iterator();
               while (items.hasNext()) {
  -                list.add(items.next().toString());
  +                // do not display the connector that the admin tool runs on 
  +                // as this should not be allowed to be deleted from the admin tool
  +                String adminPort = Integer.toString(request.getServerPort());
  +                ObjectName nextObj = (ObjectName) items.next();
  +                if (!(nextObj.getKeyProperty("port")).equalsIgnoreCase(adminPort))
  +                    list.add(nextObj.toString());
               }
           } catch (Exception e) {
               getServlet().log
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to