From 08dc22e65e0929a487fbd82fad403fd9406645f9 Mon Sep 17 00:00:00 2001 From: Philipp Haussleiter Date: Mon, 30 Jan 2017 23:29:30 +0100 Subject: [PATCH] be more compatible with the underlaying model --- .../com/innoq/ldap/connector/LdapKeys.java | 2 +- .../com/innoq/ldap/connector/LdapNode.java | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapKeys.java b/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapKeys.java index 48e8a96..8245d0e 100644 --- a/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapKeys.java +++ b/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapKeys.java @@ -31,7 +31,7 @@ public class LdapKeys { public static final String GROUP_OBJECTCLASS = "groupOfNames"; public static final String JPEG_PHOTO = "jpegPhoto"; public static final String LDAP_ATTRIBUTES_BINARY = "java.naming.ldap.attributes.binary"; - public static final String MODIFIERS_NAME = "modifiersName"; + public static final String MODIFIERS_NAME = "modifiersName"; public static final String MODIFY_TIMESTAMP = "modifyTimestamp"; public static final String OBJECT_CLASS = "objectClass"; public static final String OWNER = "owner"; diff --git a/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapNode.java b/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapNode.java index 0f6e4c3..75887e3 100644 --- a/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapNode.java +++ b/ldap-connector/src/main/java/com/innoq/ldap/connector/LdapNode.java @@ -34,9 +34,6 @@ public class LdapNode implements Node { protected Set objectClasses; protected String name; protected String dn; - protected String modifyTimestamp; - protected String modifiersName; - protected String entryUUID; protected String cn; /** @@ -123,7 +120,7 @@ public String getCn() { } public boolean isNew() { - return (this.modifiersName == null && this.modifyTimestamp == null); + return (getModifiersName() == null && getModifyTimestamp() == null); } public void debug() { @@ -131,7 +128,7 @@ public void debug() { sb.append(LINE); sb.append("\t").append("dn").append(" : ").append(getDn()).append("\n"); if (!isNew()) { - sb.append("\tupdated: ").append(this.modifyTimestamp).append(" by ").append(this.modifiersName).append("\n"); + sb.append("\tupdated: ").append(getModifyTimestamp()).append(" by ").append(getModifiersName()).append("\n"); } sb.append(LINE); for (String key : getKeys()) { @@ -197,27 +194,27 @@ public void setDn(final String dn) { } public void setModifyTimestamp(final String modifyTimestamp) { - this.modifyTimestamp = modifyTimestamp.trim(); + set(LdapKeys.MODIFY_TIMESTAMP, modifyTimestamp); } public void setModifiersName(final String modifiersName) { - this.modifiersName = modifiersName.trim(); + set(LdapKeys.MODIFIERS_NAME, modifiersName); } public String getEntryUUID() { - return entryUUID; + return get(LdapKeys.ENTRY_UUID); } public void setEntryUUID(String entryUUID) { - this.entryUUID = entryUUID; + set(LdapKeys.ENTRY_UUID, entryUUID); } public String getModifiersName() { - return this.modifiersName; + return get(LdapKeys.MODIFIERS_NAME); } public String getModifyTimestamp() { - return this.modifyTimestamp; + return get(LdapKeys.MODIFY_TIMESTAMP); } public String toLdif(LdapHelper instance) {