コード例 #1
0
 public String getToken(String user) {
   String passphrase = PropertyManager.getProperty(PropertyManager.PROPERTY_PASSPHRASE);
   String in = user + passphrase;
   String token = MessageDigester.getHash(in);
   // System.out.println("getToken :: user="******" ; token="+token);
   return token;
 }
コード例 #2
0
  private void startScheduler() {
    SchedulerFactory sf = new StdSchedulerFactory();
    try {
      sched = sf.getScheduler();

      JobDetail notificationCleanupJob =
          newJob(NotificationCleanupJob.class)
              .withIdentity("notificationCleanupJob", "chatServer")
              .build();

      CronTrigger notificationTrigger =
          newTrigger()
              .withIdentity("notificationTrigger", "chatServer")
              .withSchedule(
                  cronSchedule(
                      PropertyManager.getProperty(PropertyManager.PROPERTY_CRON_NOTIF_CLEANUP)))
              .build();

      sched.scheduleJob(notificationCleanupJob, notificationTrigger);

      sched.start();

      log.info("Scheduler Started");

    } catch (SchedulerException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    }
  }
コード例 #3
0
 private int getValidity() {
   if (validity_ == -1) {
     validity_ = 25000;
     try {
       validity_ =
           new Integer(PropertyManager.getProperty(PropertyManager.PROPERTY_INTERVAL_STATUS))
               + 10000;
     } catch (Exception e) {
       // do nothing if exception happens, keep 15000 value (=> statusInterval should set)
     }
   }
   return validity_;
 }