// Conference - a conference // // Copyright (C) 1996 by Jef Poskanzer . All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. // // Visit the ACME Labs Java page for up-to-date versions of this and other // fine Java utilities: http://www.acme.com/java/ package Acme.Conf; /// A conference. //

// Conferences are contained in conference groups, and contain topics. // Each conference has some descriptive strings, a URL, a list of hosts who // are authorized to perform maintenance functions, and an optional // list of users authorized to post. //

// This is an abstract class with separate implementations on the // client and server sides, mirrored via RPC. //

// Fetch the software.
// Fetch the entire Acme package. //

// @see Confgroup // @see Topic public abstract class Conference { /// A one-line description of the conference. public abstract String getShortDesc(); /// A paragraph about the conference. public abstract String getLongDesc(); /// The login message. Shown upon entering the conference. public abstract String getLogin(); /// The conference's url. public abstract String getUrl(); /// The number of topics in the conference. public abstract int getNumTopics(); /// The first topic number. public abstract int getFirstTopicNumber(); /// The last topic number. public abstract int getLastTopicNumber(); /// Get a topic by its topic number in this conference. public abstract Topic getTopic( int n ); /// Check whether a user is a host of this conference. public abstract boolean isHost( User user ); /// Check whether a user is a member of this conference. // If the conference is public, i.e. it has no ulist, then all users // are members. public abstract boolean isMember( User user ); /// Add a new topic, including response zero. //

// If the conference is empty, then only a host may do this. public abstract int addTopic( Session session, String title, String pseud, String text ); /// Link in an existing topic. //

// Only a host may do this. public abstract int linkTopic( Session session, Topic topic ); /// Remove a topic from the conference. It may continue to exist // in other conferences. //

// Only a host may do this; or, the topic creator may do it, if // no one else has posted there yet. public abstract void rmTopic( Session session, int topicNumber ); /// Set the one-line description of the conference. //

// Only a host may do this. public abstract void setShortDesc( Session session, String shortDesc ); /// Set the paragraph about the conference. //

// Only a host may do this. public abstract void setLongDesc( Session session, String longDesc ); /// Set the conference's login message. //

// Only a host may do this. public abstract void setLogin( Session session, String login ); /// Set the conference's URL. //

// Only a host may do this. public abstract void setUrl( Session session, String url ); /// Add a user to the conference's ulist. //

// Only a host may do this. public abstract void addConferenceUser( Session session, User user ); /// Remove a user from the conference's ulist. //

// Only a host may do this. public abstract void rmConferenceUser( Session session, User user ); /// Set the public/private status of a conference. //

// Only a manager may do this. public abstract void setPublic( Session session, boolean flag ); /// Add a host to the conference. //

// Only a manager may do this. public abstract void addHost( Session session, User user ); /// Remove a host from the conference. //

// Only a manager may do this. public abstract void rmHost( Session session, User user ); }