static {
   AWSCredentials creds = new BasicAWSCredentials(getKey(), getSecret());
   snsClient = new AmazonSNSClient(creds);
   String snsEndpoint =
       Configuration.getInstance().getServiceEndpoint(Configuration.SNS_ENDPOINT_KEY);
   if (snsEndpoint != null) {
     snsClient.setEndpoint(snsEndpoint);
   }
 }
Esempio n. 2
0
  private void preloadJournal(TravelLogDAO dao, Logger logger) {

    Configuration config = Configuration.getInstance();
    String bucket = config.getProperty("bundleBucket");
    String path = config.getProperty("bundlePath");
    DataLoader loader = new DataLoader(bucket, path, dao);
    Thread thread = new Thread(loader);
    thread.start();
    try {
      thread.join();
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      logger.log(Level.WARNING, e.getMessage(), e);
    }
  }
 // Initialize the unique bucket name
 static {
   Configuration config = Configuration.getInstance();
   uniqueBucketName =
       (config.getProperty("accessKey") + "-" + PHOTO_BUCKET)
           .toLowerCase(); // AWSSDK requires bucket name to be lower case
 }
 public static String getSecret() {
   Configuration config = Configuration.getInstance();
   return config.getProperty("secretKey");
 }
 public static String getKey() {
   Configuration config = Configuration.getInstance();
   return config.getProperty("accessKey");
 }