Class Driver


  • public abstract class Driver
    extends Object
    An abstract management connection context driver which should form the basis of driver implementations.
    • Constructor Detail

      • Driver

        protected Driver()
        Creates a new abstract driver.
    • Method Detail

      • close

        public void close()
        Closes any context associated with this management context driver.
      • deleteManagedObject

        public final <C extends ConfigurationClient,​S extends Configuration> boolean deleteManagedObject​(ManagedObjectPath<?,​?> parent,
                                                                                                               InstantiableRelationDefinition<C,​S> rd,
                                                                                                               String name)
                                                                                                        throws ManagedObjectNotFoundException,
                                                                                                               OperationRejectedException,
                                                                                                               LdapException
        Deletes the named instantiable child managed object from the named parent managed object.
        Type Parameters:
        C - The type of client managed object configuration that the relation definition refers to.
        S - The type of server managed object configuration that the relation definition refers to.
        Parameters:
        parent - The path of the parent managed object.
        rd - The instantiable relation definition.
        name - The name of the child managed object to be removed.
        Returns:
        Returns true if the named instantiable child managed object was found, or false if it was not found.
        Throws:
        IllegalArgumentException - If the relation definition is not associated with the parent managed object's definition.
        ManagedObjectNotFoundException - If the parent managed object could not be found.
        OperationRejectedException - If the managed object cannot be removed due to some client-side or server-side constraint which cannot be satisfied (for example, if it is referenced by another managed object).
        LdapException - If any other error occurs.
      • deleteManagedObject

        public final <C extends ConfigurationClient,​S extends Configuration> boolean deleteManagedObject​(ManagedObjectPath<?,​?> parent,
                                                                                                               OptionalRelationDefinition<C,​S> rd)
                                                                                                        throws ManagedObjectNotFoundException,
                                                                                                               OperationRejectedException,
                                                                                                               LdapException
        Deletes the optional child managed object from the named parent managed object.
        Type Parameters:
        C - The type of client managed object configuration that the relation definition refers to.
        S - The type of server managed object configuration that the relation definition refers to.
        Parameters:
        parent - The path of the parent managed object.
        rd - The optional relation definition.
        Returns:
        Returns true if the optional child managed object was found, or false if it was not found.
        Throws:
        IllegalArgumentException - If the relation definition is not associated with the parent managed object's definition.
        ManagedObjectNotFoundException - If the parent managed object could not be found.
        OperationRejectedException - If the managed object cannot be removed due to some client-side or server-side constraint which cannot be satisfied (for example, if it is referenced by another managed object).
        LdapException - If any other error occurs.
      • deleteManagedObject

        public final <C extends ConfigurationClient,​S extends Configuration> boolean deleteManagedObject​(ManagedObjectPath<?,​?> parent,
                                                                                                               SetRelationDefinition<C,​S> rd,
                                                                                                               String name)
                                                                                                        throws ManagedObjectNotFoundException,
                                                                                                               OperationRejectedException,
                                                                                                               LdapException
        Deletes the named instantiable child managed object from the named parent managed object.
        Type Parameters:
        C - The type of client managed object configuration that the relation definition refers to.
        S - The type of server managed object configuration that the relation definition refers to.
        Parameters:
        parent - The path of the parent managed object.
        rd - The instantiable relation definition.
        name - The name of the child managed object to be removed.
        Returns:
        Returns true if the named instantiable child managed object was found, or false if it was not found.
        Throws:
        IllegalArgumentException - If the relation definition is not associated with the parent managed object's definition.
        ManagedObjectNotFoundException - If the parent managed object could not be found.
        OperationRejectedException - If the managed object cannot be removed due to some client-side or server-side constraint which cannot be satisfied (for example, if it is referenced by another managed object).
        LdapException - If any other error occurs.
      • getPropertyValues

        public abstract <C extends ConfigurationClient,​S extends Configuration,​P> SortedSet<ValueOrExpression<P>> getPropertyValues​(ManagedObjectPath<C,​S> path,
                                                                                                                                                PropertyDefinition<P> pd)
                                                                                                                                         throws DefinitionDecodingException,
                                                                                                                                                ManagedObjectNotFoundException,
                                                                                                                                                LdapException
        Gets the effective values of a property in the named managed object.

        Implementations MUST NOT not use getManagedObject(ManagedObjectPath) to read the referenced managed object in its entirety. Specifically, implementations MUST only attempt to resolve the default values for the requested property and its dependencies (if it uses inherited defaults). This is to avoid infinite recursion where a managed object contains a property which inherits default values from another property in the same managed object.

        Type Parameters:
        C - The type of client managed object configuration that the path definition refers to.
        S - The type of server managed object configuration that the path definition refers to.
        P - The type of the property to be retrieved.
        Parameters:
        path - The path of the managed object containing the property.
        pd - The property to be retrieved.
        Returns:
        Returns the property's effective values, or an empty set if there are no values defined.
        Throws:
        IllegalArgumentException - If the property definition is not associated with the referenced managed object's definition.
        DefinitionDecodingException - If the managed object was found but its type could not be determined.
        PropertyException - If the managed object was found but the requested property could not be decoded.
        ManagedObjectNotFoundException - If the requested managed object could not be found on the server.
        LdapException - If any other error occurs.
      • getRootConfigurationManagedObject

        public abstract ManagedObject<RootCfgClient> getRootConfigurationManagedObject()
        Gets the root configuration managed object associated with this management context driver.
        Returns:
        Returns the root configuration managed object associated with this management context driver.
      • listManagedObjects

        public abstract <C extends ConfigurationClient,​S extends ConfigurationString[] listManagedObjects​(ManagedObjectPath<?,​?> parent,
                                                                                                                  InstantiableRelationDefinition<C,​S> rd,
                                                                                                                  AbstractManagedObjectDefinition<? extends C,​? extends S> d)
                                                                                                           throws ManagedObjectNotFoundException,
                                                                                                                  LdapException
        Lists the child managed objects of the named parent managed object which are a sub-type of the specified managed object definition.
        Type Parameters:
        C - The type of client managed object configuration that the relation definition refers to.
        S - The type of server managed object configuration that the relation definition refers to.
        Parameters:
        parent - The path of the parent managed object.
        rd - The instantiable relation definition.
        d - The managed object definition.
        Returns:
        Returns the names of the child managed objects which are a sub-type of the specified managed object definition.
        Throws:
        IllegalArgumentException - If the relation definition is not associated with the parent managed object's definition.
        ManagedObjectNotFoundException - If the parent managed object could not be found.
        LdapException - If any other error occurs.
      • listManagedObjects

        public abstract <C extends ConfigurationClient,​S extends ConfigurationString[] listManagedObjects​(ManagedObjectPath<?,​?> parent,
                                                                                                                  SetRelationDefinition<C,​S> rd,
                                                                                                                  AbstractManagedObjectDefinition<? extends C,​? extends S> d)
                                                                                                           throws ManagedObjectNotFoundException,
                                                                                                                  LdapException
        Lists the child managed objects of the named parent managed object which are a sub-type of the specified managed object definition.
        Type Parameters:
        C - The type of client managed object configuration that the relation definition refers to.
        S - The type of server managed object configuration that the relation definition refers to.
        Parameters:
        parent - The path of the parent managed object.
        rd - The set relation definition.
        d - The managed object definition.
        Returns:
        Returns the names of the child managed objects which are a sub-type of the specified managed object definition.
        Throws:
        IllegalArgumentException - If the relation definition is not associated with the parent managed object's definition.
        ManagedObjectNotFoundException - If the parent managed object could not be found.
        LdapException - If any other error occurs.
      • managedObjectExists

        public abstract boolean managedObjectExists​(ManagedObjectPath<?,​?> path)
                                             throws ManagedObjectNotFoundException,
                                                    LdapException
        Determines whether the named managed object exists.

        Implementations should always return true when the provided path is empty.

        Parameters:
        path - The path of the named managed object.
        Returns:
        Returns true if the named managed object exists, false otherwise.
        Throws:
        ManagedObjectNotFoundException - If the parent managed object could not be found.
        LdapException - If any other error occurs.
      • deleteManagedObject

        protected abstract <C extends ConfigurationClient,​S extends Configuration> void deleteManagedObject​(ManagedObjectPath<C,​S> path)
                                                                                                           throws OperationRejectedException,
                                                                                                                  LdapException
        Deletes the named managed object.

        Implementations do not need check whether the named managed object exists, nor do they need to enforce client constraints.

        Type Parameters:
        C - The type of client managed object configuration that the relation definition refers to.
        S - The type of server managed object configuration that the relation definition refers to.
        Parameters:
        path - The path of the managed object to be deleted.
        Throws:
        OperationRejectedException - If the managed object cannot be removed due to some server-side constraint which cannot be satisfied (for example, if it is referenced by another managed object).
        LdapException - If any other error occurs.
      • findDefaultValues

        protected final <P> Collection<ValueOrExpression<P>> findDefaultValues​(ManagedObjectPath<?,​?> p,
                                                                               PropertyDefinition<P> pd,
                                                                               boolean isCreate)
        Gets the default values for the specified property.
        Type Parameters:
        P - The type of the property.
        Parameters:
        p - The managed object path of the current managed object.
        pd - The property definition.
        isCreate - Indicates whether the managed object has been created yet.
        Returns:
        Returns the default values for the specified property.
        Throws:
        PropertyException - If the default values could not be retrieved or decoded properly.
      • getManagementContext

        protected abstract ManagementContext getManagementContext()
        Gets the management context associated with this driver.
        Returns:
        Returns the management context associated with this driver.
      • validateRelationDefinition

        protected final void validateRelationDefinition​(ManagedObjectPath<?,​?> path,
                                                        RelationDefinition<?,​?> rd)
        Validate that a relation definition belongs to the managed object referenced by the provided path.
        Parameters:
        path - The parent managed object path.
        rd - The relation definition.
        Throws:
        IllegalArgumentException - If the relation definition does not belong to the managed object definition.