001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU General
007: * Public License Version 2 only ("GPL") or the Common Development and Distribution
008: * License("CDDL") (collectively, the "License"). You may not use this file except in
009: * compliance with the License. You can obtain a copy of the License at
010: * http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the
011: * License for the specific language governing permissions and limitations under the
012: * License. When distributing the software, include this License Header Notice in
013: * each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP. Sun
014: * designates this particular file as subject to the "Classpath" exception as
015: * provided by Sun in the GPL Version 2 section of the License file that
016: * accompanied this code. If applicable, add the following below the License Header,
017: * with the fields enclosed by brackets [] replaced by your own identifying
018: * information: "Portions Copyrighted [year] [name of copyright owner]"
019: *
020: * Contributor(s):
021: *
022: * The Original Software is NetBeans. The Initial Developer of the Original Software
023: * is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun Microsystems, Inc. All
024: * Rights Reserved.
025: *
026: * If you wish your version of this file to be governed by only the CDDL or only the
027: * GPL Version 2, indicate your decision by adding "[Contributor] elects to include
028: * this software in this distribution under the [CDDL or GPL Version 2] license." If
029: * you do not indicate a single choice of license, a recipient has the option to
030: * distribute your version of this file under either the CDDL, the GPL Version 2 or
031: * to extend the choice of license to its licensees as provided above. However, if
032: * you add GPL Version 2 code and therefore, elected the GPL Version 2 license, then
033: * the option applies only if the new code is made subject to such option by the
034: * copyright holder.
035: */
036:
037: package org.netbeans.installer.infra.server.ejb;
038:
039: import java.io.File;
040: import java.util.List;
041: import javax.ejb.Local;
042: import org.netbeans.installer.product.Registry;
043: import org.netbeans.installer.product.components.Product;
044: import org.netbeans.installer.utils.helper.Platform;
045:
046: /**
047: * This is the business interface for RegistryManager enterprise bean.
048: */
049: @Local
050: public interface Manager {
051: /////////////////////////////////////////////////////////////////////////////////
052: // Constants
053: public static final File ROOT = new File("D:/temp/nbi-server/dev");
054: public static final File TEMP = new File(ROOT, "temp");
055: public static final File REGISTRIES = new File(ROOT, "registries");
056: public static final File UPLOADS = new File(TEMP, "uploads");
057: public static final File BUNDLES = new File(TEMP, "bundles");
058: public static final File EXPORTED = new File(TEMP, "exported");
059: public static final File NBI = new File(TEMP, ".nbi");
060:
061: public static final File REGISTRIES_LIST = new File(ROOT,
062: "registries.list");
063: public static final File ENGINE = new File(ROOT, "nbi-engine.jar");
064:
065: public static final String PRODUCTS = "products";
066: public static final String GROUPS = "groups";
067: public static final String REGISTRY_XML = "registry.xml";
068:
069: public static final String JNLP_STUB = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
070: + "<jnlp spec=\"1.0+\" codebase=\"{0}\" href=\"{1}\">\n"
071: + " <information>\n"
072: + " <title>NetBeans Installer</title>\n"
073: + " <vendor>Sun Microsystems, Inc.</vendor>\n"
074: + " <description>NetBeans Installer Engine</description>\n"
075: + " <description kind=\"short\">NetBeans Installer Engine</description>\n"
076: + " </information>\n"
077: + " <security>\n"
078: + " <all-permissions/>\n"
079: + " </security>\n"
080: + " <resources>\n"
081: + " <j2se version=\"1.5+\"/>\n"
082: + " <j2se version=\"1.6+\"/>\n"
083: + " <j2se version=\"1.6.0-rc\"/>\n"
084: + " <j2se version=\"1.6.0-ea\"/>\n"
085: + " <j2se version=\"1.6.0-beta\"/>\n"
086: + " <j2se version=\"1.6.0-beta2\"/>\n"
087: + " <jar href=\"{2}\"/>\n"
088: + " <property name=\"nbi.product.remote.registries\" value=\"{3}\"/>\n"
089: + " <property name=\"nbi.product.suggest.install\" value=\"true\"/>\n"
090: + " </resources>\n"
091: + " <application-desc main-class=\"org.netbeans.installer.Installer\"/>\n"
092: + "</jnlp>";
093:
094: // registry operations //////////////////////////////////////////////////////////
095: void addRegistry(String registry) throws ManagerException;
096:
097: void removeRegistry(String registry) throws ManagerException;
098:
099: String getRegistry(String name) throws ManagerException;
100:
101: List<String> getRegistries() throws ManagerException;
102:
103: // engine operations ////////////////////////////////////////////////////////////
104: File getEngine() throws ManagerException;
105:
106: void updateEngine(File engine) throws ManagerException;
107:
108: // components operations ////////////////////////////////////////////////////////
109: void addPackage(String name, File archive, String parentUid,
110: String parentVersion, String parentPlatforms,
111: String uriPrefix) throws ManagerException;
112:
113: void removeProduct(String name, String uid, String version,
114: String platforms) throws ManagerException;
115:
116: void removeGroup(String name, String uid) throws ManagerException;
117:
118: // miscellanea //////////////////////////////////////////////////////////////////
119: File exportRegistries(String[] registryNames, String codebase)
120: throws ManagerException;
121:
122: String getJnlp(String[] registryNames, String codebase)
123: throws ManagerException;
124:
125: File getFile(String name, String file) throws ManagerException;
126:
127: Registry loadRegistry(String... names) throws ManagerException;
128:
129: List<Product> getProducts(String... names) throws ManagerException;
130:
131: File createBundle(Platform platform, String[] names,
132: String[] components) throws ManagerException;
133:
134: void deleteBundles() throws ManagerException;
135:
136: void generateBundles(String[] names) throws ManagerException;
137: }
|