Class OrientDataSetHistoryRepository
- java.lang.Object
-
- com.chutneytesting.component.dataset.infra.OrientDataSetHistoryRepository
-
- All Implemented Interfaces:
DataSetHistoryRepository
@Repository public class OrientDataSetHistoryRepository extends Object implements DataSetHistoryRepository
-
-
Constructor Summary
Constructors Constructor Description OrientDataSetHistoryRepository(OrientComponentDB orientComponentDB)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<org.apache.commons.lang3.tuple.Pair<String,Integer>>addVersion(DataSet newDataSet)Add a given dataset versionMap<Integer,DataSet>allVersions(String externalDataSetId)Retrieve all versions of a dataset with given idIntegerlastVersion(String dataSetId)Retrieve last version of dataset with given idvoidremoveHistory(String externalDataSetId)Delete the version history of dataset with given idDataSetversion(String externalDataSetId, Integer version)Retrieve a specific dataset version
-
-
-
Constructor Detail
-
OrientDataSetHistoryRepository
public OrientDataSetHistoryRepository(OrientComponentDB orientComponentDB)
-
-
Method Detail
-
lastVersion
public Integer lastVersion(String dataSetId)
Description copied from interface:DataSetHistoryRepositoryRetrieve last version of dataset with given id- Specified by:
lastVersionin interfaceDataSetHistoryRepository- Parameters:
dataSetId- The dataset id- Returns:
- The last version number
-
addVersion
public Optional<org.apache.commons.lang3.tuple.Pair<String,Integer>> addVersion(DataSet newDataSet)
Description copied from interface:DataSetHistoryRepositoryAdd a given dataset version- Specified by:
addVersionin interfaceDataSetHistoryRepository- Parameters:
newDataSet- The dataset version to add- Returns:
- The Pair id / version of created version or empty if no differences were found to save
-
allVersions
public Map<Integer,DataSet> allVersions(String externalDataSetId)
Description copied from interface:DataSetHistoryRepositoryRetrieve all versions of a dataset with given id- Specified by:
allVersionsin interfaceDataSetHistoryRepository- Parameters:
externalDataSetId- The dataset id- Returns:
- The map of existing datasets with versions keys
-
version
public DataSet version(String externalDataSetId, Integer version)
Description copied from interface:DataSetHistoryRepositoryRetrieve a specific dataset version- Specified by:
versionin interfaceDataSetHistoryRepository- Parameters:
externalDataSetId- The dataset idversion- The version number- Returns:
- The dataset version
-
removeHistory
public void removeHistory(String externalDataSetId)
Description copied from interface:DataSetHistoryRepositoryDelete the version history of dataset with given id- Specified by:
removeHistoryin interfaceDataSetHistoryRepository- Parameters:
externalDataSetId- Teh dataset id
-
-