Examples of ChronicleImpl


Examples of ch.agent.crnickl.impl.ChronicleImpl

        BasicDBObject obj = (BasicDBObject) cursor.next();
        ObjectId chrOid = obj.getObjectId(MongoDatabase.FLD_ATTR_CHRON);
        Surrogate chronicle = makeSurrogate(db, DBObjectType.CHRONICLE, chrOid);
        try {
          check(Permission.READ, chronicle);
          result.add(new ChronicleImpl(chronicle));
        } catch (T2DBException e) {
          // ignore "unreadable" chronicles
        }
      }
    } catch (Exception e) {
View Full Code Here

Examples of ch.agent.crnickl.impl.ChronicleImpl

    Throwable cause = null;
    if (obj != null)
      try {
        ObjectId chrOid = obj.getObjectId(MongoDatabase.FLD_SER_CHRON);
        int serNum = obj.getInt(MongoDatabase.FLD_SER_NUM);
        Chronicle chronicle = new ChronicleImpl(
            makeSurrogate(s.getDatabase(), DBObjectType.CHRONICLE, chrOid));
        check(Permission.READ, chronicle);
        Series<T> series = new SeriesImpl<T>(chronicle, null, serNum, s);
        return series;
      } catch (Exception e) {
View Full Code Here

Examples of ch.agent.crnickl.impl.ChronicleImpl

      data.setSurrogate(s);
      data.setName(obj.getString(MongoDatabase.FLD_CHRON_NAME));
      data.setDescription(obj.getString(MongoDatabase.FLD_CHRON_DESC));
      ObjectId parentId = obj.getObjectId(MongoDatabase.FLD_CHRON_PARENT);
      data.setCollection(parentId == null ? db.getTopChronicle() :
        new ChronicleImpl(makeSurrogate(db, DBObjectType.CHRONICLE, parentId)));
      ObjectId schemaId = obj.getObjectId(MongoDatabase.FLD_CHRON_SCHEMA);
      data.setSchema(schemaId == null ? null : makeSurrogate(db, DBObjectType.SCHEMA, schemaId));
      Chronicle chronicle = new ChronicleImpl(data);
      return chronicle;
    } catch (ClassCastException e) {
      throw T2DBMMsg.exception(e, J.J81010, obj.toString());
    }
  }
View Full Code Here

Examples of ch.agent.crnickl.impl.ChronicleImpl

        data.setSurrogate(surrogate);
        data.setName(rs.getString(2));
        data.setDescription(rs.getString(4));
        int collection = rs.getInt(1);
        data.setCollection(collection == 0 ? surrogate.getDatabase().getTopChronicle() :
          new ChronicleImpl(makeSurrogate(surrogate.getDatabase(), DBObjectType.CHRONICLE, collection)));
        int schema = rs.getInt(3);
        data.setSchema(schema == 0 ? null : makeSurrogate(surrogate.getDatabase(), DBObjectType.SCHEMA, schema));
        chronicle = new ChronicleImpl(data);
        check(Permission.READ, chronicle);
      }
      rs.close();
    } catch (SQLException e) {
      cause = e;
View Full Code Here

Examples of ch.agent.crnickl.impl.ChronicleImpl

        int schema = rs.getInt(2);
        data.setCollection(parent);
        data.setSchema(schema == 0 ? null : makeSurrogate(parent.getSurrogate().getDatabase(), DBObjectType.SCHEMA, schema));
        data.setName(name);
        data.setDescription(rs.getString(3));
        chronicle = new ChronicleImpl(data);
        boolean permitted = check(Permission.READ, chronicle, false);
        if (!permitted)
          chronicle = null;
      }
      rs.close();
View Full Code Here

Examples of ch.agent.crnickl.impl.ChronicleImpl

          int schema = rs.getInt(2);
          data.setCollection(parent);
          data.setSchema(schema == 0 ? null : makeSurrogate(database, DBObjectType.SCHEMA, schema));
          data.setName(rs.getString(3));
          data.setDescription(rs.getString(4));
          Chronicle chronicle = new ChronicleImpl(data);
          check(Permission.READ, chronicle);
          result.add(chronicle);
        }
        rs.close();
      } catch (SQLException e) {
View Full Code Here

Examples of ch.agent.crnickl.impl.ChronicleImpl

      sel_entities_by_attribute.setString(1, stringValue);
      sel_entities_by_attribute.setInt(2, getId(property));
      ResultSet rs = sel_entities_by_attribute.executeQuery();
      while (rs.next()) {
        Surrogate surrogate = makeSurrogate(property.getSurrogate().getDatabase(), DBObjectType.CHRONICLE, rs.getInt(1));
        Chronicle chronicle = new ChronicleImpl(surrogate);
        check(Permission.READ, chronicle);
        chronicles.add(chronicle);
        if (maxSize > 0 && chronicles.size() >= maxSize)
          break;
      }
View Full Code Here

Examples of ch.agent.crnickl.impl.ChronicleImpl

      select_series_by_id = open(SELECT_SERIES_BY_ID, surrogate, select_series_by_id);
      int id = getId(surrogate);
      select_series_by_id.setInt(1, id);
      ResultSet rs = select_series_by_id.executeQuery();
      if (rs.next()) {
        Chronicle chronicle = new ChronicleImpl(makeSurrogate(surrogate.getDatabase(), DBObjectType.CHRONICLE, rs.getInt(1)));
        return new SeriesImpl<T>(chronicle, null, rs.getInt(2), surrogate);
      } else
        return null;
    } catch (SQLException e) {
      throw T2DBMsg.exception(e, E.E50119, surrogate.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.