KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > upgrade > common > CommonProperties


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.tools.upgrade.common;
25
26 import java.util.*;
27
28 /**
29  *
30  * author : Gautam Borah
31  *
32  */

33
34 public class CommonProperties{
35     
36     private static final String JavaDoc TRANSFORMATION_MODULE = "com.sun.enterprise.tools.upgrade.transform.TransformManager";
37     private static final String JavaDoc NSS_TO_JKS_MODULE = "com.sun.enterprise.tools.upgrade.certconversion.NSStoJKSConversionModule";
38     private static final String JavaDoc JKS_TO_JKS_MODULE = "com.sun.enterprise.tools.upgrade.certconversion.JKStoJKSConversionModule";
39     private static final String JavaDoc NSS_TO_NSS_MODULE = "com.sun.enterprise.tools.upgrade.certconversion.NSStoNSSConversionModule";
40     private static final String JavaDoc JKS_TO_NSS_MODULE = "com.sun.enterprise.tools.upgrade.certconversion.JKStoNSSConversionModule";
41     private static final String JavaDoc REALM_MODULE = "com.sun.enterprise.tools.upgrade.realm.RealmUpgrade";
42     private static final String JavaDoc DEPLOYMENT_MODULE = "com.sun.enterprise.tools.upgrade.deployment.DeploymentUpgrade";
43     private static final String JavaDoc MISC_MODULE = "com.sun.enterprise.tools.upgrade.miscconfig.ConfigTransfers";
44     
45     /*
46       Add your module to the linked list by calling add() method. Please make sure you maintain the order
47      */

48     
49     public static List getRegisteredModules(CommonInfoModel model){
50         List list = new LinkedList();
51         list.add(TRANSFORMATION_MODULE);
52         
53         if(model.getCertificateConversionFlag()){
54             if (model.getTargetEdition().equals(UpgradeConstants.EDITION_PE)){
55                 if (model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_PE) ||
56                     model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_SE) ||
57                     model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_EE) ||
58                     model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS81_EE)) {
59                     list.add(NSS_TO_JKS_MODULE);
60                 } else if (model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS80_PE) ||
61                            model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS81_PE)) {
62                     list.add(JKS_TO_JKS_MODULE);
63                 }
64             } else if (model.getTargetEdition().equals(UpgradeConstants.EDITION_EE) ||
65                        model.getTargetEdition().equals(UpgradeConstants.EDITION_SE)){
66                 if (model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_PE) ||
67                     model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_SE) ||
68                     model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS7X_EE) ||
69                     model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS81_EE)) {
70                     list.add(NSS_TO_NSS_MODULE);
71                 } else if (model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS80_PE) ||
72                            model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS81_PE)||
73                            model.getSourceVersionAndEdition().equals(UpgradeConstants.VERSION_AS90_PE)) {
74                     list.add(JKS_TO_NSS_MODULE);
75                 }
76             }
77         }
78         list.add(MISC_MODULE);
79         list.add(DEPLOYMENT_MODULE);
80         list.add(REALM_MODULE);
81         return list;
82     }
83 }
84
Popular Tags