2 * Copyright (C) 2016 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (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 Affero General Public License for more details.
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jjobs.beans.phone;
19 import javax.enterprise.context.RequestScoped;
20 import javax.faces.view.facelets.FaceletException;
21 import javax.inject.Named;
22 import javax.naming.Context;
23 import javax.naming.InitialContext;
24 import javax.naming.NamingException;
25 import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
26 import org.mxchange.jjobs.beans.BaseJobsController;
27 import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
28 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
29 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
32 * Administrative bean (controller) for phone numbers
34 * @author Roland Haeder<roland@mxchange.org>
36 @Named ("adminPhoneController")
38 public class JobsAdminPhoneWebRequestBean extends BaseJobsController implements JobsAdminPhoneWebRequestController {
43 private static final long serialVersionUID = 184_598_175_371_269_016L;
46 * Remote EJB for phone number (administrative)
48 private AdminContactsPhoneSessionBeanRemote adminPhoneBean;
53 private DialableCellphoneNumber cellPhone;
58 private DialableFaxNumber fax;
63 private DialableLandLineNumber landLine;
68 public JobsAdminPhoneWebRequestBean () {
71 // Get initial context
72 Context context = new InitialContext();
74 // Try to lookup the beans
75 this.adminPhoneBean = (AdminContactsPhoneSessionBeanRemote) context.lookup("java:global/jjobs-ejb/admincontactphone!org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote"); //NOI18N
76 } catch (final NamingException e) {
78 throw new FaceletException(e);
83 public DialableCellphoneNumber getCellPhone () {
84 return this.cellPhone;
88 public void setCellPhone (final DialableCellphoneNumber cellPhone) {
89 this.cellPhone = cellPhone;
93 public DialableFaxNumber getFax () {
98 public void setFax (final DialableFaxNumber fax) {
103 public DialableLandLineNumber getLandLine () {
104 return this.landLine;
108 public void setLandLine (final DialableLandLineNumber landLine) {
109 this.landLine = landLine;