/** * Get output content source. * * @param conf job configuration * @param hostName host name * @return content source * @throws IOException * @throws XccConfigException * @throws IOException */ public static ContentSource getOutputContentSource(Configuration conf, String hostName) throws XccConfigException, IOException { String user = conf.get(OUTPUT_USERNAME, ""); String password = conf.get(OUTPUT_PASSWORD, ""); String port = conf.get(OUTPUT_PORT,"8000"); String db = conf.get(OUTPUT_DATABASE_NAME); int portInt = Integer.parseInt(port); boolean useSsl = conf.getBoolean(OUTPUT_USE_SSL, false); if (useSsl) { return getSecureContentSource(hostName, portInt, user, password, db, getOutputSslOptions(conf)); } return ContentSourceFactory.newContentSource(hostName, portInt, user, password, db); }
/** * Get input content source. * * @param conf job configuration * @param host host to connect to * @return content source * @throws IOException * @throws XccConfigException */ public static ContentSource getInputContentSource(Configuration conf, String host) throws XccConfigException, IOException { String user = conf.get(INPUT_USERNAME, ""); String password = conf.get(INPUT_PASSWORD, ""); String port = conf.get(INPUT_PORT,"8000"); String db = conf.get(INPUT_DATABASE_NAME); int portInt = Integer.parseInt(port); boolean useSsl = conf.getBoolean(INPUT_USE_SSL, false); if (useSsl) { return getSecureContentSource(host, portInt, user, password, db, getInputSslOptions(conf)); } return ContentSourceFactory.newContentSource(host, portInt, user, password, db); }