/*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
 * 
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
 * language governing rights and limitations under the License.
 * 
 * The Original Code is the Venice Web Communities System.
 * 
 * The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
 * for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
 * Copyright (C) 2001 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 * 
 * Contributor(s): 
 */
package com.silverwrist.venice.core.internals;

import java.util.BitSet;
import java.util.Date;
import java.util.List;
import java.util.Set;
import com.silverwrist.venice.core.CommunityProperties;
import com.silverwrist.venice.core.ContactInfo;
import com.silverwrist.venice.core.ServiceToken;
import com.silverwrist.venice.except.AccessError;
import com.silverwrist.venice.except.DataException;

public interface CommunityData
{
  public abstract int getID();

  public abstract String getName();

  public abstract String getAlias();

  public abstract boolean isPublicCommunity();

  public abstract int getCategoryID();

  public abstract String getSynopsis();

  public abstract int getHostUID();

  public abstract String getLanguage();

  public abstract String getRules();

  public abstract int getContactID();

  public abstract Date getCreationDate();

  public abstract Date getLastAccessDate();

  public abstract Date getLastUpdateDate();

  public abstract void testMembership(int level, boolean is_member) throws DataException, AccessError;

  public abstract boolean checkMembership(int level, boolean is_member);

  public abstract boolean canReadCommunitySubObjects(int level);

  public abstract boolean canModifyCommunityProfile(int level);

  public abstract boolean canCreateCommunitySubObjects(int level);

  public abstract boolean canDeleteCommunity(int level);

  public abstract boolean canJoinCommunity(int uid, int level);

  public abstract void putContactInfo(EnvCommunity outer, ContactInfo ci) throws DataException;

  public abstract Set getServices();

  public abstract Set getServices(EnvCommunity outer);

  public abstract void setServiceEnable(EnvCommunity outer, ServiceToken token, boolean enable)
      throws DataException;

  public abstract void setName(EnvCommunity outer, String name) throws DataException;

  public abstract void setAlias(EnvCommunity outer, String alias) throws DataException;

  public abstract void setCategoryID(EnvCommunity outer, int catid) throws DataException;

  public abstract void setSynopsis(String synopsis) throws DataException;

  public abstract void setLanguage(String language) throws DataException;

  public abstract void setRules(String rules) throws DataException;

  public abstract void touch() throws DataException;

  public abstract boolean getHideDirectory();

  public abstract boolean getHideSearch();

  public abstract void setHideFlags(EnvCommunity outer, boolean directory, boolean search)
      throws DataException;

  public abstract boolean getMembersOnly();

  public abstract void setMembersOnly(EnvCommunity outer, boolean flag) throws DataException;

  public abstract ServiceToken getDefaultService();

  public abstract void setDefaultService(ServiceToken token) throws DataException;

  public abstract String getJoinKey() throws DataException;

  public abstract void setJoinKey(EnvCommunity outer, String key) throws DataException;

  public abstract int getReadLevel();

  public abstract int getWriteLevel();

  public abstract int getCreateLevel();

  public abstract int getDeleteLevel();

  public abstract int getJoinLevel();

  public abstract void setSecurityLevels(EnvCommunity outer, int read, int write, int create, int delete,
					 int join) throws DataException;

  public abstract boolean isAdminCommunity();

  public abstract void setMembership(EnvCommunity outer, int uid, int grant_level, boolean locked,
				     boolean hidden) throws DataException;

  public abstract int getMemberCount(boolean include_hidden) throws DataException;

  public abstract boolean hasService(ServiceToken token);

  public abstract ConferenceCommunityContext getConferenceDataObject(int confid) throws DataException;

  public abstract void detachConferenceDataObject(int confid);

  public abstract ConferenceCommunityContext createConference(EnvCommunity outer, String name, String alias,
							      String description, boolean pvt,
							      boolean hide_list)
      throws DataException;

  public abstract List searchForMembers(int field, int mode, String term, int offset, int count,
					boolean include_hidden) throws DataException;

  public abstract int getSearchMemberCount(int field, int mode, String term, boolean include_hidden)
      throws DataException;

  public abstract List getMemberList(boolean include_hidden) throws DataException;

  public abstract int getMemberLevel(int uid) throws DataException;

  public abstract void delete(EnvCommunity outer) throws DataException;

  public abstract CommunityProperties getProperties();

  public abstract void setProperties(CommunityProperties props) throws DataException;

  public abstract List getMassMailList() throws DataException;

} // end interface CommunityData
