|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.alfresco.bm.event.AbstractEventProcessor
org.alfresco.bm.http.AuthenticatedHttpEventProcessor
public abstract class AuthenticatedHttpEventProcessor
A base class used for EventProcessors that makes use of HTTP-calls that should be done when authenticated against Alfresco.
Subclasses can just do the HTTP-call(s) without having to worry about authentication. Use #executeHttpMethodAuthenticated(HttpMethod, String)
instead of using HttpClient manually or #executeHttpMethodAsAdmin(HttpMethod) to run as Alfresco Administrator.
Supports both BASIC Authentication (default) and Ticket-based authentication. In case ticket-based authentication is used, the ticket value is stored on the userdata-provider and a new ticket is fetched transparantly when the ticket is expired.
| Nested Class Summary | |
|---|---|
static interface |
AuthenticatedHttpEventProcessor.HttpRequestCallback<T>
Callback used when executing HTTP-request. |
| Field Summary |
|---|
| Fields inherited from class org.alfresco.bm.event.AbstractEventProcessor |
|---|
DEFAULT_WARN_DELAY, logger |
| Constructor Summary | |
|---|---|
AuthenticatedHttpEventProcessor(HttpClientProvider httpProvider,
AuthenticationDetailsProvider authDetailProvider)
|
|
| Method Summary | ||
|---|---|---|
protected
|
executeHttpMethodAsAdmin(org.apache.commons.httpclient.HttpMethod method,
AuthenticatedHttpEventProcessor.HttpRequestCallback<T> callback)
Execute the given method, authenticated as the Alfresco Administrator. |
|
protected
|
executeHttpMethodAuthenticated(org.apache.commons.httpclient.HttpMethod method,
String userName,
AuthenticatedHttpEventProcessor.HttpRequestCallback<T> callback)
Execute the given method, authenticated as the given user. |
|
AuthenticationDetailsProvider |
getAuthDetailProvider()
|
|
HttpClientProvider |
getHttpProvider()
|
|
abstract EventResult |
processEvent(Event event)
Process an event. |
|
void |
setTicketBasedAuthentication(boolean ticketBasedAuthentication)
Enable ticket-based authentication. |
|
| Methods inherited from class org.alfresco.bm.event.AbstractEventProcessor |
|---|
getWarnDelay, register, setBeanName, setEventName, setEventNames, setRegistry, setWarnDelay |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AuthenticatedHttpEventProcessor(HttpClientProvider httpProvider,
AuthenticationDetailsProvider authDetailProvider)
httpProvider - provider class for http-clientauthDetailProvider - provider for authentication details| Method Detail |
|---|
public void setTicketBasedAuthentication(boolean ticketBasedAuthentication)
ticketBasedAuthentication - whether or not to use ticket for authenticationpublic HttpClientProvider getHttpProvider()
HttpClientProvider used by this class.public AuthenticationDetailsProvider getAuthDetailProvider()
AuthenticationDetailsProvider used by this class.
public abstract EventResult processEvent(Event event)
throws Exception
EventProcessor
event - the event (along with associated data)
Exception
protected <T> T executeHttpMethodAuthenticated(org.apache.commons.httpclient.HttpMethod method,
String userName,
AuthenticatedHttpEventProcessor.HttpRequestCallback<T> callback)
AuthenticatedHttpEventProcessor.HttpRequestCallback.
method - method to executeuserName - name of user to authenticatecallback - called after http-call is executed. When callback returns, the
response stream is closed, so all respose-related operations should be done in the callback. Can be null.
protected <T> T executeHttpMethodAsAdmin(org.apache.commons.httpclient.HttpMethod method,
AuthenticatedHttpEventProcessor.HttpRequestCallback<T> callback)
method - method to executecallback - called after http-call is executed. When callback returns, the
response stream is closed, so all respose-related operations should be done in the callback. Can be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||