Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--CoBrowConnection
Field Summary | |
static int | BAD_REQUEST
|
static java.lang.String | HTTP_VERSION
|
static int | NO_CONTENT
|
static int | NOT_FOUND
|
static int | NOT_MODIFIED
|
static int | OK
|
Constructor Summary | |
CoBrowConnection(java.lang.String address,
int port)
|
Method Summary | |
void | close()
Closes connection to CoBrow server. |
void | create(CoBrowObject cbObject)
Registers userinterface with CoBrow server. |
void | delete(CoBrowObject cbObject,
java.lang.String requestedObject)
Unregisters userinterface from CoBrow server. |
void | get(CoBrowObject cbObject,
java.lang.String requestedObject,
java.lang.String[] parameters)
Retrieves information from CoBrow server (overloaded; with additional parameters). |
java.awt.Image | getImage(java.applet.Applet applet,
java.lang.String imageUrlString)
Fetches an image. |
void | open(java.lang.String server,
int port)
Opens connection to CoBrow server. |
void | put(CoBrowObject cbObject,
java.lang.String requestedObject,
java.lang.String requestBody)
Propagates information to CoBrow server. |
int | readMessage()
Reads bytes from socket if available. |
void | run()
Polls for incoming data. |
void | setId(java.lang.String id)
Opens connection to CoBrow server. |
void | subscribe(CoBrowObject cbObject,
java.lang.String requestedObject)
Subscribes for information. |
void | unsubscribe(CoBrowObject cbObject,
java.lang.String requestedObject)
Unsubscribes for information. |
java.lang.Integer | writeMessage(CoBrowObject cbObject,
java.lang.String command,
java.lang.String requestedObject,
byte[] requestBody)
Sends a message over an HTTP connection. |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String HTTP_VERSION
protected static final int OK
protected static final int NO_CONTENT
protected static final int NOT_MODIFIED
protected static final int BAD_REQUEST
protected static final int NOT_FOUND
Constructor Detail |
public CoBrowConnection(java.lang.String address, int port)
address
- The IP address of the CoBrow server. REMARK: Must be the server the applet came from.
port
- The port of the CoBrow service.Method Detail |
protected final java.lang.Integer writeMessage(CoBrowObject cbObject, java.lang.String command, java.lang.String requestedObject, byte[] requestBody) throws java.io.IOException
cbObject
- The CoBrowObject that issued the request.
command
- The command to be executed, e.g. PUT, GET,...
requestedObject
- The requested object, e.g. /users/
requestBody
- The message body.protected final int readMessage() throws java.io.IOException
public final void open(java.lang.String server, int port) throws java.io.IOException
server
- Name of the CoBrow server.
port
- Port number the CoBrow server listens on for incoming requests.public final void close() throws java.io.IOException
public final void setId(java.lang.String id)
id
- The userinterface's id.public java.awt.Image getImage(java.applet.Applet applet, java.lang.String imageUrlString)
applet
-
imageUrlString
- The URL pointing to the image.public final void create(CoBrowObject cbObject) throws java.io.IOException
cbObject
- The object invoking the request.public final void delete(CoBrowObject cbObject, java.lang.String requestedObject) throws java.io.IOException
cbObject
- The object invoking the request.
requestedObject
- The object which is to be unregistered.public final void get(CoBrowObject cbObject, java.lang.String requestedObject, java.lang.String[] parameters) throws java.io.IOException
cbObject
- The object invoking the request.
requestedObject
- The object which is to be requested.
parameters
- Additional parameters to be listed in the request header.public final void put(CoBrowObject cbObject, java.lang.String requestedObject, java.lang.String requestBody) throws java.io.IOException
cbObject
- The object invoking the request.
requestedObject
- The object which is to be requested.
requestBody
- The data to be propagated to the server.public final void subscribe(CoBrowObject cbObject, java.lang.String requestedObject) throws java.io.IOException
cbObject
- The object invoking the request.
requestedObject
- The object which is to be requested.public final void unsubscribe(CoBrowObject cbObject, java.lang.String requestedObject) throws java.io.IOException
cbObject
- The object invoking the request.
requestedObject
- The object which is to be requested.public void run()
Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |