com.endeca.navigation
Class AuthHttpENEConnection

java.lang.Object
  extended by com.endeca.navigation.HttpENEConnection
      extended by com.endeca.navigation.AuthHttpENEConnection
All Implemented Interfaces:
ENEConnection, Serializable

public class AuthHttpENEConnection
extends HttpENEConnection

Extends HttpENEConnection to provide a connection over to an Endeca MDEX Engine over HTTP that requires authentication. Use instances of this class to connect to the MDEX Engine via the Endeca Access Control System.

See Also:
Serialized Form

Constructor Summary
AuthHttpENEConnection()
          Default empty constructor.
AuthHttpENEConnection(String hostname, int port)
          Constructor for connection to an Endeca MDEX Engine over HTTP.
AuthHttpENEConnection(String hostname, String port)
          Constructor for connection to an Endeca MDEX Engine over HTTP.
 
Method Summary
protected  void finalize()
           
 void login(CallbackHandler handler)
          Authenticate a user.
 void logout()
          Logout an authenticated user.
 ENEQueryResults query(ENEQuery neq)
          Issues a query against the MDEX Engine.
 
Methods inherited from class com.endeca.navigation.HttpENEConnection
enableSSL, enableSSL, getHostname, getPort, setHostname, setHostnameVerifier, setPort, setPort
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthHttpENEConnection

public AuthHttpENEConnection()
Default empty constructor. Hostname and port need to be set and the login(CallbackHandler) method will need to be called before query is called, else a ENEQueryException will be thrown.


AuthHttpENEConnection

public AuthHttpENEConnection(String hostname,
                             String port)
Constructor for connection to an Endeca MDEX Engine over HTTP. A user must be authenticated with login(CallbackHandler) before the query method is called, otherwise a ENEQueryException will be thrown.

Parameters:
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.

AuthHttpENEConnection

public AuthHttpENEConnection(String hostname,
                             int port)
Constructor for connection to an Endeca MDEX Engine over HTTP. A user must be authenticated with login(CallbackHandler) before the query method is called, otherwise a ENEQueryException will be thrown.

Parameters:
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

query

public ENEQueryResults query(ENEQuery neq)
                      throws ENEQueryException
Issues a query against the MDEX Engine. The query method returns a ENEQueryResults object which contains the resultant objects returned by the MDEX Engine in response to the query neq.

Specified by:
query in interface ENEConnection
Overrides:
query in class HttpENEConnection
Parameters:
neq - the query object containing the navigation, record etc. type requests to the MDEX Engine
Returns:
ENEQueryResults object that contains the results of the query.
Throws:
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.

login

public void login(CallbackHandler handler)
           throws ENEAuthenticationException
Authenticate a user.

Parameters:
handler - An object instance that provides the mechanism to obtain credentials for authentication purposes. For example, the StaticCallbackHandler class can be used to construct the handler object.
Throws:
ENEAuthenticationException - if the login fails for any reason, including bad credentials.

logout

public void logout()
            throws ENEAuthenticationException
Logout an authenticated user.

Throws:
ENEAuthenticationException - if the operation fails for any reason.

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable


© 2008 Endeca Technologies, Inc.
Endeca Confidential