]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - src/java/org/mxchange/pizzaapplication/beans/contact/phone/PizzaContactPhoneWebRequestBean.java
Updated copyright year
[pizzaservice-war.git] / src / java / org / mxchange / pizzaapplication / beans / contact / phone / PizzaContactPhoneWebRequestBean.java
index 3de41314ed2ce93652ca2db4debdce74661314cb..63c22dbcd0cfbf951ff4f3b0f5ed285dd1d727b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2024 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
  */
 package org.mxchange.pizzaapplication.beans.contact.phone;
 
+import fish.payara.cdi.jsr107.impl.NamedCache;
 import java.text.MessageFormat;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Objects;
-import javax.enterprise.context.SessionScoped;
+import javax.cache.Cache;
+import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -38,7 +40,7 @@ import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.pizzaapplication.beans.BasePizzaController;
+import org.mxchange.pizzaapplication.beans.BasePizzaBean;
 import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebRequestController;
 
 /**
@@ -47,13 +49,13 @@ import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebRequestControl
  * @author Roland Häder<roland@mxchange.org>
  */
 @Named ("contactPhoneController")
-@SessionScoped
-public class PizzaContactPhoneWebRequestBean extends BasePizzaController implements PizzaContactPhoneWebRequestController {
+@RequestScoped
+public class PizzaContactPhoneWebRequestBean extends BasePizzaBean implements PizzaContactPhoneWebRequestController {
 
        /**
         * Serial number
         */
-       private static final long serialVersionUID = 542_145_347_916L;
+       private static final long serialVersionUID = 542_145_355_001L;
 
        /**
         * General contact controller
@@ -67,8 +69,8 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme
         * relationship (one contact, many numbers).
         */
        @Inject
-       @Cached(cacheName = "contactsPhoneCache")
-       private transient Cache<DialableNumber, List<Contact>> contactsPhoneCache;
+       @NamedCache (cacheName = "contactsPhoneCache")
+       private Cache<DialableNumber, List<Contact>> contactsPhoneCache;
 
        /**
         * fax number
@@ -338,7 +340,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme
         */
        public List<Contact> allCurrentFaxNumberContacts () {
                // Get id
-               DialableFaxNumber number = this.getFaxNumber();
+               final DialableFaxNumber number = this.getFaxNumber();
 
                // Is cache there?
                if (this.contactsPhoneCache.containsKey(number)) {
@@ -346,7 +348,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme
                        return this.contactsPhoneCache.get(number);
                } else {
                        // Ask bean
-                       List<Contact> list = new LinkedList<>();
+                       final List<Contact> list = new LinkedList<>();
 
                        // "Walk" through all contacts
                        for (final Contact contact : this.contactController.allContacts()) {
@@ -372,7 +374,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme
         */
        public List<Contact> allCurrentLandLineNumberContacts () {
                // Get id
-               DialableLandLineNumber number = this.getLandLineNumber();
+               final DialableLandLineNumber number = this.getLandLineNumber();
 
                // Is cache there?
                if (this.contactsPhoneCache.containsKey(number)) {
@@ -380,7 +382,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme
                        return this.contactsPhoneCache.get(number);
                } else {
                        // Ask bean
-                       List<Contact> list = new LinkedList<>();
+                       final List<Contact> list = new LinkedList<>();
 
                        // "Walk" through all contacts
                        for (final Contact contact : this.contactController.allContacts()) {
@@ -406,7 +408,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme
         */
        public List<Contact> allCurrentMobileNumberContacts () {
                // Get id
-               DialableMobileNumber number = this.getMobileNumber();
+               final DialableMobileNumber number = this.getMobileNumber();
 
                // Is cache there?
                if (this.contactsPhoneCache.containsKey(number)) {
@@ -414,7 +416,7 @@ public class PizzaContactPhoneWebRequestBean extends BasePizzaController impleme
                        return this.contactsPhoneCache.get(number);
                } else {
                        // Ask bean
-                       List<Contact> list = new LinkedList<>();
+                       final List<Contact> list = new LinkedList<>();
 
                        // "Walk" through all contacts
                        for (final Contact contact : this.contactController.allContacts()) {