1 19 20 package com.lutris.airsent.business.address; 21 22 import com.lutris.airsent.business.AirSentBusinessException; 23 import com.lutris.airsent.data.person.AddressDO; 24 import com.lutris.appserver.server.sql.DatabaseManagerException; 25 import com.lutris.appserver.server.sql.ObjectIdException; 26 import com.lutris.dods.builder.generator.query.DataObjectException; 27 import com.lutris.airsent.spec.address.Address; 28 35 public class AddressImpl implements Address { 36 protected AddressDO addressDO = null; 37 38 41 public AddressImpl() throws AirSentBusinessException { 42 try { 43 addressDO = AddressDO.createVirgin(); 44 } catch (Exception ex) { 45 throw new AirSentBusinessException("Error creating Address"); 46 } 47 } 48 49 53 public AddressImpl(AddressDO address) throws AirSentBusinessException { 54 this.addressDO = address; 55 } 56 57 58 62 public AddressImpl(String id) 63 throws AirSentBusinessException { 64 try { 65 addressDO = AddressDO.createExisting(id); 66 } catch (Exception ex) { 67 throw new AirSentBusinessException("Error creating Address"); 68 } 69 } 70 71 72 73 74 79 public String getHandle() throws AirSentBusinessException { 80 try { 81 return addressDO.getHandle(); 82 } catch (DatabaseManagerException ex) { 83 throw new AirSentBusinessException("Error getting address's handle", ex); 84 } 85 } 86 87 91 public AddressDO getDataObject() { 92 return addressDO; 93 } 94 95 96 101 public String getName() throws AirSentBusinessException { 102 try { 103 return addressDO.getName(); 104 } catch (DataObjectException ex) { 105 throw new AirSentBusinessException("Error getting address name", 106 ex); 107 } 108 } 109 110 115 public void setName(String name) throws AirSentBusinessException { 116 try { 117 this.addressDO.setName(name); 118 } catch (DataObjectException ex) { 119 throw new AirSentBusinessException("Error setting name", ex); 120 } 121 } 122 123 133 public String getStreet1() throws AirSentBusinessException { 134 try { 135 return addressDO.getStreet1(); 136 } catch (DataObjectException ex) { 137 throw new AirSentBusinessException("Error getting street", ex); 138 } 139 } 140 141 151 public void setStreet1(String street) throws AirSentBusinessException { 152 try { 153 this.addressDO.setStreet1(street); 154 } catch (DataObjectException ex) { 155 throw new AirSentBusinessException("Error setting street", ex); 156 } 157 } 158 159 169 public String getStreet2() throws AirSentBusinessException { 170 try { 171 return addressDO.getStreet2(); 172 } catch (DataObjectException ex) { 173 throw new AirSentBusinessException("Error getting street", ex); 174 } 175 } 176 177 187 public void setStreet2(String street) throws AirSentBusinessException { 188 try { 189 this.addressDO.setStreet2(street); 190 } catch (DataObjectException ex) { 191 throw new AirSentBusinessException("Error setting street", ex); 192 } 193 } 194 195 205 public String getStreet3() throws AirSentBusinessException { 206 try { 207 return addressDO.getStreet3(); 208 } catch (DataObjectException ex) { 209 throw new AirSentBusinessException("Error getting address street", 210 ex); 211 } 212 } 213 214 224 public void setStreet3(String street) throws AirSentBusinessException { 225 try { 226 this.addressDO.setStreet3(street); 227 } catch (DataObjectException ex) { 228 throw new AirSentBusinessException("Error setting address street", 229 ex); 230 } 231 } 232 233 243 public String getCity() throws AirSentBusinessException { 244 try { 245 return addressDO.getCity(); 246 } catch (DataObjectException ex) { 247 throw new AirSentBusinessException("Error getting address city", 248 ex); 249 } 250 } 251 252 262 public void setCity(String city) throws AirSentBusinessException { 263 try { 264 this.addressDO.setCity(city); 265 } catch (DataObjectException ex) { 266 throw new AirSentBusinessException("Error setting address street", 267 ex); 268 } 269 } 270 271 281 public String getPostalCode() throws AirSentBusinessException { 282 try { 283 return addressDO.getPostalCode(); 284 } catch (DataObjectException ex) { 285 throw new AirSentBusinessException("Error getting address postal", 286 ex); 287 } 288 } 289 290 300 public void setPostalCode(String code) throws AirSentBusinessException { 301 try { 302 this.addressDO.setPostalCode(code); 303 } catch (DataObjectException ex) { 304 throw new AirSentBusinessException("Error setting address postal", 305 ex); 306 } 307 } 308 309 319 public String getLocalNumber() throws AirSentBusinessException { 320 try { 321 return addressDO.getLocalNumber(); 322 } catch (DataObjectException ex) { 323 throw new AirSentBusinessException("Error getting address phone", 324 ex); 325 } 326 } 327 328 338 public void setLocalNumber(String number) 339 throws AirSentBusinessException { 340 try { 341 this.addressDO.setLocalNumber(number); 342 } catch (DataObjectException ex) { 343 throw new AirSentBusinessException("Error setting address phone", 344 ex); 345 } 346 } 347 348 358 public String getAreaCode() throws AirSentBusinessException { 359 try { 360 return addressDO.getAreaCode(); 361 } catch (DataObjectException ex) { 362 throw new AirSentBusinessException("Error getting address area code", 363 ex); 364 } 365 } 366 367 377 public void setAreaCode(String area) throws AirSentBusinessException { 378 try { 379 this.addressDO.setAreaCode(area); 380 } catch (DataObjectException ex) { 381 throw new AirSentBusinessException("Error setting address area code", 382 ex); 383 } 384 } 385 386 396 public String getState() throws AirSentBusinessException { 397 try { 398 return addressDO.getState(); 399 } catch (DataObjectException ex) { 400 throw new AirSentBusinessException("Error getting address state", 401 ex); 402 } 403 } 404 405 415 public void setState(String state) throws AirSentBusinessException { 416 try { 417 this.addressDO.setState(state); 418 } catch (DataObjectException ex) { 419 throw new AirSentBusinessException("Error setting address state", 420 ex); 421 } 422 } 423 424 434 public String getCountry() throws AirSentBusinessException { 435 try { 436 return addressDO.getCountry(); 437 } catch (DataObjectException ex) { 438 throw new AirSentBusinessException("Error getting address country", 439 ex); 440 } 441 } 442 443 453 public void setCountry(String country) throws AirSentBusinessException { 454 try { 455 this.addressDO.setCountry(country); 456 } catch (DataObjectException ex) { 457 throw new AirSentBusinessException("Error setting address country", 458 ex); 459 } 460 } 461 462 472 public String getDirections() throws AirSentBusinessException { 473 try { 474 return addressDO.getDirections(); 475 } catch (DataObjectException ex) { 476 throw new AirSentBusinessException("Error getting address directions", 477 ex); 478 } 479 } 480 481 491 public void setDirections(String directions) 492 throws AirSentBusinessException { 493 try { 494 this.addressDO.setDirections(directions); 495 } catch (DataObjectException ex) { 496 throw new AirSentBusinessException("Error setting address directions", 497 ex); 498 } 499 } 500 501 509 public void save() throws AirSentBusinessException { 510 try { 511 this.addressDO.commit(); 512 } catch (Exception ex) { 513 throw new AirSentBusinessException("Error saving address", ex); 514 } 515 } 516 517 525 public void delete() throws AirSentBusinessException { 526 try { 527 this.addressDO.delete(); 528 } catch (Exception ex) { 529 throw new AirSentBusinessException("Error deleting address", ex); 530 } 531 } 532 533 } 534 535 | Popular Tags |