View Javadoc

1   package org.sourceforge.jemm.server;
2   
3   import org.apache.commons.cli.ParseException;
4   
5   public enum ServerAction {
6   	START,
7   	STOP;
8   	
9   	public static ServerAction parseServerAction(String action) throws ParseException {
10  		if("start".equalsIgnoreCase(action))
11  			return START;
12  		else if("stop".equalsIgnoreCase(action)) 
13  			return STOP;
14  		else {
15  			throw new ParseException("Unknown action command valid options are (start|stop)");
16  			
17  		}
18  	}
19  }