import java.io.Serializable;
import javax.ejb.Remote;
-import org.mxchange.jproduct.exceptions.CannotAddCategoryException;
-import org.mxchange.jproduct.exceptions.CategoryTitleAlreadyUsedException;
+import org.mxchange.jproduct.exceptions.category.CategoryAlreadyAddedException;
/**
* An interface for categories for "ADMIN" role.
* <p>
* @return Updated category instance
* <p>
- * @throws CategoryTitleAlreadyUsedException If the given title is already
- * used
- * @throws CannotAddCategoryException If the category cannot be added
+ * @throws CategoryAlreadyAddedException If the category cannot be added
*/
- Category doAdminAddCategory (final Category category) throws CategoryTitleAlreadyUsedException, CannotAddCategoryException;
+ Category doAdminAddCategory (final Category category) throws CategoryAlreadyAddedException;
}
import java.io.Serializable;
import java.util.List;
import javax.ejb.Remote;
+import org.mxchange.jproduct.exceptions.category.CategoryNotFoundException;
/**
* A remote-call interface for the shop
@Remote
public interface CategorySessionBeanRemote extends Serializable {
+ /**
+ * Returns a category instance (entity) for given primary key. If not found,
+ * a proper exception is thrown.
+ * <p>
+ * @param categoryId Category id (primary key)
+ * <p>
+ * @return Category entity matching to primary key
+ * <p>
+ * @throws CategoryNotFoundException If a category with given primary key
+ * could not be found
+ */
+ Category findCategoryById (final Long categoryId) throws CategoryNotFoundException;
+
/**
* Some "getter" for a linked list of all categories
* <p>
import java.io.Serializable;
import javax.ejb.Remote;
-import org.mxchange.jproduct.exceptions.CannotAddProductException;
-import org.mxchange.jproduct.exceptions.ProductTitleAlreadyUsedException;
+import org.mxchange.jproduct.exceptions.product.ProductAlreadyAddedException;
/**
* Product interface for "ADMIN" role
* <p>
* @return Updated product instance
* <p>
- * @throws ProductTitleAlreadyUsedException If the given product title is
- * already used
- * @throws CannotAddProductException If something unexpected happened
+ * @throws ProductAlreadyAddedException If something unexpected happened
*/
- Product doAdminAddProduct (final Product product) throws ProductTitleAlreadyUsedException, CannotAddProductException;
+ Product doAdminAddProduct (final Product product) throws ProductAlreadyAddedException;
}
import java.io.Serializable;
import java.util.List;
import javax.ejb.Remote;
+import org.mxchange.jproduct.exceptions.product.ProductNotFoundException;
/**
* An interface for non-administrative purposes
@Remote
public interface ProductSessionBeanRemote extends Serializable {
+ /**
+ * Returns a product instance (entity) for given primary key. If not found,
+ * a proper exception is thrown.
+ * <p>
+ * @param productId Product id (primary key)
+ * <p>
+ * @return Product entity matching to primary key
+ * <p>
+ * @throws ProductNotFoundException If a product with given primary key
+ * could not be found
+ */
+ Product findProductById (final Long productId) throws ProductNotFoundException;
+
/**
* Returns a list of all products
* <p>