]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.akb/src/main/java/org/argeo/slc/akb/AkbService.java
1f5d998c6483cbcc8230cc25af8648b1bc17da6e
[gpl/argeo-slc.git] / runtime / org.argeo.slc.akb / src / main / java / org / argeo / slc / akb / AkbService.java
1 package org.argeo.slc.akb;
2
3 import java.sql.PreparedStatement;
4
5 import javax.jcr.Node;
6 import javax.jcr.NodeIterator;
7 import javax.jcr.RepositoryException;
8
9 /** Provides method interfaces to manage an AKB repository */
10 public interface AkbService {
11
12 /** Creates a pre-configured AKB Template */
13 public Node createAkbTemplate(Node parent, String name)
14 throws RepositoryException;
15
16 /** Creates a new pre-configured AKB connector Alias for the given template */
17 public Node createConnectorAlias(Node templateNode, String name,
18 String connectorType) throws RepositoryException;
19
20 /**
21 * @param templateNode
22 * @param connectorType
23 * if null, returns all defined connector for this template
24 * @return
25 * @throws RepositoryException
26 */
27 public NodeIterator getDefinedAliases(Node templateNode,
28 String connectorType) throws RepositoryException;
29
30 /**
31 * @param envNode
32 * an environment or a template
33 * @param aliasPath
34 * the path of the parent alias in the corresponding template
35 * environment used as key
36 * @return the corresponding active connector if found
37 * @throws RepositoryException
38 */
39 public Node getActiveConnectorByAlias(Node envNode, String aliasPath)
40 throws RepositoryException;
41
42 /**
43 * Shortcut to perform whatever test on a given connector only to check if
44 * URL is correctly defined, if the target system is there and if the
45 * current user has the sufficient credentials to connect
46 *
47 * If no active environment is defined, try to
48 */
49 public boolean testConnector(Node connector);
50
51 /**
52 * If no active environment is defined, tries to execute query with default
53 * connector defined for the template
54 *
55 * @param activeEnvironment
56 * @param itemNode
57 * @return
58 */
59 public PreparedStatement prepareJdbcQuery(Node activeEnvironment,
60 Node itemNode);
61
62 /**
63 *
64 * @param activeEnvironment
65 * @param itemNode
66 * @return
67 */
68 public String executeCommand(Node activeEnvironment, Node itemNode);
69
70 /**
71 *
72 * @param activeEnvironment
73 * @param itemNode
74 * @return
75 */
76 public String retrieveFile(Node activeEnvironment, Node itemNode);
77 }