Class RFC3339TimestampLogFieldSyntax


  • @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class RFC3339TimestampLogFieldSyntax
    extends LogFieldSyntax<java.util.Date>
    This class defines a log field syntax for values that are timestamps represented in the ISO 8601 format described in RFC 3339. This syntax does not support redacting or tokenizing individual components within the timestamps. Redacted generalized time values will have a string representation of "9999-01-01T00:00:00.000Z", which corresponds to midnight UTC of January 1 in the year 9999. Tokenized values will have a year of 8888 (in the UTC time zone).
    NOTE: This class, and other classes within the com.unboundid.ldap.sdk.unboundidds package structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.
    • Method Detail

      • valueToSanitizedString

        public void valueToSanitizedString​(@NotNull
                                           java.util.Date value,
                                           @NotNull
                                           ByteStringBuffer buffer)
        Encodes the provided value to a sanitized string representation suitable for inclusion in a log message. The sanitized string should at least be cleaned of control characters and other non-printable characters, but depending on the syntax, it may clean other characters as well.
        Specified by:
        valueToSanitizedString in class LogFieldSyntax<java.util.Date>
        Parameters:
        value - The value to be encoded. It must not be null.
        buffer - The buffer to which the string representation should be appended. It must not be null.
      • logSanitizedFieldToTextFormattedLog

        public void logSanitizedFieldToTextFormattedLog​(@NotNull
                                                        java.lang.String fieldName,
                                                        @NotNull
                                                        java.util.Date fieldValue,
                                                        @NotNull
                                                        ByteStringBuffer buffer)
        Appends a sanitized representation of the specified field (both field name and value) for a text-formatted log message to the given buffer.
        Specified by:
        logSanitizedFieldToTextFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        fieldName - The name for the field. It must not be null.
        fieldValue - The value to use for the field. It must not be null.
        buffer - The buffer to which the sanitized log field should be appended. It must not be null.
      • logSanitizedFieldToJSONFormattedLog

        public void logSanitizedFieldToJSONFormattedLog​(@NotNull
                                                        java.lang.String fieldName,
                                                        @NotNull
                                                        java.util.Date fieldValue,
                                                        @NotNull
                                                        JSONBuffer buffer)
        Appends a sanitized representation of the specified field (both field name and value) for a JSON-formatted log message to the given buffer.
        Specified by:
        logSanitizedFieldToJSONFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        fieldName - The name for the field. It must not be null.
        fieldValue - The value to use for the field. It must not be null.
        buffer - The buffer to which the sanitized log field should be appended. It must not be null.
      • logSanitizedValueToJSONFormattedLog

        public void logSanitizedValueToJSONFormattedLog​(@NotNull
                                                        java.util.Date value,
                                                        @NotNull
                                                        JSONBuffer buffer)
        Appends a sanitized representation of the provided value (without a field name, as might be suitable for a value included in a JSON array) for a JSON-formatted log message to the given buffer.
        Specified by:
        logSanitizedValueToJSONFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        value - The value to be appended to the buffer. It must not be null.
        buffer - The buffer to which the sanitized value should be appended. It must not be null.
      • parseValue

        @NotNull
        public java.util.Date parseValue​(@NotNull
                                         java.lang.String valueString)
                                  throws RedactedValueException,
                                         TokenizedValueException,
                                         LogSyntaxException
        Attempts to parse the provided string as a value in accordance with this syntax.
        Specified by:
        parseValue in class LogFieldSyntax<java.util.Date>
        Parameters:
        valueString - The string to be parsed.
        Returns:
        The value that was parsed.
        Throws:
        RedactedValueException - If the provided value has been redacted (either the complete value or one or more of its components), and the redacted form cannot be represented in this syntax.
        TokenizedValueException - If the provided value has been tokenized (either the complete value or one or more of its components), and the redacted form cannot be represented in this syntax.
        LogSyntaxException - If the provided value cannot be parsed in accordance with this syntax.
      • valueStringIsCompletelyRedacted

        public boolean valueStringIsCompletelyRedacted​(@NotNull
                                                       java.lang.String valueString)
        Determines whether the provided value string represents a value that has been completely redacted.
        Overrides:
        valueStringIsCompletelyRedacted in class LogFieldSyntax<java.util.Date>
        Parameters:
        valueString - The value for which to make the determination. It must not be null.
        Returns:
        true if the provided value string represents a value that has been completely redacted, or false if not.
      • redactEntireValue

        public void redactEntireValue​(@NotNull
                                      ByteStringBuffer buffer)
        Appends a string representation of a redacted entire value to the provided buffer.
        Overrides:
        redactEntireValue in class LogFieldSyntax<java.util.Date>
        Parameters:
        buffer - The buffer to which the redacted string representation should be appended. It must not be null.
      • supportsRedactedComponents

        public boolean supportsRedactedComponents()
        Indicates whether this syntax supports redacting individual components of the entire value.
        Specified by:
        supportsRedactedComponents in class LogFieldSyntax<java.util.Date>
        Returns:
        true if this syntax supports redacting individual components of the entire value, or false if not.
      • valueStringIncludesRedactedComponent

        public boolean valueStringIncludesRedactedComponent​(@NotNull
                                                            java.lang.String valueString)
        Determines whether the provided value string represents a value that has had one or more components redacted.
        Overrides:
        valueStringIncludesRedactedComponent in class LogFieldSyntax<java.util.Date>
        Parameters:
        valueString - The value for which to make the determination. It must not be null.
        Returns:
        true if the provided value string represents a value that has had one or more components redacted, or false if not.
      • logRedactedComponentsFieldToTextFormattedLog

        public void logRedactedComponentsFieldToTextFormattedLog​(@NotNull
                                                                 java.lang.String fieldName,
                                                                 @NotNull
                                                                 java.util.Date fieldValue,
                                                                 @NotNull
                                                                 ByteStringBuffer buffer)
        Appends a representation of the specified field (both field name and value) with redacted value components for a text-formatted log message to the given buffer. If this syntax does not support redacting components within a value, then it should redact the entire value.
        Specified by:
        logRedactedComponentsFieldToTextFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        fieldName - The name for the field. It must not be null.
        fieldValue - The value to use for the field. It must not be null.
        buffer - The buffer to which the sanitized log field should be appended. It must not be null.
      • logRedactedComponentsFieldToJSONFormattedLog

        public void logRedactedComponentsFieldToJSONFormattedLog​(@NotNull
                                                                 java.lang.String fieldName,
                                                                 @NotNull
                                                                 java.util.Date fieldValue,
                                                                 @NotNull
                                                                 JSONBuffer buffer)
        Appends a representation of the specified field (both field name and value) with redacted value components for a JSON-formatted log message to the given buffer. If this syntax does not support redacting components within a value, then it should redact the entire value.
        Specified by:
        logRedactedComponentsFieldToJSONFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        fieldName - The name for the field. It must not be null.
        fieldValue - The value to use for the field. It must not be null.
        buffer - The buffer to which the sanitized log field should be appended. It must not be null.
      • logRedactedComponentsValueToJSONFormattedLog

        public void logRedactedComponentsValueToJSONFormattedLog​(@NotNull
                                                                 java.util.Date value,
                                                                 @NotNull
                                                                 JSONBuffer buffer)
        Appends a representation of the provided value (without a field name, as might be suitable for a value included in a JSON array) with redacted components for a JSON-formatted log message to the given buffer. If this syntax does not support redacting components within a value, then it should redact the entire value.
        Specified by:
        logRedactedComponentsValueToJSONFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        value - The value to be appended to the buffer in redacted form. It must not be null.
        buffer - The buffer to which the redacted value should be appended. It must not be null.
      • valueStringIsCompletelyTokenized

        public boolean valueStringIsCompletelyTokenized​(@NotNull
                                                        java.lang.String valueString)
        Determines whether the provided value string represents a value that has been completely tokenized.
        Overrides:
        valueStringIsCompletelyTokenized in class LogFieldSyntax<java.util.Date>
        Parameters:
        valueString - The value for which to make the determination. It must not be null.
        Returns:
        true if the provided value string represents a value that has been completely tokenized, or false if not.
      • tokenizeEntireValue

        public void tokenizeEntireValue​(@NotNull
                                        java.util.Date value,
                                        @NotNull
                                        byte[] pepper,
                                        @NotNull
                                        ByteStringBuffer buffer)
        Appends a tokenized representation of the provided value to the given buffer.

        The resulting token will protect the provided value by representing it in a way that makes it at infeasible to determine what the original value was. However, tokenizing the same value with the same pepper should consistently yield the same token value, so that it will be possible to identify the same value across multiple log messages.
        Specified by:
        tokenizeEntireValue in class LogFieldSyntax<java.util.Date>
        Parameters:
        value - The value for which to generate the token. It must not be null.
        pepper - A pepper used to provide brute-force protection for the resulting token. The pepper value should be kept secret so that it is not available to unauthorized users who might be able to view log information, although the same pepper value should be consistently provided when tokenizing values so that the same value will consistently yield the same token. It must not be null and should not be empty.
        buffer - The buffer to which the tokenized representation should be appended. It must not be null.
      • logCompletelyTokenizedFieldToTextFormattedLog

        public void logCompletelyTokenizedFieldToTextFormattedLog​(@NotNull
                                                                  java.lang.String fieldName,
                                                                  @NotNull
                                                                  java.util.Date fieldValue,
                                                                  @NotNull
                                                                  byte[] pepper,
                                                                  @NotNull
                                                                  ByteStringBuffer buffer)
        Appends a completely tokenized representation of the specified field (both field name and value) for a text-formatted log message to the given buffer.
        Specified by:
        logCompletelyTokenizedFieldToTextFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        fieldName - The name for the field. It must not be null.
        fieldValue - The value to use for the field. It must not be null.
        pepper - A pepper used to provide brute-force protection for the resulting token. The pepper value should be kept secret so that it is not available to unauthorized users who might be able to view log information, although the same pepper value should be consistently provided when tokenizing values so that the same value will consistently yield the same token. It must not be null and should not be empty.
        buffer - The buffer to which the sanitized log field should be appended. It must not be null.
      • logCompletelyTokenizedFieldToJSONFormattedLog

        public void logCompletelyTokenizedFieldToJSONFormattedLog​(@NotNull
                                                                  java.lang.String fieldName,
                                                                  @NotNull
                                                                  java.util.Date fieldValue,
                                                                  @NotNull
                                                                  byte[] pepper,
                                                                  @NotNull
                                                                  JSONBuffer buffer)
        Appends a completely tokenized representation of the specified field (both field name and value) for a JSON-formatted log message to the given buffer.
        Specified by:
        logCompletelyTokenizedFieldToJSONFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        fieldName - The name for the field. It must not be null.
        fieldValue - The value to use for the field. It must not be null.
        pepper - A pepper used to provide brute-force protection for the resulting token. The pepper value should be kept secret so that it is not available to unauthorized users who might be able to view log information, although the same pepper value should be consistently provided when tokenizing values so that the same value will consistently yield the same token. It must not be null and should not be empty.
        buffer - The buffer to which the sanitized log field should be appended. It must not be null.
      • logCompletelyTokenizedValueToJSONFormattedLog

        public void logCompletelyTokenizedValueToJSONFormattedLog​(@NotNull
                                                                  java.util.Date value,
                                                                  @NotNull
                                                                  byte[] pepper,
                                                                  @NotNull
                                                                  JSONBuffer buffer)
        Appends a completely tokenized representation of the provided value (without a field name, as might be suitable for a value included in a JSON array) for a JSON-formatted log message to the given buffer.
        Specified by:
        logCompletelyTokenizedValueToJSONFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        value - The value to be appended to the buffer in tokenized form. It must not be null.
        pepper - A pepper used to provide brute-force protection for the resulting token. The pepper value should be kept secret so that it is not available to unauthorized users who might be able to view log information, although the same pepper value should be consistently provided when tokenizing values so that the same value will consistently yield the same token. It must not be null and should not be empty.
        buffer - The buffer to which the tokenized value should be appended. It must not be null.
      • supportsTokenizedComponents

        public boolean supportsTokenizedComponents()
        Indicates whether this syntax supports tokenizing individual components of the entire value.
        Specified by:
        supportsTokenizedComponents in class LogFieldSyntax<java.util.Date>
        Returns:
        true if this syntax supports tokenizing individual components of the entire value, or false if not.
      • valueStringIncludesTokenizedComponent

        public boolean valueStringIncludesTokenizedComponent​(@NotNull
                                                             java.lang.String valueString)
        Determines whether the provided value string represents a value that has had one or more components tokenized.
        Overrides:
        valueStringIncludesTokenizedComponent in class LogFieldSyntax<java.util.Date>
        Parameters:
        valueString - The value for which to make the determination. It must not be null.
        Returns:
        true if the provided value string represents a value that has had one or more components tokenized, or false if not.
      • logTokenizedComponentsFieldToTextFormattedLog

        public void logTokenizedComponentsFieldToTextFormattedLog​(@NotNull
                                                                  java.lang.String fieldName,
                                                                  @NotNull
                                                                  java.util.Date fieldValue,
                                                                  @NotNull
                                                                  byte[] pepper,
                                                                  @NotNull
                                                                  ByteStringBuffer buffer)
        Appends a representation of the specified field (both field name and value) with tokenized value components for a text-formatted log message to the given buffer. If this syntax does not support tokenizing components within a value, then it should tokenize the entire value.
        Specified by:
        logTokenizedComponentsFieldToTextFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        fieldName - The name for the field. It must not be null.
        fieldValue - The value to use for the field. It must not be null.
        pepper - A pepper used to provide brute-force protection for the resulting token. The pepper value should be kept secret so that it is not available to unauthorized users who might be able to view log information, although the same pepper value should be consistently provided when tokenizing values so that the same value will consistently yield the same token. It must not be null and should not be empty.
        buffer - The buffer to which the sanitized log field should be appended. It must not be null.
      • logTokenizedComponentsFieldToJSONFormattedLog

        public void logTokenizedComponentsFieldToJSONFormattedLog​(@NotNull
                                                                  java.lang.String fieldName,
                                                                  @NotNull
                                                                  java.util.Date fieldValue,
                                                                  @NotNull
                                                                  byte[] pepper,
                                                                  @NotNull
                                                                  JSONBuffer buffer)
        Appends a representation of the specified field (both field name and value) with tokenized value components for a JSON-formatted log message to the given buffer. If this syntax does not support tokenizing components within a value, then it should tokenize the entire value.
        Specified by:
        logTokenizedComponentsFieldToJSONFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        fieldName - The name for the field. It must not be null.
        fieldValue - The value to use for the field. It must not be null.
        pepper - A pepper used to provide brute-force protection for the resulting token. The pepper value should be kept secret so that it is not available to unauthorized users who might be able to view log information, although the same pepper value should be consistently provided when tokenizing values so that the same value will consistently yield the same token. It must not be null and should not be empty.
        buffer - The buffer to which the sanitized log field should be appended. It must not be null.
      • logTokenizedComponentsValueToJSONFormattedLog

        public void logTokenizedComponentsValueToJSONFormattedLog​(@NotNull
                                                                  java.util.Date value,
                                                                  @NotNull
                                                                  byte[] pepper,
                                                                  @NotNull
                                                                  JSONBuffer buffer)
        Appends a representation of the provided value (without a field name, as might be suitable for a value included in a JSON array) with tokenized value components for a JSON-formatted log message to the given buffer. If this syntax does not support tokenizing components within a value, then it should tokenize the entire value.
        Specified by:
        logTokenizedComponentsValueToJSONFormattedLog in class LogFieldSyntax<java.util.Date>
        Parameters:
        value - The value to be appended to the buffer in tokenized form. It must not be null.
        pepper - A pepper used to provide brute-force protection for the resulting token. The pepper value should be kept secret so that it is not available to unauthorized users who might be able to view log information, although the same pepper value should be consistently provided when tokenizing values so that the same value will consistently yield the same token. It must not be null and should not be empty.
        buffer - The buffer to which the tokenized value should be appended. It must not be null.