[jboss-cvs] JBossAS SVN: r82801 - in projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi: metadata and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 13 07:28:30 EST 2009


Author: emuckenhuber
Date: 2009-01-13 07:28:29 -0500 (Tue, 13 Jan 2009)
New Revision: 82801

Added:
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/AttachmentStore.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileDeploymentMetaData.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileMetaData.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileSourceMetaData.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfilesMetaData.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/SubProfileMetaData.java
Removed:
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/AttachmentsSerializer.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileConfiguration.java
Modified:
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/DeploymentRepository.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/DeploymentRepositoryFactory.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/Profile.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileKey.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileRepository.java
   projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileService.java
Log:
updates to the profileservice-spi for sub-profiles

Added: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/AttachmentStore.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/AttachmentStore.java	                        (rev 0)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/AttachmentStore.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.profileservice.spi;
+
+import java.net.URI;
+
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * The AttachmentStore.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public interface AttachmentStore
+{
+
+   /**
+    * Get the uri where the attachments are stored.
+    * 
+    * @return the attachment store root.
+    */
+   URI getAttachmentStoreRoot();
+   
+   /**
+    * Persist the changes of the managed component.
+    * 
+    * @param deployment the deployment.
+    * @param comp the managed component.
+    * @throws Exception
+    */
+   void updateDeployment(VFSDeployment deployment, ManagedComponent comp) throws Exception;
+   
+   /**
+    * Load the deployment with the persisted attachments.
+    * 
+    * @param vfsPath the deployment path.
+    * @return the deployment.
+    * @throws Exception
+    */
+   VFSDeployment loadDeploymentData(VirtualFile vfsPath) throws Exception;
+   
+}
+

Deleted: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/AttachmentsSerializer.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/AttachmentsSerializer.java	2009-01-13 11:51:45 UTC (rev 82800)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/AttachmentsSerializer.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.spi;
-
-
-/**
- * An interface that allows externalization of the attachment
- * serialization details.
- * 
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public interface AttachmentsSerializer
-{
-   
-   public void saveAttachment(String baseName, Object attachment) throws Exception;
-   
-   public <T> T loadAttachment(String baseName, Class<T> expected) throws Exception;
-   
-}

Modified: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/DeploymentRepository.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/DeploymentRepository.java	2009-01-13 11:51:45 UTC (rev 82800)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/DeploymentRepository.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -28,10 +28,8 @@
 import java.util.Collection;
 import java.util.Set;
 
-import org.jboss.deployers.spi.attachments.Attachments;
 import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
 import org.jboss.virtual.VirtualFile;
 
 /**
@@ -44,31 +42,34 @@
 public interface DeploymentRepository
 {
    /**
-    * Get the admin attachments root path 
-    * @return path to the root directory for attachments
+    * Get the uris of this repository.
+    * 
+    * @return URI[] the uris of this repository.
     */
-   public String getAttachmentsRoot();
+   public URI[] getRepositoryURIs();
+	
    /**
-    * Set the admin attachments root path
-    * @param root - path to the root directory for attachments
-    */
-   public void setAttachmentsRoot(String root);
-
-   /**
-    * Create the repository
+    * Create the repository.
+    * 
     * @throws Exception
     */
+   
    public void create() throws Exception;
+   
    /**
-    * Load the repository contents
+    * Load the repository contents.
+    * 
     * @throws Exception
     */
    public void load() throws Exception;
+   
    /**
-    * Delete the repository
+    * Delete the repository.
+    * 
     * @throws Exception
     */
    public void remove() throws Exception;
+   
    /**
     * Get the time any contents were last modified
     * @return
@@ -76,32 +77,11 @@
    public long getLastModified();
 
    /**
-    * Get the URI of the root of deployments for the given phase.
-    * @param phase - the phase of deployment
-    * @return URI of the root of deployments for the given phase.
-    */
-   public URI getDeploymentURI(DeploymentPhase phase);
-   /**
-    * Get the URI of the root of deployments for the given phase.
-    * @param phase - the phase of deployment
-    * @param uri - URI of the root of deployments
-    */
-   public void setDeploymentURI(URI uri, DeploymentPhase phase);
-
-   /**
     * Get the names of all deployments in the repository
     * @return
     */
    public Set<String> getDeploymentNames();
