path = getPath(args[2]);
dn = args[3];
}
Pap pap = new Pap(alias, isLocal, dn, host, port, path, protocol, isPublic);
String msg = "Adding pap: ";
if (verboseMode) {
System.out.println(msg + pap.toFormattedString(0, msg.length()));
}
if (papMgmtClient.exists(pap.getAlias())) {
System.out.println("pap already exists.");
return ExitStatus.FAILURE.ordinal();
}
papMgmtClient.addPap(pap);
if (pap.isRemote()) {
if (!commandLine.hasOption(OPT_NO_POLICIES_LONG)) {
if (verboseMode) {
System.out.print("Retrieving policies... ");
}
try {
papMgmtClient.refreshCache(pap.getAlias());
} catch (RemoteException e) {
System.out.println("Error: pap successfully added but cannot retrieve policies.");
throw e;
}