org.jboss.profileservice.spi
Interface DeploymentRepository


public interface DeploymentRepository

An interface for managing the contents of a Profile.

Version:
$Revision: 89005 $
Author:
Scott.Stark@jboss.org, adrian@jboss.org, Emanuel Muckenhuber

Method Summary
 void addDeployment(String name, ProfileDeployment deployment)
          Add a deployment.
 String addDeploymentContent(String name, InputStream contentIS)
          Upload raw deployment content to a profile repository.
 String addDeploymentContent(String name, InputStream contentIS, DeploymentOption... options)
          Upload raw deployment content to a profile repository.
 int clearDeploymentContentFlags(String name, int flags)
          Clear one or more flags for the deployment.
 void create()
          Create the repository.
 ProfileDeployment getDeployment(String name)
          Get a named deployment.
 org.jboss.virtual.VirtualFile getDeploymentContent(String name)
          Get the repository virtual file for the given deployment name.
 int getDeploymentContentFlags(String name)
          Get the status flags for the deployment path
 Set<String> getDeploymentNames()
          Get the names of all deployments in the repository
 Collection<ProfileDeployment> getDeployments()
          Get all deployments defined in this profile
 long getLastModified()
          Get the time any contents were last modified.
 Collection<ModificationInfo> getModifiedDeployments()
          Get the modified deployments.
 String[] getRepositoryNames(String... names)
          Get repository names.
 URI[] getRepositoryURIs()
          Get the uris of this repository.
 boolean hasDeploymentContentFlags(String name, int flag)
          Does a deployment content have the indicated flag.
 void load()
          Load the repository contents.
 int lockDeploymentContent(String name)
          lock deployment content and exclude it from modified deployment checks.
 void remove()
          Delete the repository.
 ProfileDeployment removeDeployment(String name)
          Remove a deployment.
 int setDeploymentContentFlags(String name, int flags)
          Set one or more flags for the deployment.
 void unload()
          Unload the repository;
 int unlockDeploymentContent(String name)
          Unlock a previously locked deployment content.
 

Method Detail

getRepositoryURIs

URI[] getRepositoryURIs()
Get the uris of this repository.

Returns:
URI[] the uris of this repository

create

void create()
            throws Exception
Create the repository.

Throws:
Exception

load

void load()
          throws Exception
Load the repository contents.

Throws:
Exception

unload

void unload()
Unload the repository;


remove

void remove()
            throws Exception
Delete the repository.

Throws:
Exception

getLastModified

long getLastModified()
Get the time any contents were last modified.

Returns:
last modified

getDeploymentNames

Set<String> getDeploymentNames()
Get the names of all deployments in the repository

Returns:
the deployment names

getRepositoryNames

String[] getRepositoryNames(String... names)
                            throws Exception
Get repository names.

Parameters:
names - the names
Returns:
the matching repository names
Throws:
Exception - for any error

addDeploymentContent

String addDeploymentContent(String name,
                            InputStream contentIS)
                            throws IOException
Upload raw deployment content to a profile repository. This does not make the deployment available to getDeployments or getModifiedDeployments

Parameters:
name - - the full vfs path of the deployment
contentIS - - the input stream for the deployment contents
Returns:
the unique name of the deployment in the repository
Throws:
IOException

addDeploymentContent

String addDeploymentContent(String name,
                            InputStream contentIS,
                            DeploymentOption... options)
                            throws IOException
Upload raw deployment content to a profile repository. This does not make the deployment available to getDeployments or getModifiedDeployments

Parameters:
name - - the full vfs path of the deployment
contentIS - - the input stream for the deployment contents
options - - optional deployment options
Returns:
the unique name of the deployment in the repository
Throws:
IOException

getDeploymentContent

org.jboss.virtual.VirtualFile getDeploymentContent(String name)
                                                   throws IOException,
                                                          URISyntaxException
Get the repository virtual file for the given deployment name.

Parameters:
name - - the unique virtual file URI name as returned by addDeploymentContent
Returns:
the deployment content virtual file
Throws:
IOException - for any error
URISyntaxException

lockDeploymentContent

int lockDeploymentContent(String name)
lock deployment content and exclude it from modified deployment checks.

Parameters:
name - - the full vfs path of the deployment
Returns:
the deployment content flags, DeploymentContentFlags

unlockDeploymentContent

int unlockDeploymentContent(String name)
Unlock a previously locked deployment content.

Parameters:
name - - the full vfs path of the deployment
Returns:
the deployment content flags, DeploymentContentFlags

getDeploymentContentFlags

int getDeploymentContentFlags(String name)
Get the status flags for the deployment path

Parameters:
name - - the full vfs path of the deployment
Returns:
the deployment content flags, DeploymentContentFlags

setDeploymentContentFlags

int setDeploymentContentFlags(String name,
                              int flags)
Set one or more flags for the deployment.

Parameters:
name - - the full vfs path of the deployment
flags - - the deployment content flags, DeploymentContentFlags
See Also:
#clearDeploymentContentFlags(String)

clearDeploymentContentFlags

int clearDeploymentContentFlags(String name,
                                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.

Parameters:
name - - the full vfs path of the deployment
flags - - the deployment content flags, DeploymentContentFlags

hasDeploymentContentFlags

boolean hasDeploymentContentFlags(String name,
                                  int flag)
Does a deployment content have the indicated flag.

Parameters:
name - - the full vfs path of the deployment
flags - - the deployment content flags, DeploymentContentFlags
Returns:
true if the content flags contains the flag, false otherwise.

addDeployment

void addDeployment(String name,
                   ProfileDeployment deployment)
                   throws Exception
Add a deployment.

Parameters:
name - - the name of the deployment
deployment - the deployment
Throws:
Exception - for any error

getDeployment

ProfileDeployment getDeployment(String name)
                                throws NoSuchDeploymentException
Get a named deployment.

Parameters:
name - - the deployment name
Returns:
the deployment
Throws:
NoSuchDeploymentException - - if there is no such deployment

removeDeployment

ProfileDeployment removeDeployment(String name)
                                   throws Exception
Remove a deployment.

Parameters:
name - - the name of the deployment
Returns:
the removed deployment
Throws:
Exception - for any error

getDeployments

Collection<ProfileDeployment> getDeployments()
Get all deployments defined in this profile

Returns:
the deployment instances in this profile

getModifiedDeployments

Collection<ModificationInfo> getModifiedDeployments()
                                                    throws Exception
Get the modified deployments.

Returns:
the modified deployments, empty if there are no modifications or hot deployment is not supported.
Throws:
Exception - for any error


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.