001: /*
002: * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions
006: * are met:
007: *
008: * - Redistributions of source code must retain the above copyright
009: * notice, this list of conditions and the following disclaimer.getc
010: *
011: * - Redistribution in binary form must reproduce the above copyright
012: * notice, this list of conditions and the following disclaimer in
013: * the documentation and/or other materials provided with the
014: * distribution.
015: *
016: * Neither the name of Sun Microsystems, Inc. or the names of
017: * contributors may be used to endorse or promote products derived
018: * from this software without specific prior written permission.
019: *
020: * This software is provided "AS IS," without a warranty of any
021: * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
022: * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
023: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
024: * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
025: * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
026: * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
027: * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
028: * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
029: * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
030: * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
031: * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
032: *
033: * You acknowledge that Software is not designed, licensed or intended
034: * any nuclear facility.
035: */
036:
037: package com.sun.portal.community;
038:
039: import javax.servlet.http.HttpServletRequest;
040: import javax.servlet.http.HttpServletResponse;
041:
042: import java.util.Map;
043: import java.util.Set;
044: import java.util.List;
045: import java.util.regex.Pattern;
046:
047: /**
048: * A community manager.
049: * <p>
050: * Objects of this type are used to create, remove, and test for existence of
051: * communities.
052: */
053: public interface CommunityManager {
054: /**
055: * Create a community.
056: */
057: public void createCommunity(CommunityId cid, String ownerId,
058: String templateId, String category, String description,
059: boolean isMembershipRestricted, boolean isSecure,
060: boolean isListed) throws CommunityServiceException,
061: CommunityException;
062:
063: /**
064: * Create a community.
065: * <p>
066: * Owner ID for the new community is taken from the request.
067: */
068: public void createCommunity(CommunityId cid, String templateId,
069: String category, String description,
070: boolean isMembershipRestricted, boolean isSecure,
071: boolean isListed) throws CommunityServiceException,
072: CommunityException;
073:
074: /**
075: * Test if a community exists.
076: */
077: public boolean existsCommunity(CommunityId cid)
078: throws CommunityException;
079:
080: /**
081: * Remove community permanently. Note that this is an irreversible action - i.e. a removed community can never be accessed.
082: */
083: public void destroyCommunity(CommunityId cid)
084: throws CommunityServiceException, CommunityException;
085:
086: /**
087: * Remove community permanently. Note that this is an irreversible action - i.e. a removed community can never be accessed. You can supply an option to continue when one of its subprocess fails.
088: */
089: public void destroyCommunity(CommunityId cid, boolean cont)
090: throws CommunityServiceException, CommunityException;
091:
092: /**
093: * Get the user counts of a set of communities
094: */
095: public Map getUserCounts(Set communityIds)
096: throws CommunityException;
097:
098: /**
099: * Get the configured search URL.
100: */
101: public String getSearchUrl();
102:
103: /**
104: * Get the configured search database name.
105: */
106: public String getSearchDb();
107:
108: /**
109: * Get the configured search database prefix.
110: */
111: public String getSearchDbPrefix();
112:
113: /**
114: * Get the configured search taxonomy root.
115: */
116: public String getSearchTaxonomyRoot();
117:
118: public String getContentsSearchDb(CommunityId cid);
119:
120: public String getDiscussionsSearchDb(CommunityId cid);
121:
122: public List getContentsSearchDbs(CommunityId cid)
123: throws CommunityException;
124:
125: public int getDpBasePriority();
126:
127: /**
128: * Return a set of matching community IDs.
129: *
130: * A match occurs when the community name or description matches the given
131: * pattern.
132: * @param p a <code>Pattern</code> object, the pattern to match.
133: * @param nameOnly boolean flag indicating whether to match community name only or not
134: * @throws com.sun.portal.community.CommunityException if a problem occurs matching communities.
135: * @return a <code>Set</code> of <code>CommunityId</code> objects, the matching communities.
136: */
137: public Set match(Pattern p, boolean nameOnly)
138: throws CommunityException;
139: }
|