/* * Copyright 2006 - 2012 Hannes Holtzhausen * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: ProductService.java,v 1.6 2007/11/01 22:53:15 hannes Exp $ * * Description: * */ package app.services; import java.util.*; import app.beans.*; /** * Interface that defines the micro business service of the beans demo * application. *
* This serves as an example of defining and implementing contract or * interface driven micro business services using the Toolbox Framework. *
* * @author Hannes Holtzhausen */ public interface ProductService { /** * Add the product information contained in the given Product. * * @param product Product containing product information. * * @throws ProductException if the information cannot be committed. */ public void addProduct(Product product) throws ProductException; /** * Add the product type information contained in the given ProductType. * * @param type ProductType containing type information. * * @throws ProductException if the information cannot be committed. */ public void addProductType(ProductType type) throws ProductException; /** * Add the vendor information contained in the given Vendor. * * @param vendor Vendor containing information. * * @throws ProductException if the information cannot be committed. */ public void addVendor(Vendor vendor) throws ProductException; /** * Update the product information contained in the given Product. * * @param product Product containing product information. * * @throws ProductException if the information cannot be committed. */ public void updateProduct(Product product) throws ProductException; /** * Update the product type information contained in the given ProductType. * * @param type ProductType containing type information. * * @throws ProductException if the information cannot be committed. */ public void updateProductType(ProductType type) throws ProductException; /** * Update the vendor information contained in the given Vendor. * * @param vendor Vendor containing vendor information. * * @throws ProductException if the information cannot be committed. */ public void updateVendor(Vendor vendor) throws ProductException; /** * Return product information as a Product instance using the given id. * * @param id Product identifier. * * @return Product instance containing product information. */ public Product getProduct(Integer id) throws ProductException; /** * Return product type information as a ProductType instance using the given * id. * * @param id ProductType identifier. * * @return ProductType instance containing type information. */ public ProductType getProductType(Integer id) throws ProductException; /** * Return vendor information as a Vendor instance using the given id. * * @param id Vendor identifier. * * @return Vendor instance containing vendor information. */ public Vendor getVendor(Integer id) throws ProductException; /** * Remove the product with the given identifier. * * @param id Product identifier. * * @throws ProductException if the product cannot be removed. */ public void removeProduct(Integer id) throws ProductException; /** * Remove the product type with the given identifier. * * @param id ProductType identifier. * * @throws ProductException if the product type cannot be removed. */ public void removeProductType(Integer id) throws ProductException; /** * Remove the vendor with the given identifier. * * @param id Vendor identifier. * * @throws ProductException if the vendor cannot be removed. */ public void removeVendor(Integer id) throws ProductException; /** * Return all products. * * @return List containing Product instances. * * @throws ProductException if the product information cannot be retrieved. */ public List getProducts() throws ProductException; /** * Return all product types. * * @return List containing ProductType instances. * * @throws ProductException if the product type information cannot be * retrieved. */ public List getProductTypes() throws ProductException; /** * Return all vendors. * * @return List containing Vendor instances. * * @throws ProductException if the vendor information cannot be retrieved. */ public List getVendors() throws ProductException; }