001: /* Copyright 2003 The JA-SIG Collaborative. All rights reserved.
002: * See license distributed with this file and
003: * available online at http://www.uportal.org/license.html
004: */
005:
006: package org.jasig.portal;
007:
008: /**
009: * Represents a portal error or problem.
010: * @author Howard Gilbert
011: * @version $Revision: 34806 $
012: */
013: public class ErrorID {
014: String category;
015: String specific;
016: String message;
017:
018: byte audience = 0;
019: public final byte audienceAdmin = 0;
020: public final byte audiencePgmr = 1;
021: public final byte audienceUser = 2;
022:
023: byte duration = 0;
024: public final byte durationRetry = 0;
025: public final byte durationSession = 1;
026: public final byte durationLater = 2;
027: public final byte durationRestart = 3;
028: public final byte durationMustfix = 4;
029:
030: /**
031: * @param category
032: * @param specific component/errorname as in "authenticate/badpassword"
033: * @param msg default message text if not replaced from resources
034: */
035: public ErrorID(String category, String specific, String msg) {
036: this .category = category;
037: this .specific = specific;
038: this .message = msg;
039: ProblemsTable.register(this );
040: }
041:
042: /**
043: * @return the message
044: */
045: public String getMessage() {
046: return message;
047: }
048:
049: /**
050: * @return the category
051: */
052: public String getCategory() {
053: return category;
054: }
055:
056: /**
057: * @return the specific
058: */
059: public String getSpecific() {
060: return specific;
061: }
062:
063: /**
064: * @return the audience
065: */
066: public byte getAudience() {
067: return audience;
068: }
069:
070: /**
071: * @return the duration
072: */
073: public byte getDuration() {
074: return duration;
075: }
076:
077: /**
078: * @param b
079: */
080: public void setAudience(byte b) {
081: audience = b;
082: }
083:
084: /**
085: * @param b
086: */
087: public void setDuration(byte b) {
088: duration = b;
089: }
090:
091: // initializer methods
092: public ErrorID withAudience(byte b) {
093: setAudience(b);
094: return this ;
095: }
096:
097: public ErrorID withDuration(byte b) {
098: setDuration(b);
099: return this;
100: }
101:
102: }
|