| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Registry |
|
| 0.0;0 |
| 1 | /* | |
| 2 | Copyright (C) 2006 Grid Systems, S.A. | |
| 3 | ||
| 4 | This library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | This library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with this library; if not, write to the Free Software | |
| 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 17 | */ | |
| 18 | package nextgrid.api.ram; | |
| 19 | ||
| 20 | import java.io.Serializable; | |
| 21 | import java.net.URI; | |
| 22 | import java.util.Collection; | |
| 23 | ||
| 24 | import nextgrid.api.pom.Process; | |
| 25 | ||
| 26 | /** | |
| 27 | * Type description. | |
| 28 | * | |
| 29 | * @author Rodrigo Ruiz | |
| 30 | */ | |
| 31 | public interface Registry extends Serializable { | |
| 32 | ||
| 33 | /** | |
| 34 | * Registers a process. | |
| 35 | * | |
| 36 | * @param process The process to register | |
| 37 | * @return An URI that can be used as an identifier | |
| 38 | * @throws RegistryException If an error occurs | |
| 39 | */ | |
| 40 | URI register(Process process) throws RegistryException; | |
| 41 | ||
| 42 | /** | |
| 43 | * Removes a process from a registry. | |
| 44 | * | |
| 45 | * @param process The process to remove | |
| 46 | * @throws RegistryException If an error occurs | |
| 47 | */ | |
| 48 | void delete(Process process) throws RegistryException; | |
| 49 | ||
| 50 | /** | |
| 51 | * Removes a process from a registry. | |
| 52 | * | |
| 53 | * @param uri The process identifier | |
| 54 | * @throws RegistryException If an error occurs | |
| 55 | */ | |
| 56 | void delete(URI uri) throws RegistryException; | |
| 57 | ||
| 58 | /** | |
| 59 | * Retrieves a process from a registry. | |
| 60 | * | |
| 61 | * @param uri The process identifier | |
| 62 | * @return The retrieved process | |
| 63 | * @throws RegistryException If an error occurs | |
| 64 | */ | |
| 65 | Process get(URI uri) throws RegistryException; | |
| 66 | ||
| 67 | /** | |
| 68 | * Performs a query in a given language. | |
| 69 | * | |
| 70 | * @param query The query text | |
| 71 | * @param lang The query language | |
| 72 | * @return A collection of results | |
| 73 | * @throws RegistryException If an error occurs | |
| 74 | */ | |
| 75 | Collection<Process> query(String query, String lang) throws RegistryException; | |
| 76 | ||
| 77 | /** | |
| 78 | * Gets if this registry supports the given syntax. | |
| 79 | * | |
| 80 | * @param lang The identifier of the query language syntax | |
| 81 | * @return <code>true</code> if it supports the query language, | |
| 82 | * <code>false</code> otherwise | |
| 83 | */ | |
| 84 | boolean supports(String lang); | |
| 85 | } |