/** * Create WikittyConfig and use props as default value * * @param props as default value */ static public ApplicationConfig getConfig(Properties props) { return getConfig(props, null); }
/** * Create WikittyConfig and use props as default value * * @param props as default value */ static public ApplicationConfig getConfig(Properties props) { return getConfig(props, null); }
/** * Create WikittyConfig and load particular configuration filename * @param configFilename name of wikitty config file */ static public ApplicationConfig getConfig(String configFilename) { return getConfig(null, configFilename); }
/** * Create WikittyConfig and load particular configuration filename * @param configFilename name of wikitty config file */ static public ApplicationConfig getConfig(String configFilename) { return getConfig(null, configFilename); }
static public ApplicationConfig getConfig() { return getConfig(null, null); }
public static String getSandraUrl() { return SandraConfigHelper.getSandraUrl(SandraConfig.getConfig()); } }
@Override public List<String> getTemplates() { String notifierTemplateDir = SandraConfigHelper.getNotifierTemplateDir(SandraConfig.getConfig()); File dir = new File(notifierTemplateDir); Preconditions.checkNotNull(dir, "Failed to find templates dir '" + notifierTemplateDir + "'"); File[] templates = dir.listFiles(); Preconditions.checkNotNull(templates, "Failed to find templates in '" + dir.getPath() + "'"); List<String> names = new ArrayList<String>(templates.length); for (File template : templates) { names.add(template.getName().replace(SandraConfig.NOTIFIER_TEMPLATE_EXTENSION, "")); } return names; }
@Override public List<String> getTemplates() { String notifierTemplateDir = SandraConfigHelper.getNotifierTemplateDir(SandraConfig.getConfig()); File dir = new File(notifierTemplateDir); Preconditions.checkNotNull(dir, "Failed to find templates dir '" + notifierTemplateDir + "'"); File[] templates = dir.listFiles(); Preconditions.checkNotNull(templates, "Failed to find templates in '" + dir.getPath() + "'"); List<String> names = new ArrayList<String>(templates.length); for (File template : templates) { names.add(template.getName().replace(SandraConfig.NOTIFIER_TEMPLATE_EXTENSION, "")); } return names; }
public static String getSandraUrl() { return SandraConfigHelper.getSandraUrl(SandraConfig.getConfig()); } }
public static String getSandraName() { return SandraConfigHelper.getSandraName(SandraConfig.getConfig()); }
@Override public String getTemplate(String name) throws LogicException { try { return FileUtils.readFileToString(SandraConfigHelper.getTemplateFile(SandraConfig.getConfig(), name), "utf8"); } catch (IOException ioe) { log.error("error.service.template.write", ioe); throw new LogicException("error.service.template.read"); } }
@Override public void saveTemplate(String name, String template) throws LogicException { try { FileUtils.writeStringToFile(SandraConfigHelper.getTemplateFile(SandraConfig.getConfig(), name), template, "utf8"); } catch (IOException ioe) { log.error("error.service.template.write", ioe); throw new LogicException("error.service.template.write"); } } }
@Override public void saveTemplate(String name, String template) throws LogicException { try { FileUtils.writeStringToFile(SandraConfigHelper.getTemplateFile(SandraConfig.getConfig(), name), template, "utf8"); } catch (IOException ioe) { log.error("error.service.template.write", ioe); throw new LogicException("error.service.template.write"); } } }
@Override public String getTemplate(String name) throws LogicException { try { return FileUtils.readFileToString(SandraConfigHelper.getTemplateFile(SandraConfig.getConfig(), name), "utf8"); } catch (IOException ioe) { log.error("error.service.template.write", ioe); throw new LogicException("error.service.template.read"); } }
public static TopiaContext getServiceRootContext() throws IOException, TopiaNotFoundException { ApplicationConfig config = SandraConfig.getConfig(); Properties serviceTopiaProperties = SandraConfigHelper.getServiceTopiaProperties(config); return TopiaContextFactory.getContext(serviceTopiaProperties); } }
public static TopiaContext getServiceRootContext(boolean secure) throws IOException, TopiaNotFoundException { ApplicationConfig config = SandraConfig.getConfig(); Properties serviceTopiaProperties = SandraConfigHelper.getServiceTopiaProperties(secure, config); return TopiaContextFactory.getContext(serviceTopiaProperties); } }
public static TopiaContext getSchedulerRootContext() throws IOException, TopiaNotFoundException { ApplicationConfig config = SandraConfig.getConfig(); return TopiaContextFactory.getContext(SandraSchedulerConfigHelper.getSchedulerTopiaProperties(config)); }
public static TopiaContext getSchedulerRootContext() throws IOException, TopiaNotFoundException { ApplicationConfig config = SandraConfig.getConfig(); return TopiaContextFactory.getContext(SandraSchedulerConfigHelper.getSchedulerTopiaProperties(config)); }
public static void sendEmailToAdmin(String subject, String message, String... attachments) { sendEmail(SandraSchedulerConfigHelper.getSandraEmailTo(SandraConfig.getConfig()), subject, message, attachments); }
public static void sendEmailToAdmin(String subject, String message, String... attachments) { sendEmail(SandraSchedulerConfigHelper.getSandraEmailTo(SandraConfig.getConfig()), subject, message, attachments); }