Class InMemoryResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
- java.lang.Object
-
- com.snowflake.connectors.application.ingestion.definition.InMemoryResourceIngestionDefinitionRepository<R>
-
- All Implemented Interfaces:
com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R>
public class InMemoryResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>> extends Object implements com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R>
In memory implementation ofResourceIngestionDefinitionRepository
-
-
Constructor Summary
Constructors Constructor Description InMemoryResourceIngestionDefinitionRepository()
Creates a newInMemoryResourceIngestionDefinitionRepository
, backed by a hashmap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the repository.long
countEnabled()
Optional<R>
fetch(String id)
List<R>
fetchAll()
List<R>
fetchAllById(List<String> ids)
List<R>
fetchAllEnabled()
List<R>
fetchAllWhere(Column condition)
Optional<R>
fetchByResourceId(Object resourceId)
void
save(R resource)
void
saveMany(List<R> resources)
void
setFetchAllWherePredicate(Predicate<Map.Entry<String,R>> fetchAllWherePredicate)
Sets the predicate used by thefetchAllWhere
method.
-
-
-
Constructor Detail
-
InMemoryResourceIngestionDefinitionRepository
public InMemoryResourceIngestionDefinitionRepository()
Creates a newInMemoryResourceIngestionDefinitionRepository
, backed by a hashmap.
-
-
Method Detail
-
fetch
public Optional<R> fetch(String id)
- Specified by:
fetch
in interfacecom.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
-
fetchByResourceId
public Optional<R> fetchByResourceId(Object resourceId)
- Specified by:
fetchByResourceId
in interfacecom.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
-
fetchAllById
public List<R> fetchAllById(List<String> ids)
- Specified by:
fetchAllById
in interfacecom.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
-
fetchAllEnabled
public List<R> fetchAllEnabled()
- Specified by:
fetchAllEnabled
in interfacecom.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
-
fetchAllWhere
public List<R> fetchAllWhere(Column condition)
- Specified by:
fetchAllWhere
in interfacecom.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
-
fetchAll
public List<R> fetchAll()
- Specified by:
fetchAll
in interfacecom.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
-
setFetchAllWherePredicate
public void setFetchAllWherePredicate(Predicate<Map.Entry<String,R>> fetchAllWherePredicate)
Sets the predicate used by thefetchAllWhere
method.- Parameters:
fetchAllWherePredicate
- new predicate
-
countEnabled
public long countEnabled()
- Specified by:
countEnabled
in interfacecom.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
-
save
public void save(R resource)
- Specified by:
save
in interfacecom.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
-
saveMany
public void saveMany(List<R> resources)
- Specified by:
saveMany
in interfacecom.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinitionRepository<R extends com.snowflake.connectors.application.ingestion.definition.ResourceIngestionDefinition<?,?,?,?>>
-
clear
public void clear()
Clears the repository.
-
-