From: Roland Haeder <roland@mxchange.org>
Date: Thu, 15 Oct 2015 07:45:21 +0000 (+0200)
Subject: Cleanup through inspection + updated jar(s)
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0d0ea908adc6bf06fb5d31da958594050d107c25;p=jshop-core.git

Cleanup through inspection + updated jar(s)
Signed-off-by:Roland Häder <roland@mxchange.org>
---

diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar
index 4bf2b79..588f0e3 100644
Binary files a/lib/jcontacts-core.jar and b/lib/jcontacts-core.jar differ
diff --git a/lib/jcore.jar b/lib/jcore.jar
index a6eb677..1c2e570 100644
Binary files a/lib/jcore.jar and b/lib/jcore.jar differ
diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar
index db108dd..176cc9d 100644
Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ
diff --git a/src/org/mxchange/jshopcore/model/basket/AddableBasketItem.java b/src/org/mxchange/jshopcore/model/basket/AddableBasketItem.java
index a732413..c85178a 100644
--- a/src/org/mxchange/jshopcore/model/basket/AddableBasketItem.java
+++ b/src/org/mxchange/jshopcore/model/basket/AddableBasketItem.java
@@ -32,74 +32,74 @@ public interface AddableBasketItem extends Serializable {
 	 * @param object Other object to check
 	 */
 	@Override
-	public boolean equals (final Object object);
+	 boolean equals (final Object object);
 
 	/**
 	 * Getter for item amount
 	 * <p>
 	 * @return the amount
 	 */
-	public Long getOrderedAmount ();
+	Long getOrderedAmount ();
 
 	/**
 	 * Setter for item amount
 	 * <p>
 	 * @param amount the amount to set
 	 */
-	public void setOrderedAmount (final Long amount);
+	void setOrderedAmount (final Long amount);
 
 	/**
 	 * Getter for entry id (from database backend)
 	 * <p>
 	 * @return the id
 	 */
-	public Long getItemId ();
+	Long getItemId ();
 
 	/**
 	 * Setter for entry id (from database backend)
 	 * <p>
 	 * @param id the id to set
 	 */
-	public void setItemId (final Long id);
+	void setItemId (final Long id);
 
 	/**
 	 * Getter for item type
 	 * <p>
 	 * @return the type
 	 */
-	public String getItemType ();
+	String getItemType ();
 
 	/**
 	 * Setter for item type
 	 * <p>
 	 * @param type the type to set
 	 */
-	public void setItemType (final String type);
+	void setItemType (final String type);
 
 	/**
 	 * Getter for product instance
 	 * <p>
 	 * @return the product
 	 */
-	public Product getItemProduct ();
+	Product getItemProduct ();
 
 	/**
 	 * Setter fo product instance
 	 * <p>
 	 * @param product the product to set
 	 */
-	public void setItemProduct (final Product product);
+	void setItemProduct (final Product product);
 
 	/**
 	 * Hash-code calculattion
 	 */
 	@Override
-	public int hashCode ();
+	 int hashCode ();
 
 	/**
 	 * Determines whether the item has a Product instance set
 	 * <p>
 	 * @return Whether a Product instance is set
 	 */
-	public boolean isProductType ();
+	boolean isProductType ();
 }
