org.glassfish.deployment.client
Interface DeploymentFacility

All Known Implementing Classes:
AbstractDeploymentFacility, RemoteDeploymentFacility

public interface DeploymentFacility

This interface defines basic deployment related facilities such as deploying any j2ee modules on a Domain Admin Server or target servers as well as retrieving non portable artifacts for successful runs in a client mode configuration.

Author:
Jerome Dochez

Field Summary
static String STUBS_JARFILENAME
           
 
Method Summary
 TargetModuleID[] _listAppRefs(String[] targets)
          list all application refs that are present in the provided list of targets
 TargetModuleID[] _listAppRefs(String[] targets, String state)
          list all application refs that are present in the provided list of targets with the specified state
 TargetModuleID[] _listAppRefs(String[] targets, String state, String type)
          list all application refs that are present in the provided list of targets with the specified state and specified type
 TargetModuleID[] _listAppRefs(Target[] targets, String state, String type)
          list all application refs that are present in the provided list of targets with the specified state and specified type
 boolean connect(ServerConnectionIdentifier targetDAS)
          Connects to a particular instance of the domain adminstration server using the provided connection information
 DFProgressObject createAppRef(Target[] targets, String moduleID, Map options)
          Add an application ref on the selected targets
 Target[] createTargets(String[] targets)
          Creates an array of Target objects corresponding to the list of target names.
 DFProgressObject deleteAppRef(Target[] targets, String moduleID, Map options)
          remove the application ref for the provided list of targets.
 DFProgressObject deploy(Target[] targets, ReadableArchive source, ReadableArchive deploymentPlan, Map deploymentOptions)
           
 DFProgressObject deploy(Target[] targets, URI source, URI deploymentPlan, Map deploymentOptions)
          Initiates a deployment operation on the server, using a source archive abstraction and an optional deployment plan if the server specific information is not embedded in the source archive.
 DFProgressObject disable(Target[] targets, String moduleID)
          Disables a deployed component on the provided list of targets
 boolean disconnect()
          Disconnects from a domain administration server and releases all associated resouces.
 String downloadFile(File location, String moduleID, String moduleURI)
          Downloads a particular file from the server repository.
 DFProgressObject enable(Target[] targets, String moduleID)
          Enables a deployed component on the provided list of targets.
 void getClientStubs(String location, String moduleID)
          Downloads the client stubs from the server repository.
 String getContextRoot(String moduleName)
          Get context root for the module
 HostAndPort getHostAndPort(String target)
          get the host and port information
 HostAndPort getHostAndPort(String target, boolean securityEnabled)
          get the host and port information with security enabled attribute
 HostAndPort getHostAndPort(String target, String modID, boolean securityEnabled)
          get the host and port information with the specified module id and security enabled attribute
 ModuleType getModuleType(String moduleName)
          Get module type for the module
 List<String> getSubModuleInfoForJ2EEApplication(String appName)
          Get sub module info for ear
 HostAndPort getVirtualServerHostAndPort(String target, String virtualServer, boolean securityEnabled)
          get the host and port information with the specified virtual server and security enabled attribute
 boolean isConnected()
           
 TargetModuleID[] listAppRefs(String[] targets)
          list all application refs that are present in the provided list of targets
 Target[] listReferencedTargets(String appName)
          list the referenced targets for application
 Target[] listTargets()
          list all targets
 DFProgressObject undeploy(Target[] targets, String moduleID)
           
 DFProgressObject undeploy(Target[] targets, String moduleID, Map options)
          Initiates an undeployment operation of the specified module affecting the selected targets.
 DFDeploymentStatus waitFor(DFProgressObject po)
          Wait for a progress object to be in a completed state (sucessful or failed) and return the DeploymentStatus for this progress object.
 

Field Detail

STUBS_JARFILENAME

static final String STUBS_JARFILENAME
See Also:
Constant Field Values
Method Detail

connect

boolean connect(ServerConnectionIdentifier targetDAS)
Connects to a particular instance of the domain adminstration server using the provided connection information

Most other methods require that connect be invoked first.

Parameters:
targetDAS - the ServerConnectionIdentifier that specifies which DAS to connect to
Returns:
whether or not the connection attempt succeeded

isConnected

boolean isConnected()
Returns:
true if we are connected to a domain adminstration server

disconnect

boolean disconnect()
Disconnects from a domain administration server and releases all associated resouces.


deploy

DFProgressObject deploy(Target[] targets,
                        URI source,
                        URI deploymentPlan,
                        Map deploymentOptions)
Initiates a deployment operation on the server, using a source archive abstraction and an optional deployment plan if the server specific information is not embedded in the source archive. The deploymentOptions is a key-value pair map of deployment options for this operation.

Once the deployment is successful, the TargetModuleID objects representing where the application now resides are available using the ProgressObject.getResultTargetModuleIDs() method.

Parameters:
targets - the Target objects to which to deploy the application - an empty array indicates a request to deploy to the default server
source - URI to the Java EE module abstraction (with or without the server specific artifacts).
deploymentPlan - URI to the optional deployment plan if the source archive is portable.
deploymentOptions - deployment options
Returns:
a DFProgressObject to receive deployment events and status
Throws:
IllegalStateException - if the client has not invoked connect yet

