]> git.mxchange.org Git - addressbook-ejb.git/commitdiff
Don't cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 18 Apr 2020 13:31:11 +0000 (15:31 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 18 Apr 2020 13:31:11 +0000 (15:31 +0200)
- renamed for Addressbook application

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jcontacts/model/contact/AddressbookAdminContactSessionBean.java
src/java/org/mxchange/jcountry/model/data/AddressbookAdminCountrySingletonBean.java
src/java/org/mxchange/jphone/model/phonenumbers/mobile/AddressbookAdminMobileSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jphone/model/phonenumbers/mobile/AddressbookMobileSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jphone/model/phonenumbers/mobile/FinancialsAdminMobileSessionBean.java [deleted file]
src/java/org/mxchange/jphone/model/phonenumbers/mobile/FinancialsMobileSessionBean.java [deleted file]

index f4c558a4a5bf69546acdf123f522035c2c2ee8a3..80f9255cf5cf93c62ae442e704f7d37a1311d1fb 100644 (file)
@@ -40,7 +40,7 @@ public class AddressbookAdminContactSessionBean extends BaseAddressbookEnterpris
        /**
         * EJB for general contact purposes
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/contact!org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote")
+       @EJB (lookup = "java:global/addressbook-ejb/contact!org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote")
        private ContactSessionBeanRemote contactBean;
 
        /**
index 42878bd780c57b01472450e6502f255e14865f48..87e193d1fd7ff233ec8ae18ce0ae214e8bacbef2 100644 (file)
@@ -40,7 +40,7 @@ public class AddressbookAdminCountrySingletonBean extends BaseAddressbookEnterpr
        /**
         * Remote country EJB
         */
