public GCMWrapper(GCMProperties props, AsyncHttpClient httpclient, String productName) { this.apiKey = "key=" + props.getGCMApiKey(); this.httpclient = httpclient; this.gcmURI = props.getGCMServer(); String title = props.getNotificationTitle(); this.title = title.replace(Placeholders.PRODUCT_NAME, productName); }
public static void main(String[] args) throws Exception { Map<String, String> cmdProperties = ArgumentsParser.parse(args); ServerProperties serverProperties = new ServerProperties(cmdProperties); LoggerUtil.configureLogging(serverProperties); //required for logging dynamic context System.setProperty("data.folder", serverProperties.getProperty("data.folder")); //required to avoid dependencies within model to server.properties setGlobalProperties(serverProperties); MailProperties mailProperties = new MailProperties(cmdProperties); SmsProperties smsProperties = new SmsProperties(cmdProperties); GCMProperties gcmProperties = new GCMProperties(cmdProperties); TwitterProperties twitterProperties = new TwitterProperties(cmdProperties); Security.addProvider(new BouncyCastleProvider()); boolean restore = Boolean.parseBoolean(cmdProperties.get(ArgumentsParser.RESTORE_OPTION)); start(serverProperties, mailProperties, smsProperties, gcmProperties, twitterProperties, restore); }
TextHolder(GCMProperties gcmProperties) { this.tokenBody = readTokenMailBody(); this.dynamicMailBody = readDynamicMailBody(); this.staticMailBody = readStaticMailBody(); this.templateIdMailBody = readTemplateIdMailBody(); this.pushNotificationBody = gcmProperties.getNotificationBody(); this.resetPassLandingTemplate = readResetPassLandingTemplateAsString(); this.appResetEmailTemplate = readAppResetEmailTemplateAsString(); this.appResetEmailConfirmationTemplate = readAppResetEmailConfirmationTemplateAsString(); this.registerEmailTemplate = readRegisterEmailTemplate(); } }
@GET @Path("/{name}") public Response getConfigByName(@PathParam("name") String name) { switch (name) { case TOKEN_MAIL_BODY : return ok(new Config(name, textHolder.tokenBody).toString()); case SERVER_PROPERTIES_FILENAME : return ok(new Config(name, serverProperties).toString()); case MAIL_PROPERTIES_FILENAME : return ok(new Config(name, new MailProperties(Collections.emptyMap())).toString()); case GCM_PROPERTIES_FILENAME : return ok(new Config(name, new GCMProperties(Collections.emptyMap())).toString()); case TWITTER_PROPERTIES_FILENAME : return ok(new Config(name, new TwitterProperties(Collections.emptyMap())).toString()); default : return badRequest(); } }
this.readingWidgetsWorker = new ReadingWidgetsWorker(sessionDao, userDao, props.getAllowWithoutActiveApp()); this.limits = new Limits(props); this.textHolder = new TextHolder(new GCMProperties(Collections.emptyMap()));