Handle special case where the requested managed object is the root configuration.
| | |
| | | * If the client cannot contact the server due to an |
| | | * underlying communication problem. |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public final <C extends ConfigurationClient, S extends Configuration> |
| | | ManagedObject<? extends C> getManagedObject( |
| | | ManagedObjectPath<C, S> path) throws DefinitionDecodingException, |
| | | ManagedObjectDecodingException, ManagedObjectNotFoundException, |
| | | AuthorizationException, CommunicationException { |
| | | // Be careful to handle the root configuration. |
| | | if (path.isEmpty()) { |
| | | return (ManagedObject<C>) getRootConfigurationManagedObject(); |
| | | } |
| | | |
| | | return getDriver().getManagedObject(path); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Gets the named managed object. |
| | | * Gets the named managed object. The path is guaranteed to be |
| | | * non-empty, so implementations do not need to worry about handling |
| | | * this special case. |
| | | * |
| | | * @param <C> |
| | | * The type of client managed object configuration that the |
| | |
| | | * The type of server managed object configuration that the |
| | | * path definition refers to. |
| | | * @param path |
| | | * The path of the managed object. |
| | | * The non-empty path of the managed object. |
| | | * @return Returns the named managed object. |
| | | * @throws DefinitionDecodingException |
| | | * If the managed object was found but its type could not |
| | |
| | | * If the named managed object could not be found or if it |
| | | * could not be decoded. |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public <C extends ConfigurationClient, S extends Configuration> |
| | | ServerManagedObject<? extends S> getManagedObject( |
| | | ManagedObjectPath<C, S> path) throws ConfigException { |
| | | // Be careful to handle the root configuration. |
| | | if (path.isEmpty()) { |
| | | return (ServerManagedObject<S>) getRootConfigurationManagedObject(); |
| | | } |
| | | |
| | | // Get the configuration entry. |
| | | DN targetDN = DNBuilder.create(path); |
| | | ConfigEntry configEntry = getManagedObjectConfigEntry(targetDN); |