Created fooCodes interfaces to go along with invocation service

packages. These contain all the message codes as well as error response
codes that are used by a particular invocation service.

Also changed client.LocationManager to client.LocationDirector and
chat.ChatManager to chat.ChatDirector to go along with the new philosophy
of naming the client-side managing entity for an invocation service a
director.

Also elimitated cocktail.util.Codes since it's no longer used as a central
repository for codes (instead they are in InvocationCodes and its
derivatives).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@368 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-10-01 22:14:55 +00:00
parent 543f977475
commit 027bb29769
17 changed files with 186 additions and 113 deletions
@@ -1,5 +1,5 @@
//
// $Id: ChatService.java,v 1.3 2001/08/04 02:54:28 mdb Exp $
// $Id: ChatService.java,v 1.4 2001/10/01 22:14:55 mdb Exp $
package com.threerings.cocktail.party.chat;
@@ -11,27 +11,12 @@ import com.threerings.cocktail.party.Log;
* The chat services provide a mechanism by which the client can broadcast
* chat messages to all clients that are subscribed to a particular place
* object or directly to a particular client. These services should not be
* used directly, but instead should be accessed via the chat manager.
* used directly, but instead should be accessed via the chat director.
*
* @see ChatManager
* @see ChatDirector
*/
public class ChatService
public class ChatService implements ChatCodes
{
/** The module name for the chat services. */
public static final String MODULE = "chat";
/** The message identifier for a speak request message. */
public static final String SPEAK_REQUEST = "spkreq";
/** The message identifier for a speak notification message. */
public static final String SPEAK_NOTIFICATION = "spknot";
/** The message identifier for a tell request. */
public static final String TELL_REQUEST = "Tell";
/** The message identifier for a tell notification. */
public static final String TELL_NOTIFICATION = "Tell";
/**
* Requests that a tell message be delivered to the user with username
* equal to <code>target</code>.
@@ -40,18 +25,18 @@ public class ChatService
* @param target the username of the user to which the tell message
* should be delivered.
* @param message the contents of the message.
* @param rsptarget the chat manager reference that will receive the
* @param rsptarget the chat director reference that will receive the
* tell response.
*
* @return the invocation request id of the generated tell request.
*/
public static int tell (Client client, String target, String message,
ChatManager rsptarget)
ChatDirector rsptarget)
{
InvocationManager invmgr = client.getInvocationManager();
Object[] args = new Object[] { target, message };
Log.info("Sending tell request [tgt=" + target +
", msg=" + message + "].");
return invmgr.invoke(MODULE, TELL_REQUEST, args, rsptarget);
return invmgr.invoke(MODULE_NAME, TELL_REQUEST, args, rsptarget);
}
}