-   /**
-    * Get the names of all deployments in the repository for the
-    * given phase.
-    * @param phase - the phase of deployment
-    * @return names of all deployments
-    */
-   public Set<String> getDeploymentNames(DeploymentPhase phase);
 
-
    /**
     * Upload raw deployment content to a profile repository. This does not make
     * the deployment avaialble to
@@ -112,28 +92,17 @@
     * @throws IOException
     * @return the unique name of the deployment in the repository
     */
-   public String addDeploymentContent(String vfsPath, InputStream contentIS, DeploymentPhase phase)
+   public String addDeploymentContent(String vfsPath, InputStream contentIS)
       throws IOException;
 
    /**
-    * Get repository names.
-    *
-    * @param names the names
-    * @param phase the deployment phase
-    * @return full repository names
-    * @throws IOException for any error
-    */
-   public String[] getRepositoryNames(String[] names, DeploymentPhase phase)
-      throws IOException;
-
-   /**
     * Get the repository virtual file for the given deployment name
     * @param name - the unique virtual file URI name as returned by addDeploymentContent
     * @param phase - the phase of the deployment as it relates to when the deployment is loaded
     * @return the deployment content virtual file
     * @throws IOException for any error
     */
-   public VirtualFile getDeploymentContent(String name, DeploymentPhase phase)
+   public VirtualFile getDeploymentContent(String name)
       throws IOException, URISyntaxException;
 
    /**
@@ -142,14 +111,14 @@
     * @param phase - the deployment phase
     * @return the deployment content flags, {@linkplain DeploymentContentFlags}
     */
-   public int lockDeploymentContent(String vfsPath, DeploymentPhase phase);
+   public int lockDeploymentContent(String vfsPath);
    /**
     * Unlock a previously locked deployment content.
     * @param vfsPath - the content vfs path relative to the deployment phase root
     * @param phase - the deployment phase
     * @return the deployment content flags, {@linkplain DeploymentContentFlags}
     */
-   public int unlockDeploymentContent(String vfsPath, DeploymentPhase phase);
+   public int unlockDeploymentContent(String vfsPath);
 
    /**
     * Get the status flags for the deployment path
@@ -157,7 +126,7 @@
     * @param phase - the deployment phase
     * @return the deployment content flags, {@linkplain DeploymentContentFlags}
     */
-   public int getDeploymentContentFlags(String vfsPath, DeploymentPhase phase);
+   public int getDeploymentContentFlags(String vfsPath);
    /**
     * Set one or more flags for the deployment.
     * @see #clearDeploymentContentFlags(String, DeploymentPhase, int)
@@ -166,8 +135,7 @@
     * @param phase - the deployment phase
     * @param flags - the deployment content flags, {@linkplain DeploymentContentFlags}
     */
-   public int setDeploymentContentFlags(String vfsPath, DeploymentPhase phase,
-         int flags);
+   public int setDeploymentContentFlags(String vfsPath, int flags);
    /**
     * Clear one or more flags for the deployment. This ands the compliment of
     * the flags argument into the existing content flags and returns the result.
@@ -176,8 +144,7 @@
     * @param phase - the deployment phase
     * @param flags - the deployment content flags, {@linkplain DeploymentContentFlags}
     */
-   public int clearDeploymentContentFlags(String vfsPath, DeploymentPhase phase,
-         int flags);
+   public int clearDeploymentContentFlags(String vfsPath, int flags);
    /**
     * Does a deployment content have the indicated flag.
     * 
@@ -186,21 +153,9 @@
     * @param flags - the deployment content flags, {@linkplain DeploymentContentFlags}
     * @return true if the content flags contains the flag, false otherwise.
     */
