KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > ui > cli > SetupCommandFactory


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13  
14 package org.ejbca.ui.cli;
15
16 /**
17  * Factory for General Setup Commands.
18  *
19  * @version $Id: SetupCommandFactory.java,v 1.3 2006/03/19 09:44:36 anatom Exp $
20  */

21 public class SetupCommandFactory {
22     /**
23      * Cannot create an instance of this class, only use static methods.
24      */

25     private SetupCommandFactory() {
26     }
27
28     /**
29      * Returns an Admin Command object based on contents in args[0].
30      *
31      * @param args array of arguments typically passed from main().
32      *
33      * @return Command object or null if args[0] does not specify a valid command.
34      */

35     public static IAdminCommand getCommand(String JavaDoc[] args) {
36         if (args.length < 1) {
37             return null;
38         }
39
40         if (args[0].equals("setdefaultbaseurl")) {
41             return new SetupSetBaseURLCommand(args);
42         }
43         if (args[0].equals("initializehardtokenissuing")) {
44             return new InitializeHardTokenIssuing(args);
45         }
46         return null;
47     } // getCommand
48
} // CaAdminCommandFactory
49
Popular Tags