1 23 package org.enhydra.barracuda.discRack.biz.person; 24 25 import org.enhydra.barracuda.discRack.biz.DiscRackBusinessException; 26 import org.enhydra.barracuda.discRack.data.person.*; 27 import org.enhydra.barracuda.discRack.data.disc.DiscDO; 28 import org.enhydra.barracuda.discRack.biz.disc.Disc; 29 import com.lutris.appserver.server.sql.DatabaseManagerException; 30 import com.lutris.appserver.server.sql.ObjectIdException; 31 import com.lutris.dods.builder.generator.query.DataObjectException; 32 33 36 public class Person implements java.io.Serializable { 37 40 protected PersonDO myDO = null; 41 42 45 public Person() throws DiscRackBusinessException { 46 try { 47 this.myDO = PersonDO.createVirgin(); 48 } catch(DatabaseManagerException ex) { 49 throw new DiscRackBusinessException("Error creating empty person", ex); 50 } catch(ObjectIdException ex) { 51 throw new DiscRackBusinessException("Error creating object ID for person", ex); 52 } 53 } 54 55 59 public Person(PersonDO thePerson) { 60 this.myDO = thePerson; 61 } 62 63 71 public String getHandle() 72 throws DiscRackBusinessException { 73 try { 74 return this.myDO.getHandle(); 75 } catch(DatabaseManagerException ex) { 76 throw new DiscRackBusinessException("Error getting handle for person", ex); 77 } 78 } 79 80 88 public String getLogin() 89 throws DiscRackBusinessException { 90 try { 91 return myDO.getLogin(); 92 } catch(DataObjectException ex) { 93 throw new DiscRackBusinessException("Error getting user's login name", ex); 94 } 95 } 96 97 105 public String getPassword() 106 throws DiscRackBusinessException { 107 try { 108 return myDO.getPassword(); 109 } catch(DataObjectException ex) { 110 throw new DiscRackBusinessException("Error getting user's password", ex); 111 } 112 } 113 114 122 public String getFirstname() 123 throws DiscRackBusinessException { 124 try { 125 return myDO.getFirstname(); 126 } catch(DataObjectException ex) { 127 throw new DiscRackBusinessException("Error getting user's first name", ex); 128 } 129 } 130 131 139 public String getLastname() 140 throws DiscRackBusinessException { 141 try { 142 return myDO.getLastname(); 143 } catch(DataObjectException ex) { 144 throw new DiscRackBusinessException("Error getting user's last name", ex); 145 } 146 } 147 148 156 public void setLogin(String login) 157 throws DiscRackBusinessException { 158 try { 159 myDO.setLogin(login); 160 } catch(DataObjectException ex) { 161 throw new DiscRackBusinessException("Error setting user's login name", ex); 162 } 163 } 164 165 173 public void setPassword(String password) 174 throws DiscRackBusinessException { 175 try { 176 myDO.setPassword(password); 177 } catch(DataObjectException ex) { 178 throw new DiscRackBusinessException("Error setting user's password", ex); 179 } 180 } 181 182 190 public void setFirstname(String firstname) 191 throws DiscRackBusinessException { 192 try { 193 myDO.setFirstname(firstname); 194 } catch(DataObjectException ex) { 195 throw new DiscRackBusinessException("Error setting user's first name", ex); 196 } 197 } 198 199 207 public void setLastname(String lastname) 208 throws DiscRackBusinessException { 209 try { 210 myDO.setLastname(lastname); 211 } catch(DataObjectException ex) { 212 throw new DiscRackBusinessException("Error setting user's last name", ex); 213 } 214 } 215 216 223 public void save() throws DiscRackBusinessException { 224 try { 225 this.myDO.commit(); 226 } catch(Exception ex) { 227 throw new DiscRackBusinessException("Error saving person", ex); 228 } 229 } 230 } 231 | Popular Tags |