com.google.enterprise.adaptor
Interface AdaptorContext


public interface AdaptorContext

Methods for an Adaptor to communicate with the adaptor library. Implementations of this class must be thread-safe.


Method Summary
 void addStatusSource(StatusSource source)
          Add a status source to the dashboard.
 HttpContext createHttpContext(String path, HttpHandler handler)
          Registers a handler with the library's HttpServer in similar fashion to HttpServer.createContext(java.lang.String, com.sun.net.httpserver.HttpHandler).
 AsyncDocIdPusher getAsyncDocIdPusher()
          Callback object for asynchronously pushing DocIds to the GSA at any time.
 Config getConfig()
          Configuration instance for the adaptor and all things within the adaptor library.
 DocIdEncoder getDocIdEncoder()
          A way to construct URIs from DocIds.
 DocIdPusher getDocIdPusher()
          Callback object for pushing DocIds to the GSA at any time.
 ExceptionHandler getGetDocIdsFullErrorHandler()
          Retrieve the current ExceptionHandler for full push.
 ExceptionHandler getGetDocIdsIncrementalErrorHandler()
          Retrieve the current ExceptionHandler for incremental push.
 SensitiveValueDecoder getSensitiveValueDecoder()
          Retrieve decoder for sensitive values, like passwords.
 Session getUserSession(HttpExchange ex, boolean create)
          Get the session for the user communicating via ex.
 void setAuthnAuthority(AuthnAuthority authnAuthority)
          Register an authentication provider, so it can authenticate users for the GSA.
 void setAuthzAuthority(AuthzAuthority authzAuthority)
          Register an authorization provider, so it can check authorization of users for the GSA.
 void setGetDocIdsFullErrorHandler(ExceptionHandler handler)
          Override the default ExceptionHandler for full push.
 void setGetDocIdsIncrementalErrorHandler(ExceptionHandler handler)
          Override the default ExceptionHandler for incremental push.
 void setPollingIncrementalLister(PollingIncrementalLister lister)
          Register a polling incremental lister, so that it can be called when appropriate.
 

Method Detail

getConfig

Config getConfig()
Configuration instance for the adaptor and all things within the adaptor library.


getDocIdPusher

DocIdPusher getDocIdPusher()
Callback object for pushing DocIds to the GSA at any time.


getAsyncDocIdPusher

AsyncDocIdPusher getAsyncDocIdPusher()
Callback object for asynchronously pushing DocIds to the GSA at any time.


getDocIdEncoder

DocIdEncoder getDocIdEncoder()
A way to construct URIs from DocIds.


addStatusSource

void addStatusSource(StatusSource source)
Add a status source to the dashboard. The source will automatically be removed just before Adaptor.destroy(). Source registration should occur during Adaptor.init(com.google.enterprise.adaptor.AdaptorContext).


setGetDocIdsFullErrorHandler

void setGetDocIdsFullErrorHandler(ExceptionHandler handler)
Override the default ExceptionHandler for full push.


getGetDocIdsFullErrorHandler

ExceptionHandler getGetDocIdsFullErrorHandler()
Retrieve the current ExceptionHandler for full push.


setGetDocIdsIncrementalErrorHandler

void setGetDocIdsIncrementalErrorHandler(ExceptionHandler handler)
Override the default ExceptionHandler for incremental push.


getGetDocIdsIncrementalErrorHandler

ExceptionHandler getGetDocIdsIncrementalErrorHandler()
Retrieve the current ExceptionHandler for incremental push.


getSensitiveValueDecoder

SensitiveValueDecoder getSensitiveValueDecoder()
Retrieve decoder for sensitive values, like passwords. To protect sensitive values, the user should have previously encoded them using the Dashboard. However, a user is still allowed to choose to keep sensitive values in plain text.


createHttpContext

HttpContext createHttpContext(String path,
                              HttpHandler handler)
Registers a handler with the library's HttpServer in similar fashion to HttpServer.createContext(java.lang.String, com.sun.net.httpserver.HttpHandler). The handler will automatically be removed during adaptor shutdown. Handler registration should occur during Adaptor.init(com.google.enterprise.adaptor.AdaptorContext).

Although path may be passed directly to the underlying HttpServer, that is not necessarily the case. Thus, implementations should use the returned context's path when forming URLs to the handler. In addition, the handler and context may be modified before being returned; this is primarily to allow adding commonly-needed filters for error handling and logging, but also available for implementation-specific needs.


getUserSession

Session getUserSession(HttpExchange ex,
                       boolean create)
Get the session for the user communicating via ex. If a session does not already exist, then create determines if one should be created.

Parameters:
ex - exchange which user issued request
create - whether a new session should be created if one does not already exist for this user
Returns:
user's session, or null if session did not already exist and create = false

setPollingIncrementalLister

void setPollingIncrementalLister(PollingIncrementalLister lister)
Register a polling incremental lister, so that it can be called when appropriate. Registration may not occur after Adaptor.init(com.google.enterprise.adaptor.AdaptorContext).


setAuthnAuthority

void setAuthnAuthority(AuthnAuthority authnAuthority)
Register an authentication provider, so it can authenticate users for the GSA. Registration may not occur after Adaptor.init(com.google.enterprise.adaptor.AdaptorContext).


setAuthzAuthority

void setAuthzAuthority(AuthzAuthority authzAuthority)
Register an authorization provider, so it can check authorization of users for the GSA. Registration may not occur after Adaptor.init(com.google.enterprise.adaptor.AdaptorContext).