Class IndexNaming
Index names are derived from one global base template. The default base is
"attackframework-tool-burp", which produces these default names:
attackframework-tool-burp-exporter, ...-findings, ...-settings,
...-sitemap, and ...-traffic.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResolved index names for one configuration snapshot at one instant.static final classResolved index names for one configuration snapshot at one instant. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncomputeIndexBaseNames(List<String> selectedSources) Returns the default concrete index names required by the selected sources.computeSelectedIndexKeys(List<String> selectedSources) Returns the logical index keys required by the selected sources.static StringconfiguredTemplateForShortName(ConfigState.State state, String shortName) Returns the configured template for the given logical index key.static StringdefaultTemplateForShortName(String shortName, String baseTemplate) Returns the default template for the given short name using the provided base template.static StringdisplayNameForIndexKey(String indexKey) Returns the user-facing display name for one logical index key.Returns the supported logical index keys in display/order-stable form.static StringindexNameForShortName(String shortName) Returns the default concrete index name for the given short name.static StringnormalizeBaseTemplate(String template) Normalizes the stored global base template and falls back to the default when blank.static StringrequireKnownIndexKey(String indexName) Returns the logical key only for default or legacy index names that can be safely inferred.static IndexNaming.ResolutionResultresolveAllConfiguredNames(ConfigState.State state, Instant instant) Resolves every configured logical index name at the provided instant and validates them.static StringresolveConfiguredIndexName(ConfigState.State state, String shortName, Instant instant) Resolves the configured template for one logical index key at the provided instant.static StringresolveTemplate(String template, Instant instant) Replaces supported date/time variables in the provided template.toExportFileNames(List<String> baseNames, boolean jsonlEnabled, boolean bulkNdjsonEnabled) Returns export data file names for the selected on-disk formats.toJsonFileNames(List<String> baseNames) Returns.jsonmapping-file names for the provided index base names.static StringvalidateBaseTemplate(String baseTemplate, Instant instant) Returns a human-readable validation error for the global base template, ornull.validateBaseTemplateDetailed(String baseTemplate, Instant instant) Validates the global base template against the concrete index names it would produce.static StringvalidateResolvedName(String resolvedName) Returns a human-readable validation error, ornullwhen the resolved name is valid.
-
Field Details
-
DEFAULT_BASE_TEMPLATE
- See Also:
-
LEGACY_TOOL_INDEX_NAME
Legacy default Exporter index name retained only for import/back-compat inference.- See Also:
-
INDEX_PREFIX
- See Also:
-
-
Method Details
-
indexKeys
Returns the supported logical index keys in display/order-stable form. -
indexNameForShortName
Returns the default concrete index name for the given short name. -
defaultTemplateForShortName
Returns the default template for the given short name using the provided base template. -
configuredTemplateForShortName
Returns the configured template for the given logical index key. -
resolveConfiguredIndexName
public static String resolveConfiguredIndexName(ConfigState.State state, String shortName, Instant instant) Resolves the configured template for one logical index key at the provided instant. -
resolveAllConfiguredNames
public static IndexNaming.ResolutionResult resolveAllConfiguredNames(ConfigState.State state, Instant instant) Resolves every configured logical index name at the provided instant and validates them.Errors include invalid date/time placeholders, unsupported variable syntax, and invalid OpenSearch index names.
-
requireKnownIndexKey
Returns the logical key only for default or legacy index names that can be safely inferred.Custom configured index names are intentionally rejected so callers do not silently misroute field filtering, stats, or retry accounting by guessing from a physical name.
- Throws:
IllegalArgumentException- when the provided name is not one of the known default or legacy index names
-
displayNameForIndexKey
Returns the user-facing display name for one logical index key. -
computeSelectedIndexKeys
Returns the logical index keys required by the selected sources.Unsupported source names are ignored. The Exporter index is included only when the
exportersource is selected. -
computeIndexBaseNames
Returns the default concrete index names required by the selected sources. -
toJsonFileNames
Returns.jsonmapping-file names for the provided index base names. -
toExportFileNames
public static List<String> toExportFileNames(List<String> baseNames, boolean jsonlEnabled, boolean bulkNdjsonEnabled) Returns export data file names for the selected on-disk formats. -
normalizeBaseTemplate
Normalizes the stored global base template and falls back to the default when blank. -
resolveTemplate
Replaces supported date/time variables in the provided template. -
validateResolvedName
Returns a human-readable validation error, ornullwhen the resolved name is valid. -
validateBaseTemplateDetailed
public static IndexNaming.BaseTemplateValidation validateBaseTemplateDetailed(String baseTemplate, Instant instant) Validates the global base template against the concrete index names it would produce.Blank input is treated as valid because the UI falls back to the default base template. Non-blank values must resolve into valid OpenSearch index names after the fixed suffix for each logical index is appended.
-
validateBaseTemplate
Returns a human-readable validation error for the global base template, ornull.
-