示例#1
0
 private static void parseRemove(String[] arr, ConfigUpdater o) throws ParseException {
   if (arr.length > 1) {
     switch (arr[1]) {
       case "CLIENT":
         {
           if (arr.length > 2) {
             if (arr.length > 3) {
               switch (arr[3]) {
                 case "LIST_CLIENT":
                   {
                     if (arr.length > 4) {
                       o.sendRemoval(ProxyFilter.removeClientFromClientList(arr[4], arr[2]));
                     } else {
                       throw new ParseException("Name for client list is not specified", 6);
                     }
                   }
                   break;
                 case "LIST_ADDRESS":
                   {
                     if (arr.length > 4) {
                       o.sendRemoval(ProxyFilter.removeClientFromAddressList(arr[4], arr[2]));
                     } else {
                       throw new ParseException("Name for address list is not specified", 6);
                     }
                   }
                   break;
                 default:
                   {
                     throw new ParseException("Wrong list type", 5);
                   }
               }
             } else {
               throw new ParseException("List type is not specified", 4);
             }
           } else {
             throw new ParseException("Name for client is not specified", 3);
           }
         }
         break;
       case "ADDRESS":
         {
           if (arr.length > 2) {
             if (arr.length > 3) {
               switch (arr[3]) {
                 case "LIST_ADDRESS":
                   {
                     if (arr.length > 4) {
                       o.sendRemoval(ProxyFilter.removeAddressFromAddressList(arr[4], arr[2]));
                     } else {
                       throw new ParseException("Name for address list is not specified", 6);
                     }
                   }
                   break;
                 default:
                   {
                     throw new ParseException("Wrong list type", 5);
                   }
               }
             } else {
               throw new ParseException("List type is not specified", 4);
             }
           } else {
             throw new ParseException("Address is not specified", 3);
           }
         }
         break;
       case "LIST_CLIENT":
         {
           if (arr.length > 2) {
             o.sendRemoval(ProxyFilter.removeClientList(arr[2]));
           } else {
             throw new ParseException("Name for client list is not specified", 3);
           }
         }
         break;
       case "LIST_ADDRESS":
         {
           if (arr.length > 2) {
             o.sendRemoval(ProxyFilter.removeAddressList(arr[2]));
           } else {
             throw new ParseException("Name for address list is not specified", 3);
           }
         }
         break;
       default:
         {
           throw new ParseException("Wrong remove params", 2);
         }
     }
   } else {
     throw new ParseException("Wrong remove section", 1);
   }
 }