deploy

DFProgressObject deploy(Target[] targets,
                        ReadableArchive source,
                        ReadableArchive deploymentPlan,
                        Map deploymentOptions)
                        throws IOException
Throws:
IOException

undeploy

DFProgressObject undeploy(Target[] targets,
                          String moduleID)

undeploy

DFProgressObject undeploy(Target[] targets,
                          String moduleID,
                          Map options)
Initiates an undeployment operation of the specified module affecting the selected targets.

After the undeployment operation completes successfully use the ProgressObject.getResultTargetModuleIDs() method to retrieve the TargetModuleID objects representing the targets from which the module has been undeployed.

Parameters:
targets - the Target objects indicating which targets from which to undeploy the application; an empty targets array is a request to undeploy from the default server
moduleID - identifies the module to undeploy
Returns:
a DFProgressObject to receive undeployment events and completion status
Throws:
IllegalStateException - if the deployment facility has not been connected to the back-end

enable

DFProgressObject enable(Target[] targets,
                        String moduleID)
Enables a deployed component on the provided list of targets.


disable

DFProgressObject disable(Target[] targets,
                         String moduleID)
Disables a deployed component on the provided list of targets


createAppRef

DFProgressObject createAppRef(Target[] targets,
                              String moduleID,
                              Map options)
Add an application ref on the selected targets


deleteAppRef

DFProgressObject deleteAppRef(Target[] targets,
                              String moduleID,
                              Map options)
remove the application ref for the provided list of targets.


getHostAndPort

HostAndPort getHostAndPort(String target)
                           throws IOException
get the host and port information

Throws:
IOException

getHostAndPort

HostAndPort getHostAndPort(String target,
                           boolean securityEnabled)
                           throws IOException
get the host and port information with security enabled attribute

Throws:
IOException

getVirtualServerHostAndPort

HostAndPort getVirtualServerHostAndPort(String target,
                                        String virtualServer,
                                        boolean securityEnabled)
                                        throws IOException
get the host and port information with the specified virtual server and security enabled attribute

Throws:
IOException

getHostAndPort

HostAndPort getHostAndPort(String target,
                           String modID,
                           boolean securityEnabled)
                           throws IOException
get the host and port information with the specified module id and security enabled attribute

Throws:
IOException

listAppRefs

TargetModuleID[] listAppRefs(String[] targets)
                             throws IOException
list all application refs that are present in the provided list of targets

Throws:
IOException

_listAppRefs

TargetModuleID[] _listAppRefs(String[] targets)
                              throws IOException
list all application refs that are present in the provided list of targets

Throws:
IOException

_listAppRefs

TargetModuleID[] _listAppRefs(String[] targets,
                              String state)
                              throws IOException
list all application refs that are present in the provided list of targets with the specified state

Throws:
IOException

_listAppRefs

TargetModuleID[] _listAppRefs(String[] targets,
                              String state,
                              String type)
                              throws IOException
list all application refs that are present in the provided list of targets with the specified state and specified type

Throws:
IOException

_listAppRefs

TargetModuleID[] _listAppRefs(Target[] targets,
                              String state,
                              String type)
                              throws IOException
list all application refs that are present in the provided list of targets with the specified state and specified type

Throws:
IOException

getSubModuleInfoForJ2EEApplication

List<String> getSubModuleInfoForJ2EEApplication(String appName)
                                                throws IOException
Get sub module info for ear

Throws:
IOException

getContextRoot

String getContextRoot(String moduleName)
                      throws IOException
Get context root for the module

Throws:
IOException

getModuleType

ModuleType getModuleType(String moduleName)
                         throws IOException
Get module type for the module

Throws:
IOException

listTargets

Target[] listTargets()
                     throws IOException
list all targets

Throws:
IOException

listReferencedTargets

Target[] listReferencedTargets(String appName)
                               throws IOException
list the referenced targets for application

Throws:
IOException

downloadFile

String downloadFile(File location,
                    String moduleID,
                    String moduleURI)
                    throws IOException
Downloads a particular file from the server repository. The filePath is a relative path from the root directory of the deployed component identified with the moduleID parameter. The resulting downloaded file should be placed in the location directory keeping the relative path constraint.

Parameters:
location - is the root directory where to place the downloaded file
moduleID - is the moduleID of the deployed component to download the file from
moduleURI - is the relative path to the file in the repository or STUBS_JARFILENAME to download the appclient jar file.
Returns:
the downloaded local file absolute path.
Throws:
IOException

getClientStubs

void getClientStubs(String location,
                    String moduleID)
                    throws IOException
Downloads the client stubs from the server repository.

Parameters:
location - is the root path where to place the downloaded stubs
moduleID - is the moduleID of the deployed component to download the stubs for
Throws:
IOException

waitFor

DFDeploymentStatus waitFor(DFProgressObject po)
Wait for a progress object to be in a completed state (sucessful or failed) and return the DeploymentStatus for this progress object.

Parameters:
the - progress object to wait for completion
Returns:
the deployment status

createTargets

Target[] createTargets(String[] targets)
Creates an array of Target objects corresponding to the list of target names.

Parameters:
targets - the names of the targets of interest
Returns:
an array of Target objects for the selected target names


Copyright © 2012. All Rights Reserved.