| 9 | |
| 10 | |
| 11 | public abstract class BaseCommand extends BaseComponent implements Command { |
| 12 | public static final String PARAM_NAME = "name"; |
| 13 | public static final String PARAM_DESCRIPTION = "description"; |
| 14 | public static final String PARAM_USAGE = "usage"; |
| 15 | |
| 16 | public void init(Session session, Map<String, String> parameters) throws OpenAS2Exception { |
| 17 | super.init(session, parameters); |
| 18 | if (getName() == null) { |
| 19 | setName(getDefaultName()); |
| 20 | } |
| 21 | if (getDescription() == null) { |
| 22 | setDescription(getDefaultDescription()); |
| 23 | } |
| 24 | if (getUsage() == null) { |
| 25 | setUsage(getDefaultUsage()); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | public String getDescription() { |
| 30 | try { |
| 31 | return getParameter(PARAM_DESCRIPTION, false); |
| 32 | } catch (InvalidParameterException e) { |
| 33 | return null; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | public void setDescription(String desc) { |
| 38 | setParameter(PARAM_DESCRIPTION, desc); |
| 39 | } |
| 40 | |
| 41 | public String getName() { |
| 42 | try { |
| 43 | return getParameter(PARAM_NAME, false); |
| 44 | } catch (InvalidParameterException e) { |
| 45 | return null; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | public void setName(String name) { |
| 50 | setParameter(PARAM_NAME, name); |
| 51 | } |
| 52 | |
| 53 | public String getUsage() { |
| 54 | try { |
| 55 | return getParameter(PARAM_USAGE, false); |
| 56 | } catch (InvalidParameterException e) { |
| 57 | return null; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | public void setUsage(String usage) { |
| 62 | setParameter(PARAM_USAGE, usage); |
| 63 | } |
| 64 | |
| 65 | public abstract String getDefaultName(); |
| 66 | |
| 67 | public abstract String getDefaultDescription(); |
| 68 |
nothing calls this directly
no outgoing calls
no test coverage detected