Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.acegisecurity.context.httpinvoker
Class AuthenticationSimpleHttpInvokerRequestExecutor

    java.lang.Object
      org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
          org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
              org.acegisecurity.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor

All Implemented Interfaces:
  HttpInvokerRequestExecutor

    public class AuthenticationSimpleHttpInvokerRequestExecutor

extends SimpleHttpInvokerRequestExecutor

Adds BASIC authentication support to `SimpleHttpInvokerRequestExecutor`.

Version:
  $Id: AuthenticationSimpleHttpInvokerRequestExecutor.java,v 1.6 2005/11/17 00:56:47 benalex Exp $
Author:
  Ben Alex

Field Summary

Fields inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
`CONTENT_TYPE_SERIALIZED_OBJECT, HTTP_HEADER_CONTENT_LENGTH, HTTP_HEADER_CONTENT_TYPE, HTTP_METHOD_POST`

Constructor Summary
`AuthenticationSimpleHttpInvokerRequestExecutor()`

Method Summary
`protected void` | `doPrepareConnection(HttpURLConnection con, int contentLength)` Provided so subclasses can perform additional configuration if required (eg set additional request headers for non-security related information etc).
`protected void` | `prepareConnection(HttpURLConnection con, int contentLength)` Called every time a HTTP invocation is made.

Methods inherited from class org.springframework.remoting.httpinvoker.SimpleHttpInvokerRequestExecutor
`doExecuteRequest, openConnection, readResponseBody, validateResponse, writeRequestBody`

Methods inherited from class org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor
`createObjectInputStream, decorateInputStream, decorateOutputStream, doReadRemoteInvocationResult, doWriteRemoteInvocation, executeRequest, getByteArrayOutputStream, readRemoteInvocationResult, writeRemoteInvocation`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AuthenticationSimpleHttpInvokerRequestExecutor

    public AuthenticationSimpleHttpInvokerRequestExecutor()

Method Detail

### doPrepareConnection

    protected void doPrepareConnection(HttpURLConnection con,
                                       int contentLength)
                                throws IOException

  Provided so subclasses can perform additional configuration if required (eg set additional request headers for non-security related information etc).

  Parameters:
    `con` - the HTTP connection to prepare
    `contentLength` - the length of the content to send
  Throws:
    `IOException` - if thrown by HttpURLConnection methods

### prepareConnection

    protected void prepareConnection(HttpURLConnection con,
                                     int contentLength)
                              throws IOException,
                                     AuthenticationCredentialsNotFoundException

  Called every time a HTTP invocation is made.

  Simply allows the parent to setup the connection, and then adds an `Authorization` HTTP header property that will be used for BASIC authentication.

  The `SecurityContextHolder` is used to obtain the relevant principal and credentials.

  Overrides:
    `prepareConnection` in class `SimpleHttpInvokerRequestExecutor`
  Parameters:
    `con` - the HTTP connection to prepare
    `contentLength` - the length of the content to send
  Throws:
    `IOException` - if thrown by HttpURLConnection methods
    `AuthenticationCredentialsNotFoundException` - if the `SecurityContextHolder` does not contain a valid `Authentication` with both its `principal` and `credentials` not `null`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.