]> git.mxchange.org Git - jfinancials-war.git/blob - src/java/org/mxchange/jfinancials/beans/phone/FinancialsAdminPhoneWebRequestBean.java
renamed namespace to jfinancials (Java naming-convention) + renamed *Addressbook...
[jfinancials-war.git] / src / java / org / mxchange / jfinancials / beans / phone / FinancialsAdminPhoneWebRequestBean.java
1 /*
2  * Copyright (C) 2016 Roland Häder
3  *
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.
8  *
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.
13  *
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/>.
16  */
17 package org.mxchange.jfinancials.beans.phone;
18
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.jfinancials.beans.BaseFinancialsController;
26 import org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote;
27 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
28 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
29 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
30
31 /**
32  * Administrative bean (controller) for phone numbers
33  * <p>
34  * @author Roland Häder<roland@mxchange.org>
35  */
36 @Named ("adminPhoneController")
37 @RequestScoped
38 public class FinancialsAdminPhoneWebRequestBean extends BaseFinancialsController implements FinancialsAdminPhoneWebRequestController {
39
40         /**
41          * Serial number
42          */
43         private static final long serialVersionUID = 184_598_175_371_269_016L;
44
45         /**
46          * Remote EJB for phone number (administrative)
47          */
48         private AdminContactsPhoneSessionBeanRemote adminPhoneBean;
49
50         /**
51          * Cell phone number
52          */
53         private DialableMobileNumber cellPhone;
54
55         /**
56          * Fax number
57          */
58         private DialableFaxNumber fax;
59
60         /**
61          * Land-line number
62          */
63         private DialableLandLineNumber landLine;
64
65         /**
66          * Default constructor
67          */
68         public FinancialsAdminPhoneWebRequestBean () {
69                 // Try it
70                 try {
71                         // Get initial context
72                         Context context = new InitialContext();
73
74                         // Try to lookup the beans
75                         this.adminPhoneBean = (AdminContactsPhoneSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/admincontactphone!org.mxchange.jcontacts.phone.AdminContactsPhoneSessionBeanRemote"); //NOI18N
76                 } catch (final NamingException e) {
77                         // Throw it again
78                         throw new FaceletException(e);
79                 }
80         }
81
82         @Override
83         public DialableMobileNumber getMobileNumber () {
84                 return this.cellPhone;
85         }
86
87         @Override
88         public void setCellPhone (final DialableMobileNumber cellPhone) {
89                 this.cellPhone = cellPhone;
90         }
91
92         @Override
93         public DialableFaxNumber getFax () {
94                 return this.fax;
95         }
96
97         @Override
98         public void setFax (final DialableFaxNumber fax) {
99                 this.fax = fax;
100         }
101
102         @Override
103         public DialableLandLineNumber getLandLine () {
104                 return this.landLine;
105         }
106
107         @Override
108         public void setLandLine (final DialableLandLineNumber landLine) {
109                 this.landLine = landLine;
110         }
111
112 }