public ReadOnlyEntry getEntry(final T o) throws LDAPPersistException { if (entryField != null) { try { final Object entryObject = entryField.get(o); if (entryObject != null) { return (ReadOnlyEntry) entryObject; } } catch (Exception e) { debugException(e); throw new LDAPPersistException( ERR_OBJECT_HANDLER_ERROR_ACCESSING_ENTRY_FIELD.get( entryField.getName(), type.getName(), getExceptionMessage(e)), e); } } return null; }
public String getEntryDN(final T o) throws LDAPPersistException { if (dnField != null) { try { final Object dnObject = dnField.get(o); if (dnObject != null) { return String.valueOf(dnObject); } } catch (Exception e) { debugException(e); throw new LDAPPersistException( ERR_OBJECT_HANDLER_ERROR_ACCESSING_DN_FIELD.get( dnField.getName(), type.getName(), getExceptionMessage(e)), e); } } final ReadOnlyEntry entry = getEntry(o); if (entry != null) { return entry.getDN(); } return null; }