]> git.mxchange.org Git - jshop-core.git/commitdiff
Some rewrites:
authorRoland Haeder <roland@mxchange.org>
Sat, 9 Apr 2016 11:07:30 +0000 (13:07 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 9 Apr 2016 11:07:30 +0000 (13:07 +0200)
- generic customer-related classes/interfaces has been moved to jcustomer-core.
- reordered imports (sorted)
- added jcustomer-core (new project)

lib/jcustomer-core.jar [new file with mode: 0644]
nbproject/project.properties
src/org/mxchange/jshopcore/exceptions/CustomerAlreadyRegisteredException.java [deleted file]
src/org/mxchange/jshopcore/model/customer/Customer.java [deleted file]
src/org/mxchange/jshopcore/model/customer/CustomerUtils.java
src/org/mxchange/jshopcore/model/customer/ShopCustomer.java
src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java [deleted file]
src/org/mxchange/jshopcore/model/order/Orderable.java
src/org/mxchange/jshopcore/model/order/ShopOrder.java
src/org/mxchange/jshopcore/wrapper/CheckoutWrapper.java
src/org/mxchange/jshopcore/wrapper/WrapableCheckout.java

diff --git a/lib/jcustomer-core.jar b/lib/jcustomer-core.jar
new file mode 100644 (file)
index 0000000..255e0d3
Binary files /dev/null and b/lib/jcustomer-core.jar differ
index fda24af321645c1f520b6db9e3fa62771c68dd23..37e2cd6a5d875e6cf84be0ebcf216f24da0b3887 100644 (file)
@@ -34,6 +34,7 @@ file.reference.commons-codec-1.10.jar=lib/commons-codec-1.10.jar
 file.reference.jcontacts-core.jar=lib/jcontacts-core.jar
 file.reference.jcore.jar=lib/jcore.jar
 file.reference.jcoreee.jar=lib/jcoreee.jar
+file.reference.jcustomer-core.jar=lib/jcustomer-core.jar
 includes=**
 jar.archive.disabled=${jnlp.enabled}
 jar.compress=false
@@ -42,6 +43,7 @@ javac.classpath=\
     ${file.reference.jcore.jar}:\
     ${file.reference.jcoreee.jar}:\
     ${file.reference.jcontacts-core.jar}:\
+    ${file.reference.jcustomer-core.jar}:\
     ${file.reference.commons-codec-1.10.jar}:\
     ${libs.javaee-api-7.0.classpath}
 # Space-separated list of extra javac options
@@ -99,5 +101,6 @@ source.encoding=UTF-8
 source.reference.jcontacts-core.jar=../jcontacts-core/src/
 source.reference.jcore.jar=../jcore/src/
 source.reference.jcoreee.jar=../jcoreee/src/
+source.reference.jcustomer-core.jar=../jcustomer-core/src/
 src.dir=src
 test.src.dir=test
diff --git a/src/org/mxchange/jshopcore/exceptions/CustomerAlreadyRegisteredException.java b/src/org/mxchange/jshopcore/exceptions/CustomerAlreadyRegisteredException.java
deleted file mode 100644 (file)
index 9c582d5..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.exceptions;
-
-import java.text.MessageFormat;
-import org.mxchange.jshopcore.model.customer.Customer;
-
-/**
- * An exception thrown when the customer is already registered
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public class CustomerAlreadyRegisteredException extends Exception {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 16_435_892_878_271L;
-
-       /**
-        * Constructor with already registered customer instance
-        * <p>
-        * @param customer Customer instance
-        */
-       public CustomerAlreadyRegisteredException (final Customer customer) {
-               // Call super contructor
-               super(MessageFormat.format("Customer {0} already registered with number {1} at record id {2}. Maybe forgot to call isRegistered(customer) ?", customer, customer.getCustomerNumber(), customer.getCustomerId()));
-       }
-}
diff --git a/src/org/mxchange/jshopcore/model/customer/Customer.java b/src/org/mxchange/jshopcore/model/customer/Customer.java
deleted file mode 100644 (file)
index d2bd2b3..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * 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.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.customer;
-
-import java.io.Serializable;
-import java.util.Calendar;
-import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jshopcore.model.customer.status.CustomerAccountStatus;
-
-/**
- * A customer interface
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public interface Customer extends Serializable {
-
-       /**
-        * Copies all attributes from other customer object to this
-        * <p>
-        * @param customer Source instance
-        */
-       void copyAll (final Customer customer);
-
-       /**
-        * Getter for contact instance
-        * <p>
-        * @return Contact id number
-        */
-       Contact getContact ();
-
-       /**
-        * Setter for contact instance
-        * <p>
-        * @param contact Contact instance
-        */
-       void setContact (final Contact contact);
-
-       /**
-        * Getter for confirmation key
-        * <p>
-        * @return Confirmation key
-        */
-       String getCustomerConfirmKey ();
-
-       /**
-        * Setter for confirmation key
-        * <p>
-        * @param customerConfirmKey Confirmation key
-        */
-       void setCustomerConfirmKey (final String customerConfirmKey);
-
-       /**
-        * Getter for "created" timestamp
-        * <p>
-        * @return "created" timestamp
-        */
-       Calendar getCustomerCreated ();
-
-       /**
-        * Setter for "created" timestamp
-        * <p>
-        * @param customerCreated "created" timestamp
-        */
-       void setCustomerCreated (final Calendar customerCreated);
-
-       /**
-        * Getter for customer id number
-        * <p>
-        * @return Customer id number
-        */
-       Long getCustomerId ();
-
-       /**
-        * Settte for customer id number
-        * <p>
-        * @param customerId Customer id number
-        */
-       void setCustomerId (final Long customerId);
-
-       /**
-        * Getter for "locked" timestamp
-        * <p>
-        * @return "locked" timestamp
-        */
-       Calendar getCustomerLocked ();
-
-       /**
-        * Getter for "locked" timestamp
-        * <p>
-        * @param customerLocked "locked" timestamp
-        */
-       void setCustomerLocked (final Calendar customerLocked);
-
-       /**
-        * Getter for customer number
-        * <p>
-        * @return Customer number
-        */
-       String getCustomerNumber ();
-
-       /**
-        * Setter for customer number
-        * <p>
-        * @param customerNumber Customer number
-        */
-       void setCustomerNumber (final String customerNumber);
-
-       /**
-        * Getter for password hash
-        * <p>
-        * @return Password hash
-        */
-       String getCustomerPasswordHash ();
-
-       /**
-        * Setter for password hash
-        * <p>
-        * @param customerPasswordHash Password hash
-        */
-       void setCustomerPasswordHash (final String customerPasswordHash);
-
-       /**
-        * Getter for account status
-        * <p>
-        * @return Account status
-        */
-       CustomerAccountStatus getCustomerAccountStatus ();
-
-       /**
-        * Setter for account status
-        * <p>
-        * @param customerStatus Account status
-        */
-       void setCustomerAccountStatus (final CustomerAccountStatus customerStatus);
-
-       @Override
-       boolean equals (final Object object);
-
-       @Override
-       int hashCode ();
-}
index f62d87354c170e933b7821be10a64fbc0a415369..6a9950aef3f627290fb43bcb256eaece008b78e5 100644 (file)
@@ -22,6 +22,7 @@ import javax.persistence.EntityNotFoundException;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.digest.Sha2Crypt;
 import org.mxchange.jcore.BaseFrameworkSystem;
