public void createGroups(AtrilSession oSes) throws NullPointerException, IllegalArgumentException {
Log.out.debug("Begin CustomerAccount.createGroups()");
long lStart, lEnd;
AuthorizationAdminManager oAam = oSes.getAuthorizationAdminManager();
AdministeredGroup oGrp = oAam.getGroup("Zesped Users");
AdministeredGroup oCom=null, oStd=null, oAdm=null, oGts=null;
String sBusinessName = getString("business_name");
try {
oCom = oAam.getGroup(sBusinessName);
oGts = oAam.getGroup(sBusinessName+" guests");
oStd = oAam.getGroup(sBusinessName+" standard users");
oAdm = oAam.getGroup(sBusinessName+" administrators");
} catch (ElementNotFoundException enf) {
// AdminGroupRights oAll = AdminRightsFactory.getGroupRightsAllGrant();
// lStart = new Date().getTime();
// AdministeredUser oAsr = oAam.getUser("admin");
// Log.out.debug("PROFILING: AuthorizationAdminManager.getUser('admin') "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
if (null==oCom) {
Log.out.debug("AuthorizationAdminManager.createGroup("+sBusinessName+")");
oCom = oAam.createGroup(sBusinessName, "", false, null, oGrp);
lStart = new Date().getTime();
// oCom.addMember(oAsr);
// Log.out.debug("PROFILING: AdministeredGroup.addMember(AdministeredUser) "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
// lStart = lEnd;
// oAam.setRights(oAsr, oCom, oAll);
// Log.out.debug("PROFILING: AuthorizationAdminManager.setRights(...) "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
}
if (null==oGts) {
Log.out.debug("AuthorizationAdminManager.createGroup("+sBusinessName+" guests)");
oGts = oAam.createGroup(sBusinessName+" guests", sBusinessName+" guests", false, null, oCom);
// oGts.addMember(oAsr);
// oAam.setRights(oAsr, oGts, oAll);
}
if (null==oStd) {
Log.out.debug("AuthorizationAdminManager.createGroup("+sBusinessName+" standard users)");
oStd = oAam.createGroup(sBusinessName+" standard users", sBusinessName+" standard users", false, null, oCom);
// oStd.addMember(oAsr);
// oAam.setRights(oAsr, oStd, oAll);
}
if (null==oAdm) {
Log.out.debug("AuthorizationAdminManager.createGroup("+sBusinessName+" administrators)");
oAdm = oAam.createGroup(sBusinessName+" administrators", sBusinessName+" administrators", false, null, oCom);
// oAdm.addMember(oAsr);
// oAam.setRights(oAsr, oAdm, oAll);
}
}
Log.out.debug("End CustomerAccount.createGroups()");