KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > service > core > ApplicationResourceManager


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.service.core;
17
18 import com.blandware.atleap.common.util.ApplicationResourceStorage;
19 import com.blandware.atleap.common.util.PartialCollection;
20 import com.blandware.atleap.common.util.QueryInfo;
21 import com.blandware.atleap.model.core.ApplicationResource;
22 import com.blandware.atleap.model.core.ContentLocale;
23 import com.blandware.atleap.service.exception.BeanNotFoundException;
24
25 /**
26  * <p>Business Delegate (Proxy) Interface to handle communication between web and
27  * persistence layer.
28  * </p>
29  * <p><a HREF="ApplicationResourceManager.java.htm"><i>View Source</i></a>
30  * </p>
31  *
32  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
33  * @version $Revision: 1.4 $ $Date: 2005/11/19 14:15:36 $
34  */

35 public interface ApplicationResourceManager extends BaseManager {
36
37     /**
38      * Loads resources from file system and deletes those of them that are not in
39      * the file system but still exist in the persistent storage. This can also
40      * 'roll back' values of resources in persistent storage to those that are
41      * in filesystem.
42      *
43      * @param overrideDynamicValues Whether or not to replace dynamically changed values with static ones from filesystem
44      * @return A storage containing loaded application resources
45      */

46     public ApplicationResourceStorage loadResources(boolean overrideDynamicValues);
47
48     /**
49      * Loads resource bundle for specified locale
50      *
51      * @param locale Locale to load resources for
52      * @return Bundle containing messages for specified locale
53      */

54     public ApplicationResourceStorage.Bundle loadBundle(ContentLocale locale);
55
56     /**
57      * Drops all resources for locale with specified identifier
58      *
59      * @param localeIdentifier Identifier of locale to flush bundle
60      */

61     public void dropBundle(String JavaDoc localeIdentifier);
62
63     /**
64      * Retrieves application resource object with specified key and locale
65      *
66      * @param key Key of resource to retrieve
67      * @param localeIdentifier Identifier of locale
68      * @return Application resource object or null if none is found
69      */

70     public ApplicationResource retrieveApplicationResource(String JavaDoc key, String JavaDoc localeIdentifier);
71
72     /**
73      * Updates application resource with specified locale and key if value has been changed. Otherwise, no action is performed.
74      *
75      * @param localeIdentifier Identifier of locale
76      * @param key Key to associate value with
77      * @param value Value to associate with key
78      * @param version Version of application resource
79      * @throws com.blandware.atleap.service.exception.BeanNotFoundException
80      * if resource couldn't be found
81      */

82     public void updateApplicationResource(String JavaDoc localeIdentifier, String JavaDoc key, String JavaDoc value, Long JavaDoc version) throws BeanNotFoundException;
83
84     // ~ Additional methods ================================================================
85

86     /**
87      * Retrieves filtered/sorted collection of application resources.
88      *
89      * @param queryInfo Object that contains information about how to filter and sort data
90      * @return Collection of application resources
91      */

92     public PartialCollection listApplicationResources(QueryInfo queryInfo);
93
94 }
Popular Tags