use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class CrlSignerInfoCmd method execute0.
@Override
protected Object execute0() throws Exception {
StringBuilder sb = new StringBuilder();
if (name == null) {
Set<String> names = caManager.getCrlSignerNames();
int size = names.size();
if (size == 0 || size == 1) {
sb.append((size == 0) ? "no" : "1");
sb.append(" CRL signer is configured\n");
} else {
sb.append(size).append(" CRL signers are configured:\n");
}
List<String> sorted = new ArrayList<>(names);
Collections.sort(sorted);
for (String entry : sorted) {
sb.append("\t").append(entry).append("\n");
}
} else {
X509CrlSignerEntry entry = caManager.getCrlSigner(name);
if (entry == null) {
throw new CmdFailure("\tno CRL signer named '" + name + "' is configured");
} else {
sb.append(entry.toString(verbose.booleanValue()));
}
}
println(sb.toString());
return null;
}
use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class CaProfileAddCmd method execute0.
@Override
protected Object execute0() throws Exception {
for (String profileName : profileNames) {
String msg = StringUtil.concat("certificate profile ", profileName, " to CA ", caName);
try {
caManager.addCertprofileToCa(profileName, caName);
println("associated " + msg);
} catch (CaMgmtException ex) {
throw new CmdFailure("could not associate " + msg + ", error: " + ex.getMessage(), ex);
}
}
return null;
}
use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class CaRemoveCmd method execute0.
@Override
protected Object execute0() throws Exception {
String msg = "CA " + name;
try {
caManager.removeCa(name);
println("removed " + msg);
return null;
} catch (CaMgmtException ex) {
throw new CmdFailure("could not remove " + msg + ", error: " + ex.getMessage(), ex);
}
}
use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class EnvAddCmd method execute0.
@Override
protected Object execute0() throws Exception {
String msg = "environment parameter " + name;
try {
caManager.addEnvParam(name, value);
println("added " + msg);
return null;
} catch (CaMgmtException ex) {
throw new CmdFailure("could not add " + msg + ", error: " + ex.getMessage(), ex);
}
}
use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class EnvRemoveCmd method execute0.
@Override
protected Object execute0() throws Exception {
String msg = "environment parameter " + name;
try {
caManager.removeEnvParam(name);
println("removed " + msg);
return null;
} catch (CaMgmtException ex) {
throw new CmdFailure("could not remove " + msg + ", error: " + ex.getMessage(), ex);
}
}
Aggregations