-   public boolean hasDeploymentContentFlags(String vfsPath, DeploymentPhase phase,
-         int flag);
+   public boolean hasDeploymentContentFlags(String vfsPath, int flag);
 
    /**
-    * Acquire the repository write lock. This generally prevents content
-    * uploads and {@link #getModifiedDeployments()} calls while the lock is
-    * held.
-    */
-   public void acquireDeploymentContentLock();
-   /**
-    * Release the previously aquired repository write lock.
-    */
-   public void releaseDeploymentContentLock();
-
-   /**
     * Add a deployment
     * 
     * @param vfsPath the path
@@ -209,8 +164,9 @@
     * deployment is loaded
     * @throws Exception for any error
     */
-   public void addDeployment(String vfsPath, VFSDeployment d, DeploymentPhase phase)
+   public void addDeployment(String vfsPath, VFSDeployment d)
       throws Exception;
+   
    /**
     * Update a deployments attachments. This persists the deployments
     * pre-determined attachments.
@@ -220,8 +176,7 @@
     * @param comp - the ManagedComponent that has been modified
     * @throws Exception
     */
-   public void updateDeployment(VFSDeployment d, DeploymentPhase phase,
-      ManagedComponent comp)
+   public void updateDeployment(VFSDeployment d, ManagedComponent comp)
       throws Exception;
 
    /**
@@ -232,11 +187,9 @@
     * deployment is loaded
     * @return the named bootstrap
     * @throws NoSuchDeploymentException - if there is no such bootstrap
-    * @throws IOException 
-    * @throws Exception for any error
     */
-   public VFSDeployment getDeployment(String name, DeploymentPhase phase)
-      throws NoSuchDeploymentException, Exception;
+   public VFSDeployment getDeployment(String name)
+      throws NoSuchDeploymentException;
 
    /**
     * Remove a deployment
@@ -247,33 +200,23 @@
     * @return the removed deployment
     * @throws Exception for any error
     */
-   public VFSDeployment removeDeployment(String vfsPath, DeploymentPhase phase)
+   public VFSDeployment removeDeployment(String vfsPath)
       throws Exception;
 
    /**
-    * Get all deployments for the given phase defined in this profile
-    * 
-    * @param phase - the phase of the deployment as it relates to when the
-    * deployment is loaded
-    * @return the bootstrap instances in this profile.
-    * @throws Exception for any error
-    */
-   public Collection<VFSDeployment> getDeployments(DeploymentPhase phase)
-      throws Exception;
-   /**
     * Get all deployments defined in this profile
     * 
     * @return the deployment instances in this profile.
-    * @throws Exception for any error
     */
-   public Collection<VFSDeployment> getDeployments()
-      throws Exception;
+   public Collection<VFSDeployment> getDeployments();
 
+   /**
+    * Get the modified deployments.
+    * 
+    * @return the modified deployments.
+    * @throws Exception
+    */
    public Collection<ModificationInfo> getModifiedDeployments()
       throws Exception;
 
-   // Managed object attachments for a deployment
-   public void addManagedObject(String vfsPath, Attachments edits)
-      throws Exception;
-
 }

Modified: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/DeploymentRepositoryFactory.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/DeploymentRepositoryFactory.java	2009-01-13 11:51:45 UTC (rev 82800)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/DeploymentRepositoryFactory.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -21,13 +21,33 @@
  */
 package org.jboss.profileservice.spi;
 
+import org.jboss.profileservice.spi.metadata.ProfileMetaData;
+
 /**
- * A factory for DeploymentRepository
+ * A factory for DeploymentRepository.
  * 
  * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision:$
  */
 public interface DeploymentRepositoryFactory
 {
-   public DeploymentRepository getDeploymentRepository(ProfileKey key);
+   
+   /**
+    * The repository types.
+    * 
+    * @return the type.
+    */
+   String[] getTypes();
+   
+   /**
+    * Create a DeploymentRepository based on a type.
+    * 
+    * @param repositoryType the repository type.
+    * @param metaData the profile meta data.
+    * @return the deploymentRepository.
+    * @throws Exception
+    */
+   DeploymentRepository createDeploymentRepository(ProfileKey key, ProfileMetaData metaData) throws Exception;
+   
 }

