]> git.mxchange.org Git - jjobs-war.git/commitdiff
Changed interface (POJI) name SmsProvider to MobileProvider
authorRoland Haeder <roland@mxchange.org>
Tue, 12 Apr 2016 18:03:11 +0000 (20:03 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 12 Apr 2016 18:07:52 +0000 (20:07 +0200)
12 files changed:
lib/jphone-core.jar
lib/jphone-lib.jar
src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationBean.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationController.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/beans/smsprovider/JobsSmsProviderWebApplicationBean.java [deleted file]
src/java/org/mxchange/jjobs/beans/smsprovider/JobsSmsProviderWebApplicationController.java [deleted file]
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebSessionController.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionController.java
src/java/org/mxchange/jjobs/converter/smsprovider/JobsMobileProviderConverter.java [new file with mode: 0644]
src/java/org/mxchange/jjobs/converter/smsprovider/JobsSmsProviderConverter.java [deleted file]

index f3842ac699566b448d005be0eb2aee5a71843015..ec8a9b92f168dd26cce8f8c0540926ee0f2da933 100644 (file)
Binary files a/lib/jphone-core.jar and b/lib/jphone-core.jar differ
index cd5aade5b6e0df051f37ee11fd7dc2c7d69d4b2b..2fc3981fc2bb4825116a152cda7739fc56fc61f8 100644 (file)
Binary files a/lib/jphone-lib.jar and b/lib/jphone-lib.jar differ
diff --git a/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationBean.java
new file mode 100644 (file)
index 0000000..32c4ad5
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.smsprovider;
+
+import java.util.Collections;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jphone.phonenumbers.smsprovider.MobileProviderSingletonBeanRemote;
+import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider;
+
+/**
+ * A SMS provider bean
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Named ("cellphone")
+@ApplicationScoped
+public class JobsMobileProviderWebApplicationBean implements JobsMobileProviderWebApplicationController {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 176_985_298_681_742_960L;
+
+       /**
+        * Remote country EJB
+        */
+       private MobileProviderSingletonBeanRemote cellphoneBean;
+
+       /**
+        * List of all countries
+        */
+       private List<MobileProvider> cellphoneList;
+
+       /**
+        * Default constructor
+        */
+       public JobsMobileProviderWebApplicationBean () {
+               // Try this
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Try to lookup the bean
+                       this.cellphoneBean = (MobileProviderSingletonBeanRemote) context.lookup("java:global/jjobs-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.MobileProviderSingletonBeanRemote"); //NOI18N
+               } catch (final NamingException ex) {
+                       // Continue to throw
+                       throw new FaceletException(ex);
+               }
+       }
+
+       @Override
+       public List<MobileProvider> allMobileProvider () {
+               // Return "cached" version
+               return Collections.unmodifiableList(this.cellphoneList);
+       }
+
+       /**
+        * Post-initialization of this class
+        */
+       @PostConstruct
+       public void init () {
+               this.cellphoneList = this.cellphoneBean.allMobileProvider();
+       }
+}
diff --git a/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationController.java b/src/java/org/mxchange/jjobs/beans/smsprovider/JobsMobileProviderWebApplicationController.java
new file mode 100644 (file)
index 0000000..3a30af0
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.beans.smsprovider;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider;
+
+/**
+ * An interface for country beans
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+public interface JobsMobileProviderWebApplicationController extends Serializable {
+
+       /**
+        * A list of all countries
+        * <p>
+        * @return All countries
+        */
+       List<MobileProvider> allMobileProvider ();
+}
diff --git a/src/java/org/mxchange/jjobs/beans/smsprovider/JobsSmsProviderWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/smsprovider/JobsSmsProviderWebApplicationBean.java
deleted file mode 100644 (file)
index ba1c5d7..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.smsprovider;
-
-import java.util.Collections;
-import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-import javax.faces.view.facelets.FaceletException;
-import javax.inject.Named;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
-import org.mxchange.jphone.phonenumbers.smsprovider.SmsProviderSingletonBeanRemote;
-
-/**
- * A SMS provider bean
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@Named ("cellphone")
-@ApplicationScoped
-public class JobsSmsProviderWebApplicationBean implements JobsSmsProviderWebApplicationController {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 176_985_298_681_742_960L;
-
-       /**
-        * Remote country EJB
-        */
-       private SmsProviderSingletonBeanRemote cellphoneBean;
-
-       /**
-        * List of all countries
-        */
-       private List<SmsProvider> cellphoneList;
-
-       /**
-        * Default constructor
-        */
-       public JobsSmsProviderWebApplicationBean () {
-               // Try this
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Try to lookup the bean
-                       this.cellphoneBean = (SmsProviderSingletonBeanRemote) context.lookup("java:global/jjobs-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.SmsProviderSingletonBeanRemote"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw
-                       throw new FaceletException(ex);
-               }
-       }
-
-       @Override
-       public List<SmsProvider> allSmsProvider () {
-               // Return "cached" version
-               return Collections.unmodifiableList(this.cellphoneList);
-       }
-
-       /**
-        * Post-initialization of this class
-        */
-       @PostConstruct
-       public void init () {
-               this.cellphoneList = this.cellphoneBean.allSmsProvider();
-       }
-}
diff --git a/src/java/org/mxchange/jjobs/beans/smsprovider/JobsSmsProviderWebApplicationController.java b/src/java/org/mxchange/jjobs/beans/smsprovider/JobsSmsProviderWebApplicationController.java
deleted file mode 100644 (file)
index e7f08f6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.beans.smsprovider;
-
-import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
-
-/**
- * An interface for country beans
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public interface JobsSmsProviderWebApplicationController extends Serializable {
-
-       /**
-        * A list of all countries
-        * <p>
-        * @return All countries
-        */
-       List<SmsProvider> allSmsProvider ();
-}
index 5286755daaac0d3fc0fd0f10a5b83d9ca9492dbd..323129c9d85a7914f2ee8de072cd9cdc6d7fc907 100644 (file)
@@ -39,7 +39,6 @@ import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
-import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
@@ -49,6 +48,7 @@ import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.UserUtils;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
+import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider;
 
 /**
  * A user bean (controller)
@@ -73,7 +73,7 @@ public class JobsAdminUserWebSessionBean implements JobsAdminUserWebSessionContr
        /**
         * Cellphone number's carrier
         */
