Search in sources :

Example 1 with JaqyExporter

use of com.teradata.jaqy.interfaces.JaqyExporter in project jaqy by Teradata.

the class ExportCommand method execute.

@Override
public void execute(String[] args, boolean silent, JaqyInterpreter interpreter) throws Exception {
    if (args.length == 0) {
        JaqyExporter exporter = interpreter.getExporter();
        if (exporter == null) {
            interpreter.println("No current exports.");
        } else {
            interpreter.println(getCommand() + " " + exporter.getName());
        }
    } else {
        String name = args[0];
        args = StringUtils.shiftArgs(args);
        JaqyExporter exporter = interpreter.getGlobals().getExporterManager().getHandler(name, args, interpreter);
        if (exporter == null) {
            interpreter.error("invalid format name: " + name);
        }
        interpreter.setExporter(exporter);
    }
}
Also used : JaqyExporter(com.teradata.jaqy.interfaces.JaqyExporter)

Example 2 with JaqyExporter

use of com.teradata.jaqy.interfaces.JaqyExporter in project jaqy by Teradata.

the class PipeImporterFactory method getHandler.

@Override
public PipeImporter getHandler(CommandLine cmdLine, JaqyInterpreter interpreter) throws Exception {
    JaqyExporter exporter = interpreter.getExporter();
    if (exporter == null)
        interpreter.error("No current pipe export.");
    else if (!(exporter instanceof PipeExporter))
        interpreter.error("Current export is not a pipe export.");
    JaqyResultSet rs = ((PipeExporter) exporter).getResultSet();
    if (rs == null)
        interpreter.error("Data has not been exported.");
    interpreter.setExporter(null);
    return new PipeImporter(rs, interpreter.getGlobals());
}
Also used : PipeExporter(com.teradata.jaqy.exporter.PipeExporter) JaqyResultSet(com.teradata.jaqy.interfaces.JaqyResultSet) JaqyExporter(com.teradata.jaqy.interfaces.JaqyExporter)

Aggregations

JaqyExporter (com.teradata.jaqy.interfaces.JaqyExporter)2 PipeExporter (com.teradata.jaqy.exporter.PipeExporter)1 JaqyResultSet (com.teradata.jaqy.interfaces.JaqyResultSet)1