]> git.mxchange.org Git - jjobs-war.git/commitdiff
added redirection outcomes to all "addFoo" methods
authorRoland Häder <roland@mxchange.org>
Wed, 27 Apr 2016 10:30:07 +0000 (12:30 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 6 May 2016 20:55:02 +0000 (22:55 +0200)
Signed-off-by: Roland Häder <roland@haeder.net>
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java
src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestController.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/jjobs/beans/mobileprovider/JobsAdminMobileProviderWebRequestController.java

index f8441a22e5517e7343625c0c39a31f25b0971345..ed3beb6d27956f175a024115167fc1bd8b0d9b1c 100644 (file)
@@ -115,7 +115,7 @@ public class JobsAdminCountryWebRequestBean implements JobsAdminCountryWebReques
        }
 
        @Override
-       public void addCountry () {
+       public String addCountry () {
                // Create new country object
                Country country = new CountryData();
 
@@ -146,6 +146,9 @@ public class JobsAdminCountryWebRequestBean implements JobsAdminCountryWebReques
 
                // Fire event
                this.addedCountryEvent.fire(new AdminEventCountryAdded(updatedCountry));
+
+               // Redirect to list
+               return "admin_list_country"; //NOI18N
        }
 
        @Override
index f0ab501266747f6138aa08caf4f0e347ecf12caf..9ea1d2a282860c325b166c354020fd5118ddfab1 100644 (file)
@@ -35,9 +35,12 @@ public interface JobsAdminCountryWebRequestController extends Serializable {
        List<Country> allCountries ();
 
        /**
-        * Adds country to all relevant beans and sends it to the EJB.
+        * Adds country to all relevant beans and sends it to the EJB. A redirect
+        * should happen after successfull creation.
+        * <p>
+        * @return Redirect outcome
         */
-       void addCountry ();
+       String addCountry ();
 
        /**
         * Checks whether countries has been registered
@@ -99,7 +102,7 @@ public interface JobsAdminCountryWebRequestController extends Serializable {
         * Setter for whether the local dial prefix is required for local calls
         * <p>
         * @param countryIsLocalPrefixRequired Whether the local dial prefix is
-        *                                     required
+        * required
         */
        void setCountryIsLocalPrefixRequired (final Boolean countryIsLocalPrefixRequired);
 
index 55c1808d07f9c1ed9489442247229166dee5235a..a432548bf9bf7163e2692f2694ff7c00f3470279 100644 (file)
@@ -106,7 +106,7 @@ public class JobsAdminMobileProviderWebRequestBean implements JobsAdminMobilePro
        }
 
        @Override
-       public void addMobileProvider () {
+       public String addMobileProvider () {
                // Create mobile provider instance
                MobileProvider mobileProvider = new CellphoneProvider(this.getProviderDialPrefix(), this.getProviderName(), this.getProviderCountry(), this.getProviderMailPattern());
 
@@ -129,6 +129,9 @@ public class JobsAdminMobileProviderWebRequestBean implements JobsAdminMobilePro
 
                // Fire event
                this.providerAddedEvent.fire(new AdminMobileProviderAddedEvent(updatedProvider));
+
+               // Redirect to list
+               return "admin_list_mobile_provider"; //NOI18N
        }
 
        @Override
index dbaabefa7864c861e1384e1ce3cbfba30ae82bce..7e380bdc9a7329a6dd3e001931c58f935be51f2f 100644 (file)
@@ -32,9 +32,11 @@ public interface JobsAdminMobileProviderWebRequestController extends Serializabl
        /**
         * Adds a mobile provider to database by calling the EJB. A pre-check on
         * dial-prefix and country combination is done, if found, an exception is
-        * thrown.
+        * thrown. A redirect should take place after successfull creation.
+        * <p>
+        * @return Redirect outcome
         */
-       void addMobileProvider ();
+       String addMobileProvider ();
 
        /**
         * Returns a list of all mobile providers