class DirContextAdapter implements DirContextOperations {

	@Override
	public ModificationItem[] getModificationItems() {
		if (!updateMode) {
			return new ModificationItem[0];
		}

		List<ModificationItem> tmpList = new LinkedList<ModificationItem>();
		NamingEnumeration<? extends Attribute> attributesEnumeration = null;
		try {
			attributesEnumeration = updatedAttrs.getAll();

			// find attributes that have been changed, removed or added
			while (attributesEnumeration.hasMore()) {
				NameAwareAttribute oneAttr = (NameAwareAttribute) attributesEnumeration.next();

				collectModifications(oneAttr, tmpList);
			}
		}
		catch (NamingException e) {
			throw LdapUtils.convertLdapException(e);
		}
		finally {
			closeNamingEnumeration(attributesEnumeration);
		}

		if (log.isDebugEnabled()) {
			log.debug("Number of modifications:" + tmpList.size());
		}

		return tmpList.toArray(new ModificationItem[tmpList.size()]);
	}

	public  DirContextAdapter();
	public  DirContextAdapter(String dnString);
	public  DirContextAdapter(Name dn);
	public  DirContextAdapter(Attributes attrs, Name dn);
	public  DirContextAdapter(Attributes attrs, Name dn, Name base);
	public  DirContextAdapter(Attributes attrs, Name dn, Name base,
			String referralUrl);
	protected  DirContextAdapter(DirContextAdapter master);

}