class PlatformMetadataProvider implements ModelProvider {

    @Override
    public PlatformMetadata getModel(DataTypeInfo dataType, DataTypeInfo videoLayer, long time, PlatformMetadata previousMetadata)
    {
        DataModelCategory category = new DataModelCategory(dataType.getUrl(), Constants.PLATFORM_METADATA_FAMILY,
                dataType.getTypeKey());
        PropertyMatcher<Long> lte = new NumberPropertyMatcher<Long>(Constants.METADATA_TIMESTAMP_PROPERTY_DESCRIPTOR,
                OperatorType.LTE, Long.valueOf(time));
        PropertyMatcher<Long> gte = new NumberPropertyMatcher<Long>(Constants.METADATA_TIMESTAMP_PROPERTY_DESCRIPTOR,
                OperatorType.GTE, Long.valueOf(time - 1000));
        SimpleQuery<PlatformMetadata> query = new SimpleQuery<>(category, Constants.PLATFORM_METADATA_DESCRIPTOR,
                New.list(lte, gte));
        myDataRegistry.performQuery(query);

        PlatformMetadata metadata = null;
        if (query.getResults() != null && !query.getResults().isEmpty())
        {
            for (PlatformMetadata aMetadata : query.getResults())
            {
                if (aMetadata.getTime().getTime() <= time
                        && (metadata == null || metadata.getTime().getTime() < aMetadata.getTime().getTime()))
                {
                    metadata = aMetadata;
                }
            }
        }

        return metadata;
    }

    public  PlatformMetadataProvider(DataRegistry dataRegistry);

}