@CLIMain public void remove() throws IOException { // initialize a profile. Will throw an exception if the path exists File profile = getProfileDirectory(); System.out.println("Validating profile in [" + profile + "]"); Profile p = new Profile(profile); System.out.println("Profile validated - purging"); FileUtils.forceDelete(profile); System.out.println("Profile deleted."); }
@CLIMain public void create() throws IOException { // initialize a profile. Will throw an exception if the path exists File profile = getProfileDirectory(); System.out.println("Creating profile in [" + profile + "]"); Profile.create(profile); System.out.println("Profile successfully created"); }
@CLIMain public void go() throws Exception { // compare the pom.xml with the target/pom_bak.xml File thisPom = new File("pom.xml"); File lastPom = new FileBuilder(new File("target")).name("pom_bak.xml").file(); if (thisPom.exists() && lastPom.exists()) { String thisPomString = FileUtils.readFileToString(thisPom); String lastPomString = FileUtils.readFileToString(lastPom); // compare if (thisPomString.equals(lastPomString)) { System.out.println("Project is up to date"); System.exit(EXIT_PROJECT_UP_TO_DATE); } } // default result - project dirty System.out.println("Project is out of date"); System.exit(EXIT_PROJECT_OUT_OF_DATE); } }
@CLIMain public void go() throws Exception { // compare the pom.xml with the target/pom_bak.xml File thisPom = new File("pom.xml"); File lastPom = new FileBuilder(new File("target")).name("pom_bak.xml").file(); if (thisPom.exists() && lastPom.exists()) { String thisPomString = FileUtils.readFileToString(thisPom); String lastPomString = FileUtils.readFileToString(lastPom); // compare if (thisPomString.equals(lastPomString)) { System.out.println("Project is up to date"); System.exit(EXIT_PROJECT_UP_TO_DATE); } } // default result - project dirty System.out.println("Project is out of date"); System.exit(EXIT_PROJECT_OUT_OF_DATE); } }
@CLIMain public void execute() throws IOException, SQLException
@CLIMain public void remove() throws IOException { File profile = getProfileDirectory(); Profile p = new Profile(profile); System.out.println("Removing sql-server connection in profile [" + profile + "]"); Map<String, DatabaseConnection> conns = p.connections(); if (!conns.containsKey(name)) { System.out.println("ERROR: Connection name [" + name + "] not found."); exit(-1); } conns.get(name).remove(); p.persist(); System.out.println("Connection removed successfully"); }
@CLIMain public void create() throws IOException { File profile = getProfileDirectory(); Profile p = new Profile(profile); System.out.println("Creating H2 connection in profile [" + profile + "]"); p.newH2Connection().name(name).path(new File(path)).create(); p.persist(); System.out.println("Connection created successfully"); }
@CLIMain public void main() throws IOException, Fault { webServicesHub.startWorkflow(
@CLIMain public void _import() throws IOException, SQLException { File profile = getProfileDirectory(); Profile p = new Profile(profile); ReportingArea reportingArea = p.defaultReportingArea(); if (reportingAreaName != null) { reportingArea = p.defaultReportingArea().reportingAreas().get(reportingAreaName); if (reportingArea == null) { throw new IllegalArgumentException("Reporting area [" + reportingAreaName + "] not found"); } } System.out.println("Importing fact in profile [" + profile + "] into reporting area [" + reportingArea.qualifiedName() + "]"); Map<String, DatabaseConnection> conns = p.connections(); if (!conns.containsKey(connectionName)) { System.out.println("ERROR: Connection name [" + connectionName + "] not found."); exit(-1); } DatabaseConnection conn = conns.get(connectionName); reportingArea.generateKeys(conn, null); p.persist(); System.out.println("Keys imported successfully"); }
@CLIMain public void _import() throws IOException, SQLException { File profile = getProfileDirectory(); Profile p = new Profile(profile); ReportingArea reportingArea = p.defaultReportingArea(); if (reportingAreaName != null) { reportingArea = p.defaultReportingArea().reportingAreas().get(reportingAreaName); if (reportingArea == null) { throw new IllegalArgumentException("Reporting area [" + reportingAreaName + "] not found"); } } System.out.println("Importing fact in profile [" + profile + "] into reporting area [" + reportingArea.qualifiedName() + "]"); Map<String, DatabaseConnection> conns = p.connections(); if (!conns.containsKey(connectionName)) { System.out.println("ERROR: Connection name [" + connectionName + "] not found."); exit(-1); } DatabaseConnection conn = conns.get(connectionName); reportingArea.loadFactFromMetaData(conn, ObjectUtils.firstNonNull(schema, conn.defaultSchema()), name); p.persist(); System.out.println("Fact imported successfully"); }
@CLIMain public void _import() throws IOException, SQLException { File profile = getProfileDirectory(); Profile p = new Profile(profile); ReportingArea reportingArea = p.defaultReportingArea(); if (reportingAreaName != null) { reportingArea = p.defaultReportingArea().reportingAreas().get(reportingAreaName); if (reportingArea == null) { throw new IllegalArgumentException("Reporting area [" + reportingAreaName + "] not found"); } } System.out.println("Importing dimension in profile [" + profile + "] into reporting area [" + reportingArea.qualifiedName() + "]"); Map<String, DatabaseConnection> conns = p.connections(); if (!conns.containsKey(connectionName)) { System.out.println("ERROR: Connection name [" + connectionName + "] not found."); exit(-1); } DatabaseConnection conn = conns.get(connectionName); reportingArea.loadDimensionFromMetaData(conn, ObjectUtils.firstNonNull(schema, conn.defaultSchema()), name); p.persist(); System.out.println("Dimension imported successfully"); }
@CLIMain public void create() throws IOException { File profile = getProfileDirectory(); Profile p = new Profile(profile); System.out.println("Creating Oracle connection in profile [" + profile + "]"); OracleConnectionBuilder sqlServerConnectionBuilder = p.newOracleConnection().name(name).serverName(serverName); sqlServerConnectionBuilder.username(sqlUser); sqlServerConnectionBuilder.password(sqlPass); if (serviceName != null) { sqlServerConnectionBuilder.serviceName(serviceName); } if (port != -1) { sqlServerConnectionBuilder.port(port); } sqlServerConnectionBuilder.create(); p.persist(); System.out.println("Connection created successfully"); }
@CLIMain public void create() throws IOException
@CLIMain public void main() throws IOException, Fault { try {
@CLIMain public void go(String [] argv) throws Exception { File root = new FileBuilder(WORKING_ROOT).subdir("target").mkdirs().file();