Modified: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/Profile.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/Profile.java	2009-01-13 11:51:45 UTC (rev 82800)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/Profile.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -18,71 +18,55 @@
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+ */ 
 package org.jboss.profileservice.spi;
 
 import java.util.Collection;
-import java.util.Map;
 import java.util.Set;
 
+import org.jboss.dependency.spi.DependencyItem;
 import org.jboss.deployers.vfs.spi.client.VFSDeployment;
 import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.virtual.VirtualFile;
 
 /**
  * A profile represents a named collection of deployments on a server
  * 
  * @author Scott.Stark at jboss.org
  * @author adrian at jboss.org
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
 public interface Profile
 {
    /**
     * Get the key used to create the Profile
-    * @return the key used to create the Profile
+    * @return key used to create the Profile
     */
    ProfileKey getKey();
 
    /**
-    * The x.y.z version of the profile
-    * 
-    * @return the version if known, null if its unspecified.
-    */
-   String getVersion();
-
-   /**
     * Get the system time in milliseconds the profile was last modified. 
     * @return System.currentTimeMillis of last modification
     */
    long getLastModified();
-
+   
    /**
-    * Get the names of the deployments in the profile
-    * @return names of deployments
+    * Internally create the profile.
+    * 
+    * @throws Exception
     */
-   Set<String> getDeploymentNames();
+   void create() throws Exception;
 
    /**
-    * Get the names of the deployments for the given phase defined in this profile
-    * @param phase - the phase of the deployment as it relates to when the
-    * deployment is loaded
-    * @return names of deployments
+    * Internally destroy the profile.
     */
-   Set<String> getDeploymentNames(DeploymentPhase phase);
-
-   //public DeploymentInfo getDeploymentInfo(String name);
-
+   void destroy();
+   
    /**
-    * Get the root for deployments of the given phase.
-    * 
-    * @param phase the deployment phase
-    * @return the VirtualFile directory that contains deployments of the
-    * given phase.
-    * @throws Exception for any error
+    * Get the names of the deployments in the profile
+    * @return names of deployments
     */
-   VirtualFile getRootFile(DeploymentPhase phase) throws Exception;
+   Set<String> getDeploymentNames();
 
    /**
     * Add a deployment
@@ -92,7 +76,7 @@
     * deployment is loaded
     * @throws Exception for any error
     */
-   void addDeployment(VFSDeployment d, DeploymentPhase phase) throws Exception;
+   void addDeployment(VFSDeployment d) throws Exception;
    
    /**
     * Update a deployment. This can be used to save attachments, other
@@ -104,9 +88,7 @@
     * @param attachments - the attachments that have been modified
     * @throws Exception for any error
     */
-   void updateDeployment(VFSDeployment d, DeploymentPhase phase,
-         ManagedComponent comp)
-      throws Exception;
+   void updateDeployment(VFSDeployment d, ManagedComponent comp) throws Exception;
 
    /**
     * Remove a deployment
@@ -117,7 +99,7 @@
     * @return the DeploymentContext for the name if found
     * @throws Exception for any error
     */
-   VFSDeployment removeDeployment(String name, DeploymentPhase phase) throws Exception;
+   VFSDeployment removeDeployment(String name) throws Exception;
 
    /**
     * Get a named deployment.
@@ -129,17 +111,9 @@
     * @throws Exception for any error
     * @throws NoSuchDeploymentException - if there is no such bootstrap
     */
-   VFSDeployment getDeployment(String name, DeploymentPhase phase) throws Exception, NoSuchDeploymentException;
+   VFSDeployment getDeployment(String name) throws Exception, NoSuchDeploymentException;
 
    /**
-    * @param phase - the phase of the deployment as it relates to when the
-    * deployment is loaded
-    * @return the bootstrap instances in this profile.
-    * @throws Exception for any error
-    */
-   Collection<VFSDeployment> getDeployments(DeploymentPhase phase) throws Exception;
-
-   /**
     * Get all deployments defined in this profile
     * 
     * @return the deployment instances in this profile.
@@ -168,18 +142,18 @@
    void enableModifiedDeploymentChecks(boolean flag);
 
    /**
-    * Get the config
-    * 
-    * @return the config
-    */
-   Map<String, Object> getConfig();
-
-   /**
     * Checks whether a deployment context is available in the basic profile service.
     * 
     * @param    name    the name of the deployment
     * @param    phase   optionally a deployment phase, if null search all
     * @return   true if the deployment is found or false otherwise
     */
