[security-dev] initial IDM transaction api/spi
Bill Burke
bburke at redhat.com
Tue Jul 9 16:35:05 EDT 2013
Ok, i've committed an API/SPI for transactional IDM and added it to my
pull request. It would be cool to get some approval for this very very
soon. Not necessarily for pull request, but the actual user-facing API.
A comittement to get it working within 2.5. I'd like to start using
it in my application - yesterday...
Also, this only works for JPA at the moment. It would probably take
some work to get it to work for LDAP and File store. I'd be willing to
work on that too as long as this gets approved.
Here's what it looks like:
IdentityContextFactory factory = new DefaultIdentityContextFactory(config);
IdentityContext ctx = factory.createIdentityContext();
ctx.getTransaction().begin();
Realm partition = ctx.findRealm("myRealm");
IdentityManager idm = ctx.createIdentityManager(partition);
...
ctx.getTransaction().commit();
ctx.close();
factory.close();
UnitTest:
https://github.com/patriot1burke/picketlink/blob/master/modules/idm/tests/src/test/java/org/picketlink/test/idm/individual/JPAIdentityContextTestCase.java
API:
https://github.com/patriot1burke/picketlink/blob/master/modules/idm/api/src/main/java/org/picketlink/idm/IdentityContext.java
https://github.com/patriot1burke/picketlink/blob/master/modules/idm/api/src/main/java/org/picketlink/idm/IdentityContextFactory.java
https://github.com/patriot1burke/picketlink/blob/master/modules/idm/api/src/main/java/org/picketlink/idm/IdentityTransaction.java
SPI:
https://github.com/patriot1burke/picketlink/blob/master/modules/idm/api/src/main/java/org/picketlink/idm/spi/IdentityContextHandler.java
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
More information about the security-dev
mailing list