|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.gsaapi.GSAClient
Use a GSAClient instance to fire queries to a specific GSA site. Typical usage:
GSAClient client = new GSAClient("http", "www.mygsa.net", 7777, "/search"); GSAQuery query = new GSAQuery(); // insert calls to (see GSAQuery): query.setXyz(xyzValue); InputStream istream = client.search(query); // 'istream' is an InputStream to the gsa xml results. // parse data from 'istream' using desired XML parser api.A single GSAClient instance may be shared by multiple threads accessing the same target search appliance. Note however that the same GSAClientDelegate instance (if used) will be used for all the threads. Thus you must appropriately design the GSAClientDelegate for multi-threaded access.
GSAQuery
Field Summary | |
static java.lang.String |
DEFAULT_PATH
default path used by contructor that allows you to skip speciyfing the path |
static int |
DEFAULT_PORT
default port number used by constructor that allows you to skip specifying the port |
static java.lang.String |
DEFAULT_PROTOCOL
default protocol used by constructor that allows you to skip specifying the protocol |
Constructor Summary | |
GSAClient(java.lang.String host)
overloaded constructor that sets the defaults: DEFAULT_PROTOCOL, DEFAULT_PORT, DEFAULT_PATH |
|
GSAClient(java.lang.String host,
int port,
java.lang.String path)
overloaded constructor that sets the defaults: DEFAULT_PROTOCOL |
|
GSAClient(java.lang.String host,
java.lang.String path)
overloaded constructor that sets the defaults: DEFAULT_PROTOCOL, DEFAULT_PORT |
|
GSAClient(java.lang.String protocol,
java.lang.String host,
int port,
java.lang.String path)
|
Method Summary | |
GSAResponse |
getGSAResponse(GSAQuery query)
Returns the search results parsed and wrapped by GSAReponse instance. |
GSAResponse |
getGSAResponse(java.lang.String rawQuery)
Normally you should be using one of the overloaded "search(GSAQuery)" functions. |
java.lang.String |
getHost()
returns the value for the host parameter passed to the constructor |
java.lang.String |
getPath()
returns the value for the path parameter passed to the constructor |
int |
getPort()
returns the value for the port parameter passed to the constructor |
java.lang.String |
getProtocol()
returns the value for the protocol parameter passed to the constructor |
java.io.InputStream |
search(GSAQuery query)
If a valid query does not result in any results, an empty List will be returned. |
java.io.InputStream |
search(java.lang.String rawQuery)
Normally, you should be using one of the overloaded "search(GSAQuery)" methods which internally call this method. |
void |
setClientDelegate(GSAClientDelegate delegate)
specify the GSAClientDelegate instance that will actually query the url and return an input stream to the response. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_PORT
public static final java.lang.String DEFAULT_PATH
public static final java.lang.String DEFAULT_PROTOCOL
Constructor Detail |
public GSAClient(java.lang.String protocol, java.lang.String host, int port, java.lang.String path)
protocol
- protocol to use to connect to GSA eg. "http"host
- hostname for the GSA eg. "www.mysite.net"port
- port at which GSA is serving eg. 3300path
- path for the search program on GSA eg. "/search"public GSAClient(java.lang.String host, int port, java.lang.String path)
host
- port
- path
- public GSAClient(java.lang.String host, java.lang.String path)
host
- path
- public GSAClient(java.lang.String host)
host
- Method Detail |
public void setClientDelegate(GSAClientDelegate delegate)
delegate
- public java.io.InputStream search(GSAQuery query) throws java.io.IOException
java.io.IOException
public java.io.InputStream search(java.lang.String rawQuery) throws java.io.IOException
rawQuery
- rawQuery string
java.io.IOException
public GSAResponse getGSAResponse(GSAQuery query) throws java.io.IOException
query
- The properly configured GSAQuery instance
java.io.IOException
public GSAResponse getGSAResponse(java.lang.String rawQuery) throws java.io.IOException
rawQuery
- raw query string
java.io.IOException
public java.lang.String getHost()
public java.lang.String getPath()
public int getPort()
public java.lang.String getProtocol()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
© Copyright 2006 Inxight Software, Inc.