KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > client > DeploymentFacility


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.deployment.client;
25
26 import java.util.Map JavaDoc;
27 import java.net.URL JavaDoc;
28 import java.io.File JavaDoc;
29 import java.io.IOException JavaDoc;
30 import com.sun.enterprise.deployment.deploy.shared.Archive;
31
32 import javax.enterprise.deploy.spi.status.ProgressObject JavaDoc;
33 import javax.enterprise.deploy.spi.Target JavaDoc;
34 import javax.enterprise.deploy.spi.TargetModuleID JavaDoc;
35
36 import com.sun.enterprise.deployment.backend.DeploymentStatus;
37
38 /**
39  * This interface defines basic deployment related facilities
40  * such as deploying any j2ee modules on a Domain Admin Server
41  * or target servers as well as retrieving non portable artifacts
42  * for successful runs in a client mode configuration.
43  *
44  * @author Jerome Dochez
45  */

46 public interface DeploymentFacility {
47
48     final static String JavaDoc STUBS_JARFILENAME = "clientstubs.jar";
49     
50     /**
51      * Connects to a particular instance of the domain adminstration
52      * server using the provided connection information
53      */

54     public boolean connect(ServerConnectionIdentifier targetDAS);
55     
56     /**
57      * @return true if we are connected to a domain adminstration
58      * server
59      */

60     public boolean isConnected();
61     
62     /**
63      * Disconnects from a domain administration server and releases
64      * all associated resouces.
65      */

66     public boolean disconnect();
67         
68     /**
69      * Initiates a deployment operation on the server, using a source
70      * archive abstraction and an optional deployment plan if the
71      * server specific information is not embedded in the source
72      * archive. The deploymentOptions is a key-value pair map of
73      * deployment options for this operations. Once the deployment
74      * is successful, the targets server instances
75      *
76      * @param source is the j2ee module abstraction (with or without
77      * the server specific artifacts).
78      * @param deploymenPlan is the optional deployment plan is the source
79      * archive is portable.
80      * @param the deployment options
81      * @return a JESProgressObject to receive deployment events.
82      */

83     public JESProgressObject deploy(Target JavaDoc[] targets, Archive source,
84         Archive deploymentPlan, Map JavaDoc deploymentOptions);
85     
86     /**
87      * Initiates a undeployment operation on the server
88      * @param module ID for the component to undeploy
89      * @return a JESProgress to receive undeployment events
90      */

91     // FIXME : This will go once admin-cli changes its code
92
public JESProgressObject undeploy(Target JavaDoc[] targets, String JavaDoc moduleID);
93
94     public JESProgressObject undeploy(Target JavaDoc[] targets, String JavaDoc moduleID, Map JavaDoc options);
95     
96     /**
97      * Enables a deployed component on the provided list of targets.
98      */

99     public JESProgressObject enable(Target JavaDoc[] targets, String JavaDoc moduleID);
100
101     /**
102      * Disables a deployed component on the provided list of targets
103      */

104     public JESProgressObject disable(Target JavaDoc[] targets, String JavaDoc moduleID);
105     
106     /**
107      * Add an application ref on the selected targets
108      */

109     public JESProgressObject createAppRef(Target JavaDoc[] targets, String JavaDoc moduleID, Map JavaDoc options);
110
111     /**
112      * remove the application ref for the provided list of targets.
113      */

114     public JESProgressObject deleteAppRef(Target JavaDoc[] targets, String JavaDoc moduleID, Map JavaDoc options);
115
116     /**
117      * list all application refs that are present in the provided list of targets
118      */

119     public TargetModuleID JavaDoc[] listAppRefs(String JavaDoc[] targets) throws IOException JavaDoc;
120     
121     /**
122      * Downloads a particular file from the server repository.
123      * The filePath is a relative path from the root directory of the
124      * deployed component identified with the moduleID parameter.
125      * The resulting downloaded file should be placed in the
126      * location directory keeping the relative path constraint.
127      *
128      * @param location is the root directory where to place the
129      * downloaded file
130      * @param moduleID is the moduleID of the deployed component
131      * to download the file from
132      * @param moduleURI is the relative path to the file in the repository
133      * or STUBS_JARFILENAME to download the appclient jar file.
134      * @return the downloaded local file absolute path.
135      */

136     public String JavaDoc downloadFile(File JavaDoc location, String JavaDoc moduleID,
137             String JavaDoc moduleURI) throws IOException JavaDoc;
138     
139     /**
140      * Wait for a progress object to be in a completed state
141      * (sucessful or failed) and return the DeploymentStatus for
142      * this progress object.
143      * @param the progress object to wait for completion
144      * @return the deployment status
145      */

146     public DeploymentStatus waitFor(JESProgressObject po);
147      
148     public Target JavaDoc[] createTargets(String JavaDoc[] targets );
149     
150 }
151
Popular Tags