KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > Yasna > forum > Category


1 /**
2  * Copyright (C) 2001 Yasna.com. All rights reserved.
3  *
4  * ===================================================================
5  * The Apache Software License, Version 1.1
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in
16  * the documentation and/or other materials provided with the
17  * distribution.
18  *
19  * 3. The end-user documentation included with the redistribution,
20  * if any, must include the following acknowledgment:
21  * "This product includes software developed by
22  * Yasna.com (http://www.yasna.com)."
23  * Alternately, this acknowledgment may appear in the software itself,
24  * if and wherever such third-party acknowledgments normally appear.
25  *
26  * 4. The names "Yazd" and "Yasna.com" must not be used to
27  * endorse or promote products derived from this software without
28  * prior written permission. For written permission, please
29  * contact yazd@yasna.com.
30  *
31  * 5. Products derived from this software may not be called "Yazd",
32  * nor may "Yazd" appear in their name, without prior written
33  * permission of Yasna.com.
34  *
35  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38  * DISCLAIMED. IN NO EVENT SHALL YASNA.COM OR
39  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46  * SUCH DAMAGE.
47  * ====================================================================
48  *
49  * This software consists of voluntary contributions made by many
50  * individuals on behalf of Yasna.com. For more information
51  * on Yasna.com, please see <http://www.yasna.com>.
52  */

53
54 package com.Yasna.forum;
55
56 import java.util.Iterator JavaDoc;
57 import java.util.Date JavaDoc;
58
59 public interface Category {
60
61   /**
62    * Returns the unique id of the Category.
63    *
64    * @return the unique id of the Category.
65    */

66   public int getID();
67
68   /**
69    * Returns the name of the Category. Every category name in the system must be
70    * unique. However, this restriction allows one to lookup a category by name
71    * as well as by ID.
72    *
73    * @return the name of the category.
74    */

75   public String JavaDoc getName();
76
77   /**
78    * Sets the name of the Category. Every category name in the system must be
79    * unique.
80    *
81    * An exception will be thrown if a category with the same name as the new
82    * name already exists.
83    *
84    * @param name the name of the category.
85    * @throws UnauthorizedException if does not have ADMIN permissions.
86    * @throws CategoryAlreadyExistsException if a category with the specified name
87    * already exists.
88    */

89   public void setName(String JavaDoc name) throws UnauthorizedException,
90           CategoryAlreadyExistsException;
91
92     /**
93      * this returns the value of the order of Category. This value is used to sort the categories.
94      * @return category order
95      */

96     public int getOrder();
97
98     /**
99      * you can use this method to set the value of the category order. This value is used to sort the categories.
100      * @param param
101      * @throws UnauthorizedException
102      */

103     public void setOrder(int param) throws UnauthorizedException;
104
105   /**
106    * Returns the description of the Category.
107    *
108    * @return the description of the Category.
109    */

110   public String JavaDoc getDescription();
111
112   /**
113    * Sets the description of the Category.
114    *
115    * @param description the description of the Category.
116    * @throws UnauthorizedException if does not have ADMIN permissions.
117    */

118   public void setDescription(String JavaDoc description) throws UnauthorizedException;
119
120   /**
121    * Returns the Date that the Category was created.
122    *
123    * @return the Date the Category was created.
124    */

125   public Date JavaDoc getCreationDate();
126
127   /**
128    * Sets the creation date of the Category.
129    *
130    * @param creationDate the date the Category was created.
131    * @throws UnauthorizedException if does not have ADMIN permissions.
132    */

133   public void setCreationDate(Date JavaDoc creationDate) throws UnauthorizedException;
134
135   /**
136    * Returns the Date that the Category was last modified.
137    *
138    * @return the Date the Category was last modified.
139    */

140   public Date JavaDoc getModifiedDate();
141
142   /**
143    * Sets the date the Category was last modified.
144    *
145    * @param modifiedDate the date the Category was modified.
146    * @throws UnauthorizedException if does not have ADMIN permissions.
147    */

148   public void setModifiedDate(Date JavaDoc modifiedDate) throws UnauthorizedException;
149
150   /**
151    * Returns the forumGroup specified by id. The method will return null
152    * if the forumGroup is not in the Category.
153    */

154   public ForumGroup getForumGroup(int forumGroupID)
155           throws ForumGroupNotFoundException;
156
157   /**
158    * Deletes a forumGroup and all forums that belongs to it.
159    *
160    * @param forumGroup the forumGroup to delete.
161    * @throws UnauthorizedException if does not have ADMIN permissions.
162    */

163   public void deleteForumGroup(ForumGroup forumGroup) throws UnauthorizedException;
164
165   /**
166    * Creates a new Forum Group.
167    *
168    * @param name the name of the ForumGroup.
169    * @param description the description of the ForumGroup.
170    * @throws UnauthorizedException if not allowed to create a ForumGroup.
171    */

172   public abstract ForumGroup createForumGroup(String JavaDoc name, String JavaDoc description)
173           throws UnauthorizedException;
174
175   /**
176    * Returns a Iterator for the Category to move through the forumGroups.
177    */

178   public Iterator JavaDoc forumGroups();
179
180 }
Popular Tags