use of edu.uiuc.ncsa.security.delegation.storage.BaseClient in project OA4MP by ncsa.
the class BaseClientStoreCommands method format.
@Override
protected String format(Identifiable identifiable) {
BaseClient client = (BaseClient) identifiable;
String rc = null;
ClientApproval ca = (ClientApproval) getClientApprovalStore().get(client.getIdentifier());
if (ca == null) {
rc = "(?) " + client.getIdentifier() + " ";
} else {
boolean isApproved = ca != null && ca.isApproved();
rc = "(" + (isApproved ? "Y" : "N") + ") " + client.getIdentifier() + " ";
}
String name = (client.getName() == null ? "no name" : client.getName());
if (20 < name.length()) {
name = name.substring(0, 20) + "...";
}
rc = rc + "(" + name + ")";
rc = rc + " created on " + Iso8601.date2String(client.getCreationTS());
return rc;
}
use of edu.uiuc.ncsa.security.delegation.storage.BaseClient in project OA4MP by ncsa.
the class BaseClientStoreCommands method approve.
public void approve(InputLine inputLine) {
if (showHelp(inputLine)) {
showApproveHelp();
return;
}
BaseClient client = (BaseClient) findItem(inputLine);
ClientApproval ca = null;
if (getClientApprovalStore().containsKey(client.getIdentifier())) {
ca = (ClientApproval) getClientApprovalStore().get(client.getIdentifier());
} else {
ca = (ClientApproval) getClientApprovalStore().create();
ca.setIdentifier(client.getIdentifier());
}
// now we have the right approval record for this identifier
clientApprovalStoreCommands.approve(ca);
}
Aggregations