| | |
| | | AuthorizationException, CommunicationException { |
| | | validateRelationDefinition(parent, rd); |
| | | |
| | | if (!entryExists(parent)) { |
| | | if (!managedObjectExists(parent)) { |
| | | throw new ManagedObjectNotFoundException(); |
| | | } |
| | | |
| | |
| | | CommunicationException { |
| | | validateRelationDefinition(parent, rd); |
| | | |
| | | if (!entryExists(parent)) { |
| | | if (!managedObjectExists(parent)) { |
| | | throw new ManagedObjectNotFoundException(); |
| | | } |
| | | |
| | |
| | | ManagedObjectPath<C, S> path) throws DefinitionDecodingException, |
| | | ManagedObjectDecodingException, ManagedObjectNotFoundException, |
| | | AuthorizationException, CommunicationException { |
| | | if (!entryExists(path)) { |
| | | if (!managedObjectExists(path)) { |
| | | throw new ManagedObjectNotFoundException(); |
| | | } |
| | | |
| | |
| | | DefinitionDecodingException, AuthorizationException, |
| | | ManagedObjectNotFoundException, CommunicationException, |
| | | PropertyException { |
| | | if (!entryExists(path)) { |
| | | if (!managedObjectExists(path)) { |
| | | throw new ManagedObjectNotFoundException(); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | boolean hasManagedObject( |
| | | ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd) |
| | | throws IllegalArgumentException, ManagedObjectNotFoundException, |
| | | AuthorizationException, CommunicationException { |
| | | validateRelationDefinition(parent, rd); |
| | | |
| | | if (!entryExists(parent)) { |
| | | throw new ManagedObjectNotFoundException(); |
| | | } |
| | | |
| | | return entryExists(parent.child(rd)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | String[] listManagedObjects( |
| | | ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd, |
| | | AbstractManagedObjectDefinition<? extends C, ? extends S> d) |
| | |
| | | AuthorizationException, CommunicationException { |
| | | validateRelationDefinition(parent, rd); |
| | | |
| | | if (!entryExists(parent)) { |
| | | if (!managedObjectExists(parent)) { |
| | | throw new ManagedObjectNotFoundException(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean managedObjectExists(ManagedObjectPath<?, ?> path) |
| | | throws ManagedObjectNotFoundException, AuthorizationException, |
| | | CommunicationException { |
| | | if (path.isEmpty()) { |
| | | return true; |
| | | } |
| | | |
| | | ManagedObjectPath<?,?> parent = path.parent(); |
| | | LdapName dn = LDAPNameBuilder.create(parent, profile); |
| | | if (!entryExists(dn)) { |
| | | throw new ManagedObjectNotFoundException(); |
| | | } |
| | | |
| | | dn = LDAPNameBuilder.create(path, profile); |
| | | return entryExists(dn); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Adapts a naming exception to an appropriate admin client |
| | | * exception. |
| | | * |
| | |
| | | |
| | | |
| | | |
| | | // Determines whether the LDAP entry associated with the managed |
| | | // object path exists. |
| | | private boolean entryExists(ManagedObjectPath<?, ?> path) |
| | | throws CommunicationException, AuthorizationException { |
| | | if (path.isEmpty()) { |
| | | return true; |
| | | } |
| | | |
| | | LdapName dn = LDAPNameBuilder.create(path, profile); |
| | | return entryExists(dn); |
| | | } |
| | | |
| | | |
| | | |
| | | // Determine the type of managed object associated with the named |
| | | // entry. |
| | | private <C extends ConfigurationClient, S extends Configuration> |
| | |
| | | private boolean removeManagedObject(ManagedObjectPath<?, ?> path) |
| | | throws CommunicationException, AuthorizationException, |
| | | OperationRejectedException, ManagedObjectNotFoundException { |
| | | if (!entryExists(path)) { |
| | | if (!managedObjectExists(path)) { |
| | | return false; |
| | | } |
| | | |