Exemplo n.º 1
0
 private void invitations() {
   int count = 0;
   printer.println("Stored Invitation codes:");
   Collection<Invitation> invitations = core.getInvitaitonManager().allInvitations();
   for (Invitation i : invitations.toArray(new Invitation[invitations.size()])) {
     count++;
     printer.print(i.getCompleteInvitaitonString());
     if (core.getInvitaitonManager()
         .getInvitation(i.getInvitationPassKey())
         .isForwardedInvitation()) {
       printer.println(
           " (Forwarded)  -  Valid next: "
               + Long.toString(
                   (InvitaitonManager.INVITATION_TIMEOUT_FORWARDED
                           - (System.currentTimeMillis() - i.getCreatedAt()))
                       / (1000 * 60))
               + " minutes.");
     } else {
       printer.println(
           " (Manual)  -  Valid next: "
               + Long.toString(
                   (InvitaitonManager.INVITATION_TIMEOUT
                           - (System.currentTimeMillis() - i.getCreatedAt()))
                       / (1000 * 60 * 60))
               + " hours.");
     }
   }
   printer.println("Found " + count + " Invitations.");
 }
Exemplo n.º 2
0
 private void invitationsRemove() {
   int count = 0;
   Collection<Invitation> invitations = core.getInvitaitonManager().allInvitations();
   for (Invitation i : invitations.toArray(new Invitation[invitations.size()])) {
     core.getInvitaitonManager().consume(i.getInvitationPassKey());
     count++;
   }
   printer.println("Removed " + count + " Invitations.");
 }