Package 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
Fields Modifier and Type Field Description static String
STUBS_JARFILENAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.enterprise.deploy.spi.TargetModuleID[]
_listAppRefs(String[] targets)
list all application refs that are present in the provided list of targetsjavax.enterprise.deploy.spi.TargetModuleID[]
_listAppRefs(String[] targets, String state)
list all application refs that are present in the provided list of targets with the specified statejavax.enterprise.deploy.spi.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 typejavax.enterprise.deploy.spi.TargetModuleID[]
_listAppRefs(javax.enterprise.deploy.spi.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 typeboolean
connect(ServerConnectionIdentifier targetDAS)
Connects to a particular instance of the domain adminstration server using the provided connection informationDFProgressObject
createAppRef(javax.enterprise.deploy.spi.Target[] targets, String moduleID, Map options)
Add an application ref on the selected targetsjavax.enterprise.deploy.spi.Target[]
createTargets(String[] targets)
Creates an array of Target objects corresponding to the list of target names.DFProgressObject
deleteAppRef(javax.enterprise.deploy.spi.Target[] targets, String moduleID, Map options)
remove the application ref for the provided list of targets.DFProgressObject
deploy(javax.enterprise.deploy.spi.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
deploy(javax.enterprise.deploy.spi.Target[] targets, ReadableArchive source, ReadableArchive deploymentPlan, Map deploymentOptions)
DFProgressObject
disable(javax.enterprise.deploy.spi.Target[] targets, String moduleID)
Disables a deployed component on the provided list of targetsboolean
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(javax.enterprise.deploy.spi.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 moduleHostAndPort
getHostAndPort(String target)
get the host and port informationHostAndPort
getHostAndPort(String target, boolean securityEnabled)
get the host and port information with security enabled attributeHostAndPort
getHostAndPort(String target, String modID, boolean securityEnabled)
get the host and port information with the specified module id and security enabled attributejavax.enterprise.deploy.shared.ModuleType
getModuleType(String moduleName)
Get module type for the moduleList<String>
getSubModuleInfoForJ2EEApplication(String appName)
Get sub module info for earHostAndPort
getVirtualServerHostAndPort(String target, String virtualServer, boolean securityEnabled)
get the host and port information with the specified virtual server and security enabled attributeboolean
isConnected()
javax.enterprise.deploy.spi.TargetModuleID[]
listAppRefs(String[] targets)
list all application refs that are present in the provided list of targetsjavax.enterprise.deploy.spi.Target[]
listReferencedTargets(String appName)
list the referenced targets for applicationjavax.enterprise.deploy.spi.Target[]
listTargets()
list all targetsDFProgressObject
undeploy(javax.enterprise.deploy.spi.Target[] targets, String moduleID)
DFProgressObject
undeploy(javax.enterprise.deploy.spi.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 informationMost other methods require that connect be invoked first.
- Parameters:
targetDAS
- theServerConnectionIdentifier
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(javax.enterprise.deploy.spi.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 serversource
- 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(javax.enterprise.deploy.spi.Target[] targets, ReadableArchive source, ReadableArchive deploymentPlan, Map deploymentOptions) throws IOException
- Throws:
IOException
-
undeploy
DFProgressObject undeploy(javax.enterprise.deploy.spi.Target[] targets, String moduleID)
-
undeploy
DFProgressObject undeploy(javax.enterprise.deploy.spi.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 servermoduleID
- 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(javax.enterprise.deploy.spi.Target[] targets, String moduleID)
Enables a deployed component on the provided list of targets.
-
disable
DFProgressObject disable(javax.enterprise.deploy.spi.Target[] targets, String moduleID)
Disables a deployed component on the provided list of targets
-
createAppRef
DFProgressObject createAppRef(javax.enterprise.deploy.spi.Target[] targets, String moduleID, Map options)
Add an application ref on the selected targets
-
deleteAppRef
DFProgressObject deleteAppRef(javax.enterprise.deploy.spi.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
javax.enterprise.deploy.spi.TargetModuleID[] listAppRefs(String[] targets) throws IOException
list all application refs that are present in the provided list of targets- Throws:
IOException
-
_listAppRefs
javax.enterprise.deploy.spi.TargetModuleID[] _listAppRefs(String[] targets) throws IOException
list all application refs that are present in the provided list of targets- Throws:
IOException
-
_listAppRefs
javax.enterprise.deploy.spi.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
javax.enterprise.deploy.spi.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
javax.enterprise.deploy.spi.TargetModuleID[] _listAppRefs(javax.enterprise.deploy.spi.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
javax.enterprise.deploy.shared.ModuleType getModuleType(String moduleName) throws IOException
Get module type for the module- Throws:
IOException
-
listTargets
javax.enterprise.deploy.spi.Target[] listTargets() throws IOException
list all targets- Throws:
IOException
-
listReferencedTargets
javax.enterprise.deploy.spi.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 filemoduleID
- is the moduleID of the deployed component to download the file frommoduleURI
- 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 stubsmoduleID
- 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
javax.enterprise.deploy.spi.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
-
-