KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jresearch > gossip > list > Mapping


1 /*
2  * $$Id: Mapping.java,v 1.3 2005/06/07 12:32:35 bel70 Exp $$
3  *
4  * ***** BEGIN LICENSE BLOCK *****
5  * The contents of this file are subject to the Mozilla Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License
8  * at http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific language governing rights and
13  * limitations under the License.
14  *
15  * The Original Code is JGossip forum code.
16  *
17  * The Initial Developer of the Original Code is the JResearch, Org.
18  * Portions created by the Initial Developer are Copyright (C) 2004
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s):
22  * Dmitry Belov <bel@jresearch.org>
23  *
24  * ***** END LICENSE BLOCK ***** */

25 /*
26  * Created on Jul 14, 2003
27  *
28  */

29 package org.jresearch.gossip.list;
30
31 import java.util.HashMap JavaDoc;
32
33 /**
34  * DOCUMENT ME!
35  *
36  * @author Bel
37  */

38 public class Mapping {
39     private static Mapping instance;
40
41     private static Object JavaDoc lock = new Object JavaDoc();
42
43     public HashMap JavaDoc TreadMapping = new HashMap JavaDoc();
44
45     public HashMap JavaDoc NewTreadMapping = new HashMap JavaDoc();
46
47     public HashMap JavaDoc MessageMapping = new HashMap JavaDoc();
48
49     public HashMap JavaDoc UserMapping = new HashMap JavaDoc();
50
51     public HashMap JavaDoc GroupMapping = new HashMap JavaDoc();
52
53     public HashMap JavaDoc SearchMapping = new HashMap JavaDoc();
54
55     public HashMap JavaDoc SubscriptionMapping = new HashMap JavaDoc();
56
57     public HashMap JavaDoc LogEntryMapping = new HashMap JavaDoc();
58
59     private Mapping() {
60         TreadMapping.put("threadid", "id");
61         TreadMapping.put("sortby", "sortby");
62         TreadMapping.put("subject", "subject");
63         TreadMapping.put("messagesCount", "tot_mes");
64         TreadMapping.put("locked", "locked");
65
66         NewTreadMapping.putAll(TreadMapping);
67         NewTreadMapping.put("forumid", "fid");
68
69         MessageMapping.put("sender", "sender");
70         MessageMapping.put("centents", "centents");
71         MessageMapping.put("intime", "intime");
72         MessageMapping.put("heading", "heading");
73         MessageMapping.put("ip", "ip");
74         MessageMapping.put("id", "id");
75
76         SearchMapping.put("sender", "sender");
77         SearchMapping.put("centents", "centents");
78         SearchMapping.put("intime", "intime");
79         SearchMapping.put("heading", "heading");
80         SearchMapping.put("id", "id");
81         SearchMapping.put("threadid", "threadid");
82         SearchMapping.put("forumid", "forumid");
83
84         SubscriptionMapping.put("forumid", "forumid");
85         SubscriptionMapping.put("subject", "heading");
86         SubscriptionMapping.put("threadid", "threadid");
87
88         UserMapping.put("id", "id");
89         UserMapping.put("name", "user_name");
90         UserMapping.put("status", "user_status");
91
92         GroupMapping.put("groupid", "groupid");
93         GroupMapping.put("name", "group_name");
94
95         LogEntryMapping.put("log_date", "log_date");
96         LogEntryMapping.put("logger", "logger");
97         LogEntryMapping.put("log_level", "log_level");
98         LogEntryMapping.put("message", "message");
99         LogEntryMapping.put("remote_ip", "remote_ip");
100         LogEntryMapping.put("user_name", "user_name");
101         LogEntryMapping.put("session_id", "session_id");
102     }
103
104     /**
105      * DOCUMENT ME!
106      *
107      * @return DOCUMENT ME!
108      */

109     public static Mapping getInstance() {
110         if (instance == null) {
111             synchronized (lock) {
112                 if (instance == null) {
113                     instance = new Mapping();
114                 }
115             }
116         }
117         return instance;
118     }
119 }
120
Popular Tags