View Javadoc

1   package org.fedoracommons.funapi;
2   
3   /**
4    * 
5    *
6    * @author Edwin Shin
7    * @since 0.1
8    * @version $Id: ObjectResolver.java 38 2008-10-25 23:11:02Z pangloss $
9    */
10  public interface ObjectResolver {
11      
12      /**
13       * Provide the object formats which should be supported for all objects 
14       * available through the unAPI service.
15       * 
16       * @return UnapiFormats representing the object formats supported for all
17       *         objects.
18       * @throws UnapiException
19       */
20      UnapiFormats getFormats() throws UnapiException;
21      
22      /**
23       * Provide a list of object formats available from the unAPI service for the 
24       * object identified by <code>id</code>. 
25       * It is similar to the {@link #getFormats() getFormats} response, but the
26       * returned UnapiFormats object must have the requested <code>id</code> set.
27       * 
28       * @param id
29       * @return UnapiFormats representing the object formats supported for the
30       *         requested object.
31       * @throws UnapiException
32       */
33      UnapiFormats getFormats(String id) throws UnapiException;
34      
35      /**
36       * <p>Return an {@link UnapiObject UnapiObject} representing the object 
37       * specified by <code>id</code> in the format specified by 
38       * <code>format</code>.</p>
39       * 
40       * <p>Implementations should throw an {@link IdentifierException 
41       * IdentifierException} for requests for an identifier that is not available 
42       * on the server.
43       * Implementations should throw a {@link FormatException FormatException} 
44       * for requests for an identifier that is available on the server in a 
45       * format that is not available for that identifier.</p>
46       * 
47       * @param id
48       * @param format
49       * @return UnapiObject
50       * @throws UnapiException
51       */
52      UnapiObject getObject(String id, String format) throws UnapiException;
53  }