@Override
 public Contests getListOfContestsByDate(long date) throws RegisterException {
   ISearchController search = LogicFacade.getSearchController(user);
   Contests result = new Contests();
   SimpleDateFormat fmt = new SimpleDateFormat("yyyy.MM.dd");
   String searchDate = fmt.format(new Date(date));
   try {
     search.start();
     List<ITransferContest> contests = search.getContests();
     List<CTOContest> tmps = new LinkedList<CTOContest>();
     for (int i = 0; i < contests.size(); i++) {
       if (fmt.format(contests.get(i).getStart()).equals(searchDate)) {
         tmps.add(SVMCorbaServer.getInstance().addCTOContest(new CTOContestImpl(contests.get(i))));
       }
     }
     result.contests = (CTOContest[]) tmps.toArray(new CTOContest[0]);
     search.commit();
   } catch (IllegalGetInstanceException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (NoSessionFoundException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (NotAllowException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (RemoteException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (ExistingTransactionException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (InstantiationException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (NoTransactionException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (IllegalAccessException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (NotSupportedException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   }
   return result;
 }
  @Override
  public Contests getListOfContestsByTeam(CTOTeam team) {
    ITeamController teamController =
        LogicFacade.getTeamController(
            user, (ITransferTeam) SVMCorbaServer.getInstance().getCTO(team).getTransferObject());
    Contests result = new Contests();

    try {
      teamController.start();
      List<ITransferContest> contests = teamController.getContests();
      List<CTOContest> tmps = new LinkedList<CTOContest>();
      for (int i = 0; i < contests.size(); i++) {
        tmps.add(SVMCorbaServer.getInstance().addCTOContest(new CTOContestImpl(contests.get(i))));
      }
      result.contests = (CTOContest[]) tmps.toArray(new CTOContest[0]);
      teamController.commit();
    } catch (NoSessionFoundException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (IllegalGetInstanceException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (RemoteException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (NotSupportedException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (InstantiationException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (IllegalAccessException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (NoTransactionException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (ExistingTransactionException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (RegisterException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    }
    return result;
  }
  @Override
  public Teams getListOfTeams() throws RegisterException {
    ISearchController search = LogicFacade.getSearchController(user);
    Teams result = new Teams();
    try {
      search.start();
      List<ITransferTeam> teams = search.getTeams();

      result.teams = new CTOTeam[teams.size()];
      for (int i = 0; i < teams.size(); i++) {
        result.teams[i] = SVMCorbaServer.getInstance().addCTOTeam(new CTOTeamImpl(teams.get(i)));
      }
      search.commit();
    } catch (IllegalGetInstanceException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (NoSessionFoundException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (NotAllowException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (RemoteException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (ExistingTransactionException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (InstantiationException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (NoTransactionException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (IllegalAccessException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    } catch (NotSupportedException e) {
      e
          .printStackTrace(); // To change body of catch statement use File | Settings | File
                              // Templates.
    }
    return result;
  }
 @Override
 public Matches getListOfMatches(CTOContest contest) throws RegisterException {
   Matches result = new Matches();
   try {
     IContestController contestController =
         LogicFacade.getContestController(
             user,
             (ITransferContest) SVMCorbaServer.getInstance().getCTO(contest).getTransferObject());
     contestController.start();
     List<ITransferMatch> matches = contestController.getMatches();
     result.matches = new CTOMatch[matches.size()];
     for (int i = 0; i < matches.size(); i++) {
       result.matches[i] =
           SVMCorbaServer.getInstance().addCTOMatch(new CTOMatchImpl(matches.get(i)));
     }
     contestController.commit();
   } catch (IllegalAccessException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (InstantiationException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (RemoteException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (NoSessionFoundException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (IllegalGetInstanceException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (NotSupportedException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (NoTransactionException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   } catch (ExistingTransactionException e) {
     e
         .printStackTrace(); // To change body of catch statement use File | Settings | File
                             // Templates.
   }
   return result;
 }