use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class CaAliasAddCmd method execute0.
@Override
protected Object execute0() throws Exception {
String msg = "CA alias " + caAlias + " associated with CA " + caName;
try {
caManager.addCaAlias(caAlias, caName);
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 CaAliasRemoveCmd method execute0.
@Override
protected Object execute0() throws Exception {
String msg = "CA alias " + caAlias;
try {
caManager.removeCaAlias(caAlias);
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 CaInfoCmd method execute0.
@Override
protected Object execute0() throws Exception {
StringBuilder sb = new StringBuilder();
if (name == null) {
sb.append("successful CAs:\n");
String prefix = " ";
printCaNames(sb, caManager.getSuccessfulCaNames(), prefix);
sb.append("failed CAs:\n");
printCaNames(sb, caManager.getFailedCaNames(), prefix);
sb.append("inactive CAs:\n");
printCaNames(sb, caManager.getInactiveCaNames(), prefix);
} else {
CaEntry entry = caManager.getCa(name);
if (entry == null) {
throw new CmdFailure("could not find CA '" + name + "'");
} else {
if (CaStatus.ACTIVE == entry.getStatus()) {
boolean started = caManager.getSuccessfulCaNames().contains(entry.getIdent().getName());
sb.append("started: ").append(started).append("\n");
}
Set<String> aliases = caManager.getAliasesForCa(name);
sb.append("aliases: ").append(toString(aliases)).append("\n");
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 CaPublisherAddCmd method execute0.
@Override
protected Object execute0() throws Exception {
for (String publisherName : publisherNames) {
String msg = "publisher " + publisherName + " to CA " + caName;
try {
caManager.addPublisherToCa(publisherName, caName);
println("added " + msg);
} catch (CaMgmtException ex) {
throw new CmdFailure("could not add " + msg + ", error: " + ex.getMessage(), ex);
}
}
return null;
}
use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class CaPublisherRemoveCmd method execute0.
@Override
protected Object execute0() throws Exception {
for (String publisherName : publisherNames) {
String msg = "publisher " + publisherName + " from CA " + caName;
try {
caManager.removePublisherFromCa(publisherName, caName);
println("removed " + msg);
} catch (CaMgmtException ex) {
throw new CmdFailure("could not remove " + msg + ", error: " + ex.getMessage(), ex);
}
}
return null;
}
Aggregations