2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.pizzaapplication.beans.customer;
19 import javax.annotation.PostConstruct;
20 import javax.enterprise.context.SessionScoped;
21 import javax.inject.Named;
22 import javax.naming.Context;
23 import javax.naming.InitialContext;
24 import javax.naming.NamingException;
25 import org.mxchange.jcore.model.contact.gender.Gender;
26 import org.mxchange.jcoreee.beans.BaseFrameworkBean;
27 import org.mxchange.jshopcore.model.customer.CustomerSessionBeanRemote;
30 * A customer bean which hides the customer instance
32 * @author Roland Haeder<roland@mxchange.org>
36 public class CustomerWebBean extends BaseFrameworkBean implements CustomerWebController {
40 private static final long serialVersionUID = 542_145_347_916L;
43 * Remote customer bean
45 private final CustomerSessionBeanRemote customerBean;
47 /////////////////////// Properties /////////////////////
51 private String cellphoneNumber;
61 private String comment;
66 private String companyName;
71 private String countryCode;
76 private String emailAddress;
81 private Gender gender;
86 private String familyName;
91 private String faxNumber;
96 private String firstName;
101 private Long houseNumber;
106 private String phoneNumber;
111 private String street;
116 private Long zipCode;
119 * Default constructor
121 * @throws javax.naming.NamingException If something happens?
123 public CustomerWebBean () throws NamingException {
124 // Get initial context
125 Context context = new InitialContext();
127 // Set gender to UNKNOWN
128 this.gender = Gender.UNKNOWN;
131 this.customerBean = (CustomerSessionBeanRemote) context.lookup("ejb/stateless-customer");
135 public void init () throws RuntimeException {
136 // Call super init first
141 public Gender getGender () {
146 public void setGender (final Gender gender) {
147 this.gender = gender;
151 public String getCompanyName () {
152 return this.companyName;
156 public void setCompanyName (final String companyName) {
157 this.companyName = companyName;
161 public String getFirstName () {
162 return this.firstName;
166 public void setFirstName (final String firstName) {
167 this.firstName = firstName;
171 public String getFamilyName () {
172 return this.familyName;
176 public void setFamilyName (final String familyName) {
177 this.familyName = familyName;
181 public String getStreet () {
186 public void setStreet (final String street) {
187 this.street = street;
191 public Long getHouseNumber () {
192 return this.houseNumber;
196 public void setHouseNumber (final Long houseNumber) {
197 this.houseNumber = houseNumber;
201 public Long getZipCode () {
206 public void setZipCode (final Long zipCode) {
207 this.zipCode = zipCode;
211 public String getCity () {
216 public void setCity (final String city) {
221 public String getCountryCode () {
222 return this.countryCode;
226 public void setCountryCode (final String countryCode) {
227 this.countryCode = countryCode;
231 public String getEmailAddress () {
232 return this.emailAddress;
236 public void setEmailAddress (final String emailAddress) {
237 this.emailAddress = emailAddress;
241 public String getPhoneNumber () {
242 return this.phoneNumber;
246 public void setPhoneNumber (final String phoneNumber) {
247 this.phoneNumber = phoneNumber;
251 public String getFaxNumber () {
252 return this.faxNumber;
256 public void setFaxNumber (final String faxNumber) {
257 this.faxNumber = faxNumber;
261 public String getCellphoneNumber () {
262 return this.cellphoneNumber;
266 public void setCellphoneNumber (final String cellphoneNumber) {
267 this.cellphoneNumber = cellphoneNumber;