View Javadoc

1   package org.bitrepository.integrityservice.tools;
2   
3   /**
4    * Class to handle launching of CollectionsAdmin 
5    */
6   public class CollectionsAdminLauncher {
7   
8       
9       public static void main(String[] args) {
10          if(!(args.length == 3)) {
11              printUsage();
12              System.exit(1);
13          }
14          String method = args[0];
15          String collectionID = args[1];
16          String settingsPath = args[2];
17          
18          CollectionsAdmin ca = new CollectionsAdmin(collectionID, settingsPath);
19          try {
20              ca.invoke(method);
21          } catch (UnknownCollectionException e) {
22              System.out.println(e.getMessage());
23          } catch (InvalidMethodException e) {
24              System.out.println(e.getMessage());
25          }
26      }
27      
28      private static void printUsage() {
29          System.out.println("Usage: collectionAdmin.sh <method> <collectionID> <path-to-settings>");
30          System.out.println("Supported methods: add | remove");
31      }
32  }