01: // servletProperties.java
02: // -------------------------------
03: // (C) 2006 Alexander Schier
04: // part of YaCy
05: //
06: // last major change: 06.02.2006
07: // this file is contributed by Alexander Schier
08: //
09: // This program is free software; you can redistribute it and/or modify
10: // it under the terms of the GNU General Public License as published by
11: // the Free Software Foundation; either version 2 of the License, or
12: // (at your option) any later version.
13: //
14: // This program is distributed in the hope that it will be useful,
15: // but WITHOUT ANY WARRANTY; without even the implied warranty of
16: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: // GNU General Public License for more details.
18: //
19: // You should have received a copy of the GNU General Public License
20: // along with this program; if not, write to the Free Software
21: // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 US
22: package de.anomic.server;
23:
24: import de.anomic.http.httpHeader;
25:
26: public class servletProperties extends serverObjects {
27:
28: private static final long serialVersionUID = 1L;
29:
30: public static final String ACTION_AUTHENTICATE = "AUTHENTICATE";
31: public static final String ACTION_LOCATION = "LOCATION";
32:
33: public static final String PEER_STAT_VERSION = "version";
34: public static final String PEER_STAT_UPTIME = "uptime";
35: public static final String PEER_STAT_MYTIME = "mytime";
36: public static final String PEER_STAT_CLIENTNAME = "clientname";
37:
38: private String prefix = "";
39:
40: private httpHeader outgoingHeader;
41:
42: public servletProperties() {
43: super ();
44: }
45:
46: public servletProperties(serverObjects so) {
47: super (so);
48: }
49:
50: public void setOutgoingHeader(httpHeader outgoingHeader) {
51: this .outgoingHeader = outgoingHeader;
52: }
53:
54: public httpHeader getOutgoingHeader() {
55: if (outgoingHeader != null)
56: return outgoingHeader;
57: else
58: return new httpHeader();
59: }
60:
61: public void setPrefix(String myprefix) {
62: prefix = myprefix;
63: }
64:
65: public String put(String key, byte[] value) {
66: return super .put(prefix + key, value);
67: }
68:
69: public long put(String key, long value) {
70: return super .put(prefix + key, value);
71: }
72:
73: public long inc(String key) {
74: return super .inc(prefix + key);
75: }
76:
77: public Object get(String key, Object dflt) {
78: return super .get(prefix + key, dflt);
79: }
80:
81: public String get(String key, String dflt) {
82: return super .get(prefix + key, dflt);
83: }
84:
85: public int getInt(String key, int dflt) {
86: return super .getInt(prefix + key, dflt);
87: }
88:
89: public long getLong(String key, long dflt) {
90: return super.getLong(prefix + key, dflt);
91: }
92: }
|