[ 
http://jira.amdatu.org/jira/browse/AMDATU-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10616#comment-10616
 ] 

Ivo Ladage - van Doorn commented on AMDATU-247:
-----------------------------------------------

This is how it works;

- The ContextManager is responsible for managing ContextProvider's
- A ContextProvider is a service that can be implemented by any component to 
add one piece of context to the overall context. It implements methods to 
resolve context information from an arbitrary map of properties (typically this 
will contain a HTTP request for example)
- Default implementations are available for a Login context and Tenant context:
  - The login context provides a username, resolved by an amdatu token send 
along with an HTTP request
  - The tenant context provides one or more tenants resolved by matching the 
servername of an HTT request onto the hostname associated with a tenant
- A HttpRequestContextResolver is available as servlet filter that invokes the 
resolve and release on the context manager, which delegates this to each 
ContextProvider
- If some component needs to retrieve information from the context, it can do 
so by invoking ContextManager.getValue(<context provider id>, <property>)


> Implement pluggable and centralized context management service
> --------------------------------------------------------------
>
>                 Key: AMDATU-247
>                 URL: http://jira.amdatu.org/jira/browse/AMDATU-247
>             Project: Amdatu
>          Issue Type: Task
>          Components: Amdatu Auth
>    Affects Versions: 0.1.0
>            Reporter: Ivo Ladage - van Doorn
>             Fix For: 0.1.0
>
>         Attachments: r565-context-patch.patch
>
>
> The following issues describe context-related issues in Amdatu:
> http://jira.amdatu.org/jira/browse/AMDATU-84
> http://jira.amdatu.org/jira/browse/AMDATU-245
> http://jira.amdatu.org/jira/browse/AMDATU-246
> Each of these issues refer to the need of context information, sometimes a 
> 'username' and in other cases a 'tenantid'. The issues described some 
> possible solutions which have obvious drawbacks:
> - Passing context information in method invocations, over and over again
> - Retrieving context information from a HTTP request
> Now while these issues only describe the contextual information 'username' 
> and 'tenantid', it is likely that more context information is required in the 
> future. For example the OpenSocial context is represented by a security 
> token, which contains a viewerid, ownerid but also an expiry date of the 
> context. So a similar approach should be available in Amdatu and it should 
> satisfy the following requirements:
> - Context is always available, without the need of passing a HTTP request
> - The context is pluggable; any component may add a piece of information to 
> the context (like Shindig adding a OpenSocial context, containing the 
> viewerid and ownerid)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to