001: /*
002: * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
003: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
004: */
005: package com.sun.portal.ubt;
006:
007: import java.util.logging.Level;
008: import java.util.Hashtable;
009: import java.util.Vector;
010:
011: /**
012: * This class represents a UBT log field. A UBT log field is predefined and cannot be instantiated.
013: */
014: public class UBTLogField {
015: private String name;
016: private Level level;
017: /**
018: * Vector of all the valid UBT fields.
019: */
020: public static Vector fields = new Vector();
021:
022: private UBTLogField(String name, Level level) {
023: this .name = name;
024: this .level = level;
025: fields.add(this );
026: }
027:
028: /**
029: * Get the name of field.
030: * @return name
031: */
032: public String getName() {
033: return name;
034: }
035:
036: /**
037: * Get the level of the field.
038: * @return level
039: */
040: public Level getLevel() {
041: return level;
042: }
043:
044: /**
045: * Overriden equals method.
046: * @param obj Object to be compared
047: * @return returns true if equal or false.
048: */
049: public boolean equals(Object obj) {
050: if (obj == null)
051: return false;
052: if (obj instanceof UBTLogField
053: && this .name == ((UBTLogField) obj).name
054: && this .level.equals(((UBTLogField) obj).level)) {
055: return true;
056: } else
057: return false;
058: }
059:
060: /**
061: * 'Timestamp' field.
062: */
063: public static final UBTLogField TIMESTAMP = new UBTLogField(
064: "Timestamp", Level.INFO);
065: /**
066: * 'PortalID' field.
067: */
068: public static final UBTLogField PORTAL_ID = new UBTLogField(
069: "PortalID", Level.INFO);
070: /**
071: * 'InstanceID' field.
072: */
073: public static final UBTLogField INSTANCE_ID = new UBTLogField(
074: "InstanceID", Level.INFO);
075: /**
076: * 'Level' field.
077: */
078: public static final UBTLogField LEVEL = new UBTLogField("Level",
079: Level.INFO);
080: /**
081: * 'UserID' field
082: */
083: public static final UBTLogField USER_ID = new UBTLogField("UserID",
084: Level.INFO);
085: /**
086: * 'EventID' field
087: */
088: public static final UBTLogField EVENT_ID = new UBTLogField(
089: "EventID", Level.INFO);
090: /**
091: * 'ComponentName' field
092: */
093: public static final UBTLogField COMP_NAME = new UBTLogField(
094: "ComponentName", Level.INFO);
095: /**
096: * 'ChannelName' field
097: */
098: public static final UBTLogField CHANNEL_NAME = new UBTLogField(
099: "ChannelName", Level.INFO);
100: /**
101: * 'Provider' field
102: */
103: public static final UBTLogField PROVIDER = new UBTLogField(
104: "Provider", Level.INFO);
105: /**
106: * 'TargetProvider' field
107: */
108: public static final UBTLogField TARGET_PROVIDER = new UBTLogField(
109: "TargetProvider", Level.INFO);
110: /**
111: * 'ContainerName' field
112: */
113: public static final UBTLogField CONTAINER_NAME = new UBTLogField(
114: "ContainerName", Level.INFO);
115: /**
116: * 'Action' field
117: */
118: public static final UBTLogField ACTION = new UBTLogField("Action",
119: Level.INFO);
120: /**
121: * 'EntityID' field
122: */
123: public static final UBTLogField ENTITY_ID = new UBTLogField(
124: "EntityID", Level.INFO);
125: /**
126: * 'Mode' field
127: */
128: public static final UBTLogField MODE = new UBTLogField("Mode",
129: Level.INFO);
130: /**
131: * 'WindowState' field
132: */
133: public static final UBTLogField WINDOW_STATE = new UBTLogField(
134: "WindowState", Level.INFO);
135: /**
136: * 'ExPortalLink' field
137: */
138: public static final UBTLogField EX_PORTAL_LINK = new UBTLogField(
139: "ExPortalLink", Level.INFO);
140: /**
141: * 'SessionID' field
142: */
143: public static final UBTLogField SESSION_ID = new UBTLogField(
144: "SessionID", Level.INFO);
145:
146: /**
147: * 'ClientHost' field
148: */
149: public static final UBTLogField CLIENT_HOST = new UBTLogField(
150: "ClientHost", Level.FINE);
151: /**
152: * 'ClientIP' field
153: */
154: public static final UBTLogField CLIENT_IP = new UBTLogField(
155: "ClientIP", Level.FINE);
156:
157: /**
158: * 'ServerHost' field
159: */
160: public static final UBTLogField SERVER_HOST = new UBTLogField(
161: "ServerHost", Level.FINER);
162: /**
163: * 'ServerPort' field
164: */
165: public static final UBTLogField SERVER_PORT = new UBTLogField(
166: "ServerPort", Level.FINER);
167:
168: /**
169: * 'RequestHeader' field
170: */
171: public static final UBTLogField REQUEST_HEAD = new UBTLogField(
172: "RequestHeader", Level.FINEST);
173: }
|