KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > service > testimonials > TestimonialManager


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.testimonials;
17
18 import com.blandware.atleap.common.util.PartialCollection;
19 import com.blandware.atleap.common.util.QueryInfo;
20 import com.blandware.atleap.model.testimonials.Testimonial;
21 import com.blandware.atleap.persistence.exception.DeleteException;
22 import com.blandware.atleap.service.core.PageManager;
23 import com.blandware.atleap.service.exception.BeanAlreadyExistsException;
24 import com.blandware.atleap.service.exception.BeanNotFoundException;
25
26 import java.util.Map JavaDoc;
27
28 /**
29  * <p>Business Delegate (Proxy) Interface to handle communication between web and
30  * persistence layer.
31  * </p>
32  * <p><a HREF="TestimonialManager.java.htm"><i>View Source</i></a>
33  * </p>
34  *
35  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
36 * @version $Revision: 1.2 $ $Date: 2005/08/02 14:53:43 $
37  */

38 public interface TestimonialManager extends PageManager {
39
40     //~ CRUD Methods ================================================================
41

42     /**
43      * Creates new testimonial item
44      *
45      * @param testimonial Testimonial item to create
46      * @param linkedObjects Map of pairs <code>uri -&gt; object<code>, which link URI in the body to
47      * corresponding object (resource or page) if it exists
48      * @return ID of created testimonial
49      * @throws com.blandware.atleap.service.exception.BeanAlreadyExistsException
50      * if linkable item with same URI already exists
51      */

52     public Long JavaDoc createTestimonial(Testimonial testimonial, Map JavaDoc linkedObjects) throws BeanAlreadyExistsException;
53
54     /**
55      * Retrieves testimonial item with specified ID
56      *
57      * @param testimonialId The ID of testimonial to retrieve
58      * @return Testimonial item or null if no testimonial with specified ID exists in database
59      */

60     public Testimonial retrieveTestimonial(Long JavaDoc testimonialId);
61
62     /**
63      * Retrieves lite version (with empty 'title' and 'body' maps) of testimonial item with specified ID
64      *
65      * @param testimonialId ID to search by
66      * @return Testimonial item with specified ID or null if no testimonial with specified ID exists in database
67      */

68     public Testimonial retrieveTestimonialLite(Long JavaDoc testimonialId);
69
70     /**
71      * Updates testimonial
72      *
73      * @param testimonial Testimonial to update
74      * @param linkedObjects Map of pairs <code>uri -&gt; object<code>, which link URI in the body to
75      * corresponding object (resource or page) if it exists
76      * @throws com.blandware.atleap.service.exception.BeanAlreadyExistsException
77      * if page (no matter content or action) with same URI already exists
78      */

79     public void updateTestimonial(Testimonial testimonial, Map JavaDoc linkedObjects) throws BeanAlreadyExistsException;
80
81     /**
82      * Updates testimonial without changing links to pages or resources from internal content field values
83      *
84      * @param testimonial Testimonial to update
85      * @throws com.blandware.atleap.service.exception.BeanAlreadyExistsException
86      * if page (no matter content or action) with same URI already exists
87      */

88     public void updateTestimonial(Testimonial testimonial) throws BeanAlreadyExistsException;
89
90     /**
91      * Removes testimonial
92      *
93      * @param testimonialId ID of testimonial to remove
94      * @throws com.blandware.atleap.persistence.exception.DeleteException
95      * if testimonial item cannot be deleted
96      * @throws com.blandware.atleap.service.exception.BeanNotFoundException if testimonial item with specified ID was not found
97      */

98     public void deleteTestimonial(Long JavaDoc testimonialId) throws DeleteException, BeanNotFoundException;
99
100     // ~ Additional methods ================================================================
101

102     /**
103      * Retrieves filtered/sorted collection of testimonials
104      *
105      * @param queryInfo Object that contains information about how to filter and sort data
106      * @return Collection of testimonials
107      */

108     public PartialCollection listTestimonials(QueryInfo queryInfo);
109
110     /**
111      * Retrieves one random active testimonial
112      *
113      * @return random testimonial or <code>null</code> if there are no active testimonials
114      */

115     public Testimonial getRandomTestimonial();
116
117 }
118
Popular Tags