| | |
| | | import java.util.SortedSet; |
| | | |
| | | import org.forgerock.opendj.admin.client.RootCfgClient; |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | | import org.opends.server.admin.AbstractManagedObjectDefinition; |
| | | import org.opends.server.admin.Configuration; |
| | | import org.opends.server.admin.ConfigurationClient; |
| | |
| | | * client-side or server-side constraint which cannot be |
| | | * satisfied (for example, if it is referenced by another |
| | | * managed object). |
| | | * @throws AuthorizationException |
| | | * If the server refuses to remove the managed objects because |
| | | * the client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject( |
| | | ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd, String name) |
| | | throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException, |
| | | AuthorizationException, CommunicationException { |
| | | ErrorResultException { |
| | | return getDriver().deleteManagedObject(parent, rd, name); |
| | | } |
| | | |
| | |
| | | * client-side or server-side constraint which cannot be |
| | | * satisfied (for example, if it is referenced by another |
| | | * managed object). |
| | | * @throws AuthorizationException |
| | | * If the server refuses to remove the managed objects because |
| | | * the client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject( |
| | | ManagedObjectPath<?, ?> parent, OptionalRelationDefinition<C, S> rd) throws IllegalArgumentException, |
| | | ManagedObjectNotFoundException, OperationRejectedException, AuthorizationException, CommunicationException { |
| | | ManagedObjectNotFoundException, OperationRejectedException, ErrorResultException { |
| | | return getDriver().deleteManagedObject(parent, rd); |
| | | } |
| | | |
| | |
| | | * client-side or server-side constraint which cannot be |
| | | * satisfied (for example, if it is referenced by another |
| | | * managed object). |
| | | * @throws AuthorizationException |
| | | * If the server refuses to remove the managed objects because |
| | | * the client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> boolean deleteManagedObject( |
| | | ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd, String name) |
| | | throws IllegalArgumentException, ManagedObjectNotFoundException, OperationRejectedException, |
| | | AuthorizationException, CommunicationException { |
| | | ErrorResultException { |
| | | return getDriver().deleteManagedObject(parent, rd, name); |
| | | } |
| | | |
| | |
| | | * @throws ManagedObjectNotFoundException |
| | | * If the requested managed object could not be found on the |
| | | * server. |
| | | * @throws AuthorizationException |
| | | * If the server refuses to retrieve the managed object because |
| | | * the client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public final <C extends ConfigurationClient, S extends Configuration> ManagedObject<? extends C> getManagedObject( |
| | | ManagedObjectPath<C, S> path) throws DefinitionDecodingException, ManagedObjectDecodingException, |
| | | ManagedObjectNotFoundException, AuthorizationException, CommunicationException { |
| | | ManagedObjectNotFoundException, ErrorResultException { |
| | | // Be careful to handle the root configuration. |
| | | if (path.isEmpty()) { |
| | | return (ManagedObject<C>) getRootConfigurationManagedObject(); |
| | |
| | | * @throws ManagedObjectNotFoundException |
| | | * If the requested managed object could not be found on the |
| | | * server. |
| | | * @throws AuthorizationException |
| | | * If the server refuses to retrieve the managed object because |
| | | * the client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | public final <PD> PD getPropertyValue(ManagedObjectPath<?, ?> path, PropertyDefinition<PD> pd) |
| | | throws IllegalArgumentException, DefinitionDecodingException, AuthorizationException, |
| | | ManagedObjectNotFoundException, CommunicationException, PropertyException { |
| | | throws IllegalArgumentException, DefinitionDecodingException, ErrorResultException, |
| | | ManagedObjectNotFoundException, PropertyException { |
| | | Set<PD> values = getPropertyValues(path, pd); |
| | | if (values.isEmpty()) { |
| | | return null; |
| | |
| | | * @throws ManagedObjectNotFoundException |
| | | * If the requested managed object could not be found on the |
| | | * server. |
| | | * @throws AuthorizationException |
| | | * If the server refuses to retrieve the managed object because |
| | | * the client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | public final <PD> SortedSet<PD> getPropertyValues(ManagedObjectPath<?, ?> path, PropertyDefinition<PD> pd) |
| | | throws IllegalArgumentException, DefinitionDecodingException, AuthorizationException, |
| | | ManagedObjectNotFoundException, CommunicationException, PropertyException { |
| | | throws IllegalArgumentException, DefinitionDecodingException, ErrorResultException, |
| | | ManagedObjectNotFoundException, PropertyException { |
| | | return getDriver().getPropertyValues(path, pd); |
| | | } |
| | | |
| | |
| | | * managed object's definition. |
| | | * @throws ManagedObjectNotFoundException |
| | | * If the parent managed object could not be found. |
| | | * @throws AuthorizationException |
| | | * If the server refuses to list the managed objects because the |
| | | * client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects( |
| | | ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd) throws IllegalArgumentException, |
| | | ManagedObjectNotFoundException, AuthorizationException, CommunicationException { |
| | | ManagedObjectNotFoundException, ErrorResultException { |
| | | return listManagedObjects(parent, rd, rd.getChildDefinition()); |
| | | } |
| | | |
| | |
| | | * managed object's definition. |
| | | * @throws ManagedObjectNotFoundException |
| | | * If the parent managed object could not be found. |
| | | * @throws AuthorizationException |
| | | * If the server refuses to list the managed objects because the |
| | | * client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects( |
| | | ManagedObjectPath<?, ?> parent, InstantiableRelationDefinition<C, S> rd, |
| | | AbstractManagedObjectDefinition<? extends C, ? extends S> d) throws IllegalArgumentException, |
| | | ManagedObjectNotFoundException, AuthorizationException, CommunicationException { |
| | | ManagedObjectNotFoundException, ErrorResultException { |
| | | return getDriver().listManagedObjects(parent, rd, d); |
| | | } |
| | | |
| | |
| | | * managed object's definition. |
| | | * @throws ManagedObjectNotFoundException |
| | | * If the parent managed object could not be found. |
| | | * @throws AuthorizationException |
| | | * If the server refuses to list the managed objects because the |
| | | * client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | public final <C extends ConfigurationClient, S extends Configuration> String[] listManagedObjects( |
| | | ManagedObjectPath<?, ?> parent, SetRelationDefinition<C, S> rd) throws IllegalArgumentException, |
| | | ManagedObjectNotFoundException, AuthorizationException, CommunicationException { |
| | | ManagedObjectNotFoundException, ErrorResultException { |
| | | return getDriver().listManagedObjects(parent, rd, rd.getChildDefinition()); |
| | | } |
| | | |
| | |
| | | * <code>false</code> otherwise. |
| | | * @throws ManagedObjectNotFoundException |
| | | * If the parent managed object could not be found. |
| | | * @throws AuthorizationException |
| | | * If the server refuses to make the determination because the |
| | | * client does not have the correct privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an underlying |
| | | * communication problem. |
| | | * @throws ErrorResultException |
| | | * If any other error occurs. |
| | | */ |
| | | public final boolean managedObjectExists(ManagedObjectPath<?, ?> path) throws ManagedObjectNotFoundException, |
| | | AuthorizationException, CommunicationException { |
| | | ErrorResultException { |
| | | return getDriver().managedObjectExists(path); |
| | | } |
| | | |