org.ow2.bonita.facade.impl
Class DeployerAPIImpl

java.lang.Object
  extended by org.ow2.bonita.facade.impl.DeployerAPIImpl
All Implemented Interfaces:
DeployerAPI

public class DeployerAPIImpl
extends java.lang.Object
implements DeployerAPI

Author:
Marc Blachon, Guillaume Porcher, Charles Souillard, Miguel Valdes, Pierre Vigneras

Constructor Summary
DeployerAPIImpl()
           
 
Method Summary
 org.ow2.bonita.deployment.PackageKey deploy(org.ow2.bonita.deployment.Deployment deployment)
          To deploy the package giving the deployment object.
 org.ow2.bonita.deployment.PackageKey deployBar(byte[] barFile)
          To deploy the package giving the bytes table of the bar file.
 org.ow2.bonita.deployment.PackageKey deployBar(java.io.File barFile)
          To deploy the package giving the file of the bar file.
 org.ow2.bonita.deployment.PackageKey deployBar(java.io.InputStream barFileInputStream)
          To deploy the package giving the input stream of the bar file.
 org.ow2.bonita.deployment.PackageKey deployBar(java.net.URL barFile)
          To deploy the package giving the URL of the bar file.
 void deployClass(java.lang.String className, byte[] clazz)
          To deploy a class giving its bytes table.
 void deployClasses(java.util.Map<java.lang.String,byte[]> classes)
          To deploy several classes giving a map of classes.
 void deployClassesInJar(byte[] classesArchive)
          To deploy several classes giving an archive containing the classes.
 void removeClass(java.lang.String className)
          To remove a class giving the class name.
 void removeClasses(java.lang.String... classNames)
          To remove classes giving the class names.
 void undeploy(java.lang.String packageId)
          To undeploy a package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeployerAPIImpl

public DeployerAPIImpl()
Method Detail

deploy

public org.ow2.bonita.deployment.PackageKey deploy(org.ow2.bonita.deployment.Deployment deployment)
Description copied from interface: DeployerAPI
To deploy the package giving the deployment object.

Specified by:
deploy in interface DeployerAPI
Parameters:
deployment - the deployment object that should contain the xpdl file and the map of required.
Returns:
PackageKey the package key.

deployBar

public org.ow2.bonita.deployment.PackageKey deployBar(java.io.InputStream barFileInputStream)
                                               throws DeploymentException
Description copied from interface: DeployerAPI
To deploy the package giving the input stream of the bar file.

Specified by:
deployBar in interface DeployerAPI
Parameters:
barFileInputStream - the input stream of the bar file.
Returns:
PackageKey the package key.
Throws:
DeploymentException - if an IO exception is thrown.

deployBar

public org.ow2.bonita.deployment.PackageKey deployBar(java.net.URL barFile)
                                               throws DeploymentException
Description copied from interface: DeployerAPI
To deploy the package giving the URL of the bar file.

Specified by:
deployBar in interface DeployerAPI
Parameters:
barFile - the URL of the bar file.
Returns:
PackageKey the package key.
Throws:
DeploymentException - if an IO exception is thrown.

deployBar

public org.ow2.bonita.deployment.PackageKey deployBar(java.io.File barFile)
                                               throws DeploymentException
Description copied from interface: DeployerAPI
To deploy the package giving the file of the bar file.

Specified by:
deployBar in interface DeployerAPI
Parameters:
barFile - the file of the barfile.
Returns:
PackageKey the package key.
Throws:
DeploymentException - if the archive file is not found.

deployBar

public org.ow2.bonita.deployment.PackageKey deployBar(byte[] barFile)
                                               throws DeploymentException
Description copied from interface: DeployerAPI
To deploy the package giving the bytes table of the bar file.

Specified by:
deployBar in interface DeployerAPI
Parameters:
barFile - the bytes table of the bar file.
Returns:
PackageKey the package key.
Throws:
DeploymentException - if either the xpdl file does not exist or is not unique or a malformed URL has occurred.

deployClass

public void deployClass(java.lang.String className,
                        byte[] clazz)
                 throws DeploymentException
Description copied from interface: DeployerAPI
To deploy a class giving its bytes table.

Specified by:
deployClass in interface DeployerAPI
Parameters:
className - the name of the class.
clazz - the bytes table of the class.
Throws:
DeploymentException - if there is already a deployed class with this name.

deployClassesInJar

public void deployClassesInJar(byte[] classesArchive)
                        throws DeploymentException
Description copied from interface: DeployerAPI
To deploy several classes giving an archive containing the classes.

Specified by:
deployClassesInJar in interface DeployerAPI
Parameters:
classesArchive - the archives containing the classes.
Throws:
DeploymentException - if there is already a deployed class with this name or there's an IOException occurs.

deployClasses

public void deployClasses(java.util.Map<java.lang.String,byte[]> classes)
                   throws DeploymentException
Description copied from interface: DeployerAPI
To deploy several classes giving a map of classes.

Specified by:
deployClasses in interface DeployerAPI
Parameters:
classes - a map of key-value where key is the name of the class and value is the bytes table.
Throws:
DeploymentException - if there is already a deployed class with the name

undeploy

public void undeploy(java.lang.String packageId)
Description copied from interface: DeployerAPI
To undeploy a package.

Specified by:
undeploy in interface DeployerAPI
Parameters:
packageId - the package id.

removeClass

public void removeClass(java.lang.String className)
                 throws DeploymentException
Description copied from interface: DeployerAPI
To remove a class giving the class name.

Specified by:
removeClass in interface DeployerAPI
Parameters:
className - the name of the class.
Throws:
DeploymentException - if there's no class defined in global class repository with this name or a package is still using global class.

removeClasses

public void removeClasses(java.lang.String... classNames)
                   throws DeploymentException
Description copied from interface: DeployerAPI
To remove classes giving the class names.

Specified by:
removeClasses in interface DeployerAPI
Parameters:
classNames - the class names.
Throws:
DeploymentException - if there's no class defined in global class repository with this name or a package is still using global class.