getLogger().info("Description: " + getDescription());
getLogger().info("Usage: " + getCommand() + " <name of group> <name of issuing CA> <match with> <match type> <match value>");
return;
}
String groupName = args[1];
AdminGroup adminGroup = ejb.getAdminGroupSession().getAdminGroup(getAdmin(), groupName);
if (adminGroup == null) {
getLogger().error("No such group \"" + groupName + "\" .");
return;
}
String caName = args[2];
CAInfo caInfo = ejb.getCAAdminSession().getCAInfo(getAdmin(), caName);
if (caInfo == null) {
getLogger().error("No such CA \"" + caName + "\" .");
return;
}
int matchWith = Arrays.asList(AdminEntity.MATCHWITHTEXTS).indexOf(args[3]);
if (matchWith == -1) {
getLogger().error("No such thing to match with as \"" + args[3] + "\" .");
return;
}
int matchType = Arrays.asList(AdminEntity.MATCHTYPETEXTS).indexOf(args[4]) + 1000;
if (matchType == (-1 + 1000)) {
getLogger().error("No such type to match with as \"" + args[4] + "\" .");
return;
}
String matchValue = args[5];
int caid = ejb.getCAAdminSession().getCAInfo(getAdmin(), caName).getCAId();
AdminEntity adminEntity = new AdminEntity(matchWith, matchType, matchValue, caid);
Collection<AdminEntity> list = adminGroup.getAdminEntities();
for (AdminEntity currentAdminEntity : list) {
if (currentAdminEntity.getMatchValue().equals(adminEntity.getMatchValue()) && currentAdminEntity.getMatchWith() == adminEntity.getMatchWith()
&& currentAdminEntity.getMatchType() == adminEntity.getMatchType() && currentAdminEntity.getCaId() == adminEntity.getCaId()) {
Collection<AdminEntity> adminEntities = new ArrayList<AdminEntity>();
adminEntities.add(adminEntity);