From: Roland Haeder Date: Tue, 8 Sep 2015 13:39:40 +0000 (+0200) Subject: More cleanup X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=82754b37a3ea3ec3b71b67cad59b5c37d09fab77;p=jshop-core.git More cleanup Signed-off-by:Roland Häder --- diff --git a/lib/jcore-ee-logger.jar b/lib/jcore-ee-logger.jar new file mode 100644 index 0000000..b7c4751 Binary files /dev/null and b/lib/jcore-ee-logger.jar differ diff --git a/lib/jcore.jar b/lib/jcore.jar index 1e4a78b..7318d47 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar new file mode 100644 index 0000000..f479cd8 Binary files /dev/null and b/lib/jcoreee.jar differ diff --git a/lib/log4j-api-2.3.jar b/lib/log4j-api-2.3.jar deleted file mode 100644 index 2a61bbe..0000000 Binary files a/lib/log4j-api-2.3.jar and /dev/null differ diff --git a/lib/log4j-core-2.3.jar b/lib/log4j-core-2.3.jar deleted file mode 100644 index 5438b0b..0000000 Binary files a/lib/log4j-core-2.3.jar and /dev/null differ diff --git a/nbproject/project.properties b/nbproject/project.properties index d608ce3..8b450d2 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -30,17 +30,17 @@ dist.jar=${dist.dir}/jshop-core.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= +file.reference.jcore-ee-logger.jar=lib\\jcore-ee-logger.jar file.reference.jcore.jar=lib/jcore.jar -file.reference.log4j-api-2.3.jar=lib/log4j-api-2.3.jar -file.reference.log4j-core-2.3.jar=lib/log4j-core-2.3.jar +file.reference.jcoreee.jar=lib\\jcoreee.jar includes=** jar.archive.disabled=${jnlp.enabled} jar.compress=false jar.index=${jnlp.enabled} javac.classpath=\ ${file.reference.jcore.jar}:\ - ${file.reference.log4j-api-2.3.jar}:\ - ${file.reference.log4j-core-2.3.jar} + ${file.reference.jcore-ee-logger.jar}:\ + ${file.reference.jcoreee.jar} # Space-separated list of extra javac options javac.compilerargs=-Xlint:unchecked -Xlint:deprecation javac.deprecation=true @@ -92,6 +92,8 @@ run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 +source.reference.jcore-ee-logger.jar=../jcore-ee-logger/src/ source.reference.jcore.jar=../jcore/src/ +source.reference.jcoreee.jar=../jcoreee/src/ src.dir=src test.src.dir=test diff --git a/src/org/mxchange/jshopcore/model/basket/BaseBasket.java b/src/org/mxchange/jshopcore/model/basket/BaseBasket.java index b019f83..9e47ad5 100644 --- a/src/org/mxchange/jshopcore/model/basket/BaseBasket.java +++ b/src/org/mxchange/jshopcore/model/basket/BaseBasket.java @@ -17,12 +17,11 @@ package org.mxchange.jshopcore.model.basket; import java.io.IOException; -import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.text.MessageFormat; import java.util.Map; -import org.mxchange.jcore.BaseFrameworkSystem; +import org.mxchange.jcoree.BaseEeSystem; import org.mxchange.jshopcore.model.item.AddableBasketItem; /** @@ -31,11 +30,11 @@ import org.mxchange.jshopcore.model.item.AddableBasketItem; * @author Roland Haeder * @param Any instance that implements AddableBasketItem */ -public abstract class BaseBasket extends BaseFrameworkSystem implements Basket, Serializable { +public abstract class BaseBasket extends BaseEeSystem implements Basket { /** * Serial number */ - private static final long serialVersionUID = 784_396_762_230_845_717L; + private static final long serialVersionUID = 782_396_762_230_845_717L; /** * Protected constructor with session instance @@ -44,27 +43,20 @@ public abstract class BaseBasket extends BaseFramew */ protected BaseBasket () throws SQLException { // Trace message - this.getLogger().trace("CALLED!"); //NOI18N + this.getLogger().logTrace("CALLED!"); //NOI18N } @Override public void init () throws SQLException { // Trace message - this.getLogger().trace("CALLED!"); //NOI18N - - // Is the bundle initialized? - if (!BaseFrameworkSystem.isBundledInitialized()) { - // Temporary initialize default bundle - // TODO The enum Gender uses this - this.initBundle(); - } + this.getLogger().logTrace("CALLED!"); //NOI18N } @Override @SuppressWarnings ("unchecked") public void addItem (final T item) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace call - this.getLogger().trace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N + this.getLogger().logTrace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N // item must not be null if (null == item) { @@ -79,7 +71,7 @@ public abstract class BaseBasket extends BaseFramew // TODO: ((BasketFrontend) this.getFrontend()).addItem(item, this.getSessionId()); // Trace call - this.getLogger().trace("EXIT!"); //NOI18N + this.getLogger().logTrace("EXIT!"); //NOI18N } @Override @@ -93,14 +85,14 @@ public abstract class BaseBasket extends BaseFramew @SuppressWarnings("unchecked") public Map getAll () throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace message - this.getLogger().trace("CALLED!"); //NOI18N + this.getLogger().logTrace("CALLED!"); //NOI18N // Init map // TODO: Map map = ((BasketFrontend) this.getFrontend()).getAll(); Map map = null; // Trace message - this.getLogger().trace("map=" + map); //NOI18N + this.getLogger().logTrace("map=" + map); //NOI18N // Return it return map; @@ -123,7 +115,7 @@ public abstract class BaseBasket extends BaseFramew @Override public boolean isAdded (final T item) throws IOException, SQLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Trace call - this.getLogger().trace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N + this.getLogger().logTrace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N // item must not be null if (null == item) { @@ -136,7 +128,7 @@ public abstract class BaseBasket extends BaseFramew boolean isAdded = true; // Trace message - this.getLogger().trace(MessageFormat.format("isAdded={0} - EXIT!", isAdded)); //NOI18N + this.getLogger().logTrace(MessageFormat.format("isAdded={0} - EXIT!", isAdded)); //NOI18N // Return it return isAdded; diff --git a/src/org/mxchange/jshopcore/model/basket/Basket.java b/src/org/mxchange/jshopcore/model/basket/Basket.java index 46af288..679200a 100644 --- a/src/org/mxchange/jshopcore/model/basket/Basket.java +++ b/src/org/mxchange/jshopcore/model/basket/Basket.java @@ -21,7 +21,6 @@ import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.util.Map; -import org.mxchange.jcore.FrameworkInterface; import org.mxchange.jshopcore.model.item.AddableBasketItem; /** @@ -30,7 +29,7 @@ import org.mxchange.jshopcore.model.item.AddableBasketItem; * @author Roland Haeder * @param Any addable basket items */ -public interface Basket extends FrameworkInterface, Serializable { +public interface Basket extends Serializable { /** * Adds given item instance to this basket diff --git a/src/org/mxchange/jshopcore/model/category/BaseCategory.java b/src/org/mxchange/jshopcore/model/category/BaseCategory.java index 5588dbe..e8fe1d9 100644 --- a/src/org/mxchange/jshopcore/model/category/BaseCategory.java +++ b/src/org/mxchange/jshopcore/model/category/BaseCategory.java @@ -19,14 +19,18 @@ package org.mxchange.jshopcore.model.category; import java.io.UnsupportedEncodingException; import java.text.MessageFormat; import java.util.Objects; -import org.mxchange.jcore.BaseFrameworkSystem; +import org.mxchange.jcoree.BaseEeSystem; /** * A general product category class * * @author Roland Haeder */ -public abstract class BaseCategory extends BaseFrameworkSystem implements Category { +public abstract class BaseCategory extends BaseEeSystem implements Category { + /** + * Serial number + */ + private static final long serialVersionUID = 38_472_937_685_901L; /** * Id number of category @@ -72,7 +76,7 @@ public abstract class BaseCategory extends BaseFrameworkSystem implements Catego @Override public int compareTo (final Category category) { // Trace message - this.getLogger().trace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N + this.getLogger().logTrace(MessageFormat.format("category={0} - CALLED!", category)); //NOI18N // category should not be null if (null == category) { @@ -80,7 +84,7 @@ public abstract class BaseCategory extends BaseFrameworkSystem implements Catego } // Debug message - this.getLogger().debug(MessageFormat.format("this.id={0},category.id={1}", this.getCategoryId(), category.getCategoryId())); //NOI18N + this.getLogger().logDebug(MessageFormat.format("this.id={0},category.id={1}", this.getCategoryId(), category.getCategoryId())); //NOI18N // Is the categoryId the same? if (Objects.equals(this.getCategoryId(), category.getCategoryId())) { diff --git a/src/org/mxchange/jshopcore/model/category/Category.java b/src/org/mxchange/jshopcore/model/category/Category.java index 4edbdee..fd775cc 100644 --- a/src/org/mxchange/jshopcore/model/category/Category.java +++ b/src/org/mxchange/jshopcore/model/category/Category.java @@ -16,15 +16,15 @@ */ package org.mxchange.jshopcore.model.category; +import java.io.Serializable; import java.io.UnsupportedEncodingException; -import org.mxchange.jcore.FrameworkInterface; /** * An interface for categories * * @author Roland Haeder */ -public interface Category extends FrameworkInterface, Comparable { +public interface Category extends Comparable, Serializable { /** * Id number of category diff --git a/src/org/mxchange/jshopcore/model/category/product/ProductCategory.java b/src/org/mxchange/jshopcore/model/category/product/ProductCategory.java index 86b531f..ad6ef83 100644 --- a/src/org/mxchange/jshopcore/model/category/product/ProductCategory.java +++ b/src/org/mxchange/jshopcore/model/category/product/ProductCategory.java @@ -23,6 +23,11 @@ import org.mxchange.jshopcore.model.category.BaseCategory; * @author Roland Haeder */ public class ProductCategory extends BaseCategory { + /** + * Serial number + */ + private static final long serialVersionUID = 21_458_945_712_659L; + /** * Constructor which accepts all database fields * @param id Id number of database record diff --git a/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java b/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java index d0c3e57..209dd71 100644 --- a/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java +++ b/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java @@ -24,4 +24,8 @@ import org.mxchange.jcore.model.contact.BaseContact; * @author Roland Haeder */ public class ShopCustomer extends BaseContact implements Customer { + /** + * Serial number + */ + private static final long serialVersionUID = 4_328_454_581_751L; } diff --git a/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java b/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java index fd75a98..00ea850 100644 --- a/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java +++ b/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java @@ -16,7 +16,7 @@ */ package org.mxchange.jshopcore.model.item; -import org.mxchange.jcore.FrameworkInterface; +import java.io.Serializable; import org.mxchange.jshopcore.model.product.Product; /** @@ -24,7 +24,7 @@ import org.mxchange.jshopcore.model.product.Product; * * @author Roland Haeder */ -public interface AddableBasketItem extends FrameworkInterface, Comparable { +public interface AddableBasketItem extends Serializable { /** * Item amount @@ -86,12 +86,4 @@ public interface AddableBasketItem extends FrameworkInterface, Comparable { + /** + * Serial number + */ + private static final long serialVersionUID = 24_348_671_457_829_156L; + /** * Entry id (from database backend) */ @@ -69,7 +74,7 @@ public abstract class BaseItem extends BaseFrameworkSystem implements AddableBas @Override public int compareTo (final AddableBasketItem item) { // Trace message - this.getLogger().trace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N + this.getLogger().logTrace(MessageFormat.format("item={0} - CALLED!", item)); //NOI18N // item should not be null if (null == item) { @@ -77,7 +82,7 @@ public abstract class BaseItem extends BaseFrameworkSystem implements AddableBas } // Debug message - this.getLogger().debug(MessageFormat.format("this.itemId={0},item.itemId={1}", this.getItemId(), item.getItemId())); //NOI18N + this.getLogger().logDebug(MessageFormat.format("this.itemId={0},item.itemId={1}", this.getItemId(), item.getItemId())); //NOI18N // Is the id the same? if (Objects.equals(this.getItemId(), item.getItemId())) { @@ -132,17 +137,11 @@ public abstract class BaseItem extends BaseFrameworkSystem implements AddableBas this.itemType = itemType; } - /** - * @return the product - */ @Override public Product getProduct () { return this.product; } - /** - * @param product the product to set - */ @Override public void setProduct (final Product product) { this.product = product; diff --git a/src/org/mxchange/jshopcore/model/item/basket/BasketItem.java b/src/org/mxchange/jshopcore/model/item/basket/BasketItem.java index 2807023..217b3ac 100644 --- a/src/org/mxchange/jshopcore/model/item/basket/BasketItem.java +++ b/src/org/mxchange/jshopcore/model/item/basket/BasketItem.java @@ -27,6 +27,11 @@ import org.mxchange.jshopcore.model.product.Product; * @author Roland Haeder */ public class BasketItem extends BaseItem implements AddableBasketItem { + /** + * Serial number + */ + private static final long serialVersionUID = 52_749_158_492_581_578L; + /** * Default constructor */ @@ -43,7 +48,7 @@ public class BasketItem extends BaseItem implements AddableBasketItem { this(); // Trace message - this.getLogger().debug(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N + this.getLogger().logDebug(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N // product must not be null if (null == product) { diff --git a/src/org/mxchange/jshopcore/model/product/BaseProduct.java b/src/org/mxchange/jshopcore/model/product/BaseProduct.java index e1cc402..b1704d6 100644 --- a/src/org/mxchange/jshopcore/model/product/BaseProduct.java +++ b/src/org/mxchange/jshopcore/model/product/BaseProduct.java @@ -7,13 +7,19 @@ package org.mxchange.jshopcore.model.product; import java.text.MessageFormat; import java.util.Objects; -import org.mxchange.jcore.BaseFrameworkSystem; +import org.mxchange.jcoree.BaseEeSystem; /** + * A general product class * * @author Roland Haeder */ -public abstract class BaseProduct extends BaseFrameworkSystem implements Product { +public abstract class BaseProduct extends BaseEeSystem implements Product, Comparable { + /** + * Serial number + */ + private static final long serialVersionUID = 48_379_575_267_451L; + /** * Availability of product */ @@ -42,7 +48,7 @@ public abstract class BaseProduct extends BaseFrameworkSystem implements Product @Override public int compareTo (final Product product) { // Trace message - this.getLogger().trace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N + this.getLogger().logTrace(MessageFormat.format("product={0} - CALLED!", product)); //NOI18N // category should not be null if (null == product) { @@ -50,7 +56,7 @@ public abstract class BaseProduct extends BaseFrameworkSystem implements Product } // Debug message - this.getLogger().debug(MessageFormat.format("this.id={0},product.id={1}", this.getItemId(), product.getItemId())); //NOI18N + this.getLogger().logDebug(MessageFormat.format("this.id={0},product.id={1}", this.getItemId(), product.getItemId())); //NOI18N // Is the id the same? if (Objects.equals(this.getItemId(), product.getItemId())) { diff --git a/src/org/mxchange/jshopcore/model/product/Product.java b/src/org/mxchange/jshopcore/model/product/Product.java index b70a199..96bdca0 100644 --- a/src/org/mxchange/jshopcore/model/product/Product.java +++ b/src/org/mxchange/jshopcore/model/product/Product.java @@ -16,14 +16,14 @@ */ package org.mxchange.jshopcore.model.product; -import org.mxchange.jcore.FrameworkInterface; +import java.io.Serializable; /** * An interface for in database storable products * * @author Roland Haeder */ -public interface Product extends FrameworkInterface, Comparable { +public interface Product extends Serializable { /** * Getter for id number, suitable for form fields. * @@ -90,12 +90,4 @@ public interface Product extends FrameworkInterface, Comparable { * @param available Product availability */ public void setAvailable (final Boolean available); - - /** - * Compare method - * @param product Product to compare to - * @return Comparison value - */ - @Override - public int compareTo (final Product product); } diff --git a/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java b/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java index 1b5b863..58619f3 100644 --- a/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java +++ b/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java @@ -27,6 +27,11 @@ import org.mxchange.jshopcore.model.product.Product; * TODO: Find a better name */ public class GenericProduct extends BaseProduct implements Product { + /** + * Serial number + */ + private static final long serialVersionUID = 54_578_571_769_283L; + /** * Default constructor */ @@ -44,7 +49,7 @@ public class GenericProduct extends BaseProduct implements Product { */ public GenericProduct (final Long id, final String title, final Float price, final Long categoryId, final Boolean available) { // Trace message - this.getLogger().trace(MessageFormat.format("id={0},title={1},price={2},categoryId={3},available={4} - CALLED!", id, title, price, categoryId, available)); //NOI18N + this.getLogger().logTrace(MessageFormat.format("id={0},title={1},price={2},categoryId={3},available={4} - CALLED!", id, title, price, categoryId, available)); //NOI18N // Set all here this.setItemId(id);