-       @EJB (lookup = "java:global/jfinancials-ejb/country!org.mxchange.jcountry.model.data.CountrySingletonBeanRemote")
+       @EJB (lookup = "java:global/addressbook-ejb/country!org.mxchange.jcountry.model.data.CountrySingletonBeanRemote")
        private CountrySingletonBeanRemote countryBean;
 
        /**
diff --git a/src/java/org/mxchange/jphone/model/phonenumbers/mobile/AddressbookAdminMobileSessionBean.java b/src/java/org/mxchange/jphone/model/phonenumbers/mobile/AddressbookAdminMobileSessionBean.java
new file mode 100644 (file)
index 0000000..8fc58c3
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2016 - 2020 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
+ * 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.model.phonenumbers.mobile;
+
+import java.text.MessageFormat;
+import java.util.Date;
+import javax.ejb.Stateless;
+import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
+
+/**
+ * An EJB for administrative mobile number purposes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "adminMobile", description = "An administrative bean handling mobile number data")
+public class AddressbookAdminMobileSessionBean extends BaseAddressbookEnterpriseBean implements AdminMobileSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 18_597_165_817_401_854L;
+
+       /**
+        * Default constructor
+        */
+       public AddressbookAdminMobileSessionBean () {
+               // Call super constructor
+               super();
+       }
+
+       @Override
+       public void deleteMobileData (final DialableMobileNumber mobileNumber) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber));
+
+               // Is all data set
+               if (null == mobileNumber) {
+                       // Not set, throw NPE
+                       throw new NullPointerException("mobileNumber is null"); //NOI18N
+               } else if (mobileNumber.getMobileId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
+               } else if (mobileNumber.getMobileId() < 1) {
+                       // Invalid number
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getMobileId())); //NOI18N
+               } else if (mobileNumber.getMobileProvider() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("mobileNumber.cellphoneProvider is null"); //NOI18N
+               } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
+                       // ... throw again
+                       throw new NullPointerException("mobileNumber.cellphoneProvider.providerId is null"); //NOI18N
+               } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
+                       // Id not valid
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.cellphoneProvider.providerId={0} is not valid.", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
+               } else if (mobileNumber.getMobileNumber() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("mobileNumber.mobileNumber is null"); //NOI18N
+               } else if (mobileNumber.getMobileNumber() < 1) {
+                       // Throw NPE again
+                       throw new NullPointerException(MessageFormat.format("mobileNumber.mobileNumber={0} is not valid.", mobileNumber.getMobileNumber())); //NOI18N
+               }
+
+               // Get a managed instance
+               final DialableMobileNumber managedNumber = this.getEntityManager().getReference(mobileNumber.getClass(), mobileNumber.getMobileId());
+
+               // Remove it from database
+               this.getEntityManager().remove(managedNumber);
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteMobileData: EXIT!", this.getClass().getSimpleName()));
+       }
+
+       @Override
+       public DialableMobileNumber updateMobileData (final DialableMobileNumber mobileNumber) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber));
+
+               // Is all data set
+               if (null == mobileNumber) {
+                       // Not set, throw NPE
+                       throw new NullPointerException("mobileNumber is null"); //NOI18N
+               } else if (mobileNumber.getMobileId() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
+               } else if (mobileNumber.getMobileId() < 1) {
+                       // Invalid number
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getMobileId())); //NOI18N
+               } else if (mobileNumber.getMobileProvider() == null) {
+                       // Throw NPE
+                       throw new NullPointerException("mobileNumber.cellphoneProvider is null"); //NOI18N
+               } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
+                       // ... throw again
+                       throw new NullPointerException("mobileNumber.cellphoneProvider.providerId is null"); //NOI18N
+               } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
+                       // Id not valid
+                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.cellphoneProvider.providerId={0} is not valid.", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
+               } else if (mobileNumber.getMobileNumber() == null) {
+                       // Throw NPE again
+                       throw new NullPointerException("mobileNumber.mobileNumber is null"); //NOI18N
+               } else if (mobileNumber.getMobileNumber() < 1) {
+                       // Throw NPE again
+                       throw new NullPointerException(MessageFormat.format("mobileNumber.mobileNumber={0} is not valid.", mobileNumber.getMobileNumber())); //NOI18N
+               }
+
+               // Get contact from it and find it
+               final DialableMobileNumber managedNumber = this.getEntityManager().find(mobileNumber.getClass(), mobileNumber.getMobileId());
+
+               // Should be found
+               assert (managedNumber instanceof DialableMobileNumber) : MessageFormat.format("Cell phone number with id {0} not found, but should be.", mobileNumber.getMobileId()); //NOI18N
+
+               // Debug message
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateMobileData: managedNumber.phoneId={1}", this.getClass().getSimpleName(), managedNumber.getMobileId())); //NOI18N
+
+               // Set updated timestamp
+               MobileNumbers.copyMobileNumber(mobileNumber, managedNumber);
+               managedNumber.setMobileEntryUpdated(new Date());
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateMobileData: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), managedNumber)); //NOI18N
+
+               // Return it
+               return managedNumber;
+       }
+
+}
diff --git a/src/java/org/mxchange/jphone/model/phonenumbers/mobile/AddressbookMobileSessionBean.java b/src/java/org/mxchange/jphone/model/phonenumbers/mobile/AddressbookMobileSessionBean.java
new file mode 100644 (file)
index 0000000..b7f3744
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2016 - 2020 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
+ * 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.model.phonenumbers.mobile;
+
+import java.text.MessageFormat;
+import java.util.List;
+import javax.ejb.Stateless;
+import javax.persistence.Query;
+import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean;
+
+/**
+ * A general mobile number EJB
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "mobile", description = "A bean handling mobile number data")
+public class AddressbookMobileSessionBean extends BaseAddressbookEnterpriseBean implements MobileSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 134_945_698_127_602L;
+
+       /**
+        * Default constructor
+        */
+       public AddressbookMobileSessionBean () {
+               // Call super constructor
+               super();
+       }
+
+       @SuppressWarnings ("unchecked")
+       @Override
+       public List<DialableMobileNumber> fetchAllMobileNumbers () {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
+               // Get query
+               final Query query = this.getEntityManager().createNamedQuery("AllMobileNumbers", MobileNumber.class); //NOI18N
+
+               // Get list from it
+               final List<DialableMobileNumber> list = query.getResultList();
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileNumbers: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+
+               // Return it
+               return list;
+       }
+
+}
diff --git a/src/java/org/mxchange/jphone/model/phonenumbers/mobile/FinancialsAdminMobileSessionBean.java b/src/java/org/mxchange/jphone/model/phonenumbers/mobile/FinancialsAdminMobileSessionBean.java
deleted file mode 100644 (file)
index 5040db6..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2016 - 2020 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
- * 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.model.phonenumbers.mobile;
-
-import java.text.MessageFormat;
-import java.util.Date;
-import javax.ejb.Stateless;
-import org.mxchange.jfinancials.enterprise.BaseFinancialsEnterpriseBean;
-
-/**
- * An EJB for administrative mobile number purposes
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Stateless (name = "adminMobile", description = "An administrative bean handling mobile number data")
-public class FinancialsAdminMobileSessionBean extends BaseFinancialsEnterpriseBean implements AdminMobileSessionBeanRemote {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 18_597_165_817_401_854L;
-
-       /**
-        * Default constructor
-        */
-       public FinancialsAdminMobileSessionBean () {
-               // Call super constructor
-               super();
-       }
-
-       @Override
-       public void deleteMobileData (final DialableMobileNumber mobileNumber) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber));
-
-               // Is all data set
-               if (null == mobileNumber) {
-                       // Not set, throw NPE
-                       throw new NullPointerException("mobileNumber is null"); //NOI18N
-               } else if (mobileNumber.getMobileId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
-               } else if (mobileNumber.getMobileId() < 1) {
-                       // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getMobileId())); //NOI18N
-               } else if (mobileNumber.getMobileProvider() == null) {
-                       // Throw NPE
-                       throw new NullPointerException("mobileNumber.cellphoneProvider is null"); //NOI18N
-               } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
-                       // ... throw again
-                       throw new NullPointerException("mobileNumber.cellphoneProvider.providerId is null"); //NOI18N
-               } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
-                       // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.cellphoneProvider.providerId={0} is not valid.", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
-               } else if (mobileNumber.getMobileNumber() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("mobileNumber.mobileNumber is null"); //NOI18N
-               } else if (mobileNumber.getMobileNumber() < 1) {
-                       // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("mobileNumber.mobileNumber={0} is not valid.", mobileNumber.getMobileNumber())); //NOI18N
-               }
-
-               // Get a managed instance
-               final DialableMobileNumber managedNumber = this.getEntityManager().getReference(mobileNumber.getClass(), mobileNumber.getMobileId());
-
-               // Remove it from database
-               this.getEntityManager().remove(managedNumber);
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteMobileData: EXIT!", this.getClass().getSimpleName()));
-       }
-
-       @Override
-       public DialableMobileNumber updateMobileData (final DialableMobileNumber mobileNumber) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateMobileData: mobileNumber={1} - CALLED!", this.getClass().getSimpleName(), mobileNumber));
-
-               // Is all data set
-               if (null == mobileNumber) {
-                       // Not set, throw NPE
-                       throw new NullPointerException("mobileNumber is null"); //NOI18N
-               } else if (mobileNumber.getMobileId() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("mobileNumber.phoneId is null"); //NOI18N
-               } else if (mobileNumber.getMobileId() < 1) {
-                       // Invalid number
-                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.phoneId={0} is not valid", mobileNumber.getMobileId())); //NOI18N
-               } else if (mobileNumber.getMobileProvider() == null) {
-                       // Throw NPE
-                       throw new NullPointerException("mobileNumber.cellphoneProvider is null"); //NOI18N
-               } else if (mobileNumber.getMobileProvider().getProviderId() == null) {
-                       // ... throw again
-                       throw new NullPointerException("mobileNumber.cellphoneProvider.providerId is null"); //NOI18N
-               } else if (mobileNumber.getMobileProvider().getProviderId() < 1) {
-                       // Id not valid
-                       throw new IllegalArgumentException(MessageFormat.format("mobileNumber.cellphoneProvider.providerId={0} is not valid.", mobileNumber.getMobileProvider().getProviderId())); //NOI18N
-               } else if (mobileNumber.getMobileNumber() == null) {
-                       // Throw NPE again
-                       throw new NullPointerException("mobileNumber.mobileNumber is null"); //NOI18N
-               } else if (mobileNumber.getMobileNumber() < 1) {
-                       // Throw NPE again
-                       throw new NullPointerException(MessageFormat.format("mobileNumber.mobileNumber={0} is not valid.", mobileNumber.getMobileNumber())); //NOI18N
-               }
-
-               // Get contact from it and find it
-               final DialableMobileNumber managedNumber = this.getEntityManager().find(mobileNumber.getClass(), mobileNumber.getMobileId());
-
-               // Should be found
-               assert (managedNumber instanceof DialableMobileNumber) : MessageFormat.format("Cell phone number with id {0} not found, but should be.", mobileNumber.getMobileId()); //NOI18N
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.updateMobileData: managedNumber.phoneId={1}", this.getClass().getSimpleName(), managedNumber.getMobileId())); //NOI18N
-
-               // Set updated timestamp
-               MobileNumbers.copyMobileNumber(mobileNumber, managedNumber);
-               managedNumber.setMobileEntryUpdated(new Date());
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateMobileData: managedNumber={1} - EXIT!", this.getClass().getSimpleName(), managedNumber)); //NOI18N
-
-               // Return it
-               return managedNumber;
-       }
-
-}
diff --git a/src/java/org/mxchange/jphone/model/phonenumbers/mobile/FinancialsMobileSessionBean.java b/src/java/org/mxchange/jphone/model/phonenumbers/mobile/FinancialsMobileSessionBean.java
deleted file mode 100644 (file)
index 8e2e899..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2016 - 2020 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
- * 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 Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.model.phonenumbers.mobile;
-
-import java.text.MessageFormat;
-import java.util.List;
-import javax.ejb.Stateless;
-import javax.persistence.Query;
-import org.mxchange.jfinancials.enterprise.BaseFinancialsEnterpriseBean;
-
-/**
- * A general mobile number EJB
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Stateless (name = "mobile", description = "A bean handling mobile number data")
-public class FinancialsMobileSessionBean extends BaseFinancialsEnterpriseBean implements MobileSessionBeanRemote {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 134_945_698_127_602L;
-
-       /**
-        * Default constructor
-        */
-       public FinancialsMobileSessionBean () {
-               // Call super constructor
-               super();
-       }
-
-       @SuppressWarnings ("unchecked")
-       @Override
-       public List<DialableMobileNumber> fetchAllMobileNumbers () {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Get query
-               final Query query = this.getEntityManager().createNamedQuery("AllMobileNumbers", MobileNumber.class); //NOI18N
-
-               // Get list from it
-               final List<DialableMobileNumber> list = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileNumbers: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
-
-               // Return it
-               return list;
-       }
-
-}