KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > common > constant > JMSAdminConstants


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.admin.common.constant;
25
26 /**
27     Constants needed by the JMS administration handler.
28  */

29 public final class JMSAdminConstants
30 {
31     // JMS Object types
32
public static final String JavaDoc JMS_OBJ_TYPE_TOPIC = "topic";
33     public static final String JavaDoc JMS_OBJ_TYPE_QUEUE = "queue";
34     public static final String JavaDoc JMS_OBJ_TYPE_QUEUE_CONN_FACTORY = "qconfactory";
35     public static final String JavaDoc JMS_OBJ_TYPE_TOPIC_CONN_FACTORY = "tconfactory";
36
37     // JMS destination types
38
public static final String JavaDoc JMS_DEST_TYPE_TOPIC = "topic";
39     public static final String JavaDoc JMS_DEST_TYPE_QUEUE = "queue";
40
41     // JMS Ping status values
42
public static final String JavaDoc JMS_HOST_RUNNING = "RUNNING";
43
44     /**
45         Convenience method for checking if the JMS object type specified is valid.
46
47     @param objType The JMS object type.
48     @return true if the object type specified was valid. False if it
49     is not valid.
50     */

51     public static boolean isValidJMSObjType(String JavaDoc objType)
52     {
53     if ( (objType.equals(JMS_OBJ_TYPE_TOPIC)) ||
54          (objType.equals(JMS_OBJ_TYPE_QUEUE)) ||
55          (objType.equals(JMS_OBJ_TYPE_QUEUE_CONN_FACTORY)) ||
56          (objType.equals(JMS_OBJ_TYPE_TOPIC_CONN_FACTORY)) )
57     {
58         return (true);
59     }
60
61     return (false);
62     }
63
64     /**
65         Convenience method for checking if the JMS destination type specified
66     is valid.
67
68     @param destType The destination type.
69     @return true if the destination type specified was valid. False if it
70     is not valid.
71     */

72     public static boolean isValidJMSDestType(String JavaDoc destType)
73     {
74     if ( (destType.equals(JMS_DEST_TYPE_TOPIC)) ||
75          (destType.equals(JMS_DEST_TYPE_QUEUE)) )
76     {
77         return (true);
78     }
79
80     return (false);
81     }
82 }
83
Popular Tags