|
DCT Lightfoot v3 API specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.dctl.j2me.io.BaseConnection
|
+--com.dctl.j2me.io.http.BaseHttpConnection
This is the base for http server and client connections
| Field Summary | |
protected static java.lang.String |
ACCEPT_PROPERTY
The accept property |
protected static java.lang.String |
ACCEPT_VALUE
The accept value |
protected static int |
ASCTIME
|
protected static java.lang.String |
CHUNKED_ENCODING
The chunked encoding value |
protected static int |
CLOSED
Closed. |
protected static java.lang.String |
COLON_SPACE
This separates property names from values |
protected static int |
COMMA
|
protected static java.lang.String |
CONNECTION_CLOSE
Close a connection |
protected static java.lang.String |
CONNECTION_KEEP_ALIVE
The default connection value |
protected static java.lang.String |
CONNECTION_PROPERTY
The connection property |
protected static java.lang.String |
CONTENT_ENCODING_PROPERTY
The content encoding property |
protected static java.lang.String |
CONTENT_LENGTH_PROPERTY
The content length property |
protected static java.lang.String |
CONTENT_TYPE_PROPERTY
The content type property |
protected static java.lang.String |
CRLF
This ends lines |
protected static int |
DASH
|
protected static java.lang.String |
DATE_PROPERTY
The date property |
protected static int |
DAY
|
protected static java.lang.String |
EXPIRES_PROPERTY
The expires property |
protected static int[] |
FIELDS
|
protected int |
handle
The handle to the TCP socket |
protected static java.lang.String |
HOST_PROPERTY
The host property string |
protected static int |
HOUR
|
protected Vector |
inputNames
The vector of response names that is only created if required |
protected Hashtable |
inputProperties
The hashtable of output properties |
protected com.dctl.j2me.io.http.InputStream |
is
The input stream |
protected static java.lang.String |
LAST_MODIFIED_PROPERTY
The last modified property |
protected java.lang.String |
method
The method we are using |
protected static int |
MIN
|
protected static int |
MONTH
|
protected static java.lang.String[] |
MONTH_STRING
|
protected int |
opens
The number of streams open on the connection plus one if the connection is open |
protected com.dctl.j2me.io.http.OutputStream |
os
The output stream |
protected Hashtable |
outputProperties
The hashtable of input properties |
protected static java.lang.String |
PROTOCOL
The protocol we are doing |
protected static int |
RECEIVING
Receiving. |
protected int |
responseCode
The response code |
protected java.lang.String |
responseMessage
The response message |
protected static int |
RFC1123
|
protected static int |
RFC850
|
protected static int |
SEC
|
protected static int |
SENDING
Sending. |
protected static int |
SETUP
Setup. |
protected static int |
SPACE
|
protected int |
state
The current state |
protected static java.lang.String |
TRANSFER_ENCODING_PROPERTY
The transfer encoding property |
protected static java.lang.String |
USER_AGENT_PROPERTY
The user agent property |
protected static java.lang.String |
USER_AGENT_VALUE
Default user agent value |
protected static java.lang.String |
VERSION
The version of HTTP we are using |
protected static int |
YEAR
|
| Fields inherited from class com.dctl.j2me.io.BaseConnection |
protocol |
| Constructor Summary | |
BaseHttpConnection()
|
|
| Method Summary | |
void |
close()
Close the connection if the reference count gets to zero |
protected abstract java.lang.String |
generateFirstOutput()
Get the first line to output |
long |
getFieldDate(Hashtable table,
java.lang.String name,
long defaultValue)
Get a field parsed as a date value |
int |
getFieldInt(Hashtable table,
java.lang.String name,
int defaultValue)
Get a field parsed as a number |
java.lang.String |
getFile()
Get the file portion of the URL |
java.lang.String |
getHost()
Get the host to connect to |
java.lang.String |
getInputFieldKey(int index)
Get the header field key at the index |
int |
getPort()
Get the port of the URL |
java.lang.String |
getProtocol()
Get the protocol used for the connection |
java.lang.String |
getQuery()
Get the query portion of the URL - after the last question mark |
java.lang.String |
getRef()
Get the ref portion of the URL |
java.lang.String |
getRequestMethod()
Get the request method |
java.lang.String |
getURL()
Get the URL |
protected abstract boolean |
handleFirstInput(java.lang.String line)
handle the first input line |
protected void |
invalidState()
|
protected abstract void |
openConnection()
Open the connection |
java.io.DataInputStream |
openDataInputStream()
Open a data input stream |
java.io.DataOutputStream |
openDataOutputStream()
Open a data output stream |
InputStream |
openInputStream()
Open an input stream |
OutputStream |
openOutputStream()
Open an output stream if it was not already open. |
protected void |
parseInput()
Parse the input stream |
void |
recycle()
Recycle the connection |
protected void |
sendOutput()
Send the request and transition the state |
void |
setRequestMethod(java.lang.String method)
Set the request method - only valid until the request has been got |
| Methods inherited from class com.dctl.j2me.io.BaseConnection |
setParameters |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String method
protected static final java.lang.String PROTOCOL
protected static final java.lang.String VERSION
protected static final java.lang.String CRLF
protected static final java.lang.String COLON_SPACE
protected static final java.lang.String HOST_PROPERTY
protected static final java.lang.String USER_AGENT_PROPERTY
protected static final java.lang.String USER_AGENT_VALUE
protected static final java.lang.String ACCEPT_PROPERTY
protected static final java.lang.String ACCEPT_VALUE
protected static final java.lang.String CONNECTION_PROPERTY
protected static final java.lang.String CONNECTION_KEEP_ALIVE
protected static final java.lang.String CONNECTION_CLOSE
protected static final java.lang.String DATE_PROPERTY
protected static final java.lang.String EXPIRES_PROPERTY
protected static final java.lang.String LAST_MODIFIED_PROPERTY
protected static final java.lang.String CONTENT_TYPE_PROPERTY
protected static final java.lang.String CONTENT_ENCODING_PROPERTY
protected static final java.lang.String CONTENT_LENGTH_PROPERTY
protected static final java.lang.String TRANSFER_ENCODING_PROPERTY
protected static final java.lang.String CHUNKED_ENCODING
protected static final int SETUP
protected static final int SENDING
protected static final int RECEIVING
protected static final int CLOSED
protected Hashtable outputProperties
protected Hashtable inputProperties
protected Vector inputNames
protected int responseCode
protected java.lang.String responseMessage
protected int state
protected com.dctl.j2me.io.http.InputStream is
protected com.dctl.j2me.io.http.OutputStream os
protected int handle
protected int opens
protected static final int YEAR
protected static final int MONTH
protected static final int DAY
protected static final int HOUR
protected static final int MIN
protected static final int SEC
protected static final int[] FIELDS
protected static final java.lang.String[] MONTH_STRING
protected static final int RFC1123
protected static final int RFC850
protected static final int ASCTIME
protected static final int COMMA
protected static final int SPACE
protected static final int DASH
| Constructor Detail |
public BaseHttpConnection()
| Method Detail |
public void recycle()
public void setRequestMethod(java.lang.String method)
throws IOException
method - The request method
IOException - if the request has already been sent or the method is not valid
protected final void invalidState()
throws IOException
IOExceptionprotected abstract java.lang.String generateFirstOutput()
protected abstract void openConnection()
throws IOException
IOException - if there is an error
protected final void sendOutput()
throws IOException
IOException - if there is an error
protected abstract boolean handleFirstInput(java.lang.String line)
throws IOException
line - The first input line
IOException - if the line is incorrect
protected final void parseInput()
throws IOException
IOException - if there is an error
public void close()
throws IOException
IOException - if there is an I/O errorpublic java.lang.String getFile()
public java.lang.String getURL()
public java.lang.String getProtocol()
public java.lang.String getHost()
public java.lang.String getRef()
public java.lang.String getQuery()
public int getPort()
public java.lang.String getRequestMethod()
public int getFieldInt(Hashtable table,
java.lang.String name,
int defaultValue)
throws IOException
table - The table to get the field fromname - The name of the fielddefaultValue - The default value to use if the field cannot be
parsed or if it does not exist
IOException - if there is an error
public long getFieldDate(Hashtable table,
java.lang.String name,
long defaultValue)
throws IOException
table - The table to get the field fromname - Thename of the fielddefaultValue - The default value to use if the field cannot be
parsed or if it does not exist
IOException - if there is an error
public java.lang.String getInputFieldKey(int index)
throws IOException
index - the index
IOException - if there is an error
public InputStream openInputStream()
throws IOException
IOException - if there is an error
public java.io.DataInputStream openDataInputStream()
throws IOException
IOException - if there is an error
public OutputStream openOutputStream()
throws IOException
IOException - if there is an error
public java.io.DataOutputStream openDataOutputStream()
throws IOException
IOException - if there is an error
|
DCT Lightfoot v3 API specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||