From f71e86979fb290e372b14310b37203155d0f28dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 17 Oct 2017 22:49:13 +0200 Subject: [PATCH] Continued: - added administrative/general remote interface for receipt items - fixed imports MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- ...inancialAdminReceiptSessionBeanRemote.java | 2 +- .../FinancialReceiptSessionBeanRemote.java | 6 +- ...cialAdminReceiptItemSessionBeanRemote.java | 45 ++++++++++++ ...FinancialReceiptItemSessionBeanRemote.java | 73 +++++++++++++++++++ 4 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 src/org/mxchange/jfinancials/model/receipt_item/FinancialAdminReceiptItemSessionBeanRemote.java create mode 100644 src/org/mxchange/jfinancials/model/receipt_item/FinancialReceiptItemSessionBeanRemote.java diff --git a/src/org/mxchange/jfinancials/model/receipt/FinancialAdminReceiptSessionBeanRemote.java b/src/org/mxchange/jfinancials/model/receipt/FinancialAdminReceiptSessionBeanRemote.java index c4438dc..5f34cf9 100644 --- a/src/org/mxchange/jfinancials/model/receipt/FinancialAdminReceiptSessionBeanRemote.java +++ b/src/org/mxchange/jfinancials/model/receipt/FinancialAdminReceiptSessionBeanRemote.java @@ -18,7 +18,7 @@ package org.mxchange.jfinancials.model.receipt; import java.io.Serializable; import javax.ejb.Remote; -import org.mxchange.jfinancials.exceptions.ReceiptAlreadyAddedException; +import org.mxchange.jfinancials.exceptions.receipt.ReceiptAlreadyAddedException; /** * A remote interface for administrative EJBs for receipts diff --git a/src/org/mxchange/jfinancials/model/receipt/FinancialReceiptSessionBeanRemote.java b/src/org/mxchange/jfinancials/model/receipt/FinancialReceiptSessionBeanRemote.java index 658610c..cb62f08 100644 --- a/src/org/mxchange/jfinancials/model/receipt/FinancialReceiptSessionBeanRemote.java +++ b/src/org/mxchange/jfinancials/model/receipt/FinancialReceiptSessionBeanRemote.java @@ -19,11 +19,11 @@ package org.mxchange.jfinancials.model.receipt; import java.io.Serializable; import java.util.List; import javax.ejb.Remote; -import org.mxchange.jfinancials.exceptions.ReceiptAlreadyAddedException; +import org.mxchange.jfinancials.exceptions.receipt.ReceiptAlreadyAddedException; import org.mxchange.jusercore.model.user.User; /** - * A remote interface for financial receipt stuff + * A remote interface for financial receipts *

* @author Roland Häder */ @@ -33,7 +33,7 @@ public interface FinancialReceiptSessionBeanRemote extends Serializable { /** * Returns a list of all receipts *

- * @return A list of all user's receipts + * @return A list of all receipts */ List allReceipts (); diff --git a/src/org/mxchange/jfinancials/model/receipt_item/FinancialAdminReceiptItemSessionBeanRemote.java b/src/org/mxchange/jfinancials/model/receipt_item/FinancialAdminReceiptItemSessionBeanRemote.java new file mode 100644 index 0000000..d43c491 --- /dev/null +++ b/src/org/mxchange/jfinancials/model/receipt_item/FinancialAdminReceiptItemSessionBeanRemote.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 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 . + */ +package org.mxchange.jfinancials.model.receipt_item; + +import java.io.Serializable; +import javax.ejb.Remote; +import org.mxchange.jfinancials.exceptions.receipt_item.ReceiptItemAlreadyAddedException; +import org.mxchange.jfinancials.model.receipt.item.BillableReceiptItem; + +/** + * A remote interface for administrative EJBs for receipt items + *

+ * @author Roland Häder + */ +@Remote +public interface FinancialAdminReceiptItemSessionBeanRemote extends Serializable { + + /** + * Adds given receipt item and returns the updated version. If the receipt + * item has already been found, a proper exception is being thrown. + *

+ * @param receiptItem Receipt item being added + *

+ * @return Updated receipt item + *

+ * @throws ReceiptItemAlreadyAddedException If the receipt item has already + * been added + */ + BillableReceiptItem addReceiptItem (final BillableReceiptItem receiptItem) throws ReceiptItemAlreadyAddedException; + +} diff --git a/src/org/mxchange/jfinancials/model/receipt_item/FinancialReceiptItemSessionBeanRemote.java b/src/org/mxchange/jfinancials/model/receipt_item/FinancialReceiptItemSessionBeanRemote.java new file mode 100644 index 0000000..ae3a2e6 --- /dev/null +++ b/src/org/mxchange/jfinancials/model/receipt_item/FinancialReceiptItemSessionBeanRemote.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 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 . + */ +package org.mxchange.jfinancials.model.receipt_item; + +import java.io.Serializable; +import java.util.List; +import javax.ejb.Remote; +import org.mxchange.jfinancials.exceptions.receipt_item.ReceiptItemAlreadyAddedException; +import org.mxchange.jfinancials.model.receipt.BillableReceipt; +import org.mxchange.jfinancials.model.receipt.item.BillableReceiptItem; +import org.mxchange.jusercore.model.user.User; + +/** + * A remote interface for financial receipt items + *

+ * @author Roland Häder + */ +@Remote +public interface FinancialReceiptItemSessionBeanRemote extends Serializable { + + /** + * Returns a list of all receipt items + *

+ * @return A list of all receipt items + */ + List allReceiptItems (); + + /** + * Returns a list of all items by given receipt instance + *

+ * @param receipt Receipt instance + *

+ * @return A list of all assigned receipt items + */ + List allReceiptItems (final BillableReceipt receipt); + + /** + * Returns a list of all user's receipt items + *

+ * @param user User instance to get all receipts for + *

+ * @return A list of all user's receipt items + */ + List allUsersReceiptItems (final User user); + + /** + * Adds given receipt item and returns the updated version. If the receipt + * item has already been found, a proper exception is being thrown. + *

+ * @param receiptItem Receipt item being added + *

+ * @return Updated receipt + *

+ * @throws ReceiptItemAlreadyAddedException If the receipt item has already + * been added + */ + BillableReceiptItem addReceiptItem (final BillableReceiptItem receiptItem) throws ReceiptItemAlreadyAddedException; + +} -- 2.39.2