Statistics
| Revision:

root / trunk / libraries / libGDBMS / src / main / java / com / hardcode / gdbms / engine / strategies / Strategy.java @ 10627

History | View | Annotate | Download (3.01 KB)

1
package com.hardcode.gdbms.engine.strategies;
2

    
3
import com.hardcode.driverManager.DriverLoadException;
4
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
5
import com.hardcode.gdbms.engine.instruction.CustomAdapter;
6
import com.hardcode.gdbms.engine.instruction.EvaluationException;
7
import com.hardcode.gdbms.engine.instruction.SelectAdapter;
8
import com.hardcode.gdbms.engine.instruction.SemanticException;
9
import com.hardcode.gdbms.engine.instruction.UnionAdapter;
10
import com.hardcode.gdbms.parser.ParseException;
11

    
12

    
13

    
14
/**
15
 * Interfaz que define las operaciones que se pueden realizar con los
16
 * DataSource. Las distintas implementaciones de esta interfaz ser?n las
17
 * encargadas del uso de los indices, del algoritmo usado para cada operaci?n,
18
 * ...
19
 */
20
public abstract class Strategy {
21
    /**
22
     * Realiza una select a partir de la instrucci?n que se pasa como par?metro
23
     *
24
     * @param instr Objeto con la informaci?n sobre las tablas que entran en
25
     *        juego en la instrucci?n, campos, expresiones condicionales, ...
26
     *
27
     * @return DataSource con el resultado de la instruccion
28
     * @throws SemanticException Si se produce alg?n error sem?ntico
29
     * @throws EvaluationException If the evaluation of any expression fails
30
     * @throws ReadDriverException TODO
31
     * @throws RuntimeException bug
32
     */
33
    public OperationDataSource select(SelectAdapter instr)
34
        throws SemanticException, EvaluationException, ReadDriverException {
35
        throw new RuntimeException(
36
            "This strategy does not support select execution");
37
    }
38

    
39
    /**
40
     * Realiza una union a partir de la instrucci?n que se pasa como par?metro
41
     *
42
     * @param instr Objeto con la informaci?n sobre las tablas que entran en
43
     *        juego en la instrucci?n
44
     *
45
     * @return DataSource con el resultado de la instruccion
46
     * @throws SemanticException Si se produce alg?n error sem?ntico
47
     * @throws DriverLoadException If cannot find the suitable driver to access the data
48
     * @throws ParseException If the union statement contains a select statement and its parse fails
49
     * @throws EvaluationException If there's any problem during expresion evaluation
50
     * @throws ReadDriverException TODO
51
     * @throws RuntimeException bug
52
     */
53
    public OperationDataSource union(UnionAdapter instr)
54
        throws SemanticException, DriverLoadException, ParseException, EvaluationException, ReadDriverException {
55
        throw new RuntimeException(
56
            "This strategy does not support union execution");
57
    }
58

    
59
    /**
60
     * Makes a custom query
61
     *
62
     * @param instr The instruction specifying the custom query
63
     *
64
     * @return The result DataSource
65
     *
66
     * @throws SemanticException If there is some semantic error in the
67
     *         expression
68
     * @throws RuntimeException bug
69
     */
70
    public OperationDataSource custom(CustomAdapter instr)
71
        throws SemanticException {
72
        throw new RuntimeException(
73
            "This strategy does not support custom queries execution");
74
    }
75
}