KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > persistence > core > ContentResourceDAO


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not 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.
15  */

16 package com.blandware.atleap.persistence.core;
17
18 import com.blandware.atleap.common.util.PartialCollection;
19 import com.blandware.atleap.common.util.QueryInfo;
20 import com.blandware.atleap.model.core.ContentResource;
21 import com.blandware.atleap.model.core.ResourceData;
22 import com.blandware.atleap.persistence.exception.DeleteException;
23
24 /**
25  * <p>DAO for content resource</p>
26  * <p><a HREF="ContentResourceDAO.java.htm"><i>View Source</i></a></p>
27  *
28  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
29  * @version $Revision: 1.9 $ $Date: 2006/03/16 11:09:37 $
30  */

31 public interface ContentResourceDAO extends DAO {
32
33     // ~ CRUD Methods ================================================================
34

35     /**
36      * Creates new content resource
37      *
38      * @param contentResource Object that represents what resource must be created
39      * @param resourceData Object that represents binary data for new resource
40      * @return ID of created content resource
41      */

42     public Long JavaDoc createContentResource(ContentResource contentResource, ResourceData resourceData);
43
44     /**
45      * Retrieves content resource with specified ID
46      *
47      * @param contentResourceId ID to search by
48      * @return Content resource or null if no content resource with specified ID exists in database
49      */

50     public ContentResource retrieveContentResource(Long JavaDoc contentResourceId);
51
52     /**
53      * Updates content resource
54      *
55      * @param contentResource Content resource to update
56      * @param resourceData Object that represents binary data for updated
57      * resource
58      */

59     public void updateContentResource(ContentResource contentResource, ResourceData resourceData);
60
61     /**
62      * Deletes content resource
63      *
64      * @param contentResource Resource to delete
65      * @throws DeleteException if content resource cannot be deleted
66      */

67     public void deleteContentResource(ContentResource contentResource) throws DeleteException;
68
69     // ~ Additional methods ================================================================
70

71     /**
72      * Retrieves filtered/sorted collection of content resources.
73      *
74      * @param queryInfo Object that contains information about how to filter and sort data
75      * @return Collection of resources
76      */

77     public PartialCollection listContentResources(QueryInfo queryInfo);
78
79     /**
80      * Searches for duplicates. Returns true if there is one or more resources with another ID, but which
81      * have same values from some set (e.g. uri)
82      *
83      * @param contentResource Resource to find duplicates for
84      * @return whether this content resource has duplicates
85      */

86     public boolean hasDuplicates(ContentResource contentResource);
87
88     // ~ Finders ================================================================
89

90     /**
91      * Finds content resource by URI
92      *
93      * @param uri URI of resource to search by
94      * @return Content resource or null if nothing was found
95      */

96     public ContentResource findContentResourceByUri(String JavaDoc uri);
97
98
99 }
100
Popular Tags