${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.displayName=CopyLibs Task
libs.CopyLibs.prop-version=2.0
-libs.JCache_CDI.classpath=\
- ${base}/JCache_CDI/jcache-cdi-0.1-SNAPSHOT.jar
-libs.JCache_CDI.displayName=JCache CDI
-libs.JCache_CDI.src=\
- ${base}/JCache_CDI/jcache-cdi-0.1-SNAPSHOT-sources.jar!//
+libs.payara-api.classpath=\
+ ${base}/payara-api/payara-api.jar
+libs.payara-api.displayName=Payara API
libs.primefaces.classpath=\
${base}/primefaces/primefaces-6.0.jar
libs.primefaces.displayName=PrimeFaces 6.0
endorsed.classpath=
excludes=
file.reference.cdi-api.jar=lib/cdi-api.jar
-file.reference.gf-client.jar=lib/gf-client.jar
file.reference.jaddressbook-core.jar=lib/jaddressbook-core.jar
file.reference.jaddressbook-lib.jar=lib/jaddressbook-lib.jar
file.reference.jaddressbook-share-core.jar=lib/jaddressbook-share-core.jar
${reference.addressbook-core.jar}:\
${reference.addressbook-lib.jar}:\
${file.reference.cdi-api.jar}:\
- ${file.reference.gf-client.jar}:\
${libs.apache_poi.classpath}:\
${libs.primefaces.classpath}:\
- ${libs.cache.classpath}
+ ${libs.cache.classpath}:\
+ ${libs.payara-api.classpath}
# Space-separated list of extra javac options
javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
javac.debug=true
<library dirs="200">
<file>${file.reference.cdi-api.jar}</file>
</library>
- <library dirs="200">
- <file>${file.reference.gf-client.jar}</file>
- </library>
<library dirs="200">
<file>${libs.apache_poi.classpath}</file>
<path-in-war>WEB-INF/lib</path-in-war>
<library dirs="200">
<file>${libs.cache.classpath}</file>
</library>
+ <library dirs="200">
+ <file>${libs.payara-api.classpath}</file>
+ </library>
</web-module-libraries>
<web-module-additional-libraries/>
<source-roots>
*/
package org.mxchange.addressbook.beans.business.basicdata;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.annotation.PostConstruct;
+import javax.cache.Cache;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Observes;
* A list of all registered companies (globally)
*/
@Inject
- @Cached (cacheName = "basicDataCache")
+ @NamedCache (cacheName = "basicDataCache", managementEnabled = true)
private transient Cache<Long, BusinessBasicData> basicDataCache;
/**
*/
package org.mxchange.addressbook.beans.business.employee;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
+import org.mxchange.addressbook.beans.BaseAddressbookController;
import org.mxchange.jcontactsbusiness.model.employee.CompanyEmployeeSessionBeanRemote;
import org.mxchange.jcontactsbusiness.model.employee.Employee;
-import org.mxchange.addressbook.beans.BaseAddressbookController;
/**
* A request-scoped bean for general purposes for company employees.
* List of all company employees
*/
@Inject
- @Cached(cacheName = "companyEmployeeCache")
+ @NamedCache (cacheName = "companyEmployeeCache", managementEnabled = true)
private transient Cache<Long, Employee> companyEmployeeCache;
/**
*/
package org.mxchange.addressbook.beans.contact;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import javax.annotation.PostConstruct;
+import javax.cache.Cache;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Observes;
* Contact list
*/
@Inject
- @Cached (cacheName = "contactsCache")
+ @NamedCache (cacheName = "contactsCache", managementEnabled = true)
private transient Cache<Long, Contact> contactsCache;
/**
* Email address list
*/
@Inject
- @Cached (cacheName = "emailAddressCache")
+ @NamedCache (cacheName = "emailAddressCache", managementEnabled = true)
private transient Cache<Long, String> emailAddressCache;
/**
*/
package org.mxchange.addressbook.beans.contact.phone;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
-import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import java.util.Objects;
+import javax.cache.Cache;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
* per each type is supported. Maybe later this will change into a OneToMany
* relationship (one contact, many numbers).
*/
- private final Map<DialableNumber, List<Contact>> contacts;
+ @Inject
+ @NamedCache (cacheName = "contactsPhoneCache", managementEnabled = true)
+ private transient Cache<DialableNumber, List<Contact>> contactsPhoneCache;
/**
* fax number
public AddressbookContactPhoneWebRequestBean () {
// Call super constructor
super();
-
- // Init lists/maps
- this.contacts = new HashMap<>(10);
}
/**
*/
package org.mxchange.addressbook.beans.country;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.annotation.PostConstruct;
+import javax.cache.Cache;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Observes;
* List of all countries
*/
@Inject
- @Cached (cacheName = "countryCache")
+ @NamedCache (cacheName = "countryCache", managementEnabled = true)
private transient Cache<Long, Country> countryCache;
/**
*/
package org.mxchange.addressbook.beans.mobileprovider;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
import java.util.Iterator;
import java.util.LinkedList;
*/
private static final long serialVersionUID = 15_869_423_671_950_276L;
- /**
- * "Cached" list of mobile providers
- */
- @Inject
- @Cached (cacheName = "mobileProviderCache")
- private transient Cache<Long, MobileProvider> mobileProviderCache;
-
/**
* Remote EJB for mobile providers (regular)
*/
@EJB (lookup = "java:global/addressbook-ejb/mobileprovider!org.mxchange.jphone.phonenumbers.mobileprovider.MobileProviderSingletonBeanRemote")
private MobileProviderSingletonBeanRemote mobileProviderBean;
+ /**
+ * "Cached" list of mobile providers
+ */
+ @Inject
+ @NamedCache (cacheName = "mobileProviderCache", managementEnabled = true)
+ private transient Cache<Long, MobileProvider> mobileProviderCache;
+
/**
* Default constructor
*/
*/
package org.mxchange.addressbook.beans.phone;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import javax.annotation.PostConstruct;
+import javax.cache.Cache;
import javax.ejb.EJB;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
* All fax numbers
*/
@Inject
- @Cached(cacheName = "faxNumberCache")
+ @NamedCache (cacheName = "faxNumberCache", managementEnabled = true)
private transient Cache<Long, DialableFaxNumber> faxNumberCache;
/**
* All land-line numbers
*/
@Inject
- @Cached(cacheName = "landLineNumberCache")
+ @NamedCache (cacheName = "landLineNumberCache", managementEnabled = true)
private transient Cache<Long, DialableLandLineNumber> landLineNumberCache;
/**
* All mobile numbers
*/
@Inject
- @Cached(cacheName = "mobileNumberCache")
+ @NamedCache (cacheName = "mobileNumberCache", managementEnabled = true)
private transient Cache<Long, DialableMobileNumber> mobileNumberCache;
/**
import javax.faces.view.facelets.FaceletException;
import javax.inject.Inject;
import javax.inject.Named;
+import org.mxchange.addressbook.beans.BaseAddressbookController;
+import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestController;
+import org.mxchange.addressbook.beans.contact.AddressbookContactWebRequestController;
import org.mxchange.addressbook.beans.localization.AddressbookLocalizationSessionController;
import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcoreee.utils.FacesUtils;
-<<<<<<< HEAD:src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java
-import org.mxchange.addressbook.beans.BaseAddressbookController;
-import org.mxchange.addressbook.beans.contact.AddressbookAdminContactWebRequestController;
import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
import org.mxchange.juserlogincore.exceptions.UserPasswordRepeatMismatchException;
import org.mxchange.juserlogincore.login.UserLoginUtils;
-import org.mxchange.addressbook.beans.contact.AddressbookContactWebRequestController;
/**
* A user bean (controller)
* @return Redirect outcome
*/
public String addUser () {
- System.out.println("addUser: this.contact=" + this.getContact());
// As the form cannot validate the data (required="true"), check it here
if (this.getUserName() == null) {
// Throw NPE
*/
package org.mxchange.addressbook.beans.user;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Objects;
import javax.annotation.PostConstruct;
+import javax.cache.Cache;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Event;
@EJB (lookup = "java:global/addressbook-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote")
private UserSessionBeanRemote userBean;
- /**
- * User id
- */
- private Long userId;
-
/**
* A list of all user profiles
*/
@Inject
- @Cached (cacheName = "userCache")
+ @NamedCache (cacheName = "userCache", managementEnabled = true)
private transient Cache<Long, User> userCache;
+ /**
+ * User id
+ */
+ private Long userId;
+
/**
* Login controller (bean)
*/
* User name list
*/
@Inject
- @Cached (cacheName = "userNameCache")
+ @NamedCache (cacheName = "userNameCache", managementEnabled = true)
private transient Cache<Long, String> userNameCache;
/**
*/
package org.mxchange.addressbook.beans.user.activity;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import java.util.List;
import javax.annotation.PostConstruct;
+import javax.cache.Cache;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Observes;
* "Cache" for activity log per user
*/
@Inject
- @Cached(cacheName = "usersActivityCache")
- private transient Cache<User, List<LogableUserActivity>> usersActivityCache;
+ @NamedCache (cacheName = "userActivityCache", managementEnabled = true)
+ private transient Cache<User, List<LogableUserActivity>> userActivityCache;
/**
* Default constructor
List<LogableUserActivity> list = new LinkedList<>();
// Is the user set?
- if (this.usersActivityCache.containsKey(this.getUser())) {
+ if (this.userActivityCache.containsKey(this.getUser())) {
// Return it
- list.addAll(this.usersActivityCache.get(this.getUser()));
+ list.addAll(this.userActivityCache.get(this.getUser()));
// Sort list and reverse it
Collections.sort(list, new UserActivityLogTimestampComparator());
// Put all in map, per-user
for (final LogableUserActivity userActivity : list) {
// Is the list there?
- if (!this.usersActivityCache.containsKey(userActivity.getActivityUser())) {
+ if (!this.userActivityCache.containsKey(userActivity.getActivityUser())) {
// Init list
- this.usersActivityCache.put(userActivity.getActivityUser(), new LinkedList<LogableUserActivity>());
+ this.userActivityCache.put(userActivity.getActivityUser(), new LinkedList<LogableUserActivity>());
}
// Add by user instance
- boolean added = this.usersActivityCache.get(userActivity.getActivityUser()).add(userActivity);
+ boolean added = this.userActivityCache.get(userActivity.getActivityUser()).add(userActivity);
// Should be added
assert (added) : "Activity log not added"; //NOI18N
}
// Is it there?
- if (!this.usersActivityCache.containsKey(userActivity.getActivityUser())) {
+ if (!this.userActivityCache.containsKey(userActivity.getActivityUser())) {
// Init it
- this.usersActivityCache.put(userActivity.getActivityUser(), new LinkedList<LogableUserActivity>());
+ this.userActivityCache.put(userActivity.getActivityUser(), new LinkedList<LogableUserActivity>());
}
// Add activity to log
- this.usersActivityCache.get(userActivity.getActivityUser()).add(userActivity);
+ this.userActivityCache.get(userActivity.getActivityUser()).add(userActivity);
}
}
import javax.faces.view.facelets.FaceletException;
import javax.inject.Inject;
import javax.inject.Named;
+import org.mxchange.addressbook.beans.BaseAddressbookController;
+import org.mxchange.addressbook.beans.user.AddressbookUserWebRequestController;
import org.mxchange.jcoreee.events.helper.clear.HelperCleanupEvent;
import org.mxchange.jcoreee.events.helper.clear.ObservableHelperCleanupEvent;
import org.mxchange.jcoreee.utils.FacesUtils;
-<<<<<<< HEAD:src/java/org/mxchange/addressbook/beans/user/confirmlink/AddressbookConfirmationLinkWebRequestBean.java
-import org.mxchange.addressbook.beans.BaseAddressbookController;
import org.mxchange.jusercore.events.user.created.CreatedUserEvent;
import org.mxchange.jusercore.events.user.created.ObservableCreatedUserEvent;
import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
import org.mxchange.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
import org.mxchange.juserlogincore.events.confirmation.UserConfirmedAccountEvent;
-import org.mxchange.addressbook.beans.user.AddressbookUserWebRequestController;
/**
* A web request bean for confirmation link handling
@Override
public void maybeConfirmUserAccount () {
- // Trace message
- System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
// Is the confirmation key set?
if (this.getConfirmationKey() == null) {
// May be null if not set
// Now try to find the user in user list, first get the whole list
List<User> users = this.userController.allUsers();
- // Debug message
- System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: users.size()={1}", this.getClass().getSimpleName(), users.size())); //NOI18N
-
// Get iterator from it
Iterator<User> iterator = users.iterator();
// Get next user
User next = iterator.next();
- // Debug message
- System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: this.confirmationKey={1},next.confirmationKey={2}", this.getClass().getSimpleName(), this.getConfirmationKey(), next.getUserConfirmKey())); //NOI18N
-
// Same confirmation key?
if (Objects.equals(this.getConfirmationKey(), next.getUserConfirmKey())) {
- // Debug message
- System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: next={1} - Aborting ...", this.getClass().getSimpleName(), next)); //NOI18N
-
// Found it, then set it and abort loop
user = next;
break;
}
}
- // Debug message
- System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: user={1}", this.getClass().getSimpleName(), user)); //NOI18N
-
// Is the user instance null?
if ((null == user) || (user.getUserAccountStatus() != UserAccountStatus.UNCONFIRMED)) {
// Then clear this bean and the helper
// Try to confirm it
this.confirmUserAccount(user);
}
-
- // Trace message
- System.out.println(MessageFormat.format("{0}.maybeConfirmAccount: EXIT!", this.getClass().getSimpleName())); //NOI18N
}
/**
* @param user User instance
*/
private void confirmUserAccount (final User user) {
- // Trace message
- System.out.println(MessageFormat.format("{0}.confirmUserAccount: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
-
// Should be set
if (null == user) {
// Throw NPE
// Get base URL
String baseUrl = FacesUtils.generateBaseUrl();
- // Debug message
- System.out.println(MessageFormat.format("{0}.confirmUserAccount: baseUrl={1}", this.getClass().getSimpleName(), baseUrl)); //NOI18N
-
// Confirm account
updatedUser = this.userBean.confirmAccount(user, baseUrl);
-
- // Debug message
- System.out.println(MessageFormat.format("{0}.confirmUserAccount: updatedUser={1} - Returned from EJB", this.getClass().getSimpleName(), updatedUser)); //NOI18N
} catch (final UserStatusConfirmedException | UserStatusLockedException ex) {
// Something unexpected happened
throw new FaceletException(MessageFormat.format("Cannot confirm user account {0}", user.getUserName()), ex); //NOI18N
// Fire event that the user has confirmed account
this.userConfirmedEvent.fire(new UserConfirmedAccountEvent(updatedUser));
- // Debug message
- System.out.println(MessageFormat.format("{0}.confirmUserAccount: updatedUser={1}", this.getClass().getSimpleName(), updatedUser)); //NOI18N
-
// Fire event
this.userCreatedEvent.fire(new CreatedUserEvent(updatedUser));
-
- // Trace message
- System.out.println(MessageFormat.format("{0}.confirmUserAccount: EXIT!", this.getClass().getSimpleName())); //NOI18N
}
}
*/
package org.mxchange.addressbook.beans.user.email_address;
+import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import javax.annotation.PostConstruct;
+import javax.cache.Cache;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.view.facelets.FaceletException;
* Local list of already queued email addresses
*/
@Inject
- @Cached (cacheName = "queuedEmailCache")
+ @NamedCache (cacheName = "queuedEmailCache", managementEnabled = true)
private transient Cache<String, Boolean> queuedEmailCache;
/**