KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > target > TargetType


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 /*
25  * $Id: TargetType.java,v 1.3 2005/12/25 04:14:39 tcfujii Exp $
26  */

27
28 package com.sun.enterprise.admin.target;
29
30 public final class TargetType
31 {
32     /**
33      * A named configuration
34      */

35     public static final TargetType CONFIG = new TargetType(1, "configuration");
36     /**
37      * A named server of any type: not including the domain admin server, a clustered
38      * server instance, an unclustered server instance
39      */

40     public static final TargetType SERVER = new TargetType(2, "server instance");
41     /**
42      * The domain
43      */

44     public static final TargetType DOMAIN = new TargetType(3, "domain");
45     /**
46      * A named cluster
47      */

48     public static final TargetType CLUSTER = new TargetType(4, "cluster");
49     /**
50      * A named node agent
51      */

52     public static final TargetType NODE_AGENT = new TargetType(5, "node agent");
53     
54     /**
55      * A stand alone server instance
56      */

57     public static final TargetType STANDALONE_SERVER = new TargetType(6, "standalone server instance");
58     
59     /**
60      * An unclustered server instance
61      */

62     public static final TargetType UNCLUSTERED_SERVER = new TargetType(7, "unclustered server instance");
63     
64     /**
65      * A stand alone cluster
66      */

67     public static final TargetType STANDALONE_CLUSTER = new TargetType(8, "standalone cluster");
68     
69     /**
70      * The domain administration server
71      */

72     public static final TargetType DAS = new TargetType(9, "domain administration server");
73
74     private int _type;
75     //Note: it does not seem as if the name needs to be localizable, hence we are
76
//not using the string manager here.
77
private String JavaDoc _name;
78     
79     private TargetType(int type, String JavaDoc name)
80     {
81         _type = type;
82         _name = name;
83     }
84     
85     public String JavaDoc getName() {
86         return _name;
87     }
88     
89     int getType() {
90         return _type;
91     }
92     
93     public boolean equals(Object JavaDoc obj)
94     {
95         if (obj instanceof TargetType) {
96             return ((TargetType)obj).getType() == this.getType() ? true : false;
97         }
98         return false;
99     }
100 }
101
Popular Tags