diff --git a/src/org/mxchange/jshopcore/model/basket/Basket.java b/src/org/mxchange/jshopcore/model/basket/Basket.java
index d2e9883..d2e9c08 100644
--- a/src/org/mxchange/jshopcore/model/basket/Basket.java
+++ b/src/org/mxchange/jshopcore/model/basket/Basket.java
@@ -36,33 +36,33 @@ public interface Basket<T extends AddableBasketItem> extends Serializable {
 	 * @throws org.mxchange.jshopcore.exceptions.BasketItemAlreadyAddedException
 	 * If the item instance has already been added
 	 */
-	public void addItem (final T item) throws BasketItemAlreadyAddedException;
+	void addItem (final T item) throws BasketItemAlreadyAddedException;
 
 	/**
 	 * Clears the basket instance
 	 */
-	public void clear ();
+	void clear ();
 
 	/**
 	 * Some "getter" for all entries in this basket
 	 * <p>
 	 * @return Map on all basket items
 	 */
-	public List<T> getAll ();
+	List<T> getAll ();
 
 	/**
 	 * Getter for last entry
 	 * <p>
 	 * @return Last added item in basket
 	 */
-	public T getLast ();
+	T getLast ();
 
 	/**
 	 * Getter for last num rows
 	 * <p>
 	 * @return Last num rows
 	 */
-	public int getLastNumRows ();
+	int getLastNumRows ();
 
 	/**
 	 * Checks whether the given item has already been added by checking the
@@ -72,12 +72,12 @@ public interface Basket<T extends AddableBasketItem> extends Serializable {
 	 * <p>
 	 * @return Whether the given item has been found
 	 */
-	public boolean isAdded (final T item);
+	boolean isAdded (final T item);
 
 	/**
 	 * Checks if the basket is empty
 	 * <p>
 	 * @return Whether the basket is empty
 	 */
-	public boolean isEmpty ();
+	boolean isEmpty ();
 }
diff --git a/src/org/mxchange/jshopcore/model/category/Category.java b/src/org/mxchange/jshopcore/model/category/Category.java
index 43b2d26..d5b56be 100644
--- a/src/org/mxchange/jshopcore/model/category/Category.java
+++ b/src/org/mxchange/jshopcore/model/category/Category.java
@@ -30,47 +30,47 @@ public interface Category extends Serializable {
 	 * <p>
 	 * @param category Source category instance
 	 */
-	public void copyAll (final Category category);
+	void copyAll (final Category category);
 
 	/**
 	 * Id number of category
 	 * <p>
 	 * @return the id
 	 */
-	public Long getCategoryId ();
+	Long getCategoryId ();
 
 	/**
 	 * Id number of category
 	 * <p>
 	 * @param id the id to set
 	 */
-	public void setCategoryId (final Long id);
+	void setCategoryId (final Long id);
 
 	/**
 	 * Parent category
 	 * <p>
 	 * @return the parent category
 	 */
-	public Category getParentCategory ();
+	Category getParentCategory ();
 
 	/**
 	 * Parent category
 	 * <p>
 	 * @param parentCategory the parent category to set
 	 */
-	public void setParentCategory (final Category parentCategory);
+	void setParentCategory (final Category parentCategory);
 
 	/**
 	 * Title of category
 	 * <p>
 	 * @return the title
 	 */
-	public String getCategoryTitle ();
+	String getCategoryTitle ();
 
 	/**
 	 * Title of category
 	 * <p>
 	 * @param title the title to set
 	 */
-	public void setCategoryTitle (final String title);
+	void setCategoryTitle (final String title);
 }
