Interface Operation

    • Method Detail

      • shallowClone

        Operation shallowClone()
                        throws org.apache.commons.lang3.exception.CloneFailedException
        Operation implementations should ensure a ShallowClone method is implemented. Performs a shallow clone. Creates a new instance and copies the fields across. It does not clone the fields. If the operation contains nested operations, these must also be cloned.
        Returns:
        shallow clone
        Throws:
        org.apache.commons.lang3.exception.CloneFailedException - if a Clone error occurs
      • getOptions

        Map<String,​String> getOptions()
        Returns:
        the operation options. This may contain store specific options such as authorisation strings or and other properties required for the operation to be executed. Note these options will probably not be interpreted in the same way by every store implementation.
      • setOptions

        void setOptions​(Map<String,​String> options)
        Parameters:
        options - the operation options. This may contain store specific options such as authorisation strings or and other properties required for the operation to be executed. Note these options will probably not be interpreted in the same way by every store implementation.
      • addOption

        default void addOption​(String name,
                               String value)
        Adds an operation option. This may contain store specific options such as authorisation strings or and other properties required for the operation to be executed. Note these options will probably not be interpreted in the same way by every store implementation.
        Parameters:
        name - the name of the option
        value - the value of the option
      • getOption

        default String getOption​(String name)
        Gets an operation option by its given name.
        Parameters:
        name - the name of the option
        Returns:
        the value of the option
      • getOption

        default String getOption​(String name,
                                 String defaultValue)
        Gets an operation option by its given name.
        Parameters:
        name - the name of the option
        defaultValue - the default value to return if value is null.
        Returns:
        the value of the option
      • containsOption

        default boolean containsOption​(String name)
        Gets if an operation contains an option of the given name.
        Parameters:
        name - the name of the option
        Returns:
        if the operation contains the option
      • close

        default void close()
                    throws IOException
        Operation implementations should ensure that all closeable fields are closed in this method.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Throws:
        IOException - if an I/O error occurs
      • validate

        default uk.gov.gchq.koryphe.ValidationResult validate()
        Validates an operation. This should be used to validate that fields have been be configured correctly. By default no validation is applied. Override this method to implement validation.
        Returns:
        validation result.
      • validateRequiredFieldPresent

        default void validateRequiredFieldPresent​(uk.gov.gchq.koryphe.ValidationResult result,
                                                  Field field)