| | |
| | | * |
| | | * |
| | | * Copyright 2007-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.client.ldap; |
| | | |
| | |
| | | */ |
| | | private static final class MockEntry { |
| | | |
| | | // The entry's attributes. |
| | | /** The entry's attributes. */ |
| | | private final Attributes attributes; |
| | | |
| | | // The entry's children. |
| | | /** The entry's children. */ |
| | | private final List<MockEntry> children; |
| | | |
| | | // The name of this mock entry. |
| | | /** The name of this mock entry. */ |
| | | private final DN dn; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() { |
| | | StringBuilder builder = new StringBuilder(); |
| | |
| | | } |
| | | } |
| | | |
| | | // All the entries. |
| | | /** All the entries. */ |
| | | private final Map<DN, MockEntry> entries; |
| | | |
| | | // The single root entry. |
| | | /** The single root entry. */ |
| | | private final MockEntry rootEntry; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void createEntry(LdapName dn, Attributes attributes) |
| | | throws NamingException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void deleteSubtree(LdapName dn) throws NamingException { |
| | | throw new UnsupportedOperationException("deleteSubtree"); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean entryExists(LdapName dn) throws NamingException { |
| | | return getEntry(dn) != null; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<LdapName> listEntries(LdapName dn, String filter) throws NamingException { |
| | | MockEntry entry = getEntry(dn); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void modifyEntry(LdapName dn, Attributes mods) throws NamingException { |
| | | throw new UnsupportedOperationException("modifyEntry"); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Attributes readEntry(LdapName dn, Collection<String> attrIds) |
| | | throws NamingException { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void unbind() { |
| | | // nothing to do |