本文整理汇总了Java中org.springframework.data.domain.Slice.getContent方法的典型用法代码示例。如果您正苦于以下问题:Java Slice.getContent方法的具体用法?Java Slice.getContent怎么用?Java Slice.getContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.data.domain.Slice
的用法示例。
在下文中一共展示了Slice.getContent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rotate
import org.springframework.data.domain.Slice; //导入方法依赖的package包/类
public void rotate() {
final long start = System.currentTimeMillis();
logger.info("Starting encryption key rotation.");
int rotatedRecordCount = 0;
final long startingNotRotatedRecordCount = encryptedValueDataService
.countAllByCanaryUuid(keySet.getActive().getUuid());
List<UUID> inactiveCanaries = keySet.getInactiveUuids();
Slice<EncryptedValue> valuesEncryptedByOldKey = encryptedValueDataService
.findByCanaryUuids(inactiveCanaries);
while (valuesEncryptedByOldKey.hasContent()) {
for (EncryptedValue value : valuesEncryptedByOldKey.getContent()) {
try {
encryptedValueDataService.rotate(value);
rotatedRecordCount++;
} catch (KeyNotFoundException e) {
logger.error("key not found for value, unable to rotate");
}
}
valuesEncryptedByOldKey = encryptedValueDataService.findByCanaryUuids(inactiveCanaries);
}
final long finish = System.currentTimeMillis();
final long duration = finish - start;
final long endingNotRotatedRecordCount = startingNotRotatedRecordCount - rotatedRecordCount;
if (rotatedRecordCount == 0 && endingNotRotatedRecordCount == 0) {
logger.info("Found no records in need of encryption key rotation.");
} else {
logger.info("Finished encryption key rotation in " + duration + " milliseconds. Details:");
logger.info(" Successfully rotated " + rotatedRecordCount + " item(s)");
logger.info(" Skipped " + endingNotRotatedRecordCount
+ " item(s) due to missing master encryption key(s).");
}
encryptionKeyCanaryMapper.delete(inactiveCanaries);
}
示例2: finishActionAndDeleteTargetsOfFirstRunningGroup
import org.springframework.data.domain.Slice; //导入方法依赖的package包/类
@Step("Finish three actions of the rollout group and delete two targets")
private void finishActionAndDeleteTargetsOfFirstRunningGroup(final Rollout createdRollout) {
// finish group one by finishing targets and deleting targets
final Slice<JpaAction> runningActionsSlice = actionRepository.findByRolloutIdAndStatus(PAGE,
createdRollout.getId(), Status.RUNNING);
final List<JpaAction> runningActions = runningActionsSlice.getContent();
finishAction(runningActions.get(0));
finishAction(runningActions.get(1));
finishAction(runningActions.get(2));
targetManagement.delete(
Arrays.asList(runningActions.get(3).getTarget().getId(), runningActions.get(4).getTarget().getId()));
}
示例3: finishActionAndDeleteTargetsOfSecondRunningGroup
import org.springframework.data.domain.Slice; //导入方法依赖的package包/类
@Step("Finish one action of the rollout group and delete four targets")
private void finishActionAndDeleteTargetsOfSecondRunningGroup(final Rollout createdRollout) {
final Slice<JpaAction> runningActionsSlice = actionRepository.findByRolloutIdAndStatus(PAGE,
createdRollout.getId(), Status.RUNNING);
final List<JpaAction> runningActions = runningActionsSlice.getContent();
finishAction(runningActions.get(0));
targetManagement.delete(
Arrays.asList(runningActions.get(1).getTarget().getId(), runningActions.get(2).getTarget().getId(),
runningActions.get(3).getTarget().getId(), runningActions.get(4).getTarget().getId()));
}
示例4: deleteAllTargetsFromThirdGroup
import org.springframework.data.domain.Slice; //导入方法依赖的package包/类
@Step("Delete all targets of the rollout group")
private void deleteAllTargetsFromThirdGroup(final Rollout createdRollout) {
final Slice<JpaAction> runningActionsSlice = actionRepository.findByRolloutIdAndStatus(PAGE,
createdRollout.getId(), Status.SCHEDULED);
final List<JpaAction> runningActions = runningActionsSlice.getContent();
targetManagement.delete(Arrays.asList(runningActions.get(0).getTarget().getId(),
runningActions.get(1).getTarget().getId(), runningActions.get(2).getTarget().getId(),
runningActions.get(3).getTarget().getId(), runningActions.get(4).getTarget().getId()));
}
示例5: postValidate
import org.springframework.data.domain.Slice; //导入方法依赖的package包/类
/**
* This method handles the complete post validation of all relatedPublications.
*
* @return a list of all post validation errors.
*/
public List<PostValidationMessageDto> postValidate() {
List<PostValidationMessageDto> errors = new ArrayList<>();
Pageable pageable = new PageRequest(0, 100);
Slice<RelatedPublication> relatedPublicationsPage =
this.relatedPublicationRepository.findBy(pageable);
while (relatedPublicationsPage.hasContent()) {
for (RelatedPublication relatedPublication : relatedPublicationsPage.getContent()) {
//Validate Studies
errors = this.postValidateStudies(relatedPublication, errors);
//Validate Variables
errors = this.postValidateVariables(relatedPublication, errors);
//Validate Surveys
errors = this.postValidateSurveys(relatedPublication, errors);
//Validate DataSets
errors = this.postValidateDataSets(relatedPublication, errors);
//Validate Instruments
errors = this.postValidateInstruments(relatedPublication, errors);
//Validate Questions
errors = this.postValidateQuestions(relatedPublication, errors);
}
pageable = pageable.next();
relatedPublicationsPage = this.relatedPublicationRepository.findBy(pageable);
}
return errors;
}