From c4a43ac53b30a191e788ab923b53ea7936e9f7ea Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Sun, 1 Apr 2018 00:56:04 +0200 Subject: [PATCH] Move some interfaces to implementation project. Necessary due to current Ecorification limitation to one project. --- .../usermanager/IAuthenticator.java | 42 +-- .../application/usermanager/IUserManager.java | 52 ++-- .../usermanager/credentials/ICredential.java | 52 ++-- .../credentials/ICredentialFactory.java | 14 +- .../enterprise/IEnterpriseDataFactory.java | 64 +++-- .../data/enterprise/IEnterpriseQuery.java | 0 .../inventory/data/enterprise/IProduct.java | 132 +++++----- .../data/enterprise/IProductSupplier.java | 90 ++++--- .../data/enterprise/ITradingEnterprise.java | 111 ++++---- .../data/persistence/IPersistence.java | 0 .../data/persistence/IPersistenceContext.java | 0 .../inventory/data/store/IOrderEntry.java | 98 +++---- .../inventory/data/store/IProductOrder.java | 148 +++++------ .../inventory/data/store/IStockItem.java | 242 +++++++++--------- .../inventory/data/store/IStore.java | 190 +++++++------- .../data/store/IStoreDataFactory.java | 120 ++++----- .../inventory/data/store/IStoreQuery.java | 2 + .../inventory/data/usermanager/ICustomer.java | 90 +++---- .../inventory/data/usermanager/IUser.java | 136 +++++----- .../data/usermanager/IUserDataFactory.java | 40 +-- .../data/usermanager/IUserQuery.java | 0 .../parsing/IBackendConversionHelper.java | 84 +++--- .../cloud-logic-core-services/pom.xml | 5 + 23 files changed, 855 insertions(+), 857 deletions(-) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IAuthenticator.java (96%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IUserManager.java (96%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredential.java (96%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredentialFactory.java (97%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseDataFactory.java (86%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseQuery.java (100%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProduct.java (94%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProductSupplier.java (91%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/ITradingEnterprise.java (89%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistence.java (100%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistenceContext.java (100%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/store/IOrderEntry.java (94%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/store/IProductOrder.java (95%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStockItem.java (95%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStore.java (93%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreDataFactory.java (97%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreQuery.java (97%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/ICustomer.java (95%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUser.java (96%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserDataFactory.java (97%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserQuery.java (100%) rename cocome-maven-project/cloud-logic-service/{cloud-logic-core-api => cloud-logic-core-impl}/src/main/java/org/cocome/tradingsystem/remote/access/parsing/IBackendConversionHelper.java (97%) diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IAuthenticator.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IAuthenticator.java similarity index 96% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IAuthenticator.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IAuthenticator.java index 091051c5..14d16377 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IAuthenticator.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IAuthenticator.java @@ -1,21 +1,21 @@ -package org.cocome.tradingsystem.inventory.application.usermanager; - -import org.cocome.tradingsystem.inventory.data.usermanager.IUser; -import org.cocome.tradingsystem.util.exception.NotInDatabaseException; - -/** - * Interface for the authentication of users. - * - * @author Tobias Pöppke - * @author Robert Heinrich - */ -public interface IAuthenticator { - public boolean checkCredentials(IUser user) throws NotInDatabaseException; - - public boolean checkHasRole(IUser user, Role role) throws NotInDatabaseException; - - IUser requestAuthToken(String username) throws NotInDatabaseException; - - boolean revokeAuthToken(String username); - -} +package org.cocome.tradingsystem.inventory.application.usermanager; + +import org.cocome.tradingsystem.inventory.data.usermanager.IUser; +import org.cocome.tradingsystem.util.exception.NotInDatabaseException; + +/** + * Interface for the authentication of users. + * + * @author Tobias Pöppke + * @author Robert Heinrich + */ +public interface IAuthenticator { + public boolean checkCredentials(IUser user) throws NotInDatabaseException; + + public boolean checkHasRole(IUser user, Role role) throws NotInDatabaseException; + + IUser requestAuthToken(String username) throws NotInDatabaseException; + + boolean revokeAuthToken(String username); + +} diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IUserManager.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IUserManager.java similarity index 96% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IUserManager.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IUserManager.java index 35bef18a..4617bd09 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IUserManager.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/IUserManager.java @@ -1,27 +1,27 @@ -package org.cocome.tradingsystem.inventory.application.usermanager; - -import org.cocome.tradingsystem.inventory.application.store.CustomerWithStoreTO; -import org.cocome.tradingsystem.inventory.data.usermanager.ICustomer; -import org.cocome.tradingsystem.inventory.data.usermanager.IUser; -import org.cocome.tradingsystem.util.exception.NotInDatabaseException; - -/** - * Interface for the management of users. - * - * @author Tobias Pöppke - * @author Robert Heinrich - */ -public interface IUserManager { - - IUser getUserByName(String username) throws NotInDatabaseException; - - ICustomer getCustomerByName(String username) throws NotInDatabaseException; - - boolean createUser(UserTO userTO); - - boolean createCustomer(CustomerWithStoreTO customerTO); - - boolean updateUser(UserTO userTO); - - boolean updateCustomer(CustomerWithStoreTO customerTO); +package org.cocome.tradingsystem.inventory.application.usermanager; + +import org.cocome.tradingsystem.inventory.application.store.CustomerWithStoreTO; +import org.cocome.tradingsystem.inventory.data.usermanager.ICustomer; +import org.cocome.tradingsystem.inventory.data.usermanager.IUser; +import org.cocome.tradingsystem.util.exception.NotInDatabaseException; + +/** + * Interface for the management of users. + * + * @author Tobias Pöppke + * @author Robert Heinrich + */ +public interface IUserManager { + + IUser getUserByName(String username) throws NotInDatabaseException; + + ICustomer getCustomerByName(String username) throws NotInDatabaseException; + + boolean createUser(UserTO userTO); + + boolean createCustomer(CustomerWithStoreTO customerTO); + + boolean updateUser(UserTO userTO); + + boolean updateCustomer(CustomerWithStoreTO customerTO); } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredential.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredential.java similarity index 96% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredential.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredential.java index 7b4c1fa8..8b3ec54a 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredential.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredential.java @@ -1,26 +1,26 @@ -package org.cocome.tradingsystem.inventory.application.usermanager.credentials; - -import org.cocome.tradingsystem.inventory.application.usermanager.CredentialType; -import org.cocome.tradingsystem.inventory.data.usermanager.IUser; - -/** - * Interface for credentials. - * - * @author Tobias Pöppke - * @author Robert Heinrich - */ -public interface ICredential { - public CredentialType getType(); - - public boolean isMatching(ICredential credential); - - public String getCredentialString(); - - public void setCredentialString(String credential); - - public char[] getCredentialChars(); - - public void setCredentialChars(char[] credential); - - public char[] resetCredential(IUser user); -} +package org.cocome.tradingsystem.inventory.application.usermanager.credentials; + +import org.cocome.tradingsystem.inventory.application.usermanager.CredentialType; +import org.cocome.tradingsystem.inventory.data.usermanager.IUser; + +/** + * Interface for credentials. + * + * @author Tobias Pöppke + * @author Robert Heinrich + */ +public interface ICredential { + public CredentialType getType(); + + public boolean isMatching(ICredential credential); + + public String getCredentialString(); + + public void setCredentialString(String credential); + + public char[] getCredentialChars(); + + public void setCredentialChars(char[] credential); + + public char[] resetCredential(IUser user); +} diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredentialFactory.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredentialFactory.java similarity index 97% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredentialFactory.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredentialFactory.java index 52a50f27..384c3a36 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredentialFactory.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/application/usermanager/credentials/ICredentialFactory.java @@ -1,8 +1,8 @@ -package org.cocome.tradingsystem.inventory.application.usermanager.credentials; - -import org.cocome.tradingsystem.inventory.application.usermanager.CredentialType; - -public interface ICredentialFactory { - ICredential getCredential(CredentialType type); - +package org.cocome.tradingsystem.inventory.application.usermanager.credentials; + +import org.cocome.tradingsystem.inventory.application.usermanager.CredentialType; + +public interface ICredentialFactory { + ICredential getCredential(CredentialType type); + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseDataFactory.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseDataFactory.java similarity index 86% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseDataFactory.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseDataFactory.java index 13e5d718..34b00b2a 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseDataFactory.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseDataFactory.java @@ -1,34 +1,32 @@ -package org.cocome.tradingsystem.inventory.data.enterprise; - -import org.cocome.tradingsystem.inventory.application.store.EnterpriseTO; -import org.cocome.tradingsystem.inventory.application.store.ProductTO; -import org.cocome.tradingsystem.inventory.application.store.ProductWithSupplierTO; -import org.cocome.tradingsystem.inventory.application.store.StoreWithEnterpriseTO; -import org.cocome.tradingsystem.inventory.application.store.SupplierTO; -import org.cocome.tradingsystem.inventory.data.store.IStore; -import org.cocome.tradingsystem.util.exception.NotInDatabaseException; - -public interface IEnterpriseDataFactory { - - public IProduct getNewProduct(); - - public IProductSupplier getNewProductSupplier(); - - public ITradingEnterprise getNewTradingEnterprise(); - - public IProduct convertToProduct(ProductTO productTO); - - public ITradingEnterprise convertToEnterprise(EnterpriseTO enterpriseTO); - - public IProductSupplier convertToSupplier(SupplierTO supplierTO); - - public SupplierTO fillSupplierTO(IProductSupplier supplier); - - public EnterpriseTO fillEnterpriseTO(ITradingEnterprise enterprise); - - public ProductTO fillProductTO(IProduct product); - - public ProductWithSupplierTO fillProductWithSupplierTO( - IProduct product) throws NotInDatabaseException; - +package org.cocome.tradingsystem.inventory.data.enterprise; + +import org.cocome.tradingsystem.inventory.application.store.EnterpriseTO; +import org.cocome.tradingsystem.inventory.application.store.ProductTO; +import org.cocome.tradingsystem.inventory.application.store.ProductWithSupplierTO; +import org.cocome.tradingsystem.inventory.application.store.SupplierTO; +import org.cocome.tradingsystem.util.exception.NotInDatabaseException; + +public interface IEnterpriseDataFactory { + + public IProduct getNewProduct(); + + public IProductSupplier getNewProductSupplier(); + + public ITradingEnterprise getNewTradingEnterprise(); + + public IProduct convertToProduct(ProductTO productTO); + + public ITradingEnterprise convertToEnterprise(EnterpriseTO enterpriseTO); + + public IProductSupplier convertToSupplier(SupplierTO supplierTO); + + public SupplierTO fillSupplierTO(IProductSupplier supplier); + + public EnterpriseTO fillEnterpriseTO(ITradingEnterprise enterprise); + + public ProductTO fillProductTO(IProduct product); + + public ProductWithSupplierTO fillProductWithSupplierTO( + IProduct product) throws NotInDatabaseException; + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseQuery.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseQuery.java similarity index 100% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseQuery.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IEnterpriseQuery.java diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProduct.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProduct.java similarity index 94% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProduct.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProduct.java index 6bf8dc54..e414cea1 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProduct.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProduct.java @@ -1,67 +1,67 @@ -package org.cocome.tradingsystem.inventory.data.enterprise; - -import org.cocome.tradingsystem.util.exception.NotInDatabaseException; - -public interface IProduct { - - /** - * Gets identifier value - * - * @return The id. - */ - long getId(); - - /** - * Sets identifier. - * - * @param id - * Identifier value. - */ - void setId(long id); - - /** - * @return The barcode of the product - */ - long getBarcode(); - - /** - * @param barcode - * The barcode of the product - */ - void setBarcode(long barcode); - - /** - * @return The name of the product - */ - String getName(); - - /** - * @param name - * The name of the product - */ - void setName(String name); - - /** - * @return The ProductSupplier of this product - * @throws NotInDatabaseException - */ - IProductSupplier getSupplier() throws NotInDatabaseException; - - /** - * @param supplier - * The ProductSupplier of this product - */ - void setSupplier(IProductSupplier supplier); - - /** - * @return The purchase price of this product - */ - double getPurchasePrice(); - - /** - * @param purchasePrice - * The purchase price of this product - */ - void setPurchasePrice(double purchasePrice); - +package org.cocome.tradingsystem.inventory.data.enterprise; + +import org.cocome.tradingsystem.util.exception.NotInDatabaseException; + +public interface IProduct { + + /** + * Gets identifier value + * + * @return The id. + */ + long getId(); + + /** + * Sets identifier. + * + * @param id + * Identifier value. + */ + void setId(long id); + + /** + * @return The barcode of the product + */ + long getBarcode(); + + /** + * @param barcode + * The barcode of the product + */ + void setBarcode(long barcode); + + /** + * @return The name of the product + */ + String getName(); + + /** + * @param name + * The name of the product + */ + void setName(String name); + + /** + * @return The ProductSupplier of this product + * @throws NotInDatabaseException + */ + IProductSupplier getSupplier() throws NotInDatabaseException; + + /** + * @param supplier + * The ProductSupplier of this product + */ + void setSupplier(IProductSupplier supplier); + + /** + * @return The purchase price of this product + */ + double getPurchasePrice(); + + /** + * @param purchasePrice + * The purchase price of this product + */ + void setPurchasePrice(double purchasePrice); + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProductSupplier.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProductSupplier.java similarity index 91% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProductSupplier.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProductSupplier.java index 9ae36cd8..9ae5e73f 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProductSupplier.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/IProductSupplier.java @@ -1,47 +1,45 @@ -package org.cocome.tradingsystem.inventory.data.enterprise; - -import java.util.Collection; - -import javax.annotation.PostConstruct; - -import org.cocome.tradingsystem.util.exception.NotInDatabaseException; - -public interface IProductSupplier { - - void initProductSupplier(); - - /** - * @return A unique identifier for ProductSupplier objects - */ - long getId(); - - /** - * @param id - * A unique identifier for ProductSupplier objects - */ - void setId(long id); - - /** - * @return The name of the ProductSupplier - */ - String getName(); - - /** - * @param name - * The name of the ProductSupplier - */ - void setName(String name); - - /** - * @return The list of Products provided by the ProductSupplier - * @throws NotInDatabaseException - */ - Collection getProducts() throws NotInDatabaseException; - - /** - * @param products - * The list of Products provided by the ProductSupplier - */ - void setProducts(Collection products); - +package org.cocome.tradingsystem.inventory.data.enterprise; + +import java.util.Collection; + +import org.cocome.tradingsystem.util.exception.NotInDatabaseException; + +public interface IProductSupplier { + + void initProductSupplier(); + + /** + * @return A unique identifier for ProductSupplier objects + */ + long getId(); + + /** + * @param id + * A unique identifier for ProductSupplier objects + */ + void setId(long id); + + /** + * @return The name of the ProductSupplier + */ + String getName(); + + /** + * @param name + * The name of the ProductSupplier + */ + void setName(String name); + + /** + * @return The list of Products provided by the ProductSupplier + * @throws NotInDatabaseException + */ + Collection getProducts() throws NotInDatabaseException; + + /** + * @param products + * The list of Products provided by the ProductSupplier + */ + void setProducts(Collection products); + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/ITradingEnterprise.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/ITradingEnterprise.java similarity index 89% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/ITradingEnterprise.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/ITradingEnterprise.java index 15edb12b..73783e28 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/ITradingEnterprise.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/enterprise/ITradingEnterprise.java @@ -1,58 +1,55 @@ -package org.cocome.tradingsystem.inventory.data.enterprise; - -import java.util.Collection; - -import javax.annotation.PostConstruct; -import javax.persistence.Basic; - -import org.cocome.tradingsystem.inventory.data.store.IStore; - -public interface ITradingEnterprise { - - void initTradingEnterprise(); - - /** - * @return id a unique identifier of this TradingEnterprise - */ - long getId(); - - /** - * @param id - * a unique identifier of this TradingEnterprise - */ - void setId(long id); - - /** - * @return Name of this TradingEnterprise - */ - String getName(); - - /** - * @param name - * Name of this TradingEnterprise - */ - void setName(String name); - - /** - * @return Collection of Stores related to the TradingEnterprise - */ - Collection getStores(); - - /** - * @param stores - * Collection of Stores related to the TradingEnterprise - */ - void setStores(Collection stores); - - /** - * @return Collection of Suppliers related to the TradingEnterprise - */ - Collection getSuppliers(); - - /** - * @param suppliers - * Collection of Suppliers related to the TradingEnterprise - */ - void setSuppliers(Collection suppliers); - +package org.cocome.tradingsystem.inventory.data.enterprise; + +import java.util.Collection; + +import org.cocome.tradingsystem.inventory.data.store.IStore; + +public interface ITradingEnterprise { + + void initTradingEnterprise(); + + /** + * @return id a unique identifier of this TradingEnterprise + */ + long getId(); + + /** + * @param id + * a unique identifier of this TradingEnterprise + */ + void setId(long id); + + /** + * @return Name of this TradingEnterprise + */ + String getName(); + + /** + * @param name + * Name of this TradingEnterprise + */ + void setName(String name); + + /** + * @return Collection of Stores related to the TradingEnterprise + */ + Collection getStores(); + + /** + * @param stores + * Collection of Stores related to the TradingEnterprise + */ + void setStores(Collection stores); + + /** + * @return Collection of Suppliers related to the TradingEnterprise + */ + Collection getSuppliers(); + + /** + * @param suppliers + * Collection of Suppliers related to the TradingEnterprise + */ + void setSuppliers(Collection suppliers); + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistence.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistence.java similarity index 100% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistence.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistence.java diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistenceContext.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistenceContext.java similarity index 100% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistenceContext.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/persistence/IPersistenceContext.java diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IOrderEntry.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IOrderEntry.java similarity index 94% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IOrderEntry.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IOrderEntry.java index 377f2f3e..449f0bb7 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IOrderEntry.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IOrderEntry.java @@ -1,50 +1,50 @@ -package org.cocome.tradingsystem.inventory.data.store; - -import org.cocome.tradingsystem.inventory.data.enterprise.IProduct; - -public interface IOrderEntry { - - /** - * Gets identifier value - * - * @return The id. - */ - long getId(); - - /** - * Sets identifier. - * - * @param id - * Identifier value. - */ - void setId(long id); - - /** - * @return The amount of ordered products - */ - long getAmount(); - - /** - * @param amount - * The amount of ordered products - */ - void setAmount(long amount); - - /** - * @return The product which is ordered - */ - IProduct getProduct(); - - /** - * @param product - * The product which is ordered - */ - void setProduct(IProduct product); - - long getProductBarcode(); - - void setProductBarcode(long productBarcode); - - String toString(); - +package org.cocome.tradingsystem.inventory.data.store; + +import org.cocome.tradingsystem.inventory.data.enterprise.IProduct; + +public interface IOrderEntry { + + /** + * Gets identifier value + * + * @return The id. + */ + long getId(); + + /** + * Sets identifier. + * + * @param id + * Identifier value. + */ + void setId(long id); + + /** + * @return The amount of ordered products + */ + long getAmount(); + + /** + * @param amount + * The amount of ordered products + */ + void setAmount(long amount); + + /** + * @return The product which is ordered + */ + IProduct getProduct(); + + /** + * @param product + * The product which is ordered + */ + void setProduct(IProduct product); + + long getProductBarcode(); + + void setProductBarcode(long productBarcode); + + String toString(); + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IProductOrder.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IProductOrder.java similarity index 95% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IProductOrder.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IProductOrder.java index 4b4b48fc..d96d62ac 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IProductOrder.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IProductOrder.java @@ -1,75 +1,75 @@ -package org.cocome.tradingsystem.inventory.data.store; - -import java.util.Collection; -import java.util.Date; - -public interface IProductOrder { - - /** - * @return A unique identifier for ProductOrder objects - */ - long getId(); - - /** - * @param id - * A unique identifier for ProductOrder objects - */ - void setId(long id); - - /** - * @return A list of OrderEntry objects (pairs of Product-Amount-pairs) - */ - Collection getOrderEntries(); - - /** - * @param orderEntries - * A list of OrderEntry objects (pairs of Product-Amount-pairs) - */ - void setOrderEntries(Collection orderEntries); - - /** - * @return The date of ordering. - */ - Date getOrderingDate(); - - /** - * @param orderingDate - * the date of ordering - */ - void setOrderingDate(Date orderingDate); - - /** - * The delivery date is used for computing the mean time to delivery - * - * @return The date of order fulfillment. - */ - Date getDeliveryDate(); - - /** - * The delivery date is used for computing the mean time to delivery - * - * @param deliveryDate - * the date of order fulfillment - */ - void setDeliveryDate(Date deliveryDate); - - /** - * @return The store where the order is placed. - */ - IStore getStore(); - - /** - * @param store - * the store where the order is placed - */ - void setStore(IStore store); - - String getStoreName(); - - void setStoreName(String storeName); - - String getStoreLocation(); - - void setStoreLocation(String storeLocation); - +package org.cocome.tradingsystem.inventory.data.store; + +import java.util.Collection; +import java.util.Date; + +public interface IProductOrder { + + /** + * @return A unique identifier for ProductOrder objects + */ + long getId(); + + /** + * @param id + * A unique identifier for ProductOrder objects + */ + void setId(long id); + + /** + * @return A list of OrderEntry objects (pairs of Product-Amount-pairs) + */ + Collection getOrderEntries(); + + /** + * @param orderEntries + * A list of OrderEntry objects (pairs of Product-Amount-pairs) + */ + void setOrderEntries(Collection orderEntries); + + /** + * @return The date of ordering. + */ + Date getOrderingDate(); + + /** + * @param orderingDate + * the date of ordering + */ + void setOrderingDate(Date orderingDate); + + /** + * The delivery date is used for computing the mean time to delivery + * + * @return The date of order fulfillment. + */ + Date getDeliveryDate(); + + /** + * The delivery date is used for computing the mean time to delivery + * + * @param deliveryDate + * the date of order fulfillment + */ + void setDeliveryDate(Date deliveryDate); + + /** + * @return The store where the order is placed. + */ + IStore getStore(); + + /** + * @param store + * the store where the order is placed + */ + void setStore(IStore store); + + String getStoreName(); + + void setStoreName(String storeName); + + String getStoreLocation(); + + void setStoreLocation(String storeLocation); + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStockItem.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStockItem.java similarity index 95% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStockItem.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStockItem.java index e599771e..ef732000 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStockItem.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStockItem.java @@ -1,122 +1,122 @@ -package org.cocome.tradingsystem.inventory.data.store; - -import org.cocome.tradingsystem.inventory.data.enterprise.IProduct; - -public interface IStockItem { - - /** - * @return A unique identifier of this StockItem. - */ - long getId(); - - /** - * @param id - * a unique identifier of this StockItem - */ - void setId(long id); - - /** - * @return The currently available amount of items of a product - */ - long getAmount(); - - /** - * @param amount - * the currently available amount of items of a product - */ - void setAmount(long amount); - - /** - * This method will be used while computing the low stock item list. - * - * @return The maximum capacity of a product in a store. - */ - long getMaxStock(); - - /** - * This method enables the definition of the maximum capacity of a product - * in a store. - * - * @param maxStock - * the maximum capacity of a product in a store - */ - void setMaxStock(long maxStock); - - /** - * @return - * The minimum amount of products which has to be available in a - * store. - */ - long getMinStock(); - - /** - * @param minStock - * the minimum amount of products which has to be available in a - * store - */ - void setMinStock(long minStock); - - /** - * @return The Product of a StockItem. - */ - IProduct getProduct(); - - /** - * @param product - * the Product of a StockItem - */ - void setProduct(IProduct product); - - /** - * @return The sales price of the StockItem - */ - double getSalesPrice(); - - /** - * @param salesPrice - * the sales price of the StockItem - */ - void setSalesPrice(double salesPrice); - - /** - * Required for UC 8 - * - * @return incomingAmount - * the amount of products that will be delivered in the near future - */ - long getIncomingAmount(); - - /** - * Set the amount of products that will be delivered in the near future. - *

- * Required for UC 8 - * - * @param incomingAmount - * the absolute amount (no delta) of incoming products - */ - void setIncomingAmount(long incomingAmount); - - /** - * @return The store where the StockItem belongs to - */ - IStore getStore(); - - /** - * @param store - * The store where the StockItem belongs to - */ - void setStore(IStore store); - - String getStoreName(); - - void setStoreName(String storeName); - - long getProductBarcode(); - - void setProductBarcode(long productBarcode); - - String getStoreLocation(); - - void setStoreLocation(String storeLocation); - +package org.cocome.tradingsystem.inventory.data.store; + +import org.cocome.tradingsystem.inventory.data.enterprise.IProduct; + +public interface IStockItem { + + /** + * @return A unique identifier of this StockItem. + */ + long getId(); + + /** + * @param id + * a unique identifier of this StockItem + */ + void setId(long id); + + /** + * @return The currently available amount of items of a product + */ + long getAmount(); + + /** + * @param amount + * the currently available amount of items of a product + */ + void setAmount(long amount); + + /** + * This method will be used while computing the low stock item list. + * + * @return The maximum capacity of a product in a store. + */ + long getMaxStock(); + + /** + * This method enables the definition of the maximum capacity of a product + * in a store. + * + * @param maxStock + * the maximum capacity of a product in a store + */ + void setMaxStock(long maxStock); + + /** + * @return + * The minimum amount of products which has to be available in a + * store. + */ + long getMinStock(); + + /** + * @param minStock + * the minimum amount of products which has to be available in a + * store + */ + void setMinStock(long minStock); + + /** + * @return The Product of a StockItem. + */ + IProduct getProduct(); + + /** + * @param product + * the Product of a StockItem + */ + void setProduct(IProduct product); + + /** + * @return The sales price of the StockItem + */ + double getSalesPrice(); + + /** + * @param salesPrice + * the sales price of the StockItem + */ + void setSalesPrice(double salesPrice); + + /** + * Required for UC 8 + * + * @return incomingAmount + * the amount of products that will be delivered in the near future + */ + long getIncomingAmount(); + + /** + * Set the amount of products that will be delivered in the near future. + *

+ * Required for UC 8 + * + * @param incomingAmount + * the absolute amount (no delta) of incoming products + */ + void setIncomingAmount(long incomingAmount); + + /** + * @return The store where the StockItem belongs to + */ + IStore getStore(); + + /** + * @param store + * The store where the StockItem belongs to + */ + void setStore(IStore store); + + String getStoreName(); + + void setStoreName(String storeName); + + long getProductBarcode(); + + void setProductBarcode(long productBarcode); + + String getStoreLocation(); + + void setStoreLocation(String storeLocation); + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStore.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStore.java similarity index 93% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStore.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStore.java index 2ec3f388..47973245 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStore.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStore.java @@ -1,97 +1,95 @@ -package org.cocome.tradingsystem.inventory.data.store; - -import java.util.Collection; - -import javax.annotation.PostConstruct; - -import org.cocome.tradingsystem.inventory.data.enterprise.ITradingEnterprise; -import org.cocome.tradingsystem.util.exception.NotInDatabaseException; - -public interface IStore { - - void initStore(); - - /** - * @return A unique identifier for Store objects - */ - long getId(); - - /** - * @param id - * A unique identifier for Store objects - */ - void setId(long id); - - /** - * Returns the name of the store. - * - * @return Store name. - */ - String getName(); - - /** - * @param name - * the name of the Store - */ - void setName(String name); - - /** - * Returns the location of the store. - * - * @return Store location. - */ - String getLocation(); - - /** - * Sets the location of the store. - * - * @param location - * store location - */ - void setLocation(String location); - - /** - * @return The enterprise which the Store belongs to - */ - ITradingEnterprise getEnterprise() throws NotInDatabaseException; - - /** - * @param enterprise - * The enterprise which the Store belongs to - */ - void setEnterprise(ITradingEnterprise enterprise); - - /** - * @return All product orders of the Store. - */ - Collection getProductOrders(); - - /** - * @param productOrders - * all product orders of the Store - */ - void setProductOrders(Collection productOrders); - - /** - * @return - * A list of StockItem objects. A StockItem represents a concrete - * product in the store including sales price, ... - */ - Collection getStockItems(); - - /** - * @param stockItems - * A list of StockItem objects. A StockItem represents a concrete - * product in the store including sales price, ... - */ - void setStockItems(Collection stockItems); - - String toString(); - - int compareTo(IStore o); - - String getEnterpriseName(); - - void setEnterpriseName(String enterpriseName); - +package org.cocome.tradingsystem.inventory.data.store; + +import java.util.Collection; + +import org.cocome.tradingsystem.inventory.data.enterprise.ITradingEnterprise; +import org.cocome.tradingsystem.util.exception.NotInDatabaseException; + +public interface IStore { + + void initStore(); + + /** + * @return A unique identifier for Store objects + */ + long getId(); + + /** + * @param id + * A unique identifier for Store objects + */ + void setId(long id); + + /** + * Returns the name of the store. + * + * @return Store name. + */ + String getName(); + + /** + * @param name + * the name of the Store + */ + void setName(String name); + + /** + * Returns the location of the store. + * + * @return Store location. + */ + String getLocation(); + + /** + * Sets the location of the store. + * + * @param location + * store location + */ + void setLocation(String location); + + /** + * @return The enterprise which the Store belongs to + */ + ITradingEnterprise getEnterprise() throws NotInDatabaseException; + + /** + * @param enterprise + * The enterprise which the Store belongs to + */ + void setEnterprise(ITradingEnterprise enterprise); + + /** + * @return All product orders of the Store. + */ + Collection getProductOrders(); + + /** + * @param productOrders + * all product orders of the Store + */ + void setProductOrders(Collection productOrders); + + /** + * @return + * A list of StockItem objects. A StockItem represents a concrete + * product in the store including sales price, ... + */ + Collection getStockItems(); + + /** + * @param stockItems + * A list of StockItem objects. A StockItem represents a concrete + * product in the store including sales price, ... + */ + void setStockItems(Collection stockItems); + + String toString(); + + int compareTo(IStore o); + + String getEnterpriseName(); + + void setEnterpriseName(String enterpriseName); + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreDataFactory.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreDataFactory.java similarity index 97% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreDataFactory.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreDataFactory.java index 1f8e557c..3175ad4e 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreDataFactory.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreDataFactory.java @@ -1,60 +1,60 @@ -/** - * - */ -package org.cocome.tradingsystem.inventory.data.store; - -import org.cocome.tradingsystem.inventory.application.store.ComplexOrderEntryTO; -import org.cocome.tradingsystem.inventory.application.store.ComplexOrderTO; -import org.cocome.tradingsystem.inventory.application.store.OrderEntryTO; -import org.cocome.tradingsystem.inventory.application.store.OrderTO; -import org.cocome.tradingsystem.inventory.application.store.ProductWithStockItemTO; -import org.cocome.tradingsystem.inventory.application.store.ProductWithSupplierAndStockItemTO; -import org.cocome.tradingsystem.inventory.application.store.StockItemTO; -import org.cocome.tradingsystem.inventory.application.store.StoreTO; -import org.cocome.tradingsystem.inventory.application.store.StoreWithEnterpriseTO; -import org.cocome.tradingsystem.util.exception.NotInDatabaseException; - -/** - * - * - * @author Tobias Pöppke - * @author Robert Heinrich - * - */ -public interface IStoreDataFactory { - public IOrderEntry getNewOrderEntry(); - - public IProductOrder getNewProductOrder(); - - public IStockItem getNewStockItem(); - - public IStore getNewStore(); - - public IOrderEntry convertToOrderEntry(ComplexOrderEntryTO entryTO); - - public ComplexOrderEntryTO fillComplexOrderEntryTO(IOrderEntry entry) throws NotInDatabaseException; - - public IProductOrder convertToProductOrder(ComplexOrderTO orderTO); - - public ComplexOrderTO fillComplexOrderTO(IProductOrder order) throws NotInDatabaseException; - - public IStockItem convertToStockItem(StockItemTO stockItemTO); - - public StockItemTO fillStockItemTO(IStockItem stockItem); - - public IStore convertToStore(StoreTO storeTO); - - public StoreTO fillStoreTO(IStore store); - - public OrderEntryTO fillOrderEntryTO(IOrderEntry entry); - - public OrderTO fillOrderTO(IProductOrder order); - - public ProductWithStockItemTO fillProductWithStockItemTO(IStockItem stockItem); - - public ProductWithSupplierAndStockItemTO fillProductWithSupplierAndStockItemTO( - IStockItem stockItem) throws NotInDatabaseException; - - public StoreWithEnterpriseTO fillStoreWithEnterpriseTO( - IStore store) throws NotInDatabaseException; -} +/** + * + */ +package org.cocome.tradingsystem.inventory.data.store; + +import org.cocome.tradingsystem.inventory.application.store.ComplexOrderEntryTO; +import org.cocome.tradingsystem.inventory.application.store.ComplexOrderTO; +import org.cocome.tradingsystem.inventory.application.store.OrderEntryTO; +import org.cocome.tradingsystem.inventory.application.store.OrderTO; +import org.cocome.tradingsystem.inventory.application.store.ProductWithStockItemTO; +import org.cocome.tradingsystem.inventory.application.store.ProductWithSupplierAndStockItemTO; +import org.cocome.tradingsystem.inventory.application.store.StockItemTO; +import org.cocome.tradingsystem.inventory.application.store.StoreTO; +import org.cocome.tradingsystem.inventory.application.store.StoreWithEnterpriseTO; +import org.cocome.tradingsystem.util.exception.NotInDatabaseException; + +/** + * + * + * @author Tobias Pöppke + * @author Robert Heinrich + * + */ +public interface IStoreDataFactory { + public IOrderEntry getNewOrderEntry(); + + public IProductOrder getNewProductOrder(); + + public IStockItem getNewStockItem(); + + public IStore getNewStore(); + + public IOrderEntry convertToOrderEntry(ComplexOrderEntryTO entryTO); + + public ComplexOrderEntryTO fillComplexOrderEntryTO(IOrderEntry entry) throws NotInDatabaseException; + + public IProductOrder convertToProductOrder(ComplexOrderTO orderTO); + + public ComplexOrderTO fillComplexOrderTO(IProductOrder order) throws NotInDatabaseException; + + public IStockItem convertToStockItem(StockItemTO stockItemTO); + + public StockItemTO fillStockItemTO(IStockItem stockItem); + + public IStore convertToStore(StoreTO storeTO); + + public StoreTO fillStoreTO(IStore store); + + public OrderEntryTO fillOrderEntryTO(IOrderEntry entry); + + public OrderTO fillOrderTO(IProductOrder order); + + public ProductWithStockItemTO fillProductWithStockItemTO(IStockItem stockItem); + + public ProductWithSupplierAndStockItemTO fillProductWithSupplierAndStockItemTO( + IStockItem stockItem) throws NotInDatabaseException; + + public StoreWithEnterpriseTO fillStoreWithEnterpriseTO( + IStore store) throws NotInDatabaseException; +} diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreQuery.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreQuery.java similarity index 97% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreQuery.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreQuery.java index 67fc6989..c91d08f6 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreQuery.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/store/IStoreQuery.java @@ -20,6 +20,8 @@ import javax.ejb.Local; +import org.cocome.tradingsystem.inventory.application.store.IStoreInventoryLocal; +import org.cocome.tradingsystem.inventory.application.store.IStoreInventoryManagerLocal; import org.cocome.tradingsystem.inventory.data.enterprise.IProduct; import org.cocome.tradingsystem.util.exception.NotInDatabaseException; diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/ICustomer.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/ICustomer.java similarity index 95% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/ICustomer.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/ICustomer.java index 0d8782e7..93144ab5 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/ICustomer.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/ICustomer.java @@ -1,46 +1,46 @@ -package org.cocome.tradingsystem.inventory.data.usermanager; - -import java.util.Set; - -import org.cocome.tradingsystem.inventory.data.store.IStore; - -/** - * Interface for customers of the pickup shop. - * - * @author Tobias Pöppke - * @author Robert Heinrich - */ -public interface ICustomer { - - public String getMailAddress(); - - public void setMailAddress(String mailAddress); - - public IStore getPreferredStore(); - - public void setPreferredStore(IStore preferredStore); - - public String getLastName(); - - public void setLastName(String lastName); - - public String getFirstName(); - - public void setFirstName(String firstName); - - public Set getCreditCardInfo(); - - public void setCreditCardInfo(Set creditCardInfo); - - public void addCreditCardInfo(String creditCardInfo); - - public void removeCreditCardInfo(String creditCardInfo); - - public void setUser(IUser user); - - public IUser getUser(); - - public long getID(); - - public void setID(long id); +package org.cocome.tradingsystem.inventory.data.usermanager; + +import java.util.Set; + +import org.cocome.tradingsystem.inventory.data.store.IStore; + +/** + * Interface for customers of the pickup shop. + * + * @author Tobias Pöppke + * @author Robert Heinrich + */ +public interface ICustomer { + + public String getMailAddress(); + + public void setMailAddress(String mailAddress); + + public IStore getPreferredStore(); + + public void setPreferredStore(IStore preferredStore); + + public String getLastName(); + + public void setLastName(String lastName); + + public String getFirstName(); + + public void setFirstName(String firstName); + + public Set getCreditCardInfo(); + + public void setCreditCardInfo(Set creditCardInfo); + + public void addCreditCardInfo(String creditCardInfo); + + public void removeCreditCardInfo(String creditCardInfo); + + public void setUser(IUser user); + + public IUser getUser(); + + public long getID(); + + public void setID(long id); } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUser.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUser.java similarity index 96% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUser.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUser.java index e5f9e40a..db82cfdc 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUser.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUser.java @@ -1,68 +1,68 @@ -package org.cocome.tradingsystem.inventory.data.usermanager; - -import java.util.Map; -import java.util.Set; - -import org.cocome.tradingsystem.inventory.application.usermanager.CredentialType; -import org.cocome.tradingsystem.inventory.application.usermanager.CredentialTypeNotFoundException; -import org.cocome.tradingsystem.inventory.application.usermanager.Role; -import org.cocome.tradingsystem.inventory.application.usermanager.UserTO; -import org.cocome.tradingsystem.inventory.application.usermanager.credentials.ICredential; - -/** - * Interface for users of the system. This interface is mainly - * used for authentication purposes. - * - * @author Tobias Pöppke - * @author Robert Heinrich - */ -public interface IUser { - public void initUser(UserTO user); - - public String getUsername(); - - public void setCredentials(Map credentials); - - public Map getCredentials(); - - public ICredential getCredential(CredentialType credentialType); - - public void addCredential(ICredential credential); - - public void removeCredential(CredentialType credentialType); - - /** - * Resets the credential of the given type to a new value. - * This can be used to handle password reset requests when - * called with the {@code CredentialType.PLAIN_PASSWORD} or - * {@code CredentialType.HASHED_PASSWORD}. - * - * @param credentialType - * @return the new credential string, e.g. the new password - * @throws CredentialTypeNotFoundException if no credential - * with this type is registered for this user - */ - public String resetCredential(CredentialType credentialType) throws CredentialTypeNotFoundException; - - public boolean checkCredential(ICredential credential); - - public boolean checkUserCredentials(IUser userToCheck); - - public boolean hasRole(Role role); - - public void addRole(Role role); - - public Set getRoles(); - - public void setRoles(Set roles); - - public void withdrawRole(Role role); - - public void setUsername(String username); - -// public boolean isLoggedIn(); -// -// public boolean logOut(); -// -// public void logIn(); -} +package org.cocome.tradingsystem.inventory.data.usermanager; + +import java.util.Map; +import java.util.Set; + +import org.cocome.tradingsystem.inventory.application.usermanager.CredentialType; +import org.cocome.tradingsystem.inventory.application.usermanager.CredentialTypeNotFoundException; +import org.cocome.tradingsystem.inventory.application.usermanager.Role; +import org.cocome.tradingsystem.inventory.application.usermanager.UserTO; +import org.cocome.tradingsystem.inventory.application.usermanager.credentials.ICredential; + +/** + * Interface for users of the system. This interface is mainly + * used for authentication purposes. + * + * @author Tobias Pöppke + * @author Robert Heinrich + */ +public interface IUser { + public void initUser(UserTO user); + + public String getUsername(); + + public void setCredentials(Map credentials); + + public Map getCredentials(); + + public ICredential getCredential(CredentialType credentialType); + + public void addCredential(ICredential credential); + + public void removeCredential(CredentialType credentialType); + + /** + * Resets the credential of the given type to a new value. + * This can be used to handle password reset requests when + * called with the {@code CredentialType.PLAIN_PASSWORD} or + * {@code CredentialType.HASHED_PASSWORD}. + * + * @param credentialType + * @return the new credential string, e.g. the new password + * @throws CredentialTypeNotFoundException if no credential + * with this type is registered for this user + */ + public String resetCredential(CredentialType credentialType) throws CredentialTypeNotFoundException; + + public boolean checkCredential(ICredential credential); + + public boolean checkUserCredentials(IUser userToCheck); + + public boolean hasRole(Role role); + + public void addRole(Role role); + + public Set getRoles(); + + public void setRoles(Set roles); + + public void withdrawRole(Role role); + + public void setUsername(String username); + +// public boolean isLoggedIn(); +// +// public boolean logOut(); +// +// public void logIn(); +} diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserDataFactory.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserDataFactory.java similarity index 97% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserDataFactory.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserDataFactory.java index 9a968717..2dab005e 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserDataFactory.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserDataFactory.java @@ -1,20 +1,20 @@ -package org.cocome.tradingsystem.inventory.data.usermanager; - -import org.cocome.tradingsystem.inventory.application.store.CustomerWithStoreTO; -import org.cocome.tradingsystem.inventory.application.usermanager.CredentialTO; -import org.cocome.tradingsystem.inventory.application.usermanager.UserTO; -import org.cocome.tradingsystem.inventory.application.usermanager.credentials.ICredential; - -public interface IUserDataFactory { - public CustomerWithStoreTO fillCustomerWithStoreTO(ICustomer customer); - - public CredentialTO fillCredentialTO(ICredential credential); - - public UserTO fillUserTO(IUser user); - - public IUser getNewUser(); - - public IUser convertToUser(UserTO userTO); - - public ICustomer getNewCustomer(); -} +package org.cocome.tradingsystem.inventory.data.usermanager; + +import org.cocome.tradingsystem.inventory.application.store.CustomerWithStoreTO; +import org.cocome.tradingsystem.inventory.application.usermanager.CredentialTO; +import org.cocome.tradingsystem.inventory.application.usermanager.UserTO; +import org.cocome.tradingsystem.inventory.application.usermanager.credentials.ICredential; + +public interface IUserDataFactory { + public CustomerWithStoreTO fillCustomerWithStoreTO(ICustomer customer); + + public CredentialTO fillCredentialTO(ICredential credential); + + public UserTO fillUserTO(IUser user); + + public IUser getNewUser(); + + public IUser convertToUser(UserTO userTO); + + public ICustomer getNewCustomer(); +} diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserQuery.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserQuery.java similarity index 100% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserQuery.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/inventory/data/usermanager/IUserQuery.java diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/remote/access/parsing/IBackendConversionHelper.java b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/remote/access/parsing/IBackendConversionHelper.java similarity index 97% rename from cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/remote/access/parsing/IBackendConversionHelper.java rename to cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/remote/access/parsing/IBackendConversionHelper.java index 73465b9f..37797094 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-api/src/main/java/org/cocome/tradingsystem/remote/access/parsing/IBackendConversionHelper.java +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-impl/src/main/java/org/cocome/tradingsystem/remote/access/parsing/IBackendConversionHelper.java @@ -1,43 +1,43 @@ -package org.cocome.tradingsystem.remote.access.parsing; - -import java.util.Collection; - -import org.cocome.tradingsystem.inventory.data.enterprise.IProduct; -import org.cocome.tradingsystem.inventory.data.enterprise.IProductSupplier; -import org.cocome.tradingsystem.inventory.data.enterprise.ITradingEnterprise; -import org.cocome.tradingsystem.inventory.data.store.IProductOrder; -import org.cocome.tradingsystem.inventory.data.store.IStockItem; -import org.cocome.tradingsystem.inventory.data.store.IStore; -import org.cocome.tradingsystem.inventory.data.usermanager.ICustomer; -import org.cocome.tradingsystem.inventory.data.usermanager.IUser; - -public interface IBackendConversionHelper { - - /** - * Converts a CSV response from the backend to a list of Store objects. - * The enterprise, suppliers and productItems attributes in the Stores are left as - * null and have to be filled separately. - * - * @param input - * the csv string to be parsed - * - * @return - * a collection of stores contained in the string - */ - Collection getStores(String input); - - Collection getCustomers(String input); - - Collection getUsers(String input); - - Collection getEnterprises(String input); - - Collection getStockItems(String input); - - Collection getProducts(String input); - - Collection getProductSuppliers(String input); - - Collection getProductOrders(String input); - +package org.cocome.tradingsystem.remote.access.parsing; + +import java.util.Collection; + +import org.cocome.tradingsystem.inventory.data.enterprise.IProduct; +import org.cocome.tradingsystem.inventory.data.enterprise.IProductSupplier; +import org.cocome.tradingsystem.inventory.data.enterprise.ITradingEnterprise; +import org.cocome.tradingsystem.inventory.data.store.IProductOrder; +import org.cocome.tradingsystem.inventory.data.store.IStockItem; +import org.cocome.tradingsystem.inventory.data.store.IStore; +import org.cocome.tradingsystem.inventory.data.usermanager.ICustomer; +import org.cocome.tradingsystem.inventory.data.usermanager.IUser; + +public interface IBackendConversionHelper { + + /** + * Converts a CSV response from the backend to a list of Store objects. + * The enterprise, suppliers and productItems attributes in the Stores are left as + * null and have to be filled separately. + * + * @param input + * the csv string to be parsed + * + * @return + * a collection of stores contained in the string + */ + Collection getStores(String input); + + Collection getCustomers(String input); + + Collection getUsers(String input); + + Collection getEnterprises(String input); + + Collection getStockItems(String input); + + Collection getProducts(String input); + + Collection getProductSuppliers(String input); + + Collection getProductOrders(String input); + } \ No newline at end of file diff --git a/cocome-maven-project/cloud-logic-service/cloud-logic-core-services/pom.xml b/cocome-maven-project/cloud-logic-service/cloud-logic-core-services/pom.xml index 09d0ff66..38860d53 100644 --- a/cocome-maven-project/cloud-logic-service/cloud-logic-core-services/pom.xml +++ b/cocome-maven-project/cloud-logic-service/cloud-logic-core-services/pom.xml @@ -385,6 +385,11 @@ cloud-logic-core-api 1.1 + + org.cocome + cloud-logic-core-impl + 1.1 + org.jboss.spec jboss-javaee-web-6.0