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