/*
- * 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;
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;
/**
* @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
* 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
*/
public List<Contact> allCurrentFaxNumberContacts () {
// Get id
- DialableFaxNumber number = this.getFaxNumber();
+ final DialableFaxNumber number = this.getFaxNumber();
// Is cache there?
if (this.contactsPhoneCache.containsKey(number)) {
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()) {
*/
public List<Contact> allCurrentLandLineNumberContacts () {
// Get id
- DialableLandLineNumber number = this.getLandLineNumber();
+ final DialableLandLineNumber number = this.getLandLineNumber();
// Is cache there?
if (this.contactsPhoneCache.containsKey(number)) {
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()) {
*/
public List<Contact> allCurrentMobileNumberContacts () {
// Get id
- DialableMobileNumber number = this.getMobileNumber();
+ final DialableMobileNumber number = this.getMobileNumber();
// Is cache there?
if (this.contactsPhoneCache.containsKey(number)) {
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()) {