/** * Creates a new instance. * * @param source * The feature source. * @param featureLoader * Provides access to the feature collection within the entity. */ public FeatureHistoryPopulator(ReleasableIterator<DbFeatureHistory<Tdbf>> source, FeatureCollectionLoader<Te, Tf> featureLoader) { this.source = new PeekableIterator<DbFeatureHistory<Tdbf>>(source); this.featureLoader = featureLoader; }
/** * Creates a new instance. * * @param sourceIterator * An iterator containing full entity history ordered by type, identifier and * version. */ public EntityHistoryListReader(ReleasableIterator<ChangeContainer> sourceIterator) { this.sourceIterator = new PeekableIterator<ChangeContainer>(sourceIterator); }
/** * Creates a new instance. * * @param sourceIterator * An iterator containing full entity history ordered by type, identifier and * version. */ public EntityHistoryListReader(ReleasableIterator<ChangeContainer> sourceIterator) { this.sourceIterator = new PeekableIterator<ChangeContainer>(sourceIterator); }
/** * Creates a new instance. * * @param source * The feature source. * @param featureLoader * Provides access to the feature collection within the entity. */ public FeaturePopulatorImpl(ReleasableIterator<Tdbf> source, FeatureCollectionLoader<Te, Tf> featureLoader) { this.source = new PeekableIterator<Tdbf>(source); this.featureLoader = featureLoader; }
/** * Creates a new instance. * * @param source * The feature source. * @param featureLoader * Provides access to the feature collection within the entity. */ public FeatureHistoryPopulator(ReleasableIterator<DbFeatureHistory<Tdbf>> source, FeatureCollectionLoader<Te, Tf> featureLoader) { this.source = new PeekableIterator<DbFeatureHistory<Tdbf>>(source); this.featureLoader = featureLoader; }
/** * Creates a new instance. * * @param sourceIterator * An iterator containing the full history for entities. */ public DeltaToDiffReader( ReleasableIterator<ChangeContainer> sourceIterator) { this.sourceIterator = new PeekableIterator<List<ChangeContainer>>(new EntityHistoryListReader(sourceIterator)); nextValueLoaded = false; }
/** * Creates a new instance. * * @param sourceIterator * An iterator containing the full history for entities. */ public DeltaToDiffReader( ReleasableIterator<ChangeContainer> sourceIterator) { this.sourceIterator = new PeekableIterator<List<ChangeContainer>>(new EntityHistoryListReader(sourceIterator)); nextValueLoaded = false; }
/** * Creates a new instance. * * @param sourceIterator * An iterator containing the full history for entities. * @param snapshotInstant * The state of the entity at this point in time will be dumped. * This ensures a consistent snapshot. */ public EntitySnapshotReader( ReleasableIterator<ChangeContainer> sourceIterator, Date snapshotInstant) { this.sourceIterator = new PeekableIterator<List<ChangeContainer>>(new EntityHistoryListReader(sourceIterator)); this.snapshotInstant = snapshotInstant; nextValueLoaded = false; }
/** * Creates a new instance. * * @param sourceIterator * An iterator containing the full history for entities. * @param snapshotInstant * The state of the entity at this point in time will be dumped. * This ensures a consistent snapshot. */ public EntitySnapshotReader( ReleasableIterator<ChangeContainer> sourceIterator, Date snapshotInstant) { this.sourceIterator = new PeekableIterator<List<ChangeContainer>>(new EntityHistoryListReader(sourceIterator)); this.snapshotInstant = snapshotInstant; nextValueLoaded = false; }
/** * Creates a new instance. * * @param dbCtx * The database context to use for accessing the database. */ public RelationReader(DatabaseContext dbCtx) { super(dbCtx, new RelationMapper()); relationMemberReader = new PeekableIterator<DbOrderedFeature<RelationMember>>( new EntityFeatureTableReader<RelationMember, DbOrderedFeature<RelationMember>>( dbCtx, new RelationMemberMapper()) ); }
/** * Creates a new instance. * * @param dbCtx * The database context to use for accessing the database. */ public WayReader(DatabaseContext dbCtx) { super(dbCtx, new WayMapper()); wayNodeReader = new PeekableIterator<DbOrderedFeature<WayNode>>( new EntityFeatureTableReader<WayNode, DbOrderedFeature<WayNode>>(dbCtx, new WayNodeMapper()) ); }
/** * Creates a new instance. * * @param dbCtx * The database context to use for accessing the database. * @param constraintTable * The table containing a column named id defining the list of * entities to be returned. */ public RelationReader(DatabaseContext dbCtx, String constraintTable) { super(dbCtx, new RelationMapper(), constraintTable); relationMemberReader = new PeekableIterator<DbOrderedFeature<RelationMember>>( new EntityFeatureTableReader<RelationMember, DbOrderedFeature<RelationMember>>( dbCtx, new RelationMemberMapper(), constraintTable) ); }
/** * Creates a new instance. * * @param dbCtx * The database context to use for accessing the database. * @param constraintTable * The table containing a column named id defining the list of * entities to be returned. */ public WayReader(DatabaseContext dbCtx, String constraintTable) { super(dbCtx, new WayMapper(), constraintTable); wayNodeReader = new PeekableIterator<DbOrderedFeature<WayNode>>( new EntityFeatureTableReader<WayNode, DbOrderedFeature<WayNode>>( dbCtx, new WayNodeMapper(), constraintTable) ); }
/** * Creates a new instance. * * @param dbCtx * The database context to use for accessing the database. * @param entityMapper * The database mapper for the entity type. */ public EntityReader(DatabaseContext dbCtx, EntityMapper<T> entityMapper) { // The postgres jdbc driver doesn't appear to allow concurrent result // sets on the same connection so only the last opened result set may be // streamed. The rest of the result sets must be persisted first. entityReader = new PersistentIterator<T>( new SingleClassObjectSerializationFactory(entityMapper.getEntityClass()), new EntityTableReader<T>(dbCtx, entityMapper), "ent", true ); entityTagReader = new PeekableIterator<DbFeature<Tag>>( new PersistentIterator<DbFeature<Tag>>( new SingleClassObjectSerializationFactory(DbFeature.class), new EntityFeatureTableReader<Tag, DbFeature<Tag>>(dbCtx, new TagMapper(entityMapper.getEntityName())), "enttag", true ) ); }
true ); entityTagReader = new PeekableIterator<DbFeature<Tag>>( new PersistentIterator<DbFeature<Tag>>( new SingleClassObjectSerializationFactory(DbFeature.class),