001: /*
002: * Copyright (C) 2001, 2002 Robert MacGrogan
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or (at your option) any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: *
018: *
019: * $Archive: SourceJammer$
020: * $FileName: SJResponse.java$
021: * $FileID: 4354$
022: *
023: * Last change:
024: * $AuthorName: Rob MacGrogan$
025: * $Date: 5/1/03 5:33 PM$
026: * $Comment: $
027: *
028: * $KeyWordsOff: $
029: */
030:
031: package org.sourcejammer.project.view;
032:
033: import java.util.Hashtable;
034: import java.util.Vector;
035:
036: /**
037: * Title: SourceJammer v 0.1.0
038: * Description:
039: * Copyright: Copyright (c) 2001
040: * Company:
041: * @author Robert MacGrogan
042: * @version $Revision: 1.3 $
043: */
044:
045: public class SJResponse implements SJResponseParams {
046:
047: private String msMessage = null;
048: private boolean mbErrorEncountered = false;
049: private long mlSessionID = -1;
050:
051: private Hashtable params = new Hashtable();
052:
053: public SJResponse() {
054: }
055:
056: public void setParams(Hashtable params) {
057: this .params = params;
058: }
059:
060: public Hashtable getParams() {
061: return params;
062: }
063:
064: public void putString(String key, String value) {
065: params.put(key, value);
066: }
067:
068: public String stringValue(String key) {
069: return (String) params.get(key);
070: }
071:
072: public void putObject(String key, Object o) {
073: params.put(key, o);
074: }
075:
076: public Object objectValue(String key) {
077: return params.get(key);
078: }
079:
080: public void putInt(String key, int value) {
081: params.put(key, new Integer(value));
082: }
083:
084: public int intValue(String key) {
085: Integer in = (Integer) params.get(key);
086: if (in == null)
087: return -1;
088: else
089: return in.intValue();
090: }
091:
092: public void putLong(String key, long value) {
093: params.put(key, new Long(value));
094: }
095:
096: public long longValue(String key) {
097: Long ln = (Long) params.get(key);
098: if (ln == null)
099: return -1;
100: else
101: return ln.longValue();
102: }
103:
104: public void putBoolean(String key, boolean value) {
105: params.put(key, new Boolean(value));
106: }
107:
108: public boolean booleanValue(String key) {
109: Boolean bl = (Boolean) params.get(key);
110: if (bl == null)
111: return false;
112: else
113: return bl.booleanValue();
114: }
115:
116: public void putFile(File value) {
117: params.put(FILE, value);
118: }
119:
120: public File fileValue() {
121: return (File) params.get(FILE);
122: }
123:
124: public void putProject(Project value) {
125: params.put(PROJECT, value);
126: }
127:
128: public Project projectValue() {
129: return (Project) params.get(PROJECT);
130: }
131:
132: public void putArchiveProperties(ArchiveProperties props) {
133: params.put(res_ARCHIVE_PROPERTIES, props);
134: }
135:
136: public ArchiveProperties archivePropertiesValue() {
137: return (ArchiveProperties) params.get(res_ARCHIVE_PROPERTIES);
138: }
139:
140: public void putDownloadFileIdentifier(DownloadFileIdentifier value) {
141: params.put(DOWNLOAD_FILE_IDENTIFIER, value);
142: }
143:
144: public DownloadFileIdentifier downloadFileIdentifierValue() {
145: return (DownloadFileIdentifier) params
146: .get(DOWNLOAD_FILE_IDENTIFIER);
147: }
148:
149: public String getMessage() {
150: return msMessage;
151: }
152:
153: public void setMessage(String s) {
154: msMessage = s;
155: }
156:
157: public long getSessionID() {
158: return mlSessionID;
159: }
160:
161: public void setSessionID(long l) {
162: mlSessionID = l;
163: }
164:
165: public boolean getErrorEncountered() {
166: return mbErrorEncountered;
167: }
168:
169: public void setErrorEncountered(boolean b) {
170: mbErrorEncountered = b;
171: }
172:
173: }
|