|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.mmbase.module.core.MMTable
|
+--org.mmbase.module.core.MMObjectBuilder
|
+--org.mmbase.module.builders.Channel
The channel builder maintains channels for forums and chats.
Each channel is linked to a Community, which defines some properties for
the channel (such as whether it is a forum or a chatbox).
Users can join a channel (up to a registered amount of users), and post
messages to it (stored in the Message builder).
The main tasks defined in this builder are ways to open and close a channel,
join users, generate sequence numbers (which defines the order for a message),
and remove messages belonging to a channel.
Optionally, a recorder (java.io.Writer) object can be opened for a
channel. The Message builder uses these writers for logging chats.
(Note that is would be possible to make a Writer that stores data in a node
or a builder, but this has not been implemented yet).
XXX: Currently, recorder info is NOT stored in the channel. A recorder has to
be activated manually (using $MOD-channelnr-RECORD-FILE-filname).
| Field Summary | |
static int |
ALREADY_CONNECTED
Join state : the user is already connected to the channel. |
static int |
CHANNEL_FULL
Join state : the channel is full. |
static int |
CLOSED
Open state : the channel is closed. |
static int |
CONNECTED
Join state : the user is connected to the channel. |
static int |
DISCONNECTED
Join state : the user is logged out of the channel. |
static java.lang.String |
F_HASMOODS
Virtual Field or Function : hasmoods or hasmoods() |
static java.lang.String |
F_MAXUSERS
Field : maxusers |
static java.lang.String |
F_OPEN
Field : open |
static java.lang.String |
F_READLOGIN
Virtual Field : readlogin |
static java.lang.String |
F_SESSION
Field : session |
static java.lang.String |
F_STATE
Field : state |
static java.lang.String |
F_WRITELOGIN
Virtual Field : writelogin |
static int |
FAILED
Join state : the user cannot be connected to the channel. |
static int |
OPEN
Open state : the channel is open. |
static int |
READ_ONLY
Open state : the channel is open for read-only. |
static int |
STATE_READ_LOGIN
state : read login bit |
static int |
STATE_WRITE_LOGIN
state : write login bit |
static int |
WANT_OPEN
Open state : the channel is waiting to be opened. |
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
broadcastChanges, database, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, fields, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, REPLACE_CACHE, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual |
| Fields inherited from class org.mmbase.module.core.MMTable |
mmb, tableName |
| Constructor Summary | |
Channel()
Constructor |
|
| Method Summary | |
boolean |
close(MMObjectNode channel)
Closes the channel. |
MMObjectNode |
communityParent(MMObjectNode channel)
Returns to which community a channel belongs. |
protected java.lang.Object |
executeFunction(MMObjectNode node,
java.lang.String function,
java.lang.String field)
Executes a function on the field of a node, and returns the result. |
java.lang.String |
getDefaultUrl(int src)
Ask URL from related community and append the channel number to the URL. |
java.lang.String |
getGUIIndicator(java.lang.String field,
MMObjectNode node)
What should a GUI display for this node/field combo. |
java.util.Vector |
getListUsers(MMObjectNode channel,
java.lang.String usertype,
java.util.Comparator compareUsers,
int offset,
int max)
Retrieve a sorted list of users connected to a channel. |
java.util.Vector |
getListUsers(StringTagger params)
Retrieve a list of users connected to a channel. |
int |
getNewSequence(MMObjectNode channel)
|
java.util.Vector |
getNodeListUsers(java.util.Map params)
Retrieve a list of users connected to a channel. |
java.io.Writer |
getRecorder(int channel)
Returns the recorder for this channel. |
java.lang.Object |
getValue(MMObjectNode node,
java.lang.String field)
Provides additional functionality when obtaining field values. |
boolean |
init()
Initializes the Channel builder. |
java.lang.String |
isOpen(MMObjectNode channel)
Returns if a channel is open, closed or readonly. |
int |
join(MMObjectNode user,
MMObjectNode channel)
Connects a user to a channel by making a temporary relation between them. |
int |
leave(MMObjectNode user,
MMObjectNode channel)
Disconnects a user from a channel. |
int |
logout(MMObjectNode user,
MMObjectNode channel)
Disconnects a user from a channel. |
boolean |
open(MMObjectNode channel)
Opens the channel. |
boolean |
open(MMObjectNode channel,
MMObjectNode community)
Opens the channel. |
boolean |
readonly(MMObjectNode channel)
Makes a channel read only. |
void |
removeAllMessages(MMObjectNode channel)
Removes all messages posted in the channel. |
java.lang.String |
replace(scanpage sp,
java.util.StringTokenizer tok)
Handles the $MOD-MMBASE-BUILDER-channel- commands. |
java.io.Writer |
startRecorder(int channel,
java.lang.String filepath)
Start the recording session of a channel, using a file to stream the output to. |
java.io.Writer |
startRecorder(int channel,
java.io.Writer recorder)
Start the recording session of a channel. |
void |
stopRecorder(int channel)
Stop the recording session of a channel. |
void |
userStillActive(MMObjectNode user,
MMObjectNode channel)
Registers a user as still being active. |
| Methods inherited from class org.mmbase.module.core.MMTable |
size |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int CLOSED
public static final int WANT_OPEN
public static final int READ_ONLY
public static final int OPEN
public static final int FAILED
public static final int CHANNEL_FULL
public static final int CONNECTED
public static final int ALREADY_CONNECTED
public static final int DISCONNECTED
public static final java.lang.String F_OPEN
public static final java.lang.String F_MAXUSERS
public static final java.lang.String F_STATE
public static final java.lang.String F_SESSION
public static final java.lang.String F_READLOGIN
public static final java.lang.String F_WRITELOGIN
public static final java.lang.String F_HASMOODS
public static final int STATE_READ_LOGIN
public static final int STATE_WRITE_LOGIN
| Constructor Detail |
public Channel()
| Method Detail |
public boolean init()
open field is set to OPEN or
WANT_OPEN .init in class MMObjectBuilderorg.mmbase.module.core.MMObjectBuilderMMObjectBuilder.create()public boolean open(MMObjectNode channel)
channel - The channel to open.
public boolean open(MMObjectNode channel,
MMObjectNode community)
channel - The channel to open.community - The community with this channel's settingspublic boolean close(MMObjectNode channel)
channel - The channel to close.public boolean readonly(MMObjectNode channel)
channel - The channel to affect.public java.lang.String isOpen(MMObjectNode channel)
The - channel of which the open state is asked.Stringpublic int getNewSequence(MMObjectNode channel)
The - channel that has to give out a new sequence number.public void removeAllMessages(MMObjectNode channel)
The - channel whose messages have to be removed.public java.io.Writer getRecorder(int channel)
channel - the channel to recordWriter with which to record data, or null if
the recorder doesn't exist.
public java.io.Writer startRecorder(int channel,
java.io.Writer recorder)
channel - the channel to recordout - a Writer to record to.
public java.io.Writer startRecorder(int channel,
java.lang.String filepath)
channel - the channel to recordfile - the file to record to.public void stopRecorder(int channel)
channel - the channel being recorded
public int join(MMObjectNode user,
MMObjectNode channel)
user - the node representing the user that tries to join the channel.channel - the channel to joinCHANNEL_FULL if there's no room in the channel,
CONNECTED if the connection is made, and FAILED
if an error occurred. If the user is already connected to the channel
ALREADY_CONNECTED is returned.
public int logout(MMObjectNode user,
MMObjectNode channel)
user - The user to disconnect.channel - The channel to disconnect from.DISCONNECTED if the user was successfully disconnected,
FAILED if an error occurred.
public int leave(MMObjectNode user,
MMObjectNode channel)
user - The user to disconnect.channel - The channel to disconnect from.DISCONNECTED if the user was successfully disconnected,
FAILED if an error occurred.
public void userStillActive(MMObjectNode user,
MMObjectNode channel)
user - the node representing the userchannel - the channel to which the user is connectedpublic java.util.Vector getListUsers(StringTagger params)
params - contains the parameters for this list command.public java.util.Vector getNodeListUsers(java.util.Map params)
params - contains the parameters for this list command.
public java.util.Vector getListUsers(MMObjectNode channel,
java.lang.String usertype,
java.util.Comparator compareUsers,
int offset,
int max)
channel - the channelusertype - the type of the userobjects to retrievecompareUsers - a Comparator used for sorting. null
means the result is not no sortedpublic MMObjectNode communityParent(MMObjectNode channel)
The - channel nodenull if the
channel is not associated with a community.
public java.lang.Object getValue(MMObjectNode node,
java.lang.String field)
getValue in class MMObjectBuildernode - the node whose fields are queriedfield - the fieldname that is requestednull if no valid functions or virtual fields could be determined.
protected java.lang.Object executeFunction(MMObjectNode node,
java.lang.String function,
java.lang.String field)
getValue(org.mmbase.module.core.MMObjectNode, java.lang.String) method.
Functions implemented are readlogin(), writelogin() and hasmoods().executeFunction in class MMObjectBuildernode - the node whose fields are queriesfield - the fieldname that is requested
public java.lang.String replace(scanpage sp,
java.util.StringTokenizer tok)
replace in class MMObjectBuilderscanpage - the current page contexttok - the tokenized commandpublic java.lang.String getDefaultUrl(int src)
getDefaultUrl in class MMObjectBuilderorg.mmbase.module.core.MMObjectBuildersrc - the number of the node to obtain the url fromString, or null if unknown.
public java.lang.String getGUIIndicator(java.lang.String field,
MMObjectNode node)
getGUIIndicator in class MMObjectBuildernode - The node to displayfield - the name field of the field to displayString, null if not specified
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||