Esempio n. 1
0
  public Account load(ObjectId id) {

    try {
      return repository.findOneById(id);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    return null;
  }
  @Override
  public Output load(String streamOutputId) throws NotFoundException {
    final Output output = coll.findOneById(streamOutputId);
    if (output == null) {
      throw new NotFoundException("Couldn't find output with id " + streamOutputId);
    }

    return output;
  }
  public MailContext getMailContext(String asociatedWorflow) {

    MailContext mail = null;
    try {
      this.db = getConnection();
      this.dbCollectionMail =
          db.getCollection(DatabaseConnectionConfig.getInstance().getMailCollection());
      // this.dbCollectionMail = db.getCollection("alarms");
      JacksonDBCollection<MailContext, String> coll;
      coll = JacksonDBCollection.wrap(this.dbCollectionMail, MailContext.class, String.class);
      mail = coll.findOneById(asociatedWorflow);

    } catch (UnknownHostException ex) {
      Logger.getLogger(DaoMailContext.class.getName()).log(Level.SEVERE, null, ex);
    }

    return mail;
  }
 private String getUsernameFromPlayerId(String playerId) {
   return playerCollection.findOneById(playerId).getUsername();
 }
 public GameLog findGameLogById(String id) {
   return gameLogCollection.findOneById(id);
 }
 @Override
 public Shipment getShipment(String id) {
   Shipment r = shipments.findOneById(id);
   return r;
 }