Author: tchemit Date: 2008-01-24 21:29:37 +0000 (Thu, 24 Jan 2008) New Revision: 515 Added: trunk/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/SimExplorerServiceException.java Modified: trunk/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageService.java Log: ajout exception sp?\195?\169cifique couche service Added: trunk/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/SimExplorerServiceException.java =================================================================== --- trunk/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/SimExplorerServiceException.java (rev 0) +++ trunk/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/SimExplorerServiceException.java 2008-01-24 21:29:37 UTC (rev 515) @@ -0,0 +1,43 @@ +/* +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* Tony Chemit, Gabriel Landais +* +* 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 2 +* 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, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* ##% */ +package fr.cemagref.simexplorer.is.service; + +/** + * Exception de base pour toute erreur rencontrée dans un service. + * + * @author chemit + */ +public class SimExplorerServiceException extends Exception { + private static final long serialVersionUID = 1054522404126322604L; + + public SimExplorerServiceException() { + } + + public SimExplorerServiceException(Throwable cause) { + super(cause); + } + + public SimExplorerServiceException(String message) { + super(message); + } + + public SimExplorerServiceException(String message, Throwable cause) { + super(message, cause); + } +} Modified: trunk/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageService.java =================================================================== --- trunk/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageService.java 2008-01-24 21:28:39 UTC (rev 514) +++ trunk/simexplorer-is-service/src/java/fr/cemagref/simexplorer/is/service/StorageService.java 2008-01-24 21:29:37 UTC (rev 515) @@ -17,135 +17,125 @@ * ##% */ package fr.cemagref.simexplorer.is.service; -import java.util.Map; - -import javax.ejb.Remote; - import com.healthmarketscience.rmiio.RemoteInputStream; import com.healthmarketscience.rmiio.RemoteOutputStream; - import fr.cemagref.simexplorer.is.entities.data.LoggableElement; import fr.cemagref.simexplorer.is.entities.metadata.MetaDataEntity; -import fr.cemagref.simexplorer.is.entities.metadata.Version; +import javax.ejb.Remote; +import java.util.Map; + /** * Service interface - * + * * @author glandais - * */ @Remote public interface StorageService { /** * Commit in storage - * - * @throws Exception + * + * @throws SimExplorerServiceException */ - void commit() throws Exception; + void commit() throws SimExplorerServiceException; /** * Login user onto system Not used for local usages - * - * @param login - * Login - * @param password - * Password + * + * @param login Login + * @param password Password * @return Token as logon evidence */ String loginUser(String login, String password); /** * Save a remote element - * + * * @param token - * @param zipRemoteStream - * RIIO stream containing data inside a zip + * @param zipRemoteStream RIIO stream containing data inside a zip * @return Metadata of element imported - * @throws Exception + * @throws SimExplorerServiceException */ MetaDataEntity saveElement(String token, RemoteInputStream zipRemoteStream) - throws Exception; + throws SimExplorerServiceException; /** * Save a remote element - * + * * @param token - * @param xmlRemoteStream - * RIIO stream containing XML Stream - * @param attachmentsRemoteStream - * RIIO stream containing attached data. Key matches metadata - * attachment keys + * @param xmlRemoteStream RIIO stream containing XML Stream + * @param attachmentsRemoteStream RIIO stream containing attached data. Key matches metadata + * attachment keys * @return Metadata of element saved - * @throws Exception + * @throws SimExplorerServiceException */ MetaDataEntity saveElement(String token, RemoteInputStream xmlRemoteStream, - Map<String, RemoteInputStream> attachmentsRemoteStream) - throws Exception; + Map<String, RemoteInputStream> attachmentsRemoteStream) + throws SimExplorerServiceException; /** * Retrieve metadata (latest version) - * + * * @param token * @param uuid * @return - * @throws Exception + * @throws SimExplorerServiceException */ - MetaDataEntity getMetadata(String token, String uuid) throws Exception; + MetaDataEntity getMetadata(String token, String uuid) throws SimExplorerServiceException; /** * Retrieve metadata - * + * * @param token * @param uuid * @param version * @return - * @throws Exception + * @throws SimExplorerServiceException */ MetaDataEntity getMetadata(String token, String uuid, String version) - throws Exception; + throws SimExplorerServiceException; /** * Export element to a remote stream - * + * * @param token - * @param xmlOutputStream - * RMIIO stream where to save data + * @param xmlOutputStream RMIIO stream where to save data * @param uuid * @param version - * @throws Exception + * @throws SimExplorerServiceException */ void exportElement(String token, RemoteOutputStream xmlOutputStream, - String uuid, String version) throws Exception; + String uuid, String version) throws SimExplorerServiceException; /** * Retrieve data related to an entity - * + * * @param token * @param uuid * @param version * @param dataKey * @return - * @throws Exception + * @throws SimExplorerServiceException */ RemoteInputStream retrieveData(String token, String uuid, String version, - String dataKey) throws Exception; + String dataKey) throws SimExplorerServiceException; /** * Retrieve number of elements matching query - * + * * @param token * @param query * @param onlyLatest * @return - * @throws Exception + * @throws SimExplorerServiceException */ int findFullTextCount(String token, String query, boolean onlyLatest) - throws Exception; + throws SimExplorerServiceException; /** * Find elements matching query - * + * * @param token * @param query * @param onlyLatest @@ -153,58 +143,58 @@ * @param count * @param dateOrder * @return - * @throws Exception + * @throws SimExplorerServiceException */ MetaDataEntity[] findFullText(String token, String query, - boolean onlyLatest, int indexStart, int count, int dateOrder) - throws Exception; + boolean onlyLatest, int indexStart, int count, int dateOrder) + throws SimExplorerServiceException; /** * Retrieve number of applications - * + * * @param token * @param onlyLatest * @return - * @throws Exception + * @throws SimExplorerServiceException */ int findApplicationsCount(String token, boolean onlyLatest) - throws Exception; + throws SimExplorerServiceException; /** * Get a list of applications - * + * * @param token * @param onlyLatest * @param start * @param count * @param dateOrder * @return - * @throws Exception + * @throws SimExplorerServiceException */ MetaDataEntity[] findApplications(String token, boolean onlyLatest, - int start, int count, int dateOrder) throws Exception; + int start, int count, int dateOrder) throws SimExplorerServiceException; /** * Fully load an element - * + * * @param token * @param uuid * @param version * @return - * @throws Exception + * @throws SimExplorerServiceException */ LoggableElement getElement(String token, String uuid, String version) - throws Exception; + throws SimExplorerServiceException; /** * Get all version of an element - * + * * @param token * @param uuid * @return - * @throws Exception + * @throws SimExplorerServiceException */ - MetaDataEntity[] getVersions(String token, String uuid) throws Exception; + MetaDataEntity[] getVersions(String token, String uuid) throws SimExplorerServiceException; /** * @param token