|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.navigation.HttpENEConnection
public class HttpENEConnection
Provides a connection to an Endeca MDEX Engine over HTTP. Also
provides a mechanism for issuing queries to the
MDEX Engine. The HttpENEConnection
is currently
the only implementation of the ENEConnection
interface.
This connection is a repository for hostname and port configuration
parameters for HTTP connections to an MDEX Engine. The connection
does not open a persistant connection to the MDEX Engine. The
instantiation of this connection does not initiate an HTTP socket
connection. Instead each issuance of the query
method opens
a HTTP socket connection(s), makes the requests, and closes the
connection(s).
An example usage of the HttpENEConnection in JSP:
<% ENEConnection nec = new HttpENEConnection("engine.endeca.com", "5001"); ENEQuery usq = new UrlENEQuery(request.getQueryString()); ENEQueryResults qr = nec.query(usq); %>Another example usage of the HttpENEConnection in JSP using the
useBean
syntax:
<jsp:useBean id="nec" scope="request" class="com.endeca.navigation.HttpENEConnection" type="com.endeca.navigation.ENEConnection"> <jsp:setProperty name="nec" property="hostname" value="moose.dev.endeca.com"/> <jsp:setProperty name="nec" property="port" value="5001"/> </jsp:useBean> <% ENEQuery usq = new UrlENEQuery(request.getQueryString()); ENEQueryResults qr = nec.query(neq); %>
Nested Class Summary | |
---|---|
static class |
HttpENEConnection.HttpHeader
|
Constructor Summary | |
---|---|
HttpENEConnection()
Default empty constructor. |
|
HttpENEConnection(String hostname,
int port)
Constructor for connection to an Endeca MDEX Engine over HTTP. |
|
HttpENEConnection(String hostname,
String port)
Constructor for connection to an Endeca MDEX Engine over HTTP. |
Method Summary | |
---|---|
void |
addHttpHeader(String name,
String value)
Add an HTTP header to the query request. |
void |
enableSSL()
Enabling SSL specifies that a secure connection must be made between the API and the dgraph. |
void |
enableSSL(KeyStore clientKs,
String clientPassphrase,
KeyStore caKs)
Enabling SSL specifies that a secure connection must be made between the API and the dgraph. |
String |
getHostname()
Gets the specified hostname of the MDEX Engine. |
int |
getMaxUrl()
Gets the value of maxUrl . |
int |
getPort()
Gets the specified port of the MDEX Engine. |
ENEQueryResults |
query(ENEQuery neq)
Issues a query against the MDEX Engine. |
void |
setHostname(String hostname)
Sets the hostname of the MDEX Engine. |
void |
setHostnameVerifier(HostnameVerifier newHv)
Sets the hostname verifier that will be used to check the server certificate's CN for an SSL connection. |
void |
setMaxUrl(int maxUrl)
Sets the value of maxUrl . |
void |
setPort(int port)
Sets the port of the MDEX Engine. |
void |
setPort(String port)
Sets the port of the MDEX Engine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpENEConnection()
query
is called, else a
ENEQueryException
will
be thrown.
public HttpENEConnection(String hostname, String port)
hostname
- hostname or IP address of the MDEX Engine.
Example: 127.0.0.1 or engine.endeca.com.port
- port of the MDEX Engine. Example: 5001.public HttpENEConnection(String hostname, int port)
hostname
- hostname or IP address of the MDEX Engine.
Example: 127.0.0.1 or engine.endeca.com.port
- port of the MDEX Engine. Example: 5001.Method Detail |
---|
public ENEQueryResults query(ENEQuery neq) throws ENEQueryException
query
method returns a ENEQueryResults
object which contains
the resultant objects returned by the MDEX Engine in
response to the
query neq
.
query
in interface ENEConnection
neq
- the query object containing the navigation, record etc.
type requests to the MDEX Engine
ENEQueryException
- if there is a
problem making the query. Possible subclasses of
ENEQueryException
that could be thrown are
ENEConnectionException
,
EmptyENEQueryException
,
PartialENEQueryException
,
ENEException
,
VersionMismatchException
, and so on.public void setHostnameVerifier(HostnameVerifier newHv)
newHv
- verifier object to be usedpublic void setHostname(String hostname)
hostname
- hostname of the MDEX Engine.public void setPort(String port)
port
- port of the MDEX Engine.public void setPort(int port)
port
- port of the MDEX Engine.public void enableSSL()
public void enableSSL(KeyStore clientKs, String clientPassphrase, KeyStore caKs) throws IllegalArgumentException
clientKs
- KeyStore containing the front-end's certificate.clientPassphrase
- Passphrase for recovering keys from the
KeyStore holding the client's certificate.caKs
- KeyStore containing additional CA certs that are trusted
to sign server certificates.
IllegalArgumentException
public void setMaxUrl(int maxUrl)
maxUrl
.
maxUrl
- The maximum URL length for which use of an HTTP GET
operation is allowed. If a longer URL is needed, an
HTTP POST operation will be used instead. If set to 0,
POST will always be used. If set to -1, either GET or
POST may be used at the discretion of the API. The
default is -1.public int getMaxUrl()
maxUrl
.
public void addHttpHeader(String name, String value)
name
- The name of the HTTP header to add.value
- The value of the HTTP header to add.public String getHostname()
null
if hostname has not been set.public int getPort()
0
if
port has not been set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |