com.michelin.cio.hudson.plugins.rolestrategy
Class RoleBasedAuthorizationStrategy.ConverterImpl

java.lang.Object
  extended by com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy.ConverterImpl
All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher
Enclosing class:
RoleBasedAuthorizationStrategy

public static class RoleBasedAuthorizationStrategy.ConverterImpl
extends java.lang.Object
implements com.thoughtworks.xstream.converters.Converter

Converter used to persist and retrieve the strategy from disk.

This converter is there to manually handle the marshalling/unmarshalling of this strategy: Doing so is a little bit dirty but allows to easily update the plugin when new access controlled object (for the moment: Job and Project) will be introduced. If it's the case, there's only the need to update the getRoleMaps() method.


Constructor Summary
RoleBasedAuthorizationStrategy.ConverterImpl()
           
 
Method Summary
 boolean canConvert(java.lang.Class type)
           
protected  RoleBasedAuthorizationStrategy create()
           
 void marshal(java.lang.Object source, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
           
 java.lang.Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleBasedAuthorizationStrategy.ConverterImpl

public RoleBasedAuthorizationStrategy.ConverterImpl()
Method Detail

canConvert

public boolean canConvert(java.lang.Class type)
Specified by:
canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher

marshal

public void marshal(java.lang.Object source,
                    com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                    com.thoughtworks.xstream.converters.MarshallingContext context)
Specified by:
marshal in interface com.thoughtworks.xstream.converters.Converter

unmarshal

public java.lang.Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                                  com.thoughtworks.xstream.converters.UnmarshallingContext context)
Specified by:
unmarshal in interface com.thoughtworks.xstream.converters.Converter

create

protected RoleBasedAuthorizationStrategy create()


Copyright © 2010. All Rights Reserved.