-       private SmsProvider cellphoneCarrier;
+       private MobileProvider cellphoneCarrier;
 
        /**
         * Cellphone number
@@ -285,7 +285,7 @@ public class JobsAdminUserWebSessionBean implements JobsAdminUserWebSessionContr
                }
 
                // Is the provider set?
-               if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof SmsProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
+               if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof MobileProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
                        // Is the number set?
                        if (cellphone.getPhoneNumber() == null) {
                                // Is null
@@ -360,12 +360,12 @@ public class JobsAdminUserWebSessionBean implements JobsAdminUserWebSessionContr
        }
 
        @Override
-       public SmsProvider getCellphoneCarrier () {
+       public MobileProvider getCellphoneCarrier () {
                return this.cellphoneCarrier;
        }
 
        @Override
-       public void setCellphoneCarrier (final SmsProvider cellphoneCarrier) {
+       public void setCellphoneCarrier (final MobileProvider cellphoneCarrier) {
                this.cellphoneCarrier = cellphoneCarrier;
        }
 
index f14ccb9cd42ff327e700ed7d1d7bd90fb1602e2a..c615324d18b2a8848b5cd0ae63dc84170b342b01 100644 (file)
@@ -21,10 +21,10 @@ import java.util.Date;
 import java.util.List;
 import org.mxchange.jcontacts.contact.gender.Gender;
 import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
+import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider;
 
 /**
  * An interface for user beans
@@ -85,14 +85,14 @@ public interface JobsAdminUserWebSessionController extends Serializable {
         * <p>
         * @return Cellphone number's carrier
         */
-       SmsProvider getCellphoneCarrier ();
+       MobileProvider getCellphoneCarrier ();
 
        /**
         * Setter for cellphone number's carrier prefix
         * <p>
         * @param cellphoneCarrier Cellphone number's carrier prefix
         */
-       void setCellphoneCarrier (final SmsProvider cellphoneCarrier);
+       void setCellphoneCarrier (final MobileProvider cellphoneCarrier);
 
        /**
         * Getter for ellphone number
index 1c38fc4297d6a9699c2bb092b20c72ea7417d025..8f5dba3df2a34b2b701cf896ad784769cedf184c 100644 (file)
@@ -41,7 +41,6 @@ import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
-import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
@@ -51,6 +50,7 @@ import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 import org.mxchange.jjobs.beans.login.JobsUserLoginWebSessionController;
+import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider;
 
 /**
  * A user bean (controller)
@@ -74,7 +74,7 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
        /**
         * Cellphone number's carrier
         */
