|
ElegantJ Data Tables Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.elegantj.data.dataprovider.AbstractDataProvider
com.elegantj.data.dataprovider.text.TextDataProvider
com.elegantj.data.dataprovider.http.HTTPTextDataProvider
This class encapsulates functionality of an HTTP text data provider.
The basic functionality can be summarized as follows:
- Create an HTTP request to GET or POST the data.
- Send the HTTP request to the web server.
- Read the response from the web server.
This bean provides powerful designing aspects by providing following user friendly property.
DataProvider the data provider
URL the URL of the source file
RowSeparator the row separator string
ColumnSeparator the column separator string
TextQualifier the text qualifier string
FirstRowAsColumnNames indicates whether the first row of the retrieved data is column names or not
ColumnsDelimited indicates whether the columns are delimited or fixed width
SkippedColumns the comma separated indexes of the columns to be skipped
ColumnsWidth the comma separated width of the columns
SortCriteria the criteria for sorting the data
FilterCriteria the criteria for filtering the data
FilterState indicates whether the filter criteria is applied or not
SaveOnlyFilteredData indicates to save only filtered rows or all rows
FetchSize the maximum number of rows which can be retrieved
AppendDataOnFetchNext indicates whether the next fetched data is appended or replaced to existing data
SkippedRows the total number of rows to be skipped
Method the HTTP method name such as GET, POST, HEAD
| Field Summary |
| Fields inherited from class com.elegantj.data.dataprovider.text.TextDataProvider |
DEFAULT_COLUMN_SEPARATOR, DEFAULT_ROW_SEPARATOR, DEFAULT_TEXT_QUALIFIER, forInput, in, out |
| Fields inherited from class com.elegantj.data.dataprovider.AbstractDataProvider |
c1, changes, clientTable, columnNames, currentIndex, dataTable |
| Constructor Summary | |
HTTPTextDataProvider()
|
|
| Method Summary | |
void |
clearHTTPRequestHeaders()
Clears the HTTP request headers. |
void |
clearHTTPResponseHeaders()
Clears the HTTP response headers. |
boolean |
close()
Closes input / output stream of the text file |
void |
closeConnection()
Closes the HTTP connection. |
java.lang.String |
getHTTPRequest()
Returns the HTTP request. |
java.lang.String |
getHTTPRequestEntityBody()
Returns the entity body of the HTTP request. |
java.lang.String |
getHTTPRequestEntityHeader()
Returns the entity header of the HTTP request. |
java.lang.String |
getHTTPRequestEntityHeaderProperty(java.lang.String field)
Returns the value for specified entity header field of HTTP entity header. |
java.lang.String |
getHTTPRequestGeneralHeader()
Returns the general header of the HTTP request. |
java.lang.String |
getHTTPRequestGeneralHeaderProperty(java.lang.String field)
Returns the value for specified general header field of HTTP request header. |
java.lang.String |
getHTTPRequestHeader()
Returns the request header of the HTTP request. |
java.lang.String |
getHTTPRequestHeaderProperty(java.lang.String field)
Returns the value for specified request header field of HTTP request header. |
java.lang.String |
getHTTPResponse()
Returns the HTTP response. |
byte[] |
getHTTPResponseEntityBody()
Returns the entity body of the HTTP response. |
java.lang.String |
getHTTPResponseHeader()
Returns the response header of the HTTP response. |
java.lang.String |
getHTTPResponseHeaderProperty(java.lang.String field)
Returns the value for specified response header field of HTTP response header. |
java.io.InputStream |
getInputStream()
Returns the input stream to read the HTTP response. |
java.lang.String |
getMethod()
Returns the name of the HTTP method. |
java.io.OutputStream |
getOutputStream()
Returns the output stream to write the HTTP request. |
void |
getResponseFromServer()
Reads HTTP response from the web server. |
void |
getResponseHeaderFromServer()
Reads HTTP response header from the web server. |
boolean |
open(boolean input)
Opens input stream or output stream of the text file |
boolean |
openConnection()
Opens an HTTP connection with the host and port specified in the URL. |
void |
readExternal(java.io.ObjectInput in)
|
void |
sendRequestToServer()
Sends the HTTP request to the web server. |
void |
setFile(java.lang.String path)
Not applicable |
void |
setFileAsEntityBody(java.io.File file)
Set the content of the specified file as the entity body for the HTTP POST request. |
void |
setHTTPRequestEntityHeaderProperty(java.lang.String field,
java.lang.String value)
Sets the entity header property for the HTTP entity header. |
void |
setHTTPRequestGeneralHeaderProperty(java.lang.String field,
java.lang.String value)
Sets the general header property for the HTTP request header. |
void |
setHTTPRequestHeaderProperty(java.lang.String field,
java.lang.String value)
Sets the request header property for the HTTP request header. |
void |
setMethod(java.lang.String method)
Sets the name of the HTTP method. |
void |
setStringBufferAsEntityBody(java.lang.String buffer)
Set the specified string buffer as the entity body for the HTTP POST request. |
void |
setURLConnectionEnabled(boolean b)
Not applicable |
void |
writeExternal(java.io.ObjectOutput out)
Externalizable interface implementation to save and retrieve the state of this bean |
| Methods inherited from class com.elegantj.data.dataprovider.text.TextDataProvider |
getFile, getSkippedColumns, getURL, isFetchNext, isURLConnectionEnabled, nextData, retrieve, retrieveData, save, saveData, setSkippedColumns, setURL |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HTTPTextDataProvider()
| Method Detail |
public boolean openConnection()
public void closeConnection()
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public void clearHTTPRequestHeaders()
public void clearHTTPResponseHeaders()
public void setMethod(java.lang.String method)
public java.lang.String getMethod()
public void setURLConnectionEnabled(boolean b)
setURLConnectionEnabled in class TextDataProviderb - true to enable the URL connectionpublic void setFile(java.lang.String path)
setFile in class TextDataProviderpath - the path of the text filepublic boolean open(boolean input)
open in class TextDataProviderinput - true to open the input stream, false to open the output stream
public boolean close()
close in class TextDataProvider
public void setHTTPRequestGeneralHeaderProperty(java.lang.String field,
java.lang.String value)
field - The name of general header field.value - The value for that field.public java.lang.String getHTTPRequestGeneralHeaderProperty(java.lang.String field)
field - The name of general header field.
public java.lang.String getHTTPRequestGeneralHeader()
public void setHTTPRequestHeaderProperty(java.lang.String field,
java.lang.String value)
field - The name of request header field.value - The value for that field.public java.lang.String getHTTPRequestHeaderProperty(java.lang.String field)
field - The name of request header field.
public java.lang.String getHTTPRequestHeader()
public void setHTTPRequestEntityHeaderProperty(java.lang.String field,
java.lang.String value)
field - The name of entity header field.value - The value for that field.public java.lang.String getHTTPRequestEntityHeaderProperty(java.lang.String field)
field - The name of entity header field.
public java.lang.String getHTTPRequestEntityHeader()
public java.lang.String getHTTPRequestEntityBody()
public java.lang.String getHTTPRequest()
public java.lang.String getHTTPResponseHeaderProperty(java.lang.String field)
field - The name of response header field.
public java.lang.String getHTTPResponseHeader()
public byte[] getHTTPResponseEntityBody()
public java.lang.String getHTTPResponse()
public void sendRequestToServer()
public void getResponseHeaderFromServer()
public void getResponseFromServer()
public void setStringBufferAsEntityBody(java.lang.String buffer)
buffer - The string buffer which holds the data to post.public void setFileAsEntityBody(java.io.File file)
file - The file which contains the data to post.
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.ExternalizablewriteExternal in class TextDataProviderjava.io.IOException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class TextDataProviderjava.io.IOException
java.lang.ClassNotFoundException
|
ElegantJ Data Tables Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||