+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jproduct.exceptions;
-
-/**
- * An exception thrown when the category cannot be added for a "low level"
- * reason.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class CannotAddCategoryException extends Exception {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 34_295_843_957_951L;
-
- /**
- * Constructor with cause
- * <p>
- * @param cause Causing exception
- */
- public CannotAddCategoryException (final Throwable cause) {
- // Call super constructor
- super(cause);
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jproduct.exceptions;
-
-/**
- * An exception thrown when the product cannot be added for a "low level"
- * reason.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class CannotAddProductException extends Exception {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 48_574_857_485_748_175L;
-
- /**
- * Constructor with cause
- * <p>
- * @param cause Causing exception
- */
- public CannotAddProductException (final Throwable cause) {
- // Call super constructor
- super(cause);
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jproduct.exceptions;
-
-import java.text.MessageFormat;
-import org.mxchange.jproduct.model.category.Category;
-
-/**
- * An exception thrown when the given title is already used
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class CategoryTitleAlreadyUsedException extends Exception {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 53_751_434_673_262L;
-
- /**
- * Constructor with HttpServletRequest instance
- * <p>
- * @param category Category instance
- */
- public CategoryTitleAlreadyUsedException (final Category category) {
- // Call super constructor
- super(MessageFormat.format("Title {0} is already used.", category.getCategoryTitle())); //NOI18N
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2016, 2017 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jproduct.exceptions;
-
-import java.text.MessageFormat;
-import org.mxchange.jproduct.model.product.Product;
-
-/**
- * An exception thrown when the given title is already used
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class ProductTitleAlreadyUsedException extends Exception {
-
- /**
- * Serial number
- */
- private static final long serialVersionUID = 4_252_734_834_174L;
-
- /**
- * Constructor with HttpServletRequest instance
- * <p>
- * @param product Product instance
- */
- public ProductTitleAlreadyUsedException (final Product product) {
- // Call super constructor
- super(MessageFormat.format("Title {0} is already used.", product.getProductTitle())); //NOI18N
- }
-}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jproduct.exceptions.category;
+
+import java.text.MessageFormat;
+import org.mxchange.jproduct.model.category.Category;
+
+/**
+ * An exception thrown when a category has already been added.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class CategoryAlreadyAddedException extends Exception {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 34_295_843_957_951L;
+
+ /**
+ * Constructor with cause
+ * <p>
+ * @param cause Causing exception
+ */
+ public CategoryAlreadyAddedException (final Throwable cause) {
+ // Call super constructor
+ super(cause);
+ }
+
+ /**
+ * Constructor with category instance
+ * <p>
+ * @param category Category instance
+ */
+ public CategoryAlreadyAddedException (final Category category) {
+ // Call super constructor
+ super(MessageFormat.format("Category with title '{0}' already added.", category.getCategoryTitle())); //NOI18N
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jproduct.exceptions.category;
+
+import java.text.MessageFormat;
+import org.mxchange.jproduct.model.category.Category;
+
+/**
+ * An exception thrown when a category was not found.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class CategoryNotFoundException extends Exception {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 34_295_843_957_952L;
+
+ /**
+ * Constructor with cause
+ * <p>
+ * @param cause Causing exception
+ */
+ public CategoryNotFoundException (final Throwable cause) {
+ // Call super constructor
+ super(cause);
+ }
+
+ /**
+ * Constructor with category instance
+ * <p>
+ * @param category Category instance
+ */
+ public CategoryNotFoundException (final Category category) {
+ // Call super constructor
+ super(MessageFormat.format("Category with title '{0}' already added.", category.getCategoryTitle())); //NOI18N
+ }
+
+ /**
+ * Constructor with category id
+ * <p>
+ * @param categoryId Category id
+ */
+ public CategoryNotFoundException (final Long categoryId) {
+ // Call super constructor
+ super(MessageFormat.format("Category with id '{0}' not found.", categoryId)); //NOI18N
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jproduct.exceptions.product;
+
+import java.text.MessageFormat;
+import org.mxchange.jproduct.model.product.Product;
+
+/**
+ * An exception thrown when a product was already found.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class ProductAlreadyAddedException extends Exception {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 48_574_857_485_748_175L;
+
+ /**
+ * Constructor with cause
+ * <p>
+ * @param cause Causing exception
+ */
+ public ProductAlreadyAddedException (final Throwable cause) {
+ // Call super constructor
+ super(cause);
+ }
+
+ /**
+ * Constructor with product instance
+ * <p>
+ * @param product Product instance
+ */
+ public ProductAlreadyAddedException (final Product product) {
+ // Call super constructor
+ super(MessageFormat.format("Product with title '{0}' already added.", product.getProductTitle())); //NOI18N
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jproduct.exceptions.product;
+
+import java.text.MessageFormat;
+
+/**
+ * An exception thrown when a product has not found.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public class ProductNotFoundException extends Exception {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 48_574_857_485_748_176L;
+
+ /**
+ * Constructor with cause
+ * <p>
+ * @param cause Causing exception
+ */
+ public ProductNotFoundException (final Throwable cause) {
+ // Call super constructor
+ super(cause);
+ }
+
+ /**
+ * Constructor with product id
+ * <p>
+ * @param productId Product id
+ */
+ public ProductNotFoundException (final Long productId) {
+ // Call super constructor
+ super(MessageFormat.format("Product with id {0} not found.", productId)); //NOI18N
+ }
+
+}