-       private SmsProvider cellphoneCarrier;
+       private MobileProvider cellphoneCarrier;
 
        /**
         * Cellphone number
@@ -393,7 +393,7 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                }
 
                // Is the provider set?
-               if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof SmsProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
+               if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof MobileProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) {
                        // Is the number set?
                        if (cellphone.getPhoneNumber() == null) {
                                // Is null
@@ -507,12 +507,12 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
        }
 
        @Override
-       public SmsProvider getCellphoneCarrier () {
+       public MobileProvider getCellphoneCarrier () {
                return this.cellphoneCarrier;
        }
 
        @Override
-       public void setCellphoneCarrier (final SmsProvider cellphoneCarrier) {
+       public void setCellphoneCarrier (final MobileProvider cellphoneCarrier) {
                this.cellphoneCarrier = cellphoneCarrier;
        }
 
@@ -939,7 +939,7 @@ public class JobsUserWebSessionBean implements JobsUserWebSessionController {
                        this.setPhoneAreaCode(phone.getPhoneAreaCode());
                        this.setPhoneNumber(phone.getPhoneNumber());
                }
-               if ((cellphone instanceof DialableCellphoneNumber) && (cellphone.getCellphoneProvider() instanceof SmsProvider)) {
+               if ((cellphone instanceof DialableCellphoneNumber) && (cellphone.getCellphoneProvider() instanceof MobileProvider)) {
                        this.setCellphoneCarrier(cellphone.getCellphoneProvider());
                        this.setCellphoneNumber(cellphone.getPhoneNumber());
                }
index b29c3e22d784ff897c86ed3298b5a20502b13460..7b72a0056c8e29fa966d0f1457ec9b1c695d16e0 100644 (file)
@@ -21,12 +21,12 @@ import java.util.Date;
 import java.util.List;
 import org.mxchange.jcontacts.contact.gender.Gender;
 import org.mxchange.jcountry.data.Country;
-import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
 import org.mxchange.jusercore.events.login.UserLoggedInEvent;
 import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
+import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider;
 
 /**
  * An interface for user beans
@@ -99,14 +99,14 @@ public interface JobsUserWebSessionController extends Serializable {
         * <p>
         * @return Cellphone number's carrier
         */
-       SmsProvider getCellphoneCarrier ();
+       MobileProvider getCellphoneCarrier ();
 
        /**
         * Setter for cellphone number's carrier prefix
         * <p>
         * @param cellphoneCarrier Cellphone number's carrier prefix
         */
-       void setCellphoneCarrier (final SmsProvider cellphoneCarrier);
+       void setCellphoneCarrier (final MobileProvider cellphoneCarrier);
 
        /**
         * Getter for ellphone number
diff --git a/src/java/org/mxchange/jjobs/converter/smsprovider/JobsMobileProviderConverter.java b/src/java/org/mxchange/jjobs/converter/smsprovider/JobsMobileProviderConverter.java
new file mode 100644 (file)
index 0000000..53e4be8
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2016 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.converter.smsprovider;
+
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.Objects;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.FacesConverter;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcoreeelogger.beans.local.logger.Log;
+import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
+import org.mxchange.jphone.phonenumbers.smsprovider.MobileProviderSingletonBeanRemote;
+import org.mxchange.jphone.phonenumbers.smsprovider.MobileProvider;
+
+/**
+ * Converter for SMS provider instance
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@FacesConverter (value = "cellphoneCarrier")
+public class JobsMobileProviderConverter implements Converter {
+
+       /**
+        * Logger instance
+        */
+       @Log
+       private LoggerBeanLocal loggerBeanLocal;
+
+       /**
+        * SMS provider bean
+        */
+       private MobileProviderSingletonBeanRemote providerController;
+
+       /**
+        * Initialization of this converter
+        */
+       public JobsMobileProviderConverter () {
+               // Try to get it
+               try {
+                       // Get initial context
+                       Context context = new InitialContext();
+
+                       // Lookup logger
+                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
+
+                       /// and SMS provider controller
+                       this.providerController = (MobileProviderSingletonBeanRemote) context.lookup("java:global/jjobs-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.MobileProviderSingletonBeanRemote"); //NOI18N
+               } catch (final NamingException ex) {
+                       // Continue to throw it
+                       throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
+               }
+       }
+
+       @Override
+       public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+               // Trace message
+               this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
+
+               // Is the value null or empty?
+               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+                       // Trace message
+                       this.loggerBeanLocal.logTrace("getAsObject: submittedValue is null or empty - EXIT!"); //NOI18N
+
+                       // Return null
+                       return null;
+               }
+
+               // Get full list
+               List<MobileProvider> providerList = this.providerController.allMobileProvider();
+
+               // Init value
+               MobileProvider provider = null;
+
+               // Try this better
+               try {
+                       // Convert it to long
+                       Long providerId = Long.parseLong(submittedValue);
+
+                       // Category id should not be below 1
+                       assert (providerId > 0) : "providerId is smaller than one: " + providerId; //NOI18N
+
+                       // Debug message
+                       this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: providerId={0}", providerId)); //NOI18N
+
+                       // Try to find it
+                       for (final MobileProvider prov : providerList) {
+                               // Is the id the same? (null-safe)
+                               if (Objects.equals(prov.getProviderId(), providerId)) {
+                                       // Found it
+                                       provider = prov;
+                                       break;
+                               }
+                       }
+               } catch (final NumberFormatException ex) {
+                       // Log exception (maybe to much?)
+                       this.loggerBeanLocal.logException(ex);
+               }
+
+               // Trace message
+               this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: provider={0} - EXIT!", provider)); //NOI18N
+
+               // Return it
+               return provider;
+       }
+
+       @Override
+       public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
+               // Is the object null?
+               if ((null == value) || ((String.valueOf(value)).isEmpty())) {
+                       // Is null
+                       return ""; //NOI18N
+               } else if (!(value instanceof MobileProvider)) {
+                       // Not same interface
+                       throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement MobileProvider.", value)); //NOI18N
+               }
+
+               // Return category id
+               return String.valueOf(((MobileProvider) value).getProviderId());
+       }
+
+}
diff --git a/src/java/org/mxchange/jjobs/converter/smsprovider/JobsSmsProviderConverter.java b/src/java/org/mxchange/jjobs/converter/smsprovider/JobsSmsProviderConverter.java
deleted file mode 100644 (file)
index 99feb4e..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Haeder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jjobs.converter.smsprovider;
-
-import java.text.MessageFormat;
-import java.util.List;
-import java.util.Objects;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.FacesConverter;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import org.mxchange.jcoreeelogger.beans.local.logger.Log;
-import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
-import org.mxchange.jphone.phonenumbers.smsprovider.SmsProvider;
-import org.mxchange.jphone.phonenumbers.smsprovider.SmsProviderSingletonBeanRemote;
-
-/**
- * Converter for SMS provider instance
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@FacesConverter (value = "cellphoneCarrier")
-public class JobsSmsProviderConverter implements Converter {
-
-       /**
-        * Logger instance
-        */
-       @Log
-       private LoggerBeanLocal loggerBeanLocal;
-
-       /**
-        * SMS provider bean
-        */
-       private SmsProviderSingletonBeanRemote providerController;
-
-       /**
-        * Initialization of this converter
-        */
-       public JobsSmsProviderConverter () {
-               // Try to get it
-               try {
-                       // Get initial context
-                       Context context = new InitialContext();
-
-                       // Lookup logger
-                       this.loggerBeanLocal = (LoggerBeanLocal) context.lookup("java:global/jcore-logger-ejb/logger!org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal"); //NOI18N
-
-                       /// and SMS provider controller
-                       this.providerController = (SmsProviderSingletonBeanRemote) context.lookup("java:global/jjobs-ejb/smsprovider!org.mxchange.jphone.phonenumbers.smsprovider.SmsProviderSingletonBeanRemote"); //NOI18N
-               } catch (final NamingException ex) {
-                       // Continue to throw it
-                       throw new RuntimeException(MessageFormat.format("context.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
-               }
-       }
-
-       @Override
-       public Object getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
-               // Trace message
-               this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: context={0},component={1},submittedValue={2} - CALLED!", context, component, submittedValue)); //NOI18N
-
-               // Is the value null or empty?
-               if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
-                       // Trace message
-                       this.loggerBeanLocal.logTrace("getAsObject: submittedValue is null or empty - EXIT!"); //NOI18N
-
-                       // Return null
-                       return null;
-               }
-
-               // Get full list
-               List<SmsProvider> providerList = this.providerController.allSmsProvider();
-
-               // Init value
-               SmsProvider provider = null;
-
-               // Try this better
-               try {
-                       // Convert it to long
-                       Long providerId = Long.parseLong(submittedValue);
-
-                       // Category id should not be below 1
-                       assert (providerId > 0) : "providerId is smaller than one: " + providerId; //NOI18N
-
-                       // Debug message
-                       this.loggerBeanLocal.logDebug(MessageFormat.format("getAsObject: providerId={0}", providerId)); //NOI18N
-
-                       // Try to find it
-                       for (final SmsProvider prov : providerList) {
-                               // Is the id the same? (null-safe)
-                               if (Objects.equals(prov.getProviderId(), providerId)) {
-                                       // Found it
-                                       provider = prov;
-                                       break;
-                               }
-                       }
-               } catch (final NumberFormatException ex) {
-                       // Log exception (maybe to much?)
-                       this.loggerBeanLocal.logException(ex);
-               }
-
-               // Trace message
-               this.loggerBeanLocal.logTrace(MessageFormat.format("getAsObject: provider={0} - EXIT!", provider)); //NOI18N
-
-               // Return it
-               return provider;
-       }
-
-       @Override
-       public String getAsString (final FacesContext context, final UIComponent component, final Object value) {
-               // Is the object null?
-               if ((null == value) || ((String.valueOf(value)).isEmpty())) {
-                       // Is null
-                       return ""; //NOI18N
-               } else if (!(value instanceof SmsProvider)) {
-                       // Not same interface
-                       throw new IllegalArgumentException(MessageFormat.format("value {0} does not implement SmsProvider.", value)); //NOI18N
-               }
-
-               // Return category id
-               return String.valueOf(((SmsProvider) value).getProviderId());
-       }
-
-}