|
| 1 | +/* |
| 2 | + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one |
| 3 | + * or more contributor license agreements. Licensed under the Elastic License; |
| 4 | + * you may not use this file except in compliance with the Elastic License. |
| 5 | + */ |
| 6 | + |
| 7 | +package org.elasticsearch.xpack.core.dataframe; |
| 8 | + |
| 9 | +import java.text.MessageFormat; |
| 10 | +import java.util.Locale; |
| 11 | + |
| 12 | +public class DataFrameMessages { |
| 13 | + |
| 14 | + public static final String REST_STOP_TRANSFORM_WAIT_FOR_COMPLETION_TIMEOUT = |
| 15 | + "Timed out after [{0}] while waiting for data frame transform [{1}] to stop"; |
| 16 | + public static final String REST_STOP_TRANSFORM_WAIT_FOR_COMPLETION_INTERRUPT = |
| 17 | + "Interrupted while waiting for data frame transform [{0}] to stop"; |
| 18 | + public static final String REST_PUT_DATA_FRAME_TRANSFORM_EXISTS = "Transform with id [{0}] already exists"; |
| 19 | + public static final String REST_DATA_FRAME_UNKNOWN_TRANSFORM = "Transform with id [{0}] could not be found"; |
| 20 | + public static final String REST_PUT_DATA_FRAME_FAILED_TO_VALIDATE_DATA_FRAME_CONFIGURATION = |
| 21 | + "Failed to validate data frame configuration"; |
| 22 | + public static final String REST_PUT_DATA_FRAME_FAILED_PERSIST_TRANSFORM_CONFIGURATION = "Failed to persist data frame configuration"; |
| 23 | + public static final String REST_PUT_DATA_FRAME_FAILED_TO_DEDUCE_TARGET_MAPPINGS = "Failed to deduce target mappings"; |
| 24 | + public static final String REST_PUT_DATA_FRAME_FAILED_TO_CREATE_TARGET_INDEX = "Failed to create target index"; |
| 25 | + public static final String REST_PUT_DATA_FRAME_FAILED_TO_START_PERSISTENT_TASK = |
| 26 | + "Failed to start persistent task, configuration has been cleaned up: [{0}]"; |
| 27 | + public static final String REST_DATA_FRAME_FAILED_TO_SERIALIZE_TRANSFORM = "Failed to serialise transform [{0}]"; |
| 28 | + |
| 29 | + public static final String FAILED_TO_CREATE_DESTINATION_INDEX = "Could not create destination index [{0}] for transform[{1}]"; |
| 30 | + public static final String FAILED_TO_LOAD_TRANSFORM_CONFIGURATION = |
| 31 | + "Failed to load data frame transform configuration for transform [{0}]"; |
| 32 | + public static final String FAILED_TO_PARSE_TRANSFORM_CONFIGURATION = |
| 33 | + "Failed to parse transform configuration for data frame transform [{0}]"; |
| 34 | + public static final String DATA_FRAME_TRANSFORM_CONFIGURATION_NO_TRANSFORM = |
| 35 | + "Data frame transform configuration must specify exactly 1 function"; |
| 36 | + public static final String DATA_FRAME_TRANSFORM_CONFIGURATION_PIVOT_NO_GROUP_BY = |
| 37 | + "Data frame pivot transform configuration must specify at least 1 group_by"; |
| 38 | + public static final String DATA_FRAME_TRANSFORM_CONFIGURATION_PIVOT_NO_AGGREGATION = |
| 39 | + "Data frame pivot transform configuration must specify at least 1 aggregation"; |
| 40 | + public static final String DATA_FRAME_TRANSFORM_PIVOT_FAILED_TO_CREATE_COMPOSITE_AGGREGATION = |
| 41 | + "Failed to create composite aggregation from pivot function"; |
| 42 | + public static final String DATA_FRAME_TRANSFORM_CONFIGURATION_INVALID = |
| 43 | + "Data frame transform configuration [{0}] has invalid elements"; |
| 44 | + |
| 45 | + public static final String LOG_DATA_FRAME_TRANSFORM_CONFIGURATION_BAD_QUERY = |
| 46 | + "Failed to parse query for data frame transform"; |
| 47 | + public static final String LOG_DATA_FRAME_TRANSFORM_CONFIGURATION_BAD_GROUP_BY = |
| 48 | + "Failed to parse group_by for data frame pivot transform"; |
| 49 | + public static final String LOG_DATA_FRAME_TRANSFORM_CONFIGURATION_BAD_AGGREGATION = |
| 50 | + "Failed to parse aggregation for data frame pivot transform"; |
| 51 | + |
| 52 | + private DataFrameMessages() { |
| 53 | + } |
| 54 | + |
| 55 | + /** |
| 56 | + * Returns the message parameter |
| 57 | + * |
| 58 | + * @param message Should be one of the statics defined in this class |
| 59 | + */ |
| 60 | + public static String getMessage(String message) { |
| 61 | + return message; |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * Format the message with the supplied arguments |
| 66 | + * |
| 67 | + * @param message Should be one of the statics defined in this class |
| 68 | + * @param args MessageFormat arguments. See {@linkplain MessageFormat#format(Object)}] |
| 69 | + */ |
| 70 | + public static String getMessage(String message, Object... args) { |
| 71 | + return new MessageFormat(message, Locale.ROOT).format(args); |
| 72 | + } |
| 73 | +} |
0 commit comments