Skip to content

Commit 28dad25

Browse files
committed
Tidy code
1 parent c0c5943 commit 28dad25

File tree

2 files changed

+5
-73
lines changed

2 files changed

+5
-73
lines changed

.idea/runConfigurations/Stroom_Grant_admin_to_IDP_user.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stroom-core/src/main/java/stroom/core/receive/ContentAutoCreationServiceImpl.java

+4-72
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
import jakarta.inject.Provider;
5555
import jakarta.inject.Singleton;
5656

57-
import java.nio.file.Path;
5857
import java.util.List;
5958
import java.util.Map;
6059
import java.util.Objects;
@@ -189,15 +188,6 @@ public Optional<FeedDoc> tryCreateFeed(final String feedName,
189188
return optFeedDoc;
190189
}
191190

192-
// private boolean isEligibleForAutoCreation(final UserDesc userDesc,
193-
// final AttributeMap attributeMap) {
194-
// return NullSafe.allNonNull(userDesc, userDesc.getSubjectId(), attributeMap)
195-
// && attributeMap.containsKey(StandardHeaderArguments.ACCOUNT_ID)
196-
// && attributeMap.containsKey(StandardHeaderArguments.COMPONENT)
197-
// && attributeMap.containsKey(StandardHeaderArguments.SCHEMA)
198-
// && attributeMap.containsKey(StandardHeaderArguments.FORMAT);
199-
// }
200-
201191
private UserRef getRunAsUser() {
202192
final AutoContentCreationConfig autoContentCreationConfig = autoContentCreationConfigProvider.get();
203193
final String createAsSubjectId = Objects.requireNonNull(autoContentCreationConfig.getCreateAsSubjectId());
@@ -233,7 +223,7 @@ private Optional<FeedDoc> ensureFeed(final String feedName,
233223
final List<DocRef> feeds = feedStore.findByName(feedName);
234224
if (feeds.isEmpty()) {
235225
try {
236-
docRef = doCreateFeed(feedName, userDesc, attributeMap);
226+
docRef = createFeedAndContent(feedName, userDesc, attributeMap);
237227
} catch (EntityServiceException e) {
238228
// It's possible that another thread/node has created the feed
239229
if (NullSafe.containsIgnoringCase(e.getMessage(), "exists")) {
@@ -255,9 +245,9 @@ private Optional<FeedDoc> ensureFeed(final String feedName,
255245
return Optional.of(feedStore.readDocument(feedDocRef));
256246
}
257247

258-
private DocRef doCreateFeed(final String feedName,
259-
final UserDesc userDesc,
260-
final AttributeMap attributeMap) {
248+
private DocRef createFeedAndContent(final String feedName,
249+
final UserDesc userDesc,
250+
final AttributeMap attributeMap) {
261251

262252
final String destinationPath = cachedDestinationPathTemplator.getValue()
263253
.apply(attributeMap);
@@ -561,62 +551,4 @@ private void createPipelineFromParent(final PipelineDoc parentPipelineDoc,
561551
// Now create the proc filter for the new pipe
562552
createProcessorFilter(streamType, newPipelineDoc.asDocRef(), feedDocRef, contentTemplate);
563553
}
564-
// private Optional<ContentTemplate> getMatchingTemplate(final List<ContentTemplate> activeTemplates,
565-
// final AttributeMap attributeMap) {
566-
// final Map<CIKey, String> caseInSenseAttributes = NullSafe.map(attributeMap)
567-
// .entrySet()
568-
// .stream()
569-
// .collect(Collectors.toMap(
570-
// entry -> CIKey.of(entry.getKey()),
571-
// Entry::getValue));
572-
//
573-
// return activeTemplates.stream()
574-
// .filter(template -> isMatch(template, caseInSenseAttributes))
575-
// .findFirst();
576-
// }
577-
//
578-
// private boolean isMatch(final ContentTemplate contentTemplate,
579-
// final Map<CIKey, String> attributeMap) {
580-
// //T
581-
//// final ExpressionOperator expressionOperator = contentTemplate.getExpression();
582-
////
583-
//// e
584-
//// if (expressionOperator == n)
585-
//// if (expressionOperator instanceof )
586-
//
587-
//
588-
// }
589-
590-
// private boolean isMatch(final ExpressionItem expressionItem,
591-
// final Map<CIKey, String> attributeMap) {
592-
// if (expressionItem == null || !expressionItem.enabled()) {
593-
// return false;
594-
// } else if (expressionItem instanceof ExpressionTerm expressionTerm) {
595-
//
596-
// } else if (expressionItem instanceof ExpressionOperator expressionOperator) {
597-
// expressionOperator.op();
598-
//
599-
// } else {
600-
// throw new RuntimeException("Unexpected ExpressionItem " + expressionItem.getClass());
601-
// }
602-
//
603-
// final ExpressionOperator expressionOperator = contentTemplate.getExpression();
604-
// if (expressionOperator instanceof )
605-
//
606-
//
607-
// }
608-
//
609-
// private boolean isMatch(final ExpressionTerm expressionTerm,
610-
// final Map<CIKey, String> attributeMap) {
611-
//
612-
// }
613-
614-
615-
// --------------------------------------------------------------------------------
616-
617-
618-
private record SourcedContentTemplate(ContentTemplate contentTemplate,
619-
Path sourceFile) {
620-
621-
}
622554
}

0 commit comments

Comments
 (0)