Author: anil.saldhana(a)jboss.com
Date: 2008-07-10 04:41:59 -0400 (Thu, 10 Jul 2008)
New Revision: 12
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java
Modified:
trunk/identity-api/.classpath
trunk/identity-api/pom.xml
Log:
JBID-5: managers
Modified: trunk/identity-api/.classpath
===================================================================
--- trunk/identity-api/.classpath 2008-07-10 08:41:27 UTC (rev 11)
+++ trunk/identity-api/.classpath 2008-07-10 08:41:59 UTC (rev 12)
@@ -2,5 +2,6 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/identity-model"/>
<classpathentry kind="output" path="target/eclipse-classes"/>
</classpath>
Modified: trunk/identity-api/pom.xml
===================================================================
--- trunk/identity-api/pom.xml 2008-07-10 08:41:27 UTC (rev 11)
+++ trunk/identity-api/pom.xml 2008-07-10 08:41:59 UTC (rev 12)
@@ -28,6 +28,11 @@
</scm>
<dependencies>
<dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-model</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java 2008-07-10
08:41:59 UTC (rev 12)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.api.managers;
+
+import java.io.InputStream;
+
+import org.jboss.identity.model.Identity;
+import org.jboss.identity.model.Role;
+import org.jboss.identity.model.RoleType;
+import org.jboss.identity.model.domain.Realm;
+import org.jboss.identity.model.groups.Group;
+
+/**
+ * Performs Operations associated with a Realm
+ * including the models
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 10, 2008
+ */
+public interface IdentityManager
+{
+ /**
+ * <p>Create a Realm or return an already
+ * created realm. Bootstrapping includes generating
+ * the models in the realm</p>
+ * @param realmName
+ * @return
+ */
+ Realm bootstrap(String realmName);
+
+ /**
+ * <p>Bootstrap a realm given a configuration</p>
+ * @param realmName
+ * @param config
+ * @return
+ */
+ Realm bootstrap(String realmName, InputStream config);
+
+ /**
+ * <p>Return a realm</p>
+ * @param realmName
+ * @param shouldBootstrap Should we bootstrap if a realm does not exist?
+ * (Default: true)
+ * @return
+ */
+ Realm getRealm(String realmName, boolean shouldBootstrap);
+
+ /**
+ * <p>Create an identity in the realm</p>
+ * @param realm
+ * @param identityName
+ * @return
+ */
+ Identity createIdentity(Realm realm, String identityName);
+
+ /**
+ * <p>Create a group in the realm</p>
+ * @param realm
+ * @param groupName
+ * @return
+ */
+ Group createGroup(Realm realm, String groupName);
+
+ /**
+ * <p>Create a role in the realm</p>
+ * @param realm
+ * @param roleName name of role
+ * @param roleType Type of Role
+ * @return
+ */
+ Role createRole(Realm realm, String roleName, RoleType roleType);
+}
\ No newline at end of file
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java
===================================================================
---
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java 2008-07-10
08:41:59 UTC (rev 12)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.api.managers;
+
+import org.jboss.identity.model.domain.Realm;
+import org.jboss.identity.model.groups.Group;
+import org.jboss.identity.model.relation.RelationshipType;
+
+/**
+ * Manages the relationships between
+ * groups, realms
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jul 10, 2008
+ */
+public interface RelationshipManager
+{
+ /**
+ * <p>Associate a relationship between two groups</p>
+ * @param groupA
+ * @param groupB
+ * @param relationshipType
+ */
+ void associate(Group groupA, Group groupB, RelationshipType relationshipType);
+
+ /**
+ * <p>Associate a relationship between two realms</p>
+ * @param realmA
+ * @param realmB
+ * @param relationshipType
+ */
+ void associate(Realm realmA, Realm realmB, RelationshipType relationshipType);
+}
\ No newline at end of file