|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.www.protocol.http.cache.push.Client
public class Client
PushCache Client - send messages to push cache server
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_SERVER
Default hostname - localhost |
static int |
FAILED
Return/exit values |
static int |
MAX_TRIES
How many times should we try to reconnect? 10 |
static int |
NO
Return/exit values |
static int |
OK
Return/exit values |
static java.lang.String |
VC_ID
Version Control Id |
static java.lang.String |
VC_REVISION
Version Control Revision |
Constructor Summary | |
---|---|
Client()
Construct a Client for the default hostname and port number |
|
Client(java.lang.String[] argv)
Construct client with command line arguments and execute command. |
|
Client(java.lang.String hostname,
int port)
Construct a Client for the specified hostname and port number |
Method Summary | |
---|---|
void |
add(java.lang.String path,
java.lang.String url)
Add file into cache as url |
protected void |
checkCommand(java.lang.String com)
Throws IllegalArgumentException iff com is not a null terminated string of the correct length |
void |
clean()
Clean cache - remove all entries |
protected void |
cleanup()
Cleanup, shutdown and close socket and streams |
protected void |
connect()
Connect to server - try up to MAX_TRIES times, then give up |
void |
del(java.lang.String url)
Remove url from cache |
protected void |
handleArgs(java.lang.String[] argv)
Interpret command line arguments |
boolean |
isPresent(java.lang.String url)
True iff url is present in cache |
static void |
main(java.lang.String[] argv)
For use as stand alone program - constructs Client with argv |
void |
nop()
Send a NOP packet |
protected void |
readPayload()
Read remaining payload length bytes into buffer |
protected void |
readReply()
Await reply packet |
void |
sendBye()
Send a BYE packet, and cleanup |
protected void |
serverError()
Handle an ERR message from server - cleanup, throw IOException |
void |
simpleCommand(java.lang.String com)
Send a simple packet with specified command |
protected void |
unexpectedReply()
Handle an unexpected message from server - send BYE, throw IOException |
void |
urlCommand(java.lang.String com,
java.lang.String url)
Send a packet with specified command and a url |
protected void |
usage()
Display usage/help message |
protected void |
version()
Display version information |
protected void |
writeHeader()
Write header information into packet buffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int OK
public static final int NO
public static final int FAILED
public static final int MAX_TRIES
public static final java.lang.String DEFAULT_SERVER
public static final java.lang.String VC_REVISION
public static final java.lang.String VC_ID
Constructor Detail |
---|
public Client()
public Client(java.lang.String hostname, int port)
public Client(java.lang.String[] argv) throws java.io.IOException
java.io.IOException
Method Detail |
---|
protected void version()
protected void usage()
protected void handleArgs(java.lang.String[] argv) throws java.io.IOException
java.io.IOException
protected void connect() throws java.net.UnknownHostException, java.io.IOException
java.net.UnknownHostException
java.io.IOException
protected void writeHeader() throws java.io.IOException
java.io.IOException
protected void readPayload() throws java.io.IOException
java.io.IOException
protected void readReply() throws java.io.IOException
java.io.IOException
protected void serverError() throws java.io.IOException
java.io.IOException
protected void unexpectedReply() throws java.io.IOException
java.io.IOException
protected void cleanup()
public void sendBye() throws java.io.IOException
java.io.IOException
public void add(java.lang.String path, java.lang.String url) throws java.io.IOException, java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalArgumentException
protected void checkCommand(java.lang.String com) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void urlCommand(java.lang.String com, java.lang.String url) throws java.io.IOException, java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalArgumentException
public void del(java.lang.String url) throws java.io.IOException
java.io.IOException
public boolean isPresent(java.lang.String url) throws java.io.IOException
java.io.IOException
public void simpleCommand(java.lang.String com) throws java.io.IOException
java.io.IOException
public void nop() throws java.io.IOException
java.io.IOException
public void clean() throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |