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;
50 private String cellphoneNumber;
60 private String comment;
65 private String companyName;
70 private String countryCode;
75 private String emailAddress;
80 private Gender gender;
85 private String familyName;
90 private String faxNumber;
95 private String firstName;
100 private Long houseNumber;
105 private String phoneNumber;
110 private String street;
115 private Long zipCode;
118 * Default constructor
120 * @throws javax.naming.NamingException If something happens?
122 public CustomerWebBean () throws NamingException {
123 // Get initial context
124 Context context = new InitialContext();
126 // Set gender to UNKNOWN
127 this.gender = Gender.UNKNOWN;
130 this.customerBean = (CustomerSessionBeanRemote) context.lookup("ejb/stateless-customer");
134 public void init () throws RuntimeException {
135 // Call super init first
140 public Gender getGender () {
145 public void setGender (final Gender gender) {
146 this.gender = gender;
150 public String getCompanyName () {
151 return this.companyName;
155 public void setCompanyName (final String companyName) {
156 this.companyName = companyName;
160 public String getFirstName () {
161 return this.firstName;
165 public void setFirstName (final String firstName) {
166 this.firstName = firstName;
170 public String getFamilyName () {
171 return this.familyName;
175 public void setFamilyName (final String familyName) {
176 this.familyName = familyName;
180 public String getStreet () {
185 public void setStreet (final String street) {
186 this.street = street;
190 public Long getHouseNumber () {
191 return this.houseNumber;
195 public void setHouseNumber (final Long houseNumber) {
196 this.houseNumber = houseNumber;
200 public Long getZipCode () {
205 public void setZipCode (final Long zipCode) {
206 this.zipCode = zipCode;
210 public String getCity () {
215 public void setCity (final String city) {
220 public String getCountryCode () {
221 return this.countryCode;
225 public void setCountryCode (final String countryCode) {
226 this.countryCode = countryCode;
230 public String getEmailAddress () {
231 return this.emailAddress;
235 public void setEmailAddress (final String emailAddress) {
236 this.emailAddress = emailAddress;
240 public String getPhoneNumber () {
241 return this.phoneNumber;
245 public void setPhoneNumber (final String phoneNumber) {
246 this.phoneNumber = phoneNumber;
250 public String getFaxNumber () {
251 return this.faxNumber;
255 public void setFaxNumber (final String faxNumber) {
256 this.faxNumber = faxNumber;
260 public String getCellphoneNumber () {
261 return this.cellphoneNumber;
265 public void setCellphoneNumber (final String cellphoneNumber) {
266 this.cellphoneNumber = cellphoneNumber;