]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.akb/src/main/java/org/argeo/slc/akb/AkbService.java
work on active environments
[gpl/argeo-slc.git] / runtime / org.argeo.slc.akb / src / main / java / org / argeo / slc / akb / AkbService.java
index 7f5348a2aad9ea5bc7e26878b4cf3a73b364839c..d39e3baa33433e8d33f7ae31ca5c17de4ebe25cf 100644 (file)
@@ -1,11 +1,86 @@
 package org.argeo.slc.akb;
 
+import java.sql.PreparedStatement;
+
 import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 
 /** Provides method interfaces to manage an AKB repository */
 public interface AkbService {
 
-       /** Creates a preconfigured AKB Template */
-       public Node createAkbTemplate(Node parent, String name) throws RepositoryException;
-}
+       /** Exposes injected Repository */
+       public Repository getRepository();
+
+       /** Creates a pre-configured AKB Template */
+       public Node createAkbTemplate(Node parent, String name)
+                       throws RepositoryException;
+
+       /** Creates an instance of a template */
+       public Node createActiveEnv(Node template, String name,
+                       boolean copyDefaultConnectors) throws RepositoryException;
+
+       /** Creates a new pre-configured AKB connector Alias for the given template */
+       public Node createConnectorAlias(Node templateNode, String name,
+                       String connectorType) throws RepositoryException;
+
+       /**
+        * @param templateNode
+        * @param connectorType
+        *            if null, returns all defined connector for this template
+        * @return
+        * @throws RepositoryException
+        */
+       public NodeIterator getDefinedAliases(Node templateNode,
+                       String connectorType) throws RepositoryException;
+
+       
+       /**
+        * @param envNode
+        *            an environment or a template
+        * @param aliasPath
+        *            the path of the parent alias in the corresponding template
+        *            environment used as key
+        * @return the corresponding active connector if found
+        * @throws RepositoryException
+        */
+       public Node getActiveConnectorByAlias(Node envNode, String aliasPath)
+                       throws RepositoryException;
+
+       /**
+        * Shortcut to perform whatever test on a given connector only to check if
+        * URL is correctly defined, if the target system is there and if the
+        * current user has the sufficient credentials to connect
+        * 
+        * If no active environment is defined, try to
+        */
+       public boolean testConnector(Node connector);
+
+       /**
+        * If no active environment is defined, tries to execute query with default
+        * connector defined for the template
+        * 
+        * @param activeEnvironment
+        * @param itemNode
+        * @return
+        */
+       public PreparedStatement prepareJdbcQuery(Node activeEnvironment,
+                       Node itemNode);
+
+       /**
+        * 
+        * @param activeEnvironment
+        * @param itemNode
+        * @return
+        */
+       public String executeCommand(Node activeEnvironment, Node itemNode);
+
+       /**
+        * 
+        * @param activeEnvironment
+        * @param itemNode
+        * @return
+        */
+       public String retrieveFile(Node activeEnvironment, Node itemNode);
+}
\ No newline at end of file