public class UnsupportedAdaptorContext extends Object implements AdaptorContext
AdaptorContext that throws an
UnsupportedOperationException if any method is called.
This class is intended to be extended for unit testing, rather
than implementing the AdaptorContext interface directly.
| Constructor and Description |
|---|
UnsupportedAdaptorContext() |
| 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
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.
|
public Config getConfig()
AdaptorContextgetConfig in interface AdaptorContextUnsupportedOperationException - alwayspublic DocIdPusher getDocIdPusher()
AdaptorContextDocIds to the GSA at any time.getDocIdPusher in interface AdaptorContextUnsupportedOperationException - alwayspublic AsyncDocIdPusher getAsyncDocIdPusher()
AdaptorContextDocIds to the GSA
at any time.getAsyncDocIdPusher in interface AdaptorContextUnsupportedOperationException - alwayspublic DocIdEncoder getDocIdEncoder()
AdaptorContextgetDocIdEncoder in interface AdaptorContextUnsupportedOperationException - alwayspublic void addStatusSource(StatusSource source)
AdaptorContextAdaptor.destroy(). Source registration should
occur during Adaptor.init(com.google.enterprise.adaptor.AdaptorContext).addStatusSource in interface AdaptorContextsource - gives data to dashboardUnsupportedOperationException - alwayspublic void setGetDocIdsFullErrorHandler(ExceptionHandler handler)
AdaptorContextExceptionHandler for full push.setGetDocIdsFullErrorHandler in interface AdaptorContexthandler - for dealing with errors sending doc ids to GSAUnsupportedOperationException - alwayspublic ExceptionHandler getGetDocIdsFullErrorHandler()
AdaptorContextExceptionHandler for full push.getGetDocIdsFullErrorHandler in interface AdaptorContextUnsupportedOperationException - alwayspublic void setGetDocIdsIncrementalErrorHandler(ExceptionHandler handler)
AdaptorContextExceptionHandler for incremental push.setGetDocIdsIncrementalErrorHandler in interface AdaptorContexthandler - for dealing with errors sending doc ids to GSAUnsupportedOperationException - alwayspublic ExceptionHandler getGetDocIdsIncrementalErrorHandler()
AdaptorContextExceptionHandler for incremental push.getGetDocIdsIncrementalErrorHandler in interface AdaptorContextUnsupportedOperationException - alwayspublic SensitiveValueDecoder getSensitiveValueDecoder()
AdaptorContextgetSensitiveValueDecoder in interface AdaptorContextUnsupportedOperationException - alwayspublic HttpContext createHttpContext(String path, HttpHandler handler)
AdaptorContextHttpServer 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.
createHttpContext in interface AdaptorContextpath - on the serverhandler - of requests for pathUnsupportedOperationException - alwayspublic Session getUserSession(HttpExchange ex, boolean create)
AdaptorContextex. If a session
does not already exist, then create determines if one should be
created.getUserSession in interface AdaptorContextex - 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 = falseUnsupportedOperationException - alwayspublic void setPollingIncrementalLister(PollingIncrementalLister lister)
AdaptorContextAdaptor.init(com.google.enterprise.adaptor.AdaptorContext).setPollingIncrementalLister in interface AdaptorContextlister - provides updated idsUnsupportedOperationException - alwayspublic void setAuthnAuthority(AuthnAuthority authnAuthority)
AdaptorContextAdaptor.init(com.google.enterprise.adaptor.AdaptorContext).setAuthnAuthority in interface AdaptorContextauthnAuthority - identifies usersUnsupportedOperationException - alwayspublic void setAuthzAuthority(AuthzAuthority authzAuthority)
AdaptorContextAdaptor.init(com.google.enterprise.adaptor.AdaptorContext).setAuthzAuthority in interface AdaptorContextauthzAuthority - makes access decisionsUnsupportedOperationException - always