summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java')
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java
index 633ae60..48e0a8e 100644
--- a/src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java
@@ -4,7 +4,7 @@ import java.util.ArrayList;
import java.util.Enumeration;
import com.c2kernel.common.ObjectCannotBeUpdated;
-import com.c2kernel.common.ObjectNotFound;
+import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.lookup.ItemPath;
import com.c2kernel.property.Property;
import com.c2kernel.utils.Logger;
@@ -36,9 +36,9 @@ public class LDAPPropertyManager {
/**
* @param thisItem - EntityPath of the subject entity
* @return
- * @throws ObjectNotFound
+ * @throws ObjectNotFoundException
*/
- public boolean hasProperties(ItemPath thisItem) throws ObjectNotFound {
+ public boolean hasProperties(ItemPath thisItem) throws ObjectNotFoundException {
LDAPEntry entityEntry = LDAPLookupUtils.getEntry(auth.getAuthObject(), ldap.getFullDN(thisItem));
return entityEntry.getAttribute("cristalprop") != null;
}
@@ -46,9 +46,9 @@ public class LDAPPropertyManager {
/**
* @param thisItem - EntityPath of the subject entity
* @return array of Property
- * @throws ObjectNotFound
+ * @throws ObjectNotFoundException
*/
- public String[] getPropertyNames(ItemPath thisItem) throws ObjectNotFound {
+ public String[] getPropertyNames(ItemPath thisItem) throws ObjectNotFoundException {
LDAPEntry entityEntry = LDAPLookupUtils.getEntry(auth.getAuthObject(), ldap.getFullDN(thisItem));
ArrayList<String> propbag = new ArrayList<String>();
LDAPAttribute props = entityEntry.getAttribute("cristalprop");
@@ -67,9 +67,9 @@ public class LDAPPropertyManager {
* @param thisItem - EntityPath of the subject entity
* @param propName - the name of the property to retrieve
* @return The Property object
- * @throws ObjectNotFound
+ * @throws ObjectNotFoundException
*/
- public Property getProperty(ItemPath thisItem, String name) throws ObjectNotFound {
+ public Property getProperty(ItemPath thisItem, String name) throws ObjectNotFoundException {
LDAPEntry entityEntry = LDAPLookupUtils.getEntry(auth.getAuthObject(), ldap.getFullDN(thisItem));
return getProperty(entityEntry, name);
}
@@ -77,10 +77,10 @@ public class LDAPPropertyManager {
/**
* @param thisItem - EntityPath of the subject entity
* @param name - the property name to delete
- * @throws ObjectNotFound
+ * @throws ObjectNotFoundException
* @throws ObjectCannotBeUpdated
*/
- public void deleteProperty(ItemPath thisItem, String name) throws ObjectNotFound, ObjectCannotBeUpdated {
+ public void deleteProperty(ItemPath thisItem, String name) throws ObjectNotFoundException, ObjectCannotBeUpdated {
LDAPEntry entityEntry = LDAPLookupUtils.getEntry(auth.getAuthObject(), ldap.getFullDN(thisItem));
Property prop = getProperty(entityEntry, name);
Logger.msg(6, "LDAPLookupUtils.deleteProperty("+name+") - Deleting property");
@@ -94,27 +94,27 @@ public class LDAPPropertyManager {
/**
* @param thisItem - EntityPath of the subject entity
* @param prop - the property to store
- * @throws ObjectNotFound
+ * @throws ObjectNotFoundException
* @throws ObjectCannotBeUpdated
*/
- public void setProperty(ItemPath thisItem, Property prop) throws ObjectNotFound, ObjectCannotBeUpdated {
+ public void setProperty(ItemPath thisItem, Property prop) throws ObjectNotFoundException, ObjectCannotBeUpdated {
LDAPEntry entityEntry = LDAPLookupUtils.getEntry(auth.getAuthObject(), ldap.getFullDN(thisItem));
try {
Property oldProp = getProperty(entityEntry, prop.getName());
Logger.msg(6, "LDAPLookupUtils.setProperty("+prop.getName()+") - Removing old value '"+oldProp.getValue()+"'");
LDAPLookupUtils.removeAttributeValue(auth.getAuthObject(), entityEntry, "cristalprop", getPropertyAttrValue(oldProp));
- } catch (ObjectNotFound ex) {
+ } catch (ObjectNotFoundException ex) {
Logger.msg(6, "LDAPLookupUtils.setProperty("+prop.getName()+") - creating new property.");
}
Logger.msg(6, "LDAPLookupUtils.setProperty("+prop.getName()+") - setting to '"+prop.getValue()+"'");
LDAPLookupUtils.addAttributeValue(auth.getAuthObject(), entityEntry, "cristalprop", getPropertyAttrValue(prop));
}
- public static Property getProperty(LDAPEntry myEntry, String propName) throws ObjectNotFound {
+ public static Property getProperty(LDAPEntry myEntry, String propName) throws ObjectNotFoundException {
// delete existing props
LDAPAttribute props = myEntry.getAttribute("cristalprop");
if (props == null)
- throw new ObjectNotFound("Property "+propName+" does not exist");
+ throw new ObjectNotFoundException("Property "+propName+" does not exist");
String propPrefix = propName+":";
String roPropPrefix = "!"+propPrefix;
String val = null, name = null; boolean mutable = false;
@@ -133,7 +133,7 @@ public class LDAPPropertyManager {
}
}
if (name == null)
- throw new ObjectNotFound("Property "+propName+" does not exist");
+ throw new ObjectNotFoundException("Property "+propName+" does not exist");
Logger.msg(6, "Loaded "+(mutable?"":"Non-")+"Mutable Property: "+name+"="+val);
return new Property(name, val, mutable);
}