1 23 24 package com.sun.enterprise.cli.commands; 25 26 import com.sun.enterprise.cli.framework.*; 27 28 public class SSLCommand extends GenericCommand 29 { 30 private static final String TYPE_OPTION = "type"; 31 private static final String TYPE_OPTION_VALUES = "http-listener|iiop-listener|iiop-service"; 32 private static final String TYPE_VALUE_NOT_REQUIRE_OPERAND = "iiop-service"; 33 34 public boolean validateOptions() throws CommandValidationException 35 { 36 super.validateOptions(); 37 final String typeOption = getOption(TYPE_OPTION); 38 if (!typeOption.matches(TYPE_OPTION_VALUES)) 39 throw new CommandValidationException(getLocalizedString( 40 "InvalidTypeOption")); 41 if (!typeOption.matches(TYPE_VALUE_NOT_REQUIRE_OPERAND) && 42 getOperands().size() < 1) 43 { 44 throw new CommandValidationException(getLocalizedString( 45 "OperandIsRequired", 46 new Object [] {typeOption})); 47 } 48 return true; 49 50 } 51 52 } 53 | Popular Tags |