X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Fjava%2Forg%2Fmxchange%2Faddressbook%2Fbeans%2Femail_address%2FAddressbookEmailChangeWebSessionBean.java;h=0c8956d0ef5ccee2667cebb2c47e1bb7d9af746a;hb=e96be6b90944d45af1b8746530f49d2790841fe9;hp=a08040ebaab42a55fe7bab4ef6c0f3d845a44e4f;hpb=511f09f14c881f34f48207e4e40eb5046aadc81d;p=addressbook-war.git
diff --git a/src/java/org/mxchange/addressbook/beans/email_address/AddressbookEmailChangeWebSessionBean.java b/src/java/org/mxchange/addressbook/beans/email_address/AddressbookEmailChangeWebSessionBean.java
index a08040eb..0c8956d0 100644
--- a/src/java/org/mxchange/addressbook/beans/email_address/AddressbookEmailChangeWebSessionBean.java
+++ b/src/java/org/mxchange/addressbook/beans/email_address/AddressbookEmailChangeWebSessionBean.java
@@ -2,16 +2,16 @@
* Copyright (C) 2016 Roland Haeder
*
* This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
+ * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package org.mxchange.addressbook.beans.email_address;
@@ -26,7 +26,7 @@ import javax.inject.Named;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.mxchange.addressbook.beans.login.UserLoginWebSessionController;
+import org.mxchange.addressbook.beans.login.AddressbookUserLoginWebSessionController;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
@@ -51,12 +51,12 @@ public class AddressbookEmailChangeWebSessionBean implements AddressbookEmailCha
/**
* Email address 1 (changing)
*/
- private String emailAddress1;
+ private String emailAddress;
/**
* Email address 2 (repeat in changing)
*/
- private String emailAddress2;
+ private String emailAddressRepeat;
/**
* Local list of already queued email addresses
@@ -72,7 +72,7 @@ public class AddressbookEmailChangeWebSessionBean implements AddressbookEmailCha
* Login bean (controller)
*/
@Inject
- private UserLoginWebSessionController loginController;
+ private AddressbookUserLoginWebSessionController loginController;
/**
* Default constructor
@@ -84,7 +84,7 @@ public class AddressbookEmailChangeWebSessionBean implements AddressbookEmailCha
Context context = new InitialContext();
// Try to lookup
- this.emailBean = (EmailChangeSessionBeanRemote) context.lookup("ejb/stateless-addressbook-email-change"); //NOI18N
+ this.emailBean = (EmailChangeSessionBeanRemote) context.lookup("java:global/addressbook-ejb/email-change!org.mxchange.jusercore.model.email_address.EmailChangeSessionBeanRemote"); //NOI18N
// Init list
this.emailAddresses = this.emailBean.allQueuedAddressesAsList();
@@ -103,7 +103,7 @@ public class AddressbookEmailChangeWebSessionBean implements AddressbookEmailCha
} else if (!this.isRequiredChangeEmailAddressSet()) {
// Not all required fields are set
throw new FaceletException("Not all required fields are set."); //NOI18N
- } else if (!Objects.equals(this.getEmailAddress1(), this.getEmailAddress2())) {
+ } else if (!Objects.equals(this.getEmailAddress(), this.getEmailAddressRepeat())) {
// Email address 1+2 mismatch
throw new FaceletException("Email address 1/2 are mismatching."); //NOI18N
} else if (!this.loginController.ifCurrentPasswordMatches()) {
@@ -123,7 +123,7 @@ public class AddressbookEmailChangeWebSessionBean implements AddressbookEmailCha
assert (user.getUserContact().getContactId() > 0) : MessageFormat.format("Instance loginController.userContact.contactId={0} is invalid", user.getUserContact().getContactId()); //NOI18N
// Get dummy email address
- String dummyEmail = this.getEmailAddress1();
+ String dummyEmail = this.getEmailAddress();
// Unset all so the user is forced to re-enter it
this.clear();
@@ -145,29 +145,29 @@ public class AddressbookEmailChangeWebSessionBean implements AddressbookEmailCha
}
@Override
- public String getEmailAddress1 () {
- return this.emailAddress1;
+ public String getEmailAddress () {
+ return this.emailAddress;
}
@Override
- public void setEmailAddress1 (final String emailAddress1) {
- this.emailAddress1 = emailAddress1;
+ public void setEmailAddress (final String emailAddress) {
+ this.emailAddress = emailAddress;
}
@Override
- public String getEmailAddress2 () {
- return this.emailAddress2;
+ public String getEmailAddressRepeat () {
+ return this.emailAddressRepeat;
}
@Override
- public void setEmailAddress2 (final String emailAddress2) {
- this.emailAddress2 = emailAddress2;
+ public void setEmailAddressRepeat (final String emailAddressRepeat) {
+ this.emailAddressRepeat = emailAddressRepeat;
}
@Override
public boolean isRequiredChangeEmailAddressSet () {
- return ((this.getEmailAddress1() != null) &&
- (this.getEmailAddress2() != null));
+ return ((this.getEmailAddress() != null) &&
+ (this.getEmailAddressRepeat() != null));
}
/**
@@ -175,8 +175,8 @@ public class AddressbookEmailChangeWebSessionBean implements AddressbookEmailCha
*/
private void clear () {
// Clear fields
- this.setEmailAddress1(null);
- this.setEmailAddress2(null);
+ this.setEmailAddress(null);
+ this.setEmailAddressRepeat(null);
}
/**
@@ -186,7 +186,7 @@ public class AddressbookEmailChangeWebSessionBean implements AddressbookEmailCha
*
* @param emailAddress Email address to verify
*
- * @return Whether the email address in field emailAddress1 is already queued
+ * @return Whether the email address in field emailAddress is already queued
*/
private boolean isEmailAddressQueued (final String emailAddress) {
// It should be there