+import org.mxchange.jcustomercore.model.customer.Customer;
 import org.mxchange.jshopcore.model.order.Orderable;
 import org.mxchange.jshopcore.model.order.ShopOrder;
 
index 0165309e13d622fb146536c5faca7263cf12e80b..1fb9cc1ba92cc47191b0e010a63013ef366163bd 100644 (file)
@@ -34,7 +34,8 @@ import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.UserContact;
-import org.mxchange.jshopcore.model.customer.status.CustomerAccountStatus;
+import org.mxchange.jcustomercore.model.customer.Customer;
+import org.mxchange.jcustomercore.model.customer.status.CustomerAccountStatus;
 
 /**
  * A shop customer class.
diff --git a/src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java b/src/org/mxchange/jshopcore/model/customer/status/CustomerAccountStatus.java
deleted file mode 100644 (file)
index 1606ac5..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.customer.status;
-
-import java.io.Serializable;
-
-/**
- * An enumeration for customer's account status like confirmed, locked, etc.
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public enum CustomerAccountStatus implements Serializable {
-
-       /**
-        * Unconfirmed (default)
-        */
-       UNCONFIRMED("CUSTOMER_ACCOUNT_STATUS_UNCONFIRMED"), //NOI18N
-
-       /**
-        * Confirmed (email address validated)
-        */
-       CONFIRMED("CUSTOMER_ACCOUNT_STATUS_CONFIRMED"), //NOI18N
-
-       /**
-        * Locked (maybe violated T&C)
-        */
-       LOCKED("CUSTOMER_ACCOUNT_STATUS_LOCKED"); //NOI18N
-
-       /**
-        * Message key
-        */
-       private final String messageKey;
-
-       /**
-        * Constructor with i18n translation key
-        * <p>
-        * @param messageKey Message key (i18n)
-        */
-       private CustomerAccountStatus (final String messageKey) {
-               // Set it here
-               this.messageKey = messageKey;
-       }
-
-       /**
-        * Output value (for messages)
-        * <p>
-        * @return the messageKey
-        */
-       public String getMessageKey () {
-               return this.messageKey;
-       }
-}
index 6413df9dce75c199aeb193b62a255b4b76f0d9e2..78a00e835548a7c008a7ea034533ec7b31ef0f6f 100644 (file)
@@ -19,8 +19,8 @@ package org.mxchange.jshopcore.model.order;
 import java.io.Serializable;
 import java.util.Calendar;
 import java.util.List;
+import org.mxchange.jcustomercore.model.customer.Customer;
 import org.mxchange.jshopcore.model.basket.AddableBasketItem;
-import org.mxchange.jshopcore.model.customer.Customer;
 
 /**
  * An interface for customer orders
index 54a087c14009fb5d44ae8f72111d165f1fbb5c36..e74ed0900eda1c432338323bb238d43ab44ab478 100644 (file)
@@ -31,8 +31,8 @@ import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
+import org.mxchange.jcustomercore.model.customer.Customer;
 import org.mxchange.jshopcore.model.basket.AddableBasketItem;
-import org.mxchange.jshopcore.model.customer.Customer;
 import org.mxchange.jshopcore.model.customer.ShopCustomer;
 
 /**
index 6b64238778c367e71bca7fa114f2d57e61905a99..44e7dc0b27edc5ed3c88f955d3d737ad9e5aba8f 100644 (file)
@@ -17,8 +17,8 @@
 package org.mxchange.jshopcore.wrapper;
 
 import java.util.List;
+import org.mxchange.jcustomercore.model.customer.Customer;
 import org.mxchange.jshopcore.model.basket.AddableBasketItem;
-import org.mxchange.jshopcore.model.customer.Customer;
 
 /**
  * A wrapper for checkouts (customer, ordered items)
index 1bef0d8a4f2f6549f7914c57fd7d95132ba72c5f..0f31363b0fe8403da0cd34cc2be5d647cb9500dc 100644 (file)
@@ -18,8 +18,8 @@ package org.mxchange.jshopcore.wrapper;
 
 import java.io.Serializable;
 import java.util.List;
+import org.mxchange.jcustomercore.model.customer.Customer;
 import org.mxchange.jshopcore.model.basket.AddableBasketItem;
-import org.mxchange.jshopcore.model.customer.Customer;
 
 /**
  * An interface for checkout wrapper