|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.taglibs.scrape.PageData
public class PageData
PageData - An object used to store information about a scrape done by the tags in the scrape package.
Field Summary | |
---|---|
static java.util.HashMap |
pageurls
static HashMap holds all of the pagedata objects keyed to the url |
Constructor Summary | |
---|---|
PageData()
constructor for the class simply creates an instance of the PageData object |
Method Summary | |
---|---|
java.lang.String |
getAuth()
get the base64 encoded auth string for proxy authorization |
boolean |
getChangeFlag()
getter method for changeflag |
java.util.ArrayList |
getHeaders()
get the http headers |
java.util.Set |
getKeySet()
getter method for the key set of the HashMap scrapes |
long |
getLastScrape()
getter method for lastscrape |
boolean |
getNewFlag()
getter method for newflag |
static PageData |
getPage(java.lang.String url,
int port,
java.lang.String server,
java.lang.String name,
java.lang.String pass)
method checks the static HashMap pageurls for the given url if it exists it is returned, otherwise a new pagedata object is created and added to the HashMap pageurls |
javax.servlet.jsp.PageContext |
getPageContext()
getter method for pagecontext returns the PageContext object for this page |
int |
getProxyPort()
get the value of the proxy port |
java.lang.String |
getProxyServer()
get the value of the proxy port |
java.lang.String |
getResults(java.lang.String id)
getter method for a result string from a scrapedata object |
ScrapeData |
getScrape(java.lang.String key)
getter method for a single scrapedata object from HashMap scrapes |
boolean |
getSSL()
get secure |
void |
scrapePage(java.lang.String url,
long time,
javax.servlet.jsp.PageContext pc,
java.lang.String cs)
checks the scrapeint, if enough time has passed it starts the getPage thread to go out and get the page, and sets scrapeing to true, then if newflag it will wait for the thread to finish running, otherwise it will just fall through and return the already stored results |
void |
setAuth(java.lang.String name,
java.lang.String pass)
set the username and password values for authentication to the proxy server |
void |
setClientPass(java.lang.String value)
set the pass word to access the client keystore |
void |
setException()
set exception to true, a malformedpatternexception has been thrown in page |
void |
setExceptionText(java.lang.String begin,
java.lang.String end)
sets the exception text to make the error in the jsp page easier for the author to find |
protected void |
setHeader(java.lang.String name,
java.lang.String value)
set the name and value of any extra headers to be sent |
void |
setLastScrape(long time)
setter method for lastscrape |
void |
setNewflag()
setter method for newflag only called to set newflag to false |
void |
setPageContext(javax.servlet.jsp.PageContext page)
setter method for pagecontext |
void |
setProxyPort(int value)
set the value of proxy port |
void |
setProxyServer(java.lang.String value)
set the value of proxy server |
void |
setScrape(java.lang.String id,
java.lang.String begin,
java.lang.String end,
java.lang.String anchors,
java.lang.String strip)
method to add an object to the HashMap scrapes, it first checks to see if the object already exists |
void |
setSSL(boolean value)
set the value of secure |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.HashMap pageurls
Constructor Detail |
---|
public PageData()
Method Detail |
---|
public static PageData getPage(java.lang.String url, int port, java.lang.String server, java.lang.String name, java.lang.String pass)
url
- the url of the page given in the calling PageTagport
- the port to use for the connection to the proxy serverserver
- the proxy serversecure
- is the link going over httpsname
- user name for authenticationpass
- password for authentication
public final void setScrape(java.lang.String id, java.lang.String begin, java.lang.String end, java.lang.String anchors, java.lang.String strip) throws javax.servlet.jsp.JspException
id
- unique identifier of the scrape the following attributes
definebegin
- beginning anchor for the scrape refered to by idend
- ending anchor for the scrape refered to by idanchors
- boolean flag that determines if begin and end anchors are
part of the resultstrip
- boolean flag that determines if tags are to be striped from
the result
javax.servlet.jsp.JspException
public java.lang.String getResults(java.lang.String id) throws javax.servlet.jsp.JspException
id
- unique key for requested scrape
javax.servlet.jsp.JspException
protected final void setHeader(java.lang.String name, java.lang.String value)
name
- string that is the name of an extra header to be sentvalue
- string that is the value of an extra header to be sentpublic java.util.ArrayList getHeaders()
public void setNewflag()
public boolean getNewFlag()
public final void setProxyPort(int value)
value
- the proxy port to use for the connection as a Stringpublic final int getProxyPort()
public final void setProxyServer(java.lang.String value)
value
- the proxy server to use for the connectionpublic final java.lang.String getProxyServer()
public final void setClientPass(java.lang.String value)
value
- password to the client keystorepublic final void setAuth(java.lang.String name, java.lang.String pass)
name
- usernamepass
- passwordbase64
- base64 encoded username and passwordpublic final java.lang.String getAuth()
public final void setSSL(boolean value)
value
- true if the connection is to be made via https the default
is falsepublic final boolean getSSL()
public final java.util.Set getKeySet()
public void setLastScrape(long time)
time
- current timepublic long getLastScrape()
time
- current timepublic void setExceptionText(java.lang.String begin, java.lang.String end)
begin
- the beginning marker for scrape where error occuredend
- the end marker for the scrape where error occuredpublic void setException()
public boolean getChangeFlag()
public ScrapeData getScrape(java.lang.String key)
key
- the value the requested scrapedata object is keyed to
public void setPageContext(javax.servlet.jsp.PageContext page)
page
- the page context object for this pagepublic javax.servlet.jsp.PageContext getPageContext()
public void scrapePage(java.lang.String url, long time, javax.servlet.jsp.PageContext pc, java.lang.String cs) throws javax.servlet.jsp.JspException
url
- url of the page to be scrapedtime
- length of time to wait before rescrapeproxy
- boolean value that says whether or not to use a proxy serverpc
- PageContext for this JSP pagecs
- charset to be used to scrape the page
javax.servlet.jsp.JspException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |