ConnectionRequestInfoImpl.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * Initial developer(s): Eric HARDESTY
00022  * --------------------------------------------------------------------------
00023  * $Id: ConnectionRequestInfoImpl.java,v 1.2 2003/09/18 16:26:39 ehardesty Exp $
00024  * --------------------------------------------------------------------------
00025  */
00026 package org.objectweb.jonas.jdbc;
00027 
00028 import java.io.Serializable;
00029 import javax.resource.spi.ConnectionRequestInfo;
00030 
00031 public class ConnectionRequestInfoImpl
00032     implements ConnectionRequestInfo, Serializable {
00033 
00034     /* User/password for this connection */
00035     String user;
00036     String password;
00037 
00038     public ConnectionRequestInfoImpl() {
00039         user     = "";
00040         password = "";
00041     }
00042 
00043     public ConnectionRequestInfoImpl(String _user, String _password) {
00044         user     = _user;
00045         password = _password;
00046     }
00047 
00048     public boolean equals(Object obj) {
00049         if(obj == null) {
00050             return false;
00051         }
00052         if(obj instanceof ConnectionRequestInfoImpl) {
00053             ConnectionRequestInfoImpl cri = 
00054                          (ConnectionRequestInfoImpl) obj;
00055             return (user == cri.user) && (password == cri.password);
00056         } else {
00057             return false;
00058         }
00059     }
00060 
00061     public String getPassword() {
00062         return password;
00063     }
00064 
00065     public String getUser() {
00066         return user;
00067     }
00068 
00069     public int hashCode() {
00070         String val = "" + user + password;
00071         return val.hashCode();
00072     }
00073 
00074     public void setPassword(String pass) {
00075         password = pass;
00076     }
00077 
00078     public void setUser(String _user) {
00079         user = _user;
00080     }
00081 
00082 }

Generated on Tue Feb 15 15:05:16 2005 for JOnAS by  doxygen 1.3.9.1