|
|||||||||
| Home >> All >> com >> synaptics >> [ elvis overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.synaptics.elvis
Class ElvisMessage

java.lang.Objectcom.synaptics.elvis.ElvisMessage
- All Implemented Interfaces:
- java.io.Serializable
- class ElvisMessage
- extends java.lang.Object
- implements java.io.Serializable
- extends java.lang.Object
ElvisMessage is used internally by Elvis to both build and parse the messages exchanged between the One True Elvis and various impersonators.
Each message has five fields:
- the Elvis identified field. This field is always the string
"Elvis" - the Elvis program name. This is the program name associated with this application. We check this to ensure that Elvis impersonators are talking to the One True Elvis they are expecting to talk to.
- the key. This is a random integer that helps to uniquely identify a particular instance of the One True Elvis. It is used mainly for security purposes - an attacker must not only know the Elvis program name he wishes to exploit, but he must be able to guess the key the program is currently using. While by no means bulletproof, this makes it much harder for an attacker to either submit fraudulent requests to the One True Elvis, or to spoof responses to the Elvis impersonators.
- the keyword. This indicates what the message is, and what semantics should be applied to it.
- the data. This is a string, which may contain status information, or may contain information of
interest to the client. It may be
nullor empty. For transmission to the One True Elvis, the fields are assembled into a single string, with the fields delimited by colon (':') characters. This means it is a bad idea for any of the fields (except thedatafield) to contain a':'.Additionally, the transmitted message is read as a single string. This means that it is a bad idea for any of the fields to contain an end-of-line sequence of any sort.
- Version:
- $Id: ElvisMessage.java,v 1.1 2002/05/09 07:17:17 clheiny Exp $
Field Summary private java.lang.Stringdata
Holds value of property data.static java.lang.StringHEADER
private java.lang.Stringkey
Holds value of property key.private java.lang.Stringkeyword
Holds value of property keyword.private java.lang.Stringprogram
Holds value of property program.private java.beans.PropertyChangeSupportpropertySupport
static charSEPARATOR
Constructor Summary privateElvisMessage()
Creates new ElvisMessage(package private)ElvisMessage(java.lang.String program, java.lang.String key, java.lang.String keyword, java.lang.String data)
Create a new ElvisMessage for the given program, key, keyword and dataMethod Summary voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)
java.lang.StringgetData()
Get the data field associated with this message.java.lang.StringgetKey()
Get the key associated with this message.java.lang.StringgetKeyword()
Get the keyword associated with this message.java.lang.StringgetProgram()
Get the program name associated with this message.static ElvisMessageparse(java.lang.String input)
This is a factory method for creating an ElvisMessage from a given input string (hopefully, one received from an Elvis or an Elvis client.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)
private voidsetData(java.lang.String data)
Set the message's data.private voidsetKey(java.lang.String key)
Set the message's key.private voidsetKeyword(java.lang.String keyword)
Set the message's keyword.private voidsetProgram(java.lang.String program)
Set the program name.java.lang.StringtoString()
Return the String representation of this message.Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitField Detail propertySupport
private java.beans.PropertyChangeSupport propertySupport
program
private java.lang.String program
- Holds value of property program.
key
private java.lang.String key
- Holds value of property key.
keyword
private java.lang.String keyword
- Holds value of property keyword.
data
private java.lang.String data
- Holds value of property data.
SEPARATOR
public static final char SEPARATOR
- See Also:
- Constant Field Values
HEADER
public static final java.lang.String HEADER
- See Also:
- Constant Field Values
Constructor Detail ElvisMessage
private ElvisMessage()
- Creates new ElvisMessage
ElvisMessage
ElvisMessage(java.lang.String program, java.lang.String key, java.lang.String keyword, java.lang.String data)
- Create a new ElvisMessage for the given program, key, keyword and data
Method Detail addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
getProgram
public java.lang.String getProgram()
- Get the program name associated with this message.
setProgram
private void setProgram(java.lang.String program)
- Set the program name. Not available to anyone else.
getKey
public java.lang.String getKey()
- Get the key associated with this message.
setKey
private void setKey(java.lang.String key)
- Set the message's key. Not available to anyone else.
getKeyword
public java.lang.String getKeyword()
- Get the keyword associated with this message.
setKeyword
private void setKeyword(java.lang.String keyword)
- Set the message's keyword. Not available to anyone else.
getData
public java.lang.String getData()
- Get the data field associated with this message.
setData
private void setData(java.lang.String data)
- Set the message's data. Not available to anyone else.
parse
public static ElvisMessage parse(java.lang.String input)
- This is a factory method for creating an ElvisMessage from a given
input string (hopefully, one received from an Elvis or an Elvis client.
toString
public java.lang.String toString()
- Return the String representation of this message. This will be suitable for sending
to Elvis, or for an Elvis to return to an ElvisClient.
Overview Package Class Use Deprecated Index Home >> All >> com >> synaptics >> [ elvis overview ] PREV CLASS NEXT CLASS SUMMARY:
JAVADOC |
SOURCE |
DOWNLOAD | NESTED | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
com.synaptics.elvis.ElvisMessage