-   boolean hasDeployment(String name, DeploymentPhase phase);
+   boolean hasDeployment(String name);
+   
+   /**
+    * Get the dependencies to other profiles.
+    * 
+    * @return the dependencies.
+    */
+   Collection<DependencyItem> getDependencies();
 }

Deleted: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileConfiguration.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileConfiguration.java	2009-01-13 11:51:45 UTC (rev 82800)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileConfiguration.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.spi;
-
-/**
- * The configuration of the deployments that make up a profile 
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public interface ProfileConfiguration
-{
-   public Profile getProfile();
-}

Modified: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileKey.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileKey.java	2009-01-13 11:51:45 UTC (rev 82800)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileKey.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -135,6 +135,9 @@
    }
    public boolean equals(Object o)
    {
+      if(o instanceof ProfileKey == false)
+         return false;
+      
       return compareTo(o) == 0;
    }
    public int hashCode()
@@ -145,7 +148,9 @@
 
    public String toString()
    {
-      StringBuilder tmp = new StringBuilder(super.toString());
+      StringBuilder tmp = new StringBuilder();
+      tmp.append(getClass().getSimpleName());
+      tmp.append('@').append(Integer.toHexString(System.identityHashCode(this)));
       tmp.append('[');
       tmp.append("domain=");
       tmp.append(domain);

Modified: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileRepository.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileRepository.java	2009-01-13 11:51:45 UTC (rev 82800)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileRepository.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -24,30 +24,34 @@
 import java.io.IOException;
 import java.util.Collection;
 
+import org.jboss.profileservice.spi.metadata.ProfileMetaData;
+
 /**
  * An interface for obtaining DeploymentRepository for a Profile.
  *  
  * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision:$
  */
 public interface ProfileRepository
 {
    /**
-    * Get the keys for all known profiles
-    * @return keys for all known profiles
+    * Get the keys for all known profiles.
+    * 
+    * @return keys for all known profiles.
     */
    public Collection<ProfileKey> getProfileKeys();
 
    /**
     * Create a new DeploymentRepository for a profile.
     * 
-    * @param key - the key for the Profile to create the DeploymentRepository for.
+    * @Param key - the profile key.
+    * @param metaData - the profile meta data.
     * @return the profile DeploymentRepository
-    * @throws IOException thrown if the repository cannot be created or
-    *    already exists
+    * @throws IOException thrown if the repository cannot be created
     * @throws Exception for any error
     */
-   public DeploymentRepository createProfileDeploymentRepository(ProfileKey key)
+   public DeploymentRepository createProfileDeploymentRepository(ProfileKey key, ProfileMetaData metaData)
       throws Exception;
 
    /**
@@ -63,6 +67,7 @@
 
    /**
     * Remove the DeploymentRepository for the given profile key.
+    * 
     * @param key - the key for the Profile to obtain the DeploymentRepository for.
     * @throws IOException thrown on error removing the repository
     * @throws NoSuchProfileException thrown if there is no such profile.

Modified: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileService.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileService.java	2009-01-13 11:51:45 UTC (rev 82800)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/ProfileService.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -27,31 +27,33 @@
 import org.jboss.deployers.spi.management.deploy.DeploymentManager;
 
 /**
- * The entry point service for accessing/administiring server profiles
+ * The entry point service for accessing/administering server profiles
  *  
  * @todo this should be broken up into different feature plugin services
  * 
  * @author Scott.Stark at jboss.org
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
 public interface ProfileService
 {
-   // Querying profiles
-
+   
    /**
-    * Get the unique domains for which profiles exist
+    * Get the unique domains for which profiles exist.
+    * 
     * @return array of profile domains
     */
    public String[] getDomains();
 
    /**
-    * Get the keys for all known profiles
-    * @return keys for all known profiles
+    * Get the keys for all registered profiles.
+    * 
+    * @return keys for all registered profiles.
     */
    public Collection<ProfileKey> getProfileKeys();
 
    /**
-    * Obtain the profile for the key.
+    * Obtain the registered profile for the key.
     * 
     * @param key - the key for the profile
     * @return the matching profile.
@@ -61,24 +63,24 @@
       throws NoSuchProfileException;
 
    /**
-    * Get the active profile.
+    * Get the keys for all active profiles.
+    * 
+    * @return keys for all active profiles.
+    */
+   public Collection<ProfileKey> getActiveProfileKeys();
+   
+   /**
+    * Obtain a activated profile for the key.
+    * 
+    * @param key - the key for the profile
     * @return the active profile
     * @throws NoSuchProfileException thrown if there is no
     *    active profile 
     */
-   public Profile getActiveProfile()
+   public Profile getActiveProfile(ProfileKey key)
       throws NoSuchProfileException;
-
+   
    /**
-    * Get a list of the deployment names associated with a profile.
-    * @param key - the key for the profile
-    * @return the list of deployment names.
-    * @throws NoSuchProfileException
-    */
-   public String[] getProfileDeploymentNames(ProfileKey key)
-      throws NoSuchProfileException;
-
-   /**
     * Obtain the ManagementView plugin
     * @return the ManagementView plugin if supported
     */
@@ -89,11 +91,39 @@
     * @return the DeploymentManager plugin if supported
     */
    public DeploymentManager getDeploymentManager();
+   
+   /**
+    * Register a Profile.
+    * 
+    * @param profile the profile.
+    * @throws Exception
+    */
+   public void registerProfile(Profile profile) throws Exception;
+   
+   /**
+    * Activate a registered profile.
+    * 
+    * @param key the profile key.
+    * @throws NoSuchProfileException if the profile is not registered. 
+    * @throws Exception
+    */
+   public void activateProfile(ProfileKey key) throws NoSuchProfileException, Exception;
+   
+   /**
+    * Release the profile.
+    * 
+    * @param key the profile key.
+    * @throws NoSuchProfileException if the profile is not active.
+    */
+   public void releaseProfile(ProfileKey key) throws NoSuchProfileException;
+   
 
-   // Admin of profiles @todo could be an option plugin
-   public Profile newProfile(ProfileKey key)
-      throws Exception;
-   public void removeProfile(ProfileKey key)
-      throws Exception;
+   /**
+    * Unregister a profile.
+    * 
+    * @param profile
+    * @throws NoSuchProfileException if the profile is not registered.
+    */
+   public void unregisterProfile(Profile profile) throws NoSuchProfileException;
 
 }

