KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > webservices > atomprotocol > AtomHandler


1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */

18 package org.apache.roller.webservices.atomprotocol;
19
20 import java.io.InputStream JavaDoc;
21 import java.util.Date JavaDoc;
22
23 import com.sun.syndication.feed.atom.Entry;
24 import com.sun.syndication.feed.atom.Feed;
25
26 /**
27  * Interface to be supported by an Atom server, expected lifetime: one request.
28  * AtomServlet calls this generic interface instead of Roller specific APIs.
29  * <p />
30  * Based on: draft-ietf-atompub-protocol-08.txt + PaceMediaEntries5
31  * <p />
32  * Designed to be Roller independent.
33  */

34 public interface AtomHandler
35 {
36     /** Get username of authenticated user */
37     public String JavaDoc getAuthenticatedUsername();
38
39     /**
40      * Return introspection document
41      */

42     public AtomService getIntrospection() throws AtomException;
43     
44     /**
45      * Return collection
46      * @param pathInfo Used to determine which collection and range
47      */

48     public Feed getCollection(String JavaDoc[] pathInfo) throws AtomException;
49     
50     /**
51      * Create a new entry specified by pathInfo and posted entry.
52      * @param pathInfo Path info portion of URL
53      */

54     public Entry postEntry(String JavaDoc[] pathInfo, Entry entry) throws AtomException;
55
56     /**
57      * Get entry specified by pathInfo.
58      * @param pathInfo Path info portion of URL
59      */

60     public Entry getEntry(String JavaDoc[] pathInfo) throws AtomException;
61     
62     /**
63      * Update entry specified by pathInfo and posted entry.
64      * @param pathInfo Path info portion of URL
65      */

66     public Entry putEntry(String JavaDoc[] pathInfo, Entry entry) throws AtomException;
67     
68
69     /**
70      * Delete entry specified by pathInfo.
71      * @param pathInfo Path info portion of URL
72      */

73     public void deleteEntry(String JavaDoc[] pathInfo) throws AtomException;
74     
75     /**
76      * Create a new media-link entry.
77      * @param pathInfo Path info portion of URL
78      * @param contentType MIME type of uploaded content
79      * @param data Binary data representing uploaded content
80      */

81     public Entry postMedia(
82         String JavaDoc[] pathInfo, String JavaDoc title, String JavaDoc slug, String JavaDoc contentType, InputStream JavaDoc is) throws AtomException;
83
84     /**
85      * Update the media file part of a media-link entry.
86      * @param pathInfo Path info portion of URL
87      */

88     public Entry putMedia(
89         String JavaDoc[] pathInfo, String JavaDoc contentType, InputStream JavaDoc is) throws AtomException;
90         
91     /**
92      * Return true if specified pathinfo represents URI of introspection doc.
93      */

94     public boolean isIntrospectionURI(String JavaDoc [] pathInfo);
95  
96     /**
97      * Return true if specified pathinfo represents URI of a collection.
98      */

99     public boolean isCollectionURI(String JavaDoc [] pathInfo);
100      
101     /**
102      * Return true if specified pathinfo represents URI of an Atom entry.
103      */

104     public boolean isEntryURI(String JavaDoc[] pathInfo);
105         
106     /**
107      * Return true if specified pathinfo represents media-edit URI.
108      */

109     public boolean isMediaEditURI(String JavaDoc[] pathInfo);
110 }
111
112
Popular Tags