From be9aa9c636204051381f4efe4b895dff968f0c4d Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 17 May 2013 11:44:46 +0200 Subject: Add Role management support to module, instead of just creating one if it's not already there. Supports 'jobList' attribute to enable job pushing --- src/main/java/com/c2kernel/lookup/LDAPRoleManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/com/c2kernel/lookup/LDAPRoleManager.java') diff --git a/src/main/java/com/c2kernel/lookup/LDAPRoleManager.java b/src/main/java/com/c2kernel/lookup/LDAPRoleManager.java index 0536d6c..b2cffc6 100644 --- a/src/main/java/com/c2kernel/lookup/LDAPRoleManager.java +++ b/src/main/java/com/c2kernel/lookup/LDAPRoleManager.java @@ -196,4 +196,16 @@ public class LDAPRoleManager { throw new ObjectNotFoundException("Entry was not a Role"); } + public void setHasJobList(RolePath role, boolean hasJobList) throws ObjectNotFoundException, ObjectCannotBeUpdated { + // get entry + LDAPEntry roleEntry; + try { + roleEntry = LDAPLookupUtils.getEntry(mLdap.getConnection(), role.getFullDN()); + } catch (ObjectNotFoundException e) { + throw new ObjectNotFoundException("Role does not exist", ""); + } + // set attribute + LDAPLookupUtils.setAttributeValue(mLdap.getConnection(), roleEntry, "jobList", hasJobList?"TRUE":"FALSE"); + } + } -- cgit v1.2.3