Added: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileDeploymentMetaData.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileDeploymentMetaData.java	                        (rev 0)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileDeploymentMetaData.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.profileservice.spi.metadata;
+
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ProfileDeploymentMetaData
+{
+
+   /** The deployment name. */
+   private String name;
+   
+   @XmlValue
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+}
+

Added: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileMetaData.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileMetaData.java	                        (rev 0)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileMetaData.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.profileservice.spi.metadata;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ProfileMetaData
+{
+
+   /** The profile name. */
+   private String name;
+   
+   /** The server. */
+   private String server;
+   
+   /** The doamin. */
+   private String domain;
+   
+   /** The profile sources. */
+   private List<ProfileSourceMetaData> sources;
+   
+   /** The sub profiles. */
+   private List<SubProfileMetaData> subprofiles;
+   
+   /** The deployments. */
+   private List<ProfileDeploymentMetaData> deployments;
+   
+   /** TODO The dependencies. */
+   private List<Object> dependencies;
+
+   @XmlAttribute(name = "name")
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   @XmlAttribute(name = "server")
+   public String getServer()
+   {
+      return server;
+   }
+
+   public void setServer(String server)
+   {
+      this.server = server;
+   }
+
+   @XmlAttribute(name = "domain")
+   public String getDomain()
+   {
+      return domain;
+   }
+
+   public void setDomain(String domain)
+   {
+      this.domain = domain;
+   }
+
+   @XmlElement(name = "source")
+   public List<ProfileSourceMetaData> getSources()
+   {
+      return sources;
+   }
+
+   public void setSources(List<ProfileSourceMetaData> sources)
+   {
+      this.sources = sources;
+   }
+
+   @XmlElement(name = "sub-profile")
+   public List<SubProfileMetaData> getSubprofiles()
+   {
+      return subprofiles;
+   }
+
+   public void setSubprofiles(List<SubProfileMetaData> subprofiles)
+   {
+      this.subprofiles = subprofiles;
+   }
+
+   @XmlElement(name = "deployment")
+   public List<ProfileDeploymentMetaData> getDeployments()
+   {
+      return deployments;
+   }
+   
+   public void setDeployments(List<ProfileDeploymentMetaData> deployments)
+   {
+      this.deployments = deployments;
+   }
+
+   @XmlTransient
+//   @XmlElement(name = "dependency", type = String.class)
+   public List<Object> getDependencies()
+   {
+      return dependencies;
+   }
+   
+   public void setDependencies(List<Object> dependencies)
+   {
+      this.dependencies = dependencies;
+   }
+   
+}

Added: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileSourceMetaData.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileSourceMetaData.java	                        (rev 0)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfileSourceMetaData.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.profileservice.spi.metadata;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ProfileSourceMetaData
+{
+
+   /** The source type. */
+   private String type;
+   
+   /** The source. */
+   private String source;
+
+   @XmlAttribute(name = "type")
+   public String getType()
+   {
+      return type;
+   }
+
+   public void setType(String type)
+   {
+      this.type = type;
+   }
+
+   @XmlValue
+   public String getSource()
+   {
+      return source;
+   }
+
+   public void setSource(String source)
+   {
+      this.source = source;
+   }
+
+}
+

Added: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfilesMetaData.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfilesMetaData.java	                        (rev 0)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/ProfilesMetaData.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.profileservice.spi.metadata;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at XmlRootElement(name = "profiles")
+public class ProfilesMetaData
+{
+   /** The name. */
+   private String name;
+   
+   /** The server. */
+   private String server;
+   
+   /** The doamin. */
+   private String domain;
+   
+   /** The profiles. */
+   private List<ProfileMetaData> profiles;
+   
+   @XmlAttribute(name = "name")
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   @XmlAttribute(name = "server")
+   public String getServer()
+   {
+      return server;
+   }
+
+   public void setServer(String server)
+   {
+      this.server = server;
+   }
+
+   @XmlAttribute(name = "domain")
+   public String getDomain()
+   {
+      return domain;
+   }
+
+   public void setDomain(String domain)
+   {
+      this.domain = domain;
+   }
+   
+   @XmlElement(name = "profile")
+   public List<ProfileMetaData> getProfiles()
+   {
+      return profiles;
+   }
+   
+   public void setProfiles(List<ProfileMetaData> profiles)
+   {
+      this.profiles = profiles;
+   }
+   
+}
+

Added: projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/SubProfileMetaData.java
===================================================================
--- projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/SubProfileMetaData.java	                        (rev 0)
+++ projects/integration/trunk/jboss-profileservice-spi/src/main/java/org/jboss/profileservice/spi/metadata/SubProfileMetaData.java	2009-01-13 12:28:29 UTC (rev 82801)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.profileservice.spi.metadata;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class SubProfileMetaData
+{
+   
+   /** The name. */
+   private String name;
+   
+   /** The server. */
+   private String server;
+   
+   /** The doamin. */
+   private String domain;
+
+   @XmlValue
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   @XmlAttribute(name = "server")
+   public String getServer()
+   {
+      return server;
+   }
+
+   public void setServer(String server)
+   {
+      this.server = server;
+   }
+
+   @XmlAttribute(name = "domain")
+   public String getDomain()
+   {
+      return domain;
+   }
+
+   public void setDomain(String domain)
+   {
+      this.domain = domain;
+   }
+   
+}




More information about the jboss-cvs-commits mailing list