diff --git a/src/org/mxchange/jshopcore/model/customer/Customer.java b/src/org/mxchange/jshopcore/model/customer/Customer.java
index a86b71b..a44a196 100644
--- a/src/org/mxchange/jshopcore/model/customer/Customer.java
+++ b/src/org/mxchange/jshopcore/model/customer/Customer.java
@@ -33,117 +33,117 @@ public interface Customer extends Serializable {
 	 * <p>
 	 * @param customer Source instance
 	 */
-	public void copyAll (final Customer customer);
+	void copyAll (final Customer customer);
 
 	/**
 	 * Getter for contact instance
 	 * <p>
 	 * @return Contact id number
 	 */
-	public Contact getContact ();
+	Contact getContact ();
 
 	/**
 	 * Setter for contact instance
 	 * <p>
 	 * @param contact Contact instance
 	 */
-	public void setContact (final Contact contact);
+	void setContact (final Contact contact);
 
 	/**
 	 * Getter for confirmation key
 	 * <p>
 	 * @return Confirmation key
 	 */
-	public String getCustomerConfirmKey ();
+	String getCustomerConfirmKey ();
 
 	/**
 	 * Setter for confirmation key
 	 * <p>
 	 * @param customerConfirmKey Confirmation key
 	 */
-	public void setCustomerConfirmKey (final String customerConfirmKey);
+	void setCustomerConfirmKey (final String customerConfirmKey);
 
 	/**
 	 * Getter for "created" timestamp
 	 * <p>
 	 * @return "created" timestamp
 	 */
-	public Calendar getCustomerCreated ();
+	Calendar getCustomerCreated ();
 
 	/**
 	 * Setter for "created" timestamp
 	 * <p>
 	 * @param customerCreated "created" timestamp
 	 */
-	public void setCustomerCreated (final Calendar customerCreated);
+	void setCustomerCreated (final Calendar customerCreated);
 
 	/**
 	 * Getter for customer id number
 	 * <p>
 	 * @return Customer id number
 	 */
-	public Long getCustomerId ();
+	Long getCustomerId ();
 
 	/**
 	 * Settte for customer id number
 	 * <p>
 	 * @param customerId Customer id number
 	 */
-	public void setCustomerId (final Long customerId);
+	void setCustomerId (final Long customerId);
 
 	/**
 	 * Getter for "locked" timestamp
 	 * <p>
 	 * @return "locked" timestamp
 	 */
-	public Calendar getCustomerLocked ();
+	Calendar getCustomerLocked ();
 
 	/**
 	 * Getter for "locked" timestamp
 	 * <p>
 	 * @param customerLocked "locked" timestamp
 	 */
-	public void setCustomerLocked (final Calendar customerLocked);
+	void setCustomerLocked (final Calendar customerLocked);
 
 	/**
 	 * Getter for customer number
 	 * <p>
 	 * @return Customer number
 	 */
-	public String getCustomerNumber ();
+	String getCustomerNumber ();
 
 	/**
 	 * Setter for customer number
 	 * <p>
 	 * @param customerNumber Customer number
 	 */
-	public void setCustomerNumber (final String customerNumber);
+	void setCustomerNumber (final String customerNumber);
 
 	/**
 	 * Getter for password hash
 	 * <p>
 	 * @return Password hash
 	 */
-	public String getCustomerPasswordHash ();
+	String getCustomerPasswordHash ();
 
 	/**
 	 * Setter for password hash
 	 * <p>
 	 * @param customerPasswordHash Password hash
 	 */
-	public void setCustomerPasswordHash (final String customerPasswordHash);
+	void setCustomerPasswordHash (final String customerPasswordHash);
 
 	/**
 	 * Getter for account status
 	 * <p>
 	 * @return Account status
 	 */
-	public CustomerAccountStatus getCustomerAccountStatus ();
+	CustomerAccountStatus getCustomerAccountStatus ();
 
 	/**
 	 * Setter for account status
 	 * <p>
 	 * @param customerStatus Account status
 	 */
-	public void setCustomerAccountStatus (final CustomerAccountStatus customerStatus);
+	void setCustomerAccountStatus (final CustomerAccountStatus customerStatus);
 }
diff --git a/src/org/mxchange/jshopcore/model/customer/CustomerUtils.java b/src/org/mxchange/jshopcore/model/customer/CustomerUtils.java
index 1ef7cfb..3b06d44 100644
--- a/src/org/mxchange/jshopcore/model/customer/CustomerUtils.java
+++ b/src/org/mxchange/jshopcore/model/customer/CustomerUtils.java
@@ -33,23 +33,16 @@ import org.mxchange.jshopcore.model.order.ShopOrder;
 public class CustomerUtils extends BaseFrameworkSystem {
 
 	/**
-	 * No instance from this class
-	 */
-	private CustomerUtils () {
-	}
-
-	/**
-	 * Generates an unique customer number by checking is existence
+	 * Generates an unique access key.
 	 * <p>
 	 * @param em Entity manager instance
+	 * @param customer Customer instance
 	 * <p>
-	 * @return Generated customer number (not used before)
-	 * <p>
-	 * @throws java.sql.SQLException If any SQL error occured
+	 * @return An unique access key
 	 */
-	public static String generateCustomerNumber (final EntityManager em) throws SQLException {
+	public static String generateAccessKey (final EntityManager em, final Customer customer) {
 		// Trace message
-		// TODO: utils.getLogger().logTrace(MessageFormat.format("generateCustomerNumber: connection={0} - CALLED!", connection));
+		// TODO: utils.getLogger().logTrace(MessageFormat.format("generateAccessKey: connection={0} - CALLED!", connection));
 
 		// em cannot be null
 		if (null == em) {
@@ -59,49 +52,52 @@ public class CustomerUtils extends BaseFrameworkSystem {
 			// Not open
 			throw new IllegalStateException("Entity manager is closed.");
 		}
-
-		// Generate number
-		String customerNumber = null;
-
+		
+		// Generate fake order instance
+		Orderable orderable = null;
+		
+		// Generate access keyy
+		String accessKey = null;
+		
 		// Default is found
 		boolean isFound = true;
 
 		// Is the number used?
 		while (isFound) {
 			// Both number parts
-			long part1 = Math.round(Math.random() * 100_000);
-			long part2 = Math.round(Math.random() * 1_000);
-
-			// Generate new number
-			customerNumber = String.format("%s-%s", part1, part2); //NOI18N
-
-			// Try it
+			String randString = String.format("%s:%s:%s", Long.toHexString(Math.round(Math.random() * 1_000_000)), em, customer.getCustomerNumber());
+			
+			// Generate access key, use SHA512 hashing and BASE64-encoding for strong key generation
+			accessKey = Base64.encodeBase64String(Sha2Crypt.sha512Crypt(randString.getBytes()).getBytes()).substring(0, 100);
+			
+			// Try this
 			try {
-				// Get instance
-				Customer customer = em.getReference(ShopCustomer.class, customerNumber);
+				// Get reference
+				orderable = em.getReference(ShopOrder.class, accessKey);
 			} catch (final EntityNotFoundException ex) {
-				// Not found
+				// Not found, so abort loop here
 				isFound = false;
 			}
 		}
 
 		// Trace message
-		// TODO: utils.getLogger().logTrace(MessageFormat.format("generateCustomerNumber: customerNumber={0} - EXIT!", customerNumber));
+		// TODO: utils.getLogger().logTrace(MessageFormat.format("generateAccessKey: accessKey={0} - EXIT!", accessKey));
 		// Found one
-		return customerNumber;
+		return accessKey;
 	}
 
 	/**
-	 * Generates an unique access key.
+	 * Generates an unique customer number by checking is existence
 	 * <p>
 	 * @param em Entity manager instance
-	 * @param customer Customer instance
 	 * <p>
-	 * @return An unique access key
+	 * @return Generated customer number (not used before)
+	 * <p>
+	 * @throws java.sql.SQLException If any SQL error occured
 	 */
-	public static String generateAccessKey (final EntityManager em, final Customer customer) {
+	public static String generateCustomerNumber (final EntityManager em) throws SQLException {
 		// Trace message
-		// TODO: utils.getLogger().logTrace(MessageFormat.format("generateAccessKey: connection={0} - CALLED!", connection));
+		// TODO: utils.getLogger().logTrace(MessageFormat.format("generateCustomerNumber: connection={0} - CALLED!", connection));
 
 		// em cannot be null
 		if (null == em) {
@@ -112,11 +108,8 @@ public class CustomerUtils extends BaseFrameworkSystem {
 			throw new IllegalStateException("Entity manager is closed.");
 		}
 
-		// Generate fake order instance
-		Orderable orderable = null;
-
-		// Generate access keyy
-		String accessKey = null;
+		// Generate number
+		String customerNumber = null;
 
 		// Default is found
 		boolean isFound = true;
@@ -124,24 +117,31 @@ public class CustomerUtils extends BaseFrameworkSystem {
 		// Is the number used?
 		while (isFound) {
 			// Both number parts
-			String randString = String.format("%s:%s:%s", Long.toHexString(Math.round(Math.random() * 1_000_000)), em, customer.getCustomerNumber());
+			long part1 = Math.round(Math.random() * 100_000);
+			long part2 = Math.round(Math.random() * 1_000);
 
-			// Generate access key, use SHA512 hashing and BASE64-encoding for strong key generation
-			accessKey = Base64.encodeBase64String(Sha2Crypt.sha512Crypt(randString.getBytes()).getBytes()).substring(0, 100);
+			// Generate new number
+			customerNumber = String.format("%s-%s", part1, part2); //NOI18N
 
-			// Try this
+			// Try it
 			try {
-				// Get reference
-				orderable = em.getReference(ShopOrder.class, accessKey);
+				// Get instance
+				Customer customer = em.getReference(ShopCustomer.class, customerNumber);
 			} catch (final EntityNotFoundException ex) {
-				// Not found, so abort loop here
+				// Not found
 				isFound = false;
 			}
 		}
 
 		// Trace message
-		// TODO: utils.getLogger().logTrace(MessageFormat.format("generateAccessKey: accessKey={0} - EXIT!", accessKey));
+		// TODO: utils.getLogger().logTrace(MessageFormat.format("generateCustomerNumber: customerNumber={0} - EXIT!", customerNumber));
 		// Found one
-		return accessKey;
+		return customerNumber;
+	}
+
+	/**
+	 * No instance from this class
+	 */
+	private CustomerUtils () {
 	}
 }
diff --git a/src/org/mxchange/jshopcore/model/order/Orderable.java b/src/org/mxchange/jshopcore/model/order/Orderable.java
index 4517cda..66cf7aa 100644
--- a/src/org/mxchange/jshopcore/model/order/Orderable.java
+++ b/src/org/mxchange/jshopcore/model/order/Orderable.java
@@ -34,68 +34,68 @@ public interface Orderable extends Serializable {
 	 * <p>
 	 * @return Access key
 	 */
-	public String getAccessKey ();
+	String getAccessKey ();
 
 	/**
 	 * Setter for access key
 	 * <p>
 	 * @param accessKey Access key
 	 */
-	public void setAccessKey (final String accessKey);
+	void setAccessKey (final String accessKey);
 
 	/**
 	 * Getter for created timestamp
 	 * <p>
 	 * @return Created timestamp
 	 */
-	public Calendar getOrderCreated ();
+	Calendar getOrderCreated ();
 
 	/**
 	 * Setter for created timestamp
 	 * <p>
 	 * @param created Created timestamp
 	 */
-	public void setOrderCreated (final Calendar created);
+	void setOrderCreated (final Calendar created);
 
 	/**
 	 * Getter for customer instance
 	 * <p>
 	 * @return Customer instance
 	 */
-	public Customer getCustomer ();
+	Customer getCustomer ();
 
 	/**
 	 * Setter for customer instance
 	 * <p>
 	 * @param customer Customer instance
 	 */
-	public void setCustomer (final Customer customer);
+	void setCustomer (final Customer customer);
 
 	/**
 	 * Getter for order id
 	 * <p>
 	 * @return Order id
 	 */
-	public Long getOrderId ();
+	Long getOrderId ();
 
 	/**
 	 * Setter for order id
 	 * <p>
 	 * @param id Order id
 	 */
-	public void setOrderId (final Long id);
+	void setOrderId (final Long id);
 
 	/**
 	 * Getter for list of ordered basket items
 	 * <p>
 	 * @return List of items
 	 */
-	public List<AddableBasketItem> getOrderedItems ();
+	List<AddableBasketItem> getOrderedItems ();
 
 	/**
 	 * Setter for list of ordered basket items
 	 * <p>
 	 * @param orderedItems List of ordered items
 	 */
-	public void setOrderedItems (final List<AddableBasketItem> orderedItems);
+	void setOrderedItems (final List<AddableBasketItem> orderedItems);
 }
diff --git a/src/org/mxchange/jshopcore/model/product/Product.java b/src/org/mxchange/jshopcore/model/product/Product.java
index 365e38c..4598d0f 100644
--- a/src/org/mxchange/jshopcore/model/product/Product.java
+++ b/src/org/mxchange/jshopcore/model/product/Product.java
@@ -31,75 +31,75 @@ public interface Product extends Serializable {
 	 * <p>
 	 * @param product Source product
 	 */
-	public void copyAll (final Product product);
+	void copyAll (final Product product);
 
 	/**
 	 * Getter for product availability
 	 * <p>
 	 * @return Product availability
 	 */
-	public Boolean getProductAvailability ();
+	Boolean getProductAvailability ();
 
 	/**
 	 * Setter for product availability
 	 * <p>
 	 * @param productAvailability Product availability
 	 */
-	public void setProductAvailability (final Boolean productAvailability);
+	void setProductAvailability (final Boolean productAvailability);
 
 	/**
 	 * Getter for product category id
 	 * <p>
 	 * @return Product category id
 	 */
-	public Category getProductCategory ();
+	Category getProductCategory ();
 
 	/**
 	 * Setter for product category
 	 * <p>
 	 * @param productCategory Product category
 	 */
-	public void setProductCategory (final Category productCategory);
+	void setProductCategory (final Category productCategory);
 
 	/**
 	 * Getter for id number, suitable for form fields.
 	 * <p>
 	 * @return Id number of product
 	 */
-	public Long getProductId ();
+	Long getProductId ();
 
 	/**
 	 * Id number of product
 	 * <p>
 	 * @param productId the id number to set
 	 */
-	public void setProductId (final Long productId);
+	void setProductId (final Long productId);
 
 	/**
 	 * Getter for raw price.
 	 * <p>
 	 * @return Single price of product
 	 */
-	public Float getProductPrice ();
+	Float getProductPrice ();
 
 	/**
 	 * Price of product
 	 * <p>
 	 * @param productPrice the price to set
 	 */
-	public void setProductPrice (final Float productPrice);
+	void setProductPrice (final Float productPrice);
 
 	/**
 	 * Getter for title.
 	 * <p>
 	 * @return Title of product
 	 */
-	public String getProductTitle ();
+	String getProductTitle ();
 
 	/**
 	 * Title of product
 	 * <p>
 	 * @param productTitle the title to set
 	 */
-	public void setProductTitle (final String productTitle);
+	void setProductTitle (final String productTitle);
 }
diff --git a/src/org/mxchange/jshopcore/wrapper/WrapableCheckout.java b/src/org/mxchange/jshopcore/wrapper/WrapableCheckout.java
index a23f691..78dde40 100644
--- a/src/org/mxchange/jshopcore/wrapper/WrapableCheckout.java
+++ b/src/org/mxchange/jshopcore/wrapper/WrapableCheckout.java
@@ -33,26 +33,26 @@ public interface WrapableCheckout extends Serializable {
 	 * <p>
 	 * @return Customer indstance
 	 */
-	public Customer getCustomer ();
+	Customer getCustomer ();
 
 	/**
 	 * Setter for customer instance
 	 * <p>
 	 * @param customer Customer instance
 	 */
-	public void setCustomer (final Customer customer);
+	void setCustomer (final Customer customer);
 
 	/**
 	 * Getter for a List of AddableBasktem instances
 	 * <p>
 	 * @return List with AddableBasketItem instances
 	 */
-	public List<AddableBasketItem> getList ();
+	List<AddableBasketItem> getList ();
 
 	/**
 	 * Setter for a List of AddableBasktem instances
 	 * <p>
 	 * @param list List with AddableBasketItem instances
 	 */
-	public void setList (final List<AddableBasketItem> list);
+	void setList (final List<AddableBasketItem> list);
 }