]> git.mxchange.org Git - addressbook-war.git/blobdiff - src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java
updated own name and resources
[addressbook-war.git] / src / java / org / mxchange / addressbook / beans / mobileprovider / AddressbookAdminMobileProviderWebRequestBean.java
index 5b052c515e3e7fa9f60529b45a9ba924e250fbaf..01fc8bd5edef4c1e6e300d98233f75d3c7211d56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Roland Haeder
+ * Copyright (C) 2016 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -28,6 +28,7 @@ import javax.inject.Named;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import org.mxchange.addressbook.beans.BaseAddressbookController;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jphone.events.AdminAddedMobileProviderEvent;
 import org.mxchange.jphone.events.AdminMobileProviderAddedEvent;
@@ -39,11 +40,11 @@ import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
 /**
  * Administrative bean (controller) for mobile provider
  * <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
  */
 @Named ("adminMobileProviderController")
 @RequestScoped
-public class AddressbookAdminMobileProviderWebRequestBean implements AddressbookAdminMobileProviderWebRequestController {
+public class AddressbookAdminMobileProviderWebRequestBean extends BaseAddressbookController implements AddressbookAdminMobileProviderWebRequestController {
 
        /**
         * Serial number
@@ -113,7 +114,8 @@ public class AddressbookAdminMobileProviderWebRequestBean implements Addressbook
                // Is the provider already created?
                if (this.isMobileProviderCreated(mobileProvider)) {
                        // Then throw exception
-                       throw new FaceletException(new MobileProviderAlreadyAddedException(mobileProvider));
+                       this.showFacesMessage("form_add_mobile_provider:providerDialPrefix", new MobileProviderAlreadyAddedException(mobileProvider)); //NOI18N
+                       return ""; //NOI18N
                }
 
                // Init variable
@@ -134,11 +136,6 @@ public class AddressbookAdminMobileProviderWebRequestBean implements Addressbook
                return "admin_list_mobile_provider"; //NOI18N
        }
 
-       @Override
-       public List<MobileProvider> allMobileProvider () {
-               return this.mobileController.allMobileProvider();
-       }
-
        @Override
        public Country getProviderCountry () {
                return this.providerCountry;
@@ -179,11 +176,6 @@ public class AddressbookAdminMobileProviderWebRequestBean implements Addressbook
                this.providerName = providerName;
        }
 
-       @Override
-       public boolean hasMobileProvider () {
-               return (!this.allMobileProvider().isEmpty());
-       }
-
        /**
         * Checks whether if the given mobile provider is already created by
         * checking both dial prefix and country.
@@ -197,7 +189,7 @@ public class AddressbookAdminMobileProviderWebRequestBean implements Addressbook
                boolean isFound = false;
 
                // Get list of all providers
-               List<MobileProvider> providers = this.allMobileProvider();
+               List<MobileProvider> providers = this.mobileController.allMobileProvider();
 
                // Get iterator from it
                Iterator<MobileProvider> iterator = providers.iterator();