01: /*
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * Initial developer(s): Eric HARDESTY
22: * --------------------------------------------------------------------------
23: * $Id: ConnectionRequestInfoImpl.java 3343 2003-09-18 16:26:39Z ehardesty $
24: * --------------------------------------------------------------------------
25: */
26: package org.objectweb.jonas.jdbc;
27:
28: import java.io.Serializable;
29: import javax.resource.spi.ConnectionRequestInfo;
30:
31: public class ConnectionRequestInfoImpl implements
32: ConnectionRequestInfo, Serializable {
33:
34: /* User/password for this connection */
35: String user;
36: String password;
37:
38: public ConnectionRequestInfoImpl() {
39: user = "";
40: password = "";
41: }
42:
43: public ConnectionRequestInfoImpl(String _user, String _password) {
44: user = _user;
45: password = _password;
46: }
47:
48: public boolean equals(Object obj) {
49: if (obj == null) {
50: return false;
51: }
52: if (obj instanceof ConnectionRequestInfoImpl) {
53: ConnectionRequestInfoImpl cri = (ConnectionRequestInfoImpl) obj;
54: return (user == cri.user) && (password == cri.password);
55: } else {
56: return false;
57: }
58: }
59:
60: public String getPassword() {
61: return password;
62: }
63:
64: public String getUser() {
65: return user;
66: }
67:
68: public int hashCode() {
69: String val = "" + user + password;
70: return val.hashCode();
71: }
72:
73: public void setPassword(String pass) {
74: password = pass;
75: }
76:
77: public void setUser(String _user) {
78: user = _user;
79: }
80:
81: }
|