1 24 25 package org.objectweb.cjdbc.common.users; 26 27 import java.io.Serializable ; 28 import java.security.Principal ; 29 30 37 public abstract class AbstractDatabaseUser implements Serializable , Principal 38 { 39 40 protected String login; 41 42 43 protected String password; 44 45 52 protected AbstractDatabaseUser(String login, String password) 53 { 54 this.login = login; 55 this.password = password; 56 } 57 58 63 public String getLogin() 64 { 65 return login; 66 } 67 68 73 public String getName() 74 { 75 return getLogin(); 76 } 77 78 83 public String getPassword() 84 { 85 return password; 86 } 87 88 96 public boolean matches(String login, String password) 97 { 98 return (this.login.equals(login) && this.password.equals(password)); 99 } 100 101 108 public boolean equals(Object other) 109 { 110 if ((other == null) || !(other instanceof AbstractDatabaseUser)) 111 return false; 112 113 AbstractDatabaseUser user = (AbstractDatabaseUser) other; 114 return matches(user.login, user.password); 115 } 116 117 120 public abstract String getXml(); 121 } 122 | Popular Tags |