net.jetrix.protocols
Class QueryProtocol

java.lang.Object
  extended by net.jetrix.protocols.QueryProtocol
All Implemented Interfaces:
Protocol

public class QueryProtocol
extends Object
implements Protocol

Query Protocol. See http://jetrix.sourceforge.net/dev-guide.php#section2-4 for more information.

Version:
$Revision: 393 $, $Date: 2004-06-04 16:44:04 +0200 (ven., 04 juin 2004) $
Author:
Emmanuel Bourg

Field Summary
static char EOL
          Line terminator
static String OK
          Response terminator
 
Constructor Summary
QueryProtocol()
           
 
Method Summary
 String applyStyle(String text)
          Transform the style tags (<blue>, <u>, etc...) contained in the specified string into the style codes of this protocol.
 char getEOL()
          Return the end of line character used by this protocol.
 Message getMessage(String message)
          Parse the specified string and return the corresponding server message for this protocol.
 String getName()
          Return the name of this protocol.
static boolean isQueryCommand(String command)
          Test if the specified string is a valid query request.
 String translate(Message m, Locale locale)
          Translate the specified message into a string that will be sent to a client using this protocol.
 String translate(NoConnectingMessage m, Locale locale)
           
 String translate(PlineMessage m, Locale locale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOL

public static final char EOL
Line terminator

See Also:
Constant Field Values

OK

public static final String OK
Response terminator

See Also:
Constant Field Values
Constructor Detail

QueryProtocol

public QueryProtocol()
Method Detail

getName

public String getName()
Description copied from interface: Protocol
Return the name of this protocol.

Specified by:
getName in interface Protocol
Returns:
the name of this protocol

getMessage

public Message getMessage(String message)
Description copied from interface: Protocol
Parse the specified string and return the corresponding server message for this protocol.

Specified by:
getMessage in interface Protocol
Parameters:
message - the client message to parse
Returns:
the Message equivalent of the specified String or null if the protocol cannot understand the message.

translate

public String translate(Message m,
                        Locale locale)
Description copied from interface: Protocol
Translate the specified message into a string that will be sent to a client using this protocol.

Specified by:
translate in interface Protocol
Parameters:
m - the message to translate
locale - the locale used for internationalized text messages
Returns:
the String equivalent in this protocol for the specified Message or null if it can't be translated.

translate

public String translate(PlineMessage m,
                        Locale locale)

translate

public String translate(NoConnectingMessage m,
                        Locale locale)

applyStyle

public String applyStyle(String text)
Description copied from interface: Protocol
Transform the style tags (<blue>, <u>, etc...) contained in the specified string into the style codes of this protocol.

Specified by:
applyStyle in interface Protocol
Parameters:
text - the string to transform
Returns:
the stylized representation of the specified string for this protocol.

getEOL

public char getEOL()
Description copied from interface: Protocol
Return the end of line character used by this protocol.

Specified by:
getEOL in interface Protocol

isQueryCommand

public static boolean isQueryCommand(String command)
Test if the specified string is a valid query request.



Copyright © 2001-2008 Emmanuel Bourg. All Rights Reserved.