1 package org.enhydra.pim.business.base; 2 3 import java.math.BigDecimal ; 4 import java.util.Vector ; 5 import org.enhydra.pim.business.PersonManager; 6 import org.enhydra.pim.business.PimBase; 7 import org.enhydra.pim.business.UserManager; 8 import org.enhydra.pim.business.api.*; 9 import org.enhydra.pim.exception.EnhydraPimException; 10 import org.enhydra.pim.exception.EnhydraPimLogicException; 11 12 17 public class Owner extends BasePimImpl implements OwnerI, java.io.Serializable { 18 19 private String username = null; 20 21 private String password = null; 22 23 27 public Owner(String username, String password) { 28 super(null); 29 this.username = username; 30 this.password = password; 31 } 32 33 38 public Owner(BigDecimal handle, String username, String password) { 39 super(handle); 40 this.username = username; 41 this.password = password; 42 } 43 44 public void clean() { 45 super.clean(); 46 this.username = null; 47 this.password = null; 48 } 49 50 56 public void setUsername(String _username) { 57 username = _username; 58 } 59 60 65 public String getUsername() { 66 return username; 67 } 68 69 75 public void setPassword(String _password) { 76 password = _password; 77 } 78 79 84 public String getPassword() { 85 return password; 86 } 87 88 93 public boolean isValid() { 94 OwnerI user = null; 95 UserManager uMan = new UserManager(); 96 try { 97 user = uMan.checkOwner(this.username, this.password); 98 } catch (EnhydraPimLogicException ex1) { 99 PimBase.logDebug("[id=2010]" + ex1.getMessage()); 100 } catch (Exception ex2) { 101 ex2.printStackTrace(); 102 } 103 return (user != null && this.handle != null && user.getHandle().equals(this.handle)); 104 } 105 106 111 public Vector getNotes() { 112 return null; 114 } 115 116 122 public void addNote(NoteI _note) { 123 } 125 126 132 public void removeNote(NoteI _note) { 133 } 135 136 142 public Vector getPersons() throws EnhydraPimException { 143 PersonManager pMan = new PersonManager(); 144 return pMan.getOwnerPersons(this); 145 } 146 147 154 public void addPerson(PersonI _person) throws EnhydraPimException { 155 PersonManager pMan = new PersonManager(); 156 pMan.addPerson(_person,this); 157 } 158 159 166 public void removePerson(PersonI _person) throws EnhydraPimException { 167 PersonManager pMan = new PersonManager(); 168 pMan.removePerson(_person); 169 } 170 171 176 public Vector getTasks() { 177 return null; 179 } 180 181 187 public void addTask(TaskI _task) { 188 } 190 191 197 public void removeTask(TaskI _task) { 198 } 200 } | Popular Tags |