if (results.size() < 1) { found = false; } else {
if (attrs == null || attrs.size()==0) { attrs = ctx.getAttributes(userDn, getUserAttributes());
public boolean hasModifications() { return ( modified != null ) && ( modified.size() > 0 ); }
public int size() { return wrapped.size(); }
public boolean hasAdditions() { return ( created != null ) && ( created.size() > 0 ); }
@Override public Object mapFromAttributes(final Attributes attributes) throws NamingException { final int attributeCount = attributes.size(); final Map<String, Object> mapOfAttrValues = this.createAttributeMap(attributeCount); for (final NamingEnumeration<? extends Attribute> attributesEnum = attributes.getAll(); attributesEnum.hasMore(); ) { final Attribute attribute = attributesEnum.next(); if (!this.ignoreNull || attribute.size() > 0) { final String attrName = attribute.getID(); final String key = this.getAttributeKey(attrName); final NamingEnumeration<?> valuesEnum = attribute.getAll(); final List<?> values = this.getAttributeValues(valuesEnum); mapOfAttrValues.put(key, values); } } return mapOfAttrValues; }
public void checkModify( LdapDN normName, int modOp, Attributes mods ) throws NamingException { ModificationItemImpl[] modsAsArray = new ModificationItemImpl[ mods.size() ]; NamingEnumeration allAttrs = mods.getAll(); int i = 0; while ( allAttrs.hasMoreElements() ) { Attribute attr = ( Attribute ) allAttrs.nextElement(); modsAsArray[i] = new ModificationItemImpl( modOp, attr ); i++; } checkModify( normName, modsAsArray ); }
public Object mapFromAttributes(Attributes attributes) throws NamingException { final int attributeCount = attributes.size(); final Map<String, Object> mapOfAttrValues = this.createAttributeMap(attributeCount); for (final NamingEnumeration<? extends Attribute> attributesEnum = attributes.getAll(); attributesEnum.hasMore();) { final Attribute attribute = attributesEnum.next(); if (!this.ignoreNull || attribute.size() > 0) { final String attrName = attribute.getID(); final String key = this.getAttributeKey(attrName); final NamingEnumeration<?> valuesEnum = attribute.getAll(); final List<?> values = this.getAttributeValues(valuesEnum); mapOfAttrValues.put(key, values); } } return mapOfAttrValues; }
@Override public Object mapFromAttributes(final Attributes attributes) throws NamingException { final int attributeCount = attributes.size(); final Map<String, Object> mapOfAttrValues = this.createAttributeMap(attributeCount); for (final NamingEnumeration<? extends Attribute> attributesEnum = attributes.getAll(); attributesEnum.hasMore(); ) { final Attribute attribute = attributesEnum.next(); if (!this.ignoreNull || attribute.size() > 0) { final String attrName = attribute.getID(); final String key = this.getAttributeKey(attrName); final NamingEnumeration<?> valuesEnum = attribute.getAll(); final List<?> values = this.getAttributeValues(valuesEnum); mapOfAttrValues.put(key, values); } } return mapOfAttrValues; }
/** * Create UserProfileData from LDAP attributes. * * @param attrs {@link Attributes} * @return {@link UserProfileData} */ public final UserProfileData attributesToProfile(Attributes attrs) { if (attrs == null || attrs.size() == 0) return null; UserProfileData upd = new UserProfileData(); upd.setProfile(getAttributeValueAsString(attrs, ldapDescriptionAttr)); return upd; }
/** * Create MembershipType from LDAP attributes. * * @param attrs {@link Attributes} * @return MemebrshipType */ public final MembershipType attributesToMembershipType(Attributes attrs) { if (attrs == null || attrs.size() == 0) return null; MembershipType m = new MembershipTypeImpl(); m.setName(getAttributeValueAsString(attrs, membershipTypeNameAttr)); m.setDescription(getAttributeValueAsString(attrs, ldapDescriptionAttr)); m.setCreatedDate(new Date()); m.setModifiedDate(new Date()); return m; }
public void modify( NextInterceptor next, LdapDN name, int modOp, Attributes mods ) throws NamingException { Invocation invocation = InvocationStack.getInstance().peek(); PartitionNexusProxy proxy = invocation.getProxy(); Attributes oriEntry = proxy.lookup( name, PartitionNexusProxy.LOOKUP_BYPASS ); super.modify( next, name, modOp, mods ); // package modifications in ModItem format for event delivery ModificationItemImpl[] modItems = new ModificationItemImpl[mods.size()]; NamingEnumeration list = mods.getAll(); for ( int ii = 0; ii < modItems.length; ii++ ) { modItems[ii] = new ModificationItemImpl( modOp, ( Attribute ) list.next() ); } notifyOnModify( name, modItems, oriEntry ); }
/** * Retrieves the number of attributes in the attribute set. */ public int size() { if (attributes == null) { int size = 0; if (getCreationDate() != null) size += 2; if (getLastModifiedDate() != null) size += 2; if (getName() != null) size++; if (getResourceType() != null) size += 2; if (getContentLength() >= 0) size += 2; if (getETag() != null) size += 2; return size; } else { return attributes.size(); } }
/** * Retrieves the number of attributes in the attribute set. */ @Override public int size() { if (attributes == null) { int size = 0; if (getCreationDate() != null) size += 2; if (getLastModifiedDate() != null) size += 2; if (getName() != null) size++; if (getResourceType() != null) size += 2; if (getContentLength() >= 0) size += 2; if (getETag() != null) size += 2; return size; } else { return attributes.size(); } }
/** * Retrieves the number of attributes in the attribute set. */ public int size() { if (attributes == null) { int size = 0; if (getCreationDate() != null) size += 2; if (getLastModifiedDate() != null) size += 2; if (getName() != null) size++; if (getResourceType() != null) size += 2; if (getContentLength() >= 0) size += 2; if (getETag() != null) size += 2; return size; } else { return attributes.size(); } }
/** * Retrieves the number of attributes in the attribute set. */ @Override public int size() { if (attributes == null) { int size = 0; if (getCreationDate() != null) size += 2; if (getLastModifiedDate() != null) size += 2; if (getName() != null) size++; if (getResourceType() != null) size += 2; if (getContentLength() >= 0) size += 2; if (getETag() != null) size += 2; return size; } else { return attributes.size(); } }
/** * Retrieves the number of attributes in the attribute set. */ @Override public int size() { if (attributes == null) { int size = 0; if (getCreationDate() != null) size += 2; if (getLastModifiedDate() != null) size += 2; if (getName() != null) size++; if (getResourceType() != null) size += 2; if (getContentLength() >= 0) size += 2; if (getETag() != null) size += 2; return size; } else { return attributes.size(); } }
/** * Retrieves the number of attributes in the attribute set. */ @Override public int size() { if (attributes == null) { int size = 0; if (getCreationDate() != null) size += 2; if (getLastModifiedDate() != null) size += 2; if (getName() != null) size++; if (getResourceType() != null) size += 2; if (getContentLength() >= 0) size += 2; if (getETag() != null) size += 2; return size; } else { return attributes.size(); } }
/** * Retrieves the number of attributes in the attribute set. */ @Override public int size() { if (attributes == null) { int size = 0; if (getCreationDate() != null) size += 2; if (getLastModifiedDate() != null) size += 2; if (getName() != null) size++; if (getResourceType() != null) size += 2; if (getContentLength() >= 0) size += 2; if (getETag() != null) size += 2; return size; } else { return attributes.size(); } }
/** * Create group from LDAP attributes. * * @param attrs {@link Attributes} * @return Group */ public final Group attributesToGroup(Attributes attrs) { if (attrs == null || attrs.size() == 0) return null; Group group = new GroupImpl(); group.setGroupName(getAttributeValueAsString(attrs, groupNameAttr)); group.setDescription(getAttributeValueAsString(attrs, ldapDescriptionAttr)); group.setLabel(getAttributeValueAsString(attrs, groupLabelAttr)); return group; }