Author: bdaw
Date: 2009-11-18 10:06:43 -0500 (Wed, 18 Nov 2009)
New Revision: 1008
Added:
migration/idm/trunk/example/auth/src/main/java/org/picketlink/
migration/idm/trunk/example/auth/src/main/java/org/picketlink/idm/example/auth/SimplePopulationService.java
Removed:
migration/idm/trunk/example/auth/src/main/java/org/picketlink/idm/example/auth/SimplePopulationService.java
Log:
more renaming...
Copied: migration/idm/trunk/example/auth/src/main/java/org/picketlink (from rev 1005,
migration/idm/trunk/example/auth/src/main/java/org/jboss/identity)
Deleted:
migration/idm/trunk/example/auth/src/main/java/org/picketlink/idm/example/auth/SimplePopulationService.java
===================================================================
---
migration/idm/trunk/example/auth/src/main/java/org/jboss/identity/idm/example/auth/SimplePopulationService.java 2009-11-18
13:42:38 UTC (rev 1005)
+++
migration/idm/trunk/example/auth/src/main/java/org/picketlink/idm/example/auth/SimplePopulationService.java 2009-11-18
15:06:43 UTC (rev 1008)
@@ -1,88 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2009, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-
-package org.jboss.identity.idm.example.auth;
-
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.IdentitySessionFactory;
-import org.jboss.identity.idm.api.User;
-import org.jboss.identity.idm.api.Group;
-
-import javax.naming.InitialContext;
-import javax.naming.Context;
-import java.util.logging.Logger;
-
-public class SimplePopulationService
-{
-
- private static Logger logger =
Logger.getLogger(SimplePopulationService.class.getName());
-
- private String idmSessionFactoryJNDI = "java:/IdentitySessionFactory";
-
- public String getIdmSessionFactoryJNDI()
- {
- return idmSessionFactoryJNDI;
- }
-
- public void setIdmSessionFactoryJNDI(String idmSessionFactoryJNDI)
- {
- this.idmSessionFactoryJNDI = idmSessionFactoryJNDI;
- }
-
- public void start() throws Exception
- {
-
- logger.fine("Starting example population service");
-
- Context ctx = new InitialContext();
- IdentitySessionFactory ids =
(IdentitySessionFactory)ctx.lookup(getIdmSessionFactoryJNDI());
-
- IdentitySession is =
ids.getCurrentIdentitySession("realm://JBossIdentity");
- is.beginTransaction();
-
- if (is.getPersistenceManager().getUserCount() == 0 &&
is.getPersistenceManager().getGroupTypeCount("GROUP") == 0)
- {
- logger.fine("Database content not present. Populating...");
-
-
- User userUser = is.getPersistenceManager().createUser("user");
- User adminUser = is.getPersistenceManager().createUser("admin");
- Group userGroup = is.getPersistenceManager().createGroup("Users",
"GROUP");
- Group adminGroup =
is.getPersistenceManager().createGroup("Administrators", "GROUP");
-
- is.getAttributesManager().updatePassword(userUser, "user");
- is.getAttributesManager().updatePassword(adminUser, "admin");
-
- is.getRelationshipManager().associateUser(adminGroup, adminUser);
- is.getRelationshipManager().associateUser(userGroup, adminUser);
- is.getRelationshipManager().associateUser(userGroup, userUser);
-
- }
-
-
- is.getTransaction().commit();
-
-
-
- }
-}
Copied:
migration/idm/trunk/example/auth/src/main/java/org/picketlink/idm/example/auth/SimplePopulationService.java
(from rev 1007,
migration/idm/trunk/example/auth/src/main/java/org/jboss/identity/idm/example/auth/SimplePopulationService.java)
===================================================================
---
migration/idm/trunk/example/auth/src/main/java/org/picketlink/idm/example/auth/SimplePopulationService.java
(rev 0)
+++
migration/idm/trunk/example/auth/src/main/java/org/picketlink/idm/example/auth/SimplePopulationService.java 2009-11-18
15:06:43 UTC (rev 1008)
@@ -0,0 +1,88 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2009, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+
+package org.picketlink.idm.example.auth;
+
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.IdentitySessionFactory;
+import org.picketlink.idm.api.User;
+import org.picketlink.idm.api.Group;
+
+import javax.naming.InitialContext;
+import javax.naming.Context;
+import java.util.logging.Logger;
+
+public class SimplePopulationService
+{
+
+ private static Logger logger =
Logger.getLogger(SimplePopulationService.class.getName());
+
+ private String idmSessionFactoryJNDI = "java:/IdentitySessionFactory";
+
+ public String getIdmSessionFactoryJNDI()
+ {
+ return idmSessionFactoryJNDI;
+ }
+
+ public void setIdmSessionFactoryJNDI(String idmSessionFactoryJNDI)
+ {
+ this.idmSessionFactoryJNDI = idmSessionFactoryJNDI;
+ }
+
+ public void start() throws Exception
+ {
+
+ logger.fine("Starting example population service");
+
+ Context ctx = new InitialContext();
+ IdentitySessionFactory ids =
(IdentitySessionFactory)ctx.lookup(getIdmSessionFactoryJNDI());
+
+ IdentitySession is =
ids.getCurrentIdentitySession("realm://JBossIdentity");
+ is.beginTransaction();
+
+ if (is.getPersistenceManager().getUserCount() == 0 &&
is.getPersistenceManager().getGroupTypeCount("GROUP") == 0)
+ {
+ logger.fine("Database content not present. Populating...");
+
+
+ User userUser = is.getPersistenceManager().createUser("user");
+ User adminUser = is.getPersistenceManager().createUser("admin");
+ Group userGroup = is.getPersistenceManager().createGroup("Users",
"GROUP");
+ Group adminGroup =
is.getPersistenceManager().createGroup("Administrators", "GROUP");
+
+ is.getAttributesManager().updatePassword(userUser, "user");
+ is.getAttributesManager().updatePassword(adminUser, "admin");
+
+ is.getRelationshipManager().associateUser(adminGroup, adminUser);
+ is.getRelationshipManager().associateUser(userGroup, adminUser);
+ is.getRelationshipManager().associateUser(userGroup, userUser);
+
+ }
+
+
+ is.getTransaction().commit();
+
+
+
+ }
+}