diff options
| author | ogattaz <olivier@gattaz.com> | 2014-07-07 10:59:14 +0200 |
|---|---|---|
| committer | ogattaz <olivier@gattaz.com> | 2014-07-07 10:59:14 +0200 |
| commit | 6772bfb46b72d859c316a9f6573d0c6be477ad5c (patch) | |
| tree | dafa343584216685e68b6edae37570eb97cf9d0c /src/main/java/com/c2kernel/lookup/LookupManager.java | |
| parent | 2fd193d7936084de91eae46e8c2763914d87ab71 (diff) | |
| parent | 0b689a787288f5a4ba568157905c3a0577f83821 (diff) | |
Merge branch 'master' of ssh://dev.cccs.uwe.ac.uk:22/var/git/cristal-kernel
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/LookupManager.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lookup/LookupManager.java | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/src/main/java/com/c2kernel/lookup/LookupManager.java b/src/main/java/com/c2kernel/lookup/LookupManager.java new file mode 100644 index 0000000..ce1268e --- /dev/null +++ b/src/main/java/com/c2kernel/lookup/LookupManager.java @@ -0,0 +1,85 @@ +package com.c2kernel.lookup;
+
+import java.security.NoSuchAlgorithmException;
+
+import com.c2kernel.common.ObjectAlreadyExistsException;
+import com.c2kernel.common.ObjectCannotBeUpdated;
+import com.c2kernel.common.ObjectNotFoundException;
+
+/**
+ * @author abranson
+ *
+ */
+public interface LookupManager extends Lookup {
+
+ /**
+ * Called when a server starts up. The Lookup implementation should ensure that the initial structure of its directory is valid, and create it on first boot.
+ *
+ * @throws ObjectNotFoundException When initialization data is not found
+ */
+ public void initializeDirectory() throws ObjectNotFoundException;
+
+ // Path management
+
+ /**
+ * Register a new a Path in the directory.
+ *
+ * @param newPath The path to add
+ * @throws ObjectCannotBeUpdated When there is an error writing to the directory
+ * @throws ObjectAlreadyExistsException When the Path has already been registered
+ */
+ public void add(Path newPath) throws ObjectCannotBeUpdated, ObjectAlreadyExistsException;
+
+ /**
+ * Remove a Path from the directory
+ * @param path The path to remove
+ * @throws ObjectCannotBeUpdated When an error occurs writing to the directory
+ */
+ public void delete(Path path) throws ObjectCannotBeUpdated;
+
+ // Role and agent management
+
+ /**
+ * @param role
+ * @param hasJobList
+ * @return
+ * @throws ObjectAlreadyExistsException
+ * @throws ObjectCannotBeUpdated
+ */
+ public RolePath createRole(String role, boolean hasJobList) throws ObjectAlreadyExistsException, ObjectCannotBeUpdated;
+
+ /**
+ * @param agent
+ * @param rolePath
+ * @throws ObjectCannotBeUpdated
+ * @throws ObjectNotFoundException
+ */
+ public void addRole(AgentPath agent, RolePath rolePath) throws ObjectCannotBeUpdated, ObjectNotFoundException;
+
+ /**
+ * @param agent
+ * @param role
+ * @throws ObjectCannotBeUpdated
+ * @throws ObjectNotFoundException
+ */
+ public void removeRole(AgentPath agent, RolePath role) throws ObjectCannotBeUpdated, ObjectNotFoundException;
+
+ /**
+ * @param agent
+ * @param newPassword
+ * @throws ObjectNotFoundException
+ * @throws ObjectCannotBeUpdated
+ * @throws NoSuchAlgorithmException
+ */
+ public void setAgentPassword(AgentPath agent, String newPassword) throws ObjectNotFoundException, ObjectCannotBeUpdated, NoSuchAlgorithmException;
+
+ /**
+ * @param role
+ * @param hasJobList
+ * @throws ObjectNotFoundException
+ * @throws ObjectCannotBeUpdated
+ */
+ public void setHasJobList(RolePath role, boolean hasJobList) throws ObjectNotFoundException, ObjectCannotBeUpdated;
+
+
+}
|
