0 Replies Latest reply on Sep 18, 2007 3:40 PM by starksm64

    ProfileService/OBR repository

    starksm64

      I just checked in a OSGi OBR like addition to the org.jboss.profileservice.spi.repository package. The interfaces in there mirror the OSGi OBR interfaces with two additions:

      1. The RepositoryAdmin has an additional Repository getRepository(URI repository) throws Exception; method.
      2. There is an extension of the Repository interface that allows for addition/removal and modification detection of Resources:

      public interface MutableRepository extends Repository
      {
       /** */
       public enum ModifyStatus {ADDED, MODIFIED, REMOVED};
      
       /**
       * Add a resource to the repository.
       * @param resource the resource to add
       * @throws Exception thrown on any addition failure
       */
       public void addResource(Resource resource)
       throws Exception;
       /**
       * Remove a resource from the repository
       * @param name the resource SYMBOLIC_NAME or ID
       * @return the Resource that was removed if found, null otherwise.
       * @throws Exception thrown on any remove failure
       */
       public Resource removeResource(String name)
       throws Exception;
       /**
       * Return a collection of resources that have been modified since
       * the last call to this method. The returned resources contain
       * a modifyStatus property of type ModifyStatus to indicate the
       * type of change.
       *
       * @return The Resources that have been modified.
       * @throws Exception
       */
       public Collection<Resource> getModifiedResources()
       throws Exception;
      }
      


      There are still a lot of issues to validate in terms of actually using an OBR implementation. The validation of the OBR like API is in the mapping class org.jboss.system.server.profileservice.repository.RepositoryAdminAdaptor. This maps the current org.jboss.profileservice.spi.DeploymentRepository spi onto the org.jboss.profileservice.spi.repository.RepositoryAdmin OBR like SPI. I'm going to look at using some form of the Felix 1.1 bundlerepository code(http://svn.apache.org/repos/asf/felix/trunk/bundlerepository/) for the next release.