public interface AdaptorContext
Avoid implementing this interface in adaptor unit tests because
new methods may be added in the future. Instead use
UnsupportedAdaptorContext
, or use an automated mock
generator like Mockito or java.lang.reflect.Proxy
.
Modifier and Type | Method and Description |
---|---|
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
DocId s 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
DocId s 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.
|
Config getConfig()
DocIdPusher getDocIdPusher()
DocId
s to the GSA at any time.AsyncDocIdPusher getAsyncDocIdPusher()
DocId
s to the GSA
at any time.DocIdEncoder getDocIdEncoder()
void addStatusSource(StatusSource source)
Adaptor.destroy()
. Source registration should
occur during Adaptor.init(com.google.enterprise.adaptor.AdaptorContext)
.source
- gives data to dashboardvoid setGetDocIdsFullErrorHandler(ExceptionHandler handler)
ExceptionHandler
for full push.handler
- for dealing with errors sending doc ids to GSAExceptionHandler getGetDocIdsFullErrorHandler()
ExceptionHandler
for full push.void setGetDocIdsIncrementalErrorHandler(ExceptionHandler handler)
ExceptionHandler
for incremental push.handler
- for dealing with errors sending doc ids to GSAExceptionHandler getGetDocIdsIncrementalErrorHandler()
ExceptionHandler
for incremental push.SensitiveValueDecoder getSensitiveValueDecoder()
HttpContext createHttpContext(String path, HttpHandler handler)
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.
path
- on the serverhandler
- of requests for pathSession getUserSession(HttpExchange ex, boolean create)
ex
. If a session
does not already exist, then create
determines if one should be
created.ex
- exchange which user issued requestcreate
- whether a new session should be created if one does not
already exist for this usernull
if session did not already exist
and create = false
void setPollingIncrementalLister(PollingIncrementalLister lister)
Adaptor.init(com.google.enterprise.adaptor.AdaptorContext)
.lister
- provides updated idsvoid setAuthnAuthority(AuthnAuthority authnAuthority)
Adaptor.init(com.google.enterprise.adaptor.AdaptorContext)
.authnAuthority
- identifies usersvoid setAuthzAuthority(AuthzAuthority authzAuthority)
Adaptor.init(com.google.enterprise.adaptor.AdaptorContext)
.authzAuthority
- makes access decisions