KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jaspersoft > jasperserver > api > metadata > common > service > RepositoryService


1 /*
2  * Copyright (C) 2006 JasperSoft http://www.jaspersoft.com
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed WITHOUT ANY WARRANTY; and without the
10  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
15  * or write to:
16  *
17  * Free Software Foundation, Inc.,
18  * 59 Temple Place - Suite 330,
19  * Boston, MA USA 02111-1307
20  */

21 package com.jaspersoft.jasperserver.api.metadata.common.service;
22
23 import java.util.List JavaDoc;
24
25 import com.jaspersoft.jasperserver.api.common.domain.ExecutionContext;
26 import com.jaspersoft.jasperserver.api.metadata.common.domain.FileResourceData;
27 import com.jaspersoft.jasperserver.api.metadata.common.domain.Folder;
28 import com.jaspersoft.jasperserver.api.metadata.common.domain.Resource;
29 import com.jaspersoft.jasperserver.api.metadata.common.domain.ResourceLookup;
30 import com.jaspersoft.jasperserver.api.metadata.view.domain.FilterCriteria;
31
32
33 /**
34  * Top level class for accessing the repository metadata.
35  * This class has various methods for retrieving resources from the repository
36  * and for uploading resources to the repository.
37  *
38  * @author Teodor Danciu (teodord@users.sourceforge.net)
39  * @version $Id: RepositoryService.java 3987 2006-07-15 13:49:58Z swood $
40  */

41 public interface RepositoryService
42 {
43
44     /**
45      *
46      * @param context
47      * @param uri
48      * @return the resource if found or null otherwise
49      */

50     public Resource getResource(ExecutionContext context, String JavaDoc uri);
51
52
53     /**
54      *
55      * @param context
56      * @param uri
57      * @return
58      * @throws JSResourceNotFoundException
59      */

60     public FileResourceData getResourceData(ExecutionContext context, String JavaDoc uri) throws JSResourceNotFoundException;
61
62
63     public FileResourceData getContentResourceData(ExecutionContext context, String JavaDoc uri) throws JSResourceNotFoundException;
64
65
66     public Folder getFolder(ExecutionContext context, String JavaDoc uri);
67
68
69     public void saveFolder(ExecutionContext context, Folder folder);
70
71
72     public List JavaDoc getAllFolders(ExecutionContext context);
73
74
75     public List JavaDoc getSubFolders(ExecutionContext context, String JavaDoc folderURI);
76     
77
78     /**
79      *
80      */

81     public void saveResource(ExecutionContext context, Resource resource);
82     
83
84     public void deleteResource(ExecutionContext context, String JavaDoc uri);
85
86     
87     public void deleteFolder(ExecutionContext context, String JavaDoc uri);
88
89     
90     public void delete(ExecutionContext context, String JavaDoc resourceURIs[], String JavaDoc folderURIs[]);
91     
92     
93     /**
94      * Given filtering criteria, find relevant Resources.
95      *
96      * @param context
97      * @param criteria
98      * @return Array of found Resources
99      */

100     public ResourceLookup[] findResource(ExecutionContext context, FilterCriteria criteria);
101
102     public List JavaDoc loadResourcesList(final FilterCriteria filterCriteria);
103
104     public List JavaDoc loadClientResources(FilterCriteria filterCriteria);
105
106     /**
107      * Return a Resource that does not yet contain content.
108      *
109      * @param context
110      * @param class - class of resource to create
111      * @return Resource
112      */

113     public Resource newResource(ExecutionContext context, Class JavaDoc _class);
114
115     public String JavaDoc getChildrenFolderName(String JavaDoc resourceName);
116 }
117
Popular Tags