text:
/* v3_lib.c */
/*
 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
 * 1999.
 */
/* ====================================================================
 * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
 *
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please contact
 *    licensing@OpenSSL.org.
 *
 * 5. Products derived from this software may not be called "OpenSSL"
 *    nor may "OpenSSL" appear in their names without prior written
 *    permission of the OpenSSL Project.
 *
 * 6. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
 *
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 *
 * This product includes cryptographic software written by Eric Young
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */
/* X509 v3 extension utilities */

#include <stdio.h>

#include <openssl_grpc/conf.h>
#include <openssl_grpc/err.h>
#include <openssl_grpc/mem.h>
#include <openssl_grpc/obj.h>
#include <openssl_grpc/x509v3.h>

#include "ext_dat.h"
static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL;

static void ext_list_free(X509V3_EXT_METHOD *ext);

static int ext_stack_cmp(const X509V3_EXT_METHOD **a,
                         const X509V3_EXT_METHOD **b)
{
    return ((*a)->ext_nid - (*b)->ext_nid);
}

int X509V3_EXT_add(X509V3_EXT_METHOD *ext)
{
    if (!ext_list && !(ext_list = sk_X509V3_EXT_METHOD_new(ext_stack_cmp))) {
        OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
        ext_list_free(ext);
        return 0;
    }
    if (!sk_X509V3_EXT_METHOD_push(ext_list, ext)) {
        OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
        ext_list_free(ext);
        return 0;
    }
    return 1;
}

static int ext_cmp(const void *void_a, const void *void_b)
{
    const X509V3_EXT_METHOD **a = (const X509V3_EXT_METHOD **)void_a;
    const X509V3_EXT_METHOD **b = (const X509V3_EXT_METHOD **)void_b;
    return ext_stack_cmp(a, b);
}

const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid)
{
    X509V3_EXT_METHOD tmp;
    const X509V3_EXT_METHOD *t = &tmp, *const *ret;
    size_t idx;

    if (nid < 0)
        return NULL;
    tmp.ext_nid = nid;
    ret =
        bsearch(&t, standard_exts, STANDARD_EXTENSION_COUNT,
                sizeof(X509V3_EXT_METHOD *), ext_cmp);
    if (ret)
        return *ret;
    if (!ext_list)
        return NULL;

    if (!sk_X509V3_EXT_METHOD_find(ext_list, &idx, &tmp))
        return NULL;
    return sk_X509V3_EXT_METHOD_value(ext_list, idx);
}

const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext)
{
    int nid;
    if ((nid = OBJ_obj2nid(ext->object)) == NID_undef)
        return NULL;
    return X509V3_EXT_get_nid(nid);
}

int X509V3_EXT_free(int nid, void *ext_data)
{
    const X509V3_EXT_METHOD *ext_method = X509V3_EXT_get_nid(nid);
    if (ext_method == NULL) {
        OPENSSL_PUT_ERROR(X509V3, X509V3_R_CANNOT_FIND_FREE_FUNCTION);
        return 0;
    }

    if (ext_method->it != NULL)
        ASN1_item_free(ext_data, ASN1_ITEM_ptr(ext_method->it));
    else if (ext_method->ext_free != NULL)
        ext_method->ext_free(ext_data);
    else {
        OPENSSL_PUT_ERROR(X509V3, X509V3_R_CANNOT_FIND_FREE_FUNCTION);
        return 0;
    }

    return 1;
}

int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist)
{
    for (; extlist->ext_nid != -1; extlist++)
        if (!X509V3_EXT_add(extlist))
            return 0;
    return 1;
}

int X509V3_EXT_add_alias(int nid_to, int nid_from)
{
    const X509V3_EXT_METHOD *ext;
    X509V3_EXT_METHOD *tmpext;

    if (!(ext = X509V3_EXT_get_nid(nid_from))) {
        OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXTENSION_NOT_FOUND);
        return 0;
    }
    if (!
        (tmpext =
         (X509V3_EXT_METHOD *)OPENSSL_malloc(sizeof(X509V3_EXT_METHOD)))) {
        OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
        return 0;
    }
    *tmpext = *ext;
    tmpext->ext_nid = nid_to;
    tmpext->ext_flags |= X509V3_EXT_DYNAMIC;
    return X509V3_EXT_add(tmpext);
}

void X509V3_EXT_cleanup(void)
{
    sk_X509V3_EXT_METHOD_pop_free(ext_list, ext_list_free);
    ext_list = NULL;
}

static void ext_list_free(X509V3_EXT_METHOD *ext)
{
    if (ext->ext_flags & X509V3_EXT_DYNAMIC)
        OPENSSL_free(ext);
}

/*
 * Legacy function: we don't need to add standard extensions any more because
 * they are now kept in ext_dat.h.
 */

int X509V3_add_standard_extensions(void)
{
    return 1;
}

/* Return an extension internal structure */

void *X509V3_EXT_d2i(X509_EXTENSION *ext)
{
    const X509V3_EXT_METHOD *method;
    const unsigned char *p;

    if (!(method = X509V3_EXT_get(ext)))
        return NULL;
    p = ext->value->data;
    if (method->it)
        return ASN1_item_d2i(NULL, &p, ext->value->length,
                             ASN1_ITEM_ptr(method->it));
    return method->d2i(NULL, &p, ext->value->length);
}

/*
 * Get critical flag and decoded version of extension from a NID. The "idx"
 * variable returns the last found extension and can be used to retrieve
 * multiple extensions of the same NID. However multiple extensions with the
 * same NID is usually due to a badly encoded certificate so if idx is NULL
 * we choke if multiple extensions exist. The "crit" variable is set to the
 * critical value. The return value is the decoded extension or NULL on
 * error. The actual error can have several different causes, the value of
 * *crit reflects the cause: >= 0, extension found but not decoded (reflects
 * critical value). -1 extension not found. -2 extension occurs more than
 * once.
 */

void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit,
                     int *idx)
{
    int lastpos;
    size_t i;
    X509_EXTENSION *ex, *found_ex = NULL;
    if (!x) {
        if (idx)
            *idx = -1;
        if (crit)
            *crit = -1;
        return NULL;
    }
    if (idx)
        lastpos = *idx + 1;
    else
        lastpos = 0;
    if (lastpos < 0)
        lastpos = 0;
    for (i = lastpos; i < sk_X509_EXTENSION_num(x); i++) {
        ex = sk_X509_EXTENSION_value(x, i);
        if (OBJ_obj2nid(ex->object) == nid) {
            if (idx) {
                *idx = i;
                found_ex = ex;
                break;
            } else if (found_ex) {
                /* Found more than one */
                if (crit)
                    *crit = -2;
                return NULL;
            }
            found_ex = ex;
        }
    }
    if (found_ex) {
        /* Found it */
        if (crit)
            *crit = X509_EXTENSION_get_critical(found_ex);
        return X509V3_EXT_d2i(found_ex);
    }

    /* Extension not found */
    if (idx)
        *idx = -1;
    if (crit)
        *crit = -1;
    return NULL;
}

/*
 * This function is a general extension append, replace and delete utility.
 * The precise operation is governed by the 'flags' value. The 'crit' and
 * 'value' arguments (if relevant) are the extensions internal structure.
 */

int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value,
                    int crit, unsigned long flags)
{
    int errcode, extidx = -1;
    X509_EXTENSION *ext = NULL, *extmp;
    STACK_OF(X509_EXTENSION) *ret = NULL;
    unsigned long ext_op = flags & X509V3_ADD_OP_MASK;

    /*
     * If appending we don't care if it exists, otherwise look for existing
     * extension.
     */
    if (ext_op != X509V3_ADD_APPEND)
        extidx = X509v3_get_ext_by_NID(*x, nid, -1);

    /* See if extension exists */
    if (extidx >= 0) {
        /* If keep existing, nothing to do */
        if (ext_op == X509V3_ADD_KEEP_EXISTING)
            return 1;
        /* If default then its an error */
        if (ext_op == X509V3_ADD_DEFAULT) {
            errcode = X509V3_R_EXTENSION_EXISTS;
            goto err;
        }
        /* If delete, just delete it */
        if (ext_op == X509V3_ADD_DELETE) {
            if (!sk_X509_EXTENSION_delete(*x, extidx))
                return -1;
            return 1;
        }
    } else {
        /*
         * If replace existing or delete, error since extension must exist
         */
        if ((ext_op == X509V3_ADD_REPLACE_EXISTING) ||
            (ext_op == X509V3_ADD_DELETE)) {
            errcode = X509V3_R_EXTENSION_NOT_FOUND;
            goto err;
        }
    }

    /*
     * If we get this far then we have to create an extension: could have
     * some flags for alternative encoding schemes...
     */

    ext = X509V3_EXT_i2d(nid, crit, value);

    if (!ext) {
        OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_CREATING_EXTENSION);
        return 0;
    }

    /* If extension exists replace it.. */
    if (extidx >= 0) {
        extmp = sk_X509_EXTENSION_value(*x, extidx);
        X509_EXTENSION_free(extmp);
        if (!sk_X509_EXTENSION_set(*x, extidx, ext))
            return -1;
        return 1;
    }

    if ((ret = *x) == NULL
         && (ret = sk_X509_EXTENSION_new_null()) == NULL)
        goto m_fail;
    if (!sk_X509_EXTENSION_push(ret, ext))
        goto m_fail;

    *x = ret;
    return 1;

 m_fail:
    if (ret != *x)
        sk_X509_EXTENSION_free(ret);
    X509_EXTENSION_free(ext);
    return -1;

 err:
    if (!(flags & X509V3_ADD_SILENT))
        OPENSSL_PUT_ERROR(X509V3, errcode);
    return 0;
}


text:
import _ from 'lodash';

/**
  Declarative Validation Rules

    const plugins = {
      dvr: dvr({
        package: validatorjs,
        extend: callback,
      }),
    };

*/
class DVR {

  promises = [];

  config = null;

  state = null;

  extend = null;

  validator = null;

  constructor({
    config = {},
    state = {},
    promises = [],
  }) {
    this.state = state;
    this.promises = promises;
    this.extend = config.extend;
    this.validator = config.package || config;
    this.extendValidator();
  }

  extendValidator() {
    // extend using "extend" callback
    if (_.isFunction(this.extend)) {
      this.extend({
        validator: this.validator,
        form: this.state.form,
      });
    }
  }

  validateField(field) {
    // get form fields data
    const data = this.state.form.validatedValues;
    this.validateFieldAsync(field, data);
    this.validateFieldSync(field, data);
  }

  makeLabels(validation, field) {
    const labels = { [field.path]: field.label };
    _.forIn(validation.rules[field.path], (rule) => {
      if (typeof rule.value === 'string' && rule.name.match(/^(required_|same|different)/)) {
        _.forIn(rule.value.split(','), (p, i) => {
          if (!rule.name.match(/^required_(if|unless)/) || (i % 2 === 0)) {
            const f = this.state.form.$(p);
            if (f && f.path && f.label) {
              labels[f.path] = f.label;
            }
          }
        });
      }
    });
    validation.setAttributeNames(labels);
  }

  validateFieldSync(field, data) {
    const $rules = this.rules(field.rules, 'sync');
    // exit if no rules found
    if (_.isEmpty($rules[0])) return;
    // get field rules
    const rules = { [field.path]: $rules };
    // create the validator instance
    const validation = new this.validator(data, rules);
    // set label into errors messages instead key
    this.makeLabels(validation, field);
    // check validation
    if (validation.passes()) return;
    // the validation is failed, set the field error
    field.invalidate(_.first(validation.errors.get(field.path)));
  }

  validateFieldAsync(field, data) {
    const $rules = this.rules(field.rules, 'async');
    // exit if no rules found
    if (_.isEmpty($rules[0])) return;
    // get field rules
    const rules = { [field.path]: $rules };
    // create the validator instance
    const validation = new this.validator(data, rules);
    // set label into errors messages instead key
    this.makeLabels(validation, field);

    const $p = new Promise(resolve =>
      validation.checkAsync(
        () => this.handleAsyncPasses(field, resolve),
        () => this.handleAsyncFails(field, validation, resolve),
      ));

    this.promises.push($p);
  }

  handleAsyncPasses(field, resolve) {
    field.setValidationAsyncData(true);
    field.showAsyncErrors();
    resolve();
  }

  handleAsyncFails(field, validation, resolve) {
    field.setValidationAsyncData(false, _.first(validation.errors.get(field.path)));
    this.executeAsyncValidation(field);
    field.showAsyncErrors();
    resolve();
  }

  executeAsyncValidation(field) {
    if (field.validationAsyncData.valid === false) {
      field.invalidate(field.validationAsyncData.message, true);
    }
  }

  rules(rules, type) {
    const $rules = _.isString(rules) ? _.split(rules, '|') : rules;
    // eslint-disable-next-line new-cap
    const v = new this.validator();
    return _.filter($rules, $rule => type === 'async'
      ? v.getRule(_.split($rule, ':')[0]).async
      : !v.getRule(_.split($rule, ':')[0]).async);
  }
}

export default (config) => ({
  class: DVR,
  config,
});

redpajama_set_name: RedPajamaGithub


text:
package com.amazonaws.services.databasemigrationservice.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ModifyEndpointRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
     *

     */
    private String endpointArn;
    /**
     *

     * The database endpoint identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits,
     * and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
     *

     */
    private String endpointIdentifier;
    /**
     *

     * The type of endpoint. Valid values are source and target.
     *

     */
    private String endpointType;
    /**
     *

     * The type of engine for the endpoint. Valid values, depending on the EndpointType, include mysql, oracle,
     * postgres, mariadb, aurora, aurora-postgresql, redshift, s3, db2, azuredb, sybase, dynamodb, mongodb, and
     * sqlserver.
     *

     */
    private String engineName;
    /**
     *

     * The user name to be used to login to the endpoint database.
     *

     */
    private String username;
    /**
     *

     * The password to be used to login to the endpoint database.
     *

     */
    private String password;
    /**
     *

     * The name of the server where the endpoint database resides.
     *

     */
    private String serverName;
    /**
     *

     * The port used by the endpoint database.
     *

     */
    private Integer port;
    /**
     *

     * The name of the endpoint database.
     *

     */
    private String databaseName;
    /**
     *

     * Additional attributes associated with the connection. To reset this parameter, pass the empty string ("") as an
     * argument.
     *

     */
    private String extraConnectionAttributes;
    /**
     *

     * The Amazon Resource Name (ARN) of the certificate used for SSL connection.
     *

     */
    private String certificateArn;
    /**
     *

     * The SSL mode used to connect to the endpoint. The default value is none.
     *

     */
    private String sslMode;
    /**
     *

     * The Amazon Resource Name (ARN) for the service access role you want to use to modify the endpoint.
     *

     */
    private String serviceAccessRoleArn;
    /**
     *

     * The external table definition.
     *

     */
    private String externalTableDefinition;
    /**
     *

     * Settings in JSON format for the target Amazon DynamoDB endpoint. For more information about the available
     * settings, see Using Object
     * Mapping to Migrate Data to DynamoDB in the AWS Database Migration Service User Guide.
     *

     */
    private DynamoDbSettings dynamoDbSettings;
    /**
     *

     * Settings in JSON format for the target Amazon S3 endpoint. For more information about the available settings, see
     * Extra
     * Connection Attributes When Using Amazon S3 as a Target for AWS DMS in the AWS Database Migration Service
     * User Guide.
     *

     */
    private S3Settings s3Settings;
    /**
     *

     * The settings in JSON format for the DMS transfer type of source endpoint.
     *

     *

     * Attributes include the following:
     *

     *

     *

     *

     * serviceAccessRoleArn - The IAM role that has permission to access the Amazon S3 bucket.
     *

     *

     *

     *

     * BucketName - The name of the S3 bucket to use.
     *

     *

     *

     *

     * compressionType - An optional parameter to use GZIP to compress the target files. Set to NONE (the default) or do
     * not use to leave the files uncompressed.
     *

     *

     *

     *

     * Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string
     *

     *

     * JSON syntax:
     *

     *

     * { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType": "none"|"gzip" }
     *

     */
    private DmsTransferSettings dmsTransferSettings;
    /**
     *

     * Settings in JSON format for the source MongoDB endpoint. For more information about the available settings, see
     * the configuration properties section in  Using MongoDB as a Target for
     * AWS Database Migration Service in the AWS Database Migration Service User Guide.
     *

     */
    private MongoDbSettings mongoDbSettings;
    /**
     *

     * Settings in JSON format for the target Amazon Kinesis Data Streams endpoint. For more information about the
     * available settings, see Using Object Mapping to Migrate Data to a Kinesis Data Stream in the AWS Database Migration User
     * Guide.
     *

     */
    private KinesisSettings kinesisSettings;
    /**
     *

     * Settings in JSON format for the target Elasticsearch endpoint. For more information about the available settings,
     * see Extra Connection Attributes When Using Elasticsearch as a Target for AWS DMS in the AWS Database
     * Migration User Guide.
     *

     */
    private ElasticsearchSettings elasticsearchSettings;

    private RedshiftSettings redshiftSettings;

    /**
     *

     * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
     *

     *
     * @param endpointArn
     *        The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
     */

    public void setEndpointArn(String endpointArn) {
        this.endpointArn = endpointArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
     *

     *
     * @return The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
     */

    public String getEndpointArn() {
        return this.endpointArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
     *

     *
     * @param endpointArn
     *        The Amazon Resource Name (ARN) string that uniquely identifies the endpoint.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withEndpointArn(String endpointArn) {
        setEndpointArn(endpointArn);
        return this;
    }

    /**
     *

     * The database endpoint identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits,
     * and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
     *

     *
     * @param endpointIdentifier
     *        The database endpoint identifier. Identifiers must begin with a letter; must contain only ASCII letters,
     *        digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
     */

    public void setEndpointIdentifier(String endpointIdentifier) {
        this.endpointIdentifier = endpointIdentifier;
    }

    /**
     *

     * The database endpoint identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits,
     * and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
     *

     *
     * @return The database endpoint identifier. Identifiers must begin with a letter; must contain only ASCII letters,
     *         digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
     */

    public String getEndpointIdentifier() {
        return this.endpointIdentifier;
    }

    /**
     *

     * The database endpoint identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits,
     * and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
     *

     *
     * @param endpointIdentifier
     *        The database endpoint identifier. Identifiers must begin with a letter; must contain only ASCII letters,
     *        digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withEndpointIdentifier(String endpointIdentifier) {
        setEndpointIdentifier(endpointIdentifier);
        return this;
    }

    /**
     *

     * The type of endpoint. Valid values are source and target.
     *

     *
     * @param endpointType
     *        The type of endpoint. Valid values are source and target.
     * @see ReplicationEndpointTypeValue
     */

    public void setEndpointType(String endpointType) {
        this.endpointType = endpointType;
    }

    /**
     *

     * The type of endpoint. Valid values are source and target.
     *

     *
     * @return The type of endpoint. Valid values are source and target.
     * @see ReplicationEndpointTypeValue
     */

    public String getEndpointType() {
        return this.endpointType;
    }

    /**
     *

     * The type of endpoint. Valid values are source and target.
     *

     *
     * @param endpointType
     *        The type of endpoint. Valid values are source and target.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ReplicationEndpointTypeValue
     */

    public ModifyEndpointRequest withEndpointType(String endpointType) {
        setEndpointType(endpointType);
        return this;
    }

    /**
     *

     * The type of endpoint. Valid values are source and target.
     *

     *
     * @param endpointType
     *        The type of endpoint. Valid values are source and target.
     * @see ReplicationEndpointTypeValue
     */

    public void setEndpointType(ReplicationEndpointTypeValue endpointType) {
        withEndpointType(endpointType);
    }

    /**
     *

     * The type of endpoint. Valid values are source and target.
     *

     *
     * @param endpointType
     *        The type of endpoint. Valid values are source and target.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ReplicationEndpointTypeValue
     */

    public ModifyEndpointRequest withEndpointType(ReplicationEndpointTypeValue endpointType) {
        this.endpointType = endpointType.toString();
        return this;
    }

    /**
     *

     * The type of engine for the endpoint. Valid values, depending on the EndpointType, include mysql, oracle,
     * postgres, mariadb, aurora, aurora-postgresql, redshift, s3, db2, azuredb, sybase, dynamodb, mongodb, and
     * sqlserver.
     *

     *
     * @param engineName
     *        The type of engine for the endpoint. Valid values, depending on the EndpointType, include mysql, oracle,
     *        postgres, mariadb, aurora, aurora-postgresql, redshift, s3, db2, azuredb, sybase, dynamodb, mongodb, and
     *        sqlserver.
     */

    public void setEngineName(String engineName) {
        this.engineName = engineName;
    }

    /**
     *

     * The type of engine for the endpoint. Valid values, depending on the EndpointType, include mysql, oracle,
     * postgres, mariadb, aurora, aurora-postgresql, redshift, s3, db2, azuredb, sybase, dynamodb, mongodb, and
     * sqlserver.
     *

     *
     * @return The type of engine for the endpoint. Valid values, depending on the EndpointType, include mysql, oracle,
     *         postgres, mariadb, aurora, aurora-postgresql, redshift, s3, db2, azuredb, sybase, dynamodb, mongodb, and
     *         sqlserver.
     */

    public String getEngineName() {
        return this.engineName;
    }

    /**
     *

     * The type of engine for the endpoint. Valid values, depending on the EndpointType, include mysql, oracle,
     * postgres, mariadb, aurora, aurora-postgresql, redshift, s3, db2, azuredb, sybase, dynamodb, mongodb, and
     * sqlserver.
     *

     *
     * @param engineName
     *        The type of engine for the endpoint. Valid values, depending on the EndpointType, include mysql, oracle,
     *        postgres, mariadb, aurora, aurora-postgresql, redshift, s3, db2, azuredb, sybase, dynamodb, mongodb, and
     *        sqlserver.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withEngineName(String engineName) {
        setEngineName(engineName);
        return this;
    }

    /**
     *

     * The user name to be used to login to the endpoint database.
     *

     *
     * @param username
     *        The user name to be used to login to the endpoint database.
     */

    public void setUsername(String username) {
        this.username = username;
    }

    /**
     *

     * The user name to be used to login to the endpoint database.
     *

     *
     * @return The user name to be used to login to the endpoint database.
     */

    public String getUsername() {
        return this.username;
    }

    /**
     *

     * The user name to be used to login to the endpoint database.
     *

     *
     * @param username
     *        The user name to be used to login to the endpoint database.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withUsername(String username) {
        setUsername(username);
        return this;
    }

    /**
     *

     * The password to be used to login to the endpoint database.
     *

     *
     * @param password
     *        The password to be used to login to the endpoint database.
     */

    public void setPassword(String password) {
        this.password = password;
    }

    /**
     *

     * The password to be used to login to the endpoint database.
     *

     *
     * @return The password to be used to login to the endpoint database.
     */

    public String getPassword() {
        return this.password;
    }

    /**
     *

     * The password to be used to login to the endpoint database.
     *

     *
     * @param password
     *        The password to be used to login to the endpoint database.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withPassword(String password) {
        setPassword(password);
        return this;
    }

    /**
     *

     * The name of the server where the endpoint database resides.
     *

     *
     * @param serverName
     *        The name of the server where the endpoint database resides.
     */

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    /**
     *

     * The name of the server where the endpoint database resides.
     *

     *
     * @return The name of the server where the endpoint database resides.
     */

    public String getServerName() {
        return this.serverName;
    }

    /**
     *

     * The name of the server where the endpoint database resides.
     *

     *
     * @param serverName
     *        The name of the server where the endpoint database resides.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withServerName(String serverName) {
        setServerName(serverName);
        return this;
    }

    /**
     *

     * The port used by the endpoint database.
     *

     *
     * @param port
     *        The port used by the endpoint database.
     */

    public void setPort(Integer port) {
        this.port = port;
    }

    /**
     *

     * The port used by the endpoint database.
     *

     *
     * @return The port used by the endpoint database.
     */

    public Integer getPort() {
        return this.port;
    }

    /**
     *

     * The port used by the endpoint database.
     *

     *
     * @param port
     *        The port used by the endpoint database.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withPort(Integer port) {
        setPort(port);
        return this;
    }

    /**
     *

     * The name of the endpoint database.
     *

     *
     * @param databaseName
     *        The name of the endpoint database.
     */

    public void setDatabaseName(String databaseName) {
        this.databaseName = databaseName;
    }

    /**
     *

     * The name of the endpoint database.
     *

     *
     * @return The name of the endpoint database.
     */

    public String getDatabaseName() {
        return this.databaseName;
    }

    /**
     *

     * The name of the endpoint database.
     *

     *
     * @param databaseName
     *        The name of the endpoint database.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withDatabaseName(String databaseName) {
        setDatabaseName(databaseName);
        return this;
    }

    /**
     *

     * Additional attributes associated with the connection. To reset this parameter, pass the empty string ("") as an
     * argument.
     *

     *
     * @param extraConnectionAttributes
     *        Additional attributes associated with the connection. To reset this parameter, pass the empty string ("")
     *        as an argument.
     */

    public void setExtraConnectionAttributes(String extraConnectionAttributes) {
        this.extraConnectionAttributes = extraConnectionAttributes;
    }

    /**
     *

     * Additional attributes associated with the connection. To reset this parameter, pass the empty string ("") as an
     * argument.
     *

     *
     * @return Additional attributes associated with the connection. To reset this parameter, pass the empty string ("")
     *         as an argument.
     */

    public String getExtraConnectionAttributes() {
        return this.extraConnectionAttributes;
    }

    /**
     *

     * Additional attributes associated with the connection. To reset this parameter, pass the empty string ("") as an
     * argument.
     *

     *
     * @param extraConnectionAttributes
     *        Additional attributes associated with the connection. To reset this parameter, pass the empty string ("")
     *        as an argument.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withExtraConnectionAttributes(String extraConnectionAttributes) {
        setExtraConnectionAttributes(extraConnectionAttributes);
        return this;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the certificate used for SSL connection.
     *

     *
     * @param certificateArn
     *        The Amazon Resource Name (ARN) of the certificate used for SSL connection.
     */

    public void setCertificateArn(String certificateArn) {
        this.certificateArn = certificateArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the certificate used for SSL connection.
     *

     *
     * @return The Amazon Resource Name (ARN) of the certificate used for SSL connection.
     */

    public String getCertificateArn() {
        return this.certificateArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the certificate used for SSL connection.
     *

     *
     * @param certificateArn
     *        The Amazon Resource Name (ARN) of the certificate used for SSL connection.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withCertificateArn(String certificateArn) {
        setCertificateArn(certificateArn);
        return this;
    }

    /**
     *

     * The SSL mode used to connect to the endpoint. The default value is none.
     *

     *
     * @param sslMode
     *        The SSL mode used to connect to the endpoint. The default value is none.
     * @see DmsSslModeValue
     */

    public void setSslMode(String sslMode) {
        this.sslMode = sslMode;
    }

    /**
     *

     * The SSL mode used to connect to the endpoint. The default value is none.
     *

     *
     * @return The SSL mode used to connect to the endpoint. The default value is none.
     * @see DmsSslModeValue
     */

    public String getSslMode() {
        return this.sslMode;
    }

    /**
     *

     * The SSL mode used to connect to the endpoint. The default value is none.
     *

     *
     * @param sslMode
     *        The SSL mode used to connect to the endpoint. The default value is none.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see DmsSslModeValue
     */

    public ModifyEndpointRequest withSslMode(String sslMode) {
        setSslMode(sslMode);
        return this;
    }

    /**
     *

     * The SSL mode used to connect to the endpoint. The default value is none.
     *

     *
     * @param sslMode
     *        The SSL mode used to connect to the endpoint. The default value is none.
     * @see DmsSslModeValue
     */

    public void setSslMode(DmsSslModeValue sslMode) {
        withSslMode(sslMode);
    }

    /**
     *

     * The SSL mode used to connect to the endpoint. The default value is none.
     *

     *
     * @param sslMode
     *        The SSL mode used to connect to the endpoint. The default value is none.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see DmsSslModeValue
     */

    public ModifyEndpointRequest withSslMode(DmsSslModeValue sslMode) {
        this.sslMode = sslMode.toString();
        return this;
    }

    /**
     *

     * The Amazon Resource Name (ARN) for the service access role you want to use to modify the endpoint.
     *

     *
     * @param serviceAccessRoleArn
     *        The Amazon Resource Name (ARN) for the service access role you want to use to modify the endpoint.
     */

    public void setServiceAccessRoleArn(String serviceAccessRoleArn) {
        this.serviceAccessRoleArn = serviceAccessRoleArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) for the service access role you want to use to modify the endpoint.
     *

     *
     * @return The Amazon Resource Name (ARN) for the service access role you want to use to modify the endpoint.
     */

    public String getServiceAccessRoleArn() {
        return this.serviceAccessRoleArn;
    }

    /**
     *

     * The Amazon Resource Name (ARN) for the service access role you want to use to modify the endpoint.
     *

     *
     * @param serviceAccessRoleArn
     *        The Amazon Resource Name (ARN) for the service access role you want to use to modify the endpoint.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withServiceAccessRoleArn(String serviceAccessRoleArn) {
        setServiceAccessRoleArn(serviceAccessRoleArn);
        return this;
    }

    /**
     *

     * The external table definition.
     *

     *
     * @param externalTableDefinition
     *        The external table definition.
     */

    public void setExternalTableDefinition(String externalTableDefinition) {
        this.externalTableDefinition = externalTableDefinition;
    }

    /**
     *

     * The external table definition.
     *

     *
     * @return The external table definition.
     */

    public String getExternalTableDefinition() {
        return this.externalTableDefinition;
    }

    /**
     *

     * The external table definition.
     *

     *
     * @param externalTableDefinition
     *        The external table definition.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withExternalTableDefinition(String externalTableDefinition) {
        setExternalTableDefinition(externalTableDefinition);
        return this;
    }

    /**
     *

     * Settings in JSON format for the target Amazon DynamoDB endpoint. For more information about the available
     * settings, see Using Object
     * Mapping to Migrate Data to DynamoDB in the AWS Database Migration Service User Guide.
     *

     *
     * @param dynamoDbSettings
     *        Settings in JSON format for the target Amazon DynamoDB endpoint. For more information about the available
     *        settings, see Using
     *        Object Mapping to Migrate Data to DynamoDB in the AWS Database Migration Service User Guide.
     */

    public void setDynamoDbSettings(DynamoDbSettings dynamoDbSettings) {
        this.dynamoDbSettings = dynamoDbSettings;
    }

    /**
     *

     * Settings in JSON format for the target Amazon DynamoDB endpoint. For more information about the available
     * settings, see Using Object
     * Mapping to Migrate Data to DynamoDB in the AWS Database Migration Service User Guide.
     *

     *
     * @return Settings in JSON format for the target Amazon DynamoDB endpoint. For more information about the available
     *         settings, see Using
     *         Object Mapping to Migrate Data to DynamoDB in the AWS Database Migration Service User Guide.
     */

    public DynamoDbSettings getDynamoDbSettings() {
        return this.dynamoDbSettings;
    }

    /**
     *

     * Settings in JSON format for the target Amazon DynamoDB endpoint. For more information about the available
     * settings, see Using Object
     * Mapping to Migrate Data to DynamoDB in the AWS Database Migration Service User Guide.
     *

     *
     * @param dynamoDbSettings
     *        Settings in JSON format for the target Amazon DynamoDB endpoint. For more information about the available
     *        settings, see Using
     *        Object Mapping to Migrate Data to DynamoDB in the AWS Database Migration Service User Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withDynamoDbSettings(DynamoDbSettings dynamoDbSettings) {
        setDynamoDbSettings(dynamoDbSettings);
        return this;
    }

    /**
     *

     * Settings in JSON format for the target Amazon S3 endpoint. For more information about the available settings, see
     * Extra
     * Connection Attributes When Using Amazon S3 as a Target for AWS DMS in the AWS Database Migration Service
     * User Guide.
     *

     *
     * @param s3Settings
     *        Settings in JSON format for the target Amazon S3 endpoint. For more information about the available
     *        settings, see Extra Connection Attributes When Using Amazon S3 as a Target for AWS DMS in the AWS Database
     *        Migration Service User Guide.
     */

    public void setS3Settings(S3Settings s3Settings) {
        this.s3Settings = s3Settings;
    }

    /**
     *

     * Settings in JSON format for the target Amazon S3 endpoint. For more information about the available settings, see
     * Extra
     * Connection Attributes When Using Amazon S3 as a Target for AWS DMS in the AWS Database Migration Service
     * User Guide.
     *

     *
     * @return Settings in JSON format for the target Amazon S3 endpoint. For more information about the available
     *         settings, see Extra Connection Attributes When Using Amazon S3 as a Target for AWS DMS in the AWS Database
     *         Migration Service User Guide.
     */

    public S3Settings getS3Settings() {
        return this.s3Settings;
    }

    /**
     *

     * Settings in JSON format for the target Amazon S3 endpoint. For more information about the available settings, see
     * Extra
     * Connection Attributes When Using Amazon S3 as a Target for AWS DMS in the AWS Database Migration Service
     * User Guide.
     *

     *
     * @param s3Settings
     *        Settings in JSON format for the target Amazon S3 endpoint. For more information about the available
     *        settings, see Extra Connection Attributes When Using Amazon S3 as a Target for AWS DMS in the AWS Database
     *        Migration Service User Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withS3Settings(S3Settings s3Settings) {
        setS3Settings(s3Settings);
        return this;
    }

    /**
     *

     * The settings in JSON format for the DMS transfer type of source endpoint.
     *

     *

     * Attributes include the following:
     *

     *

     *

     *

     * serviceAccessRoleArn - The IAM role that has permission to access the Amazon S3 bucket.
     *

     *

     *

     *

     * BucketName - The name of the S3 bucket to use.
     *

     *

     *

     *

     * compressionType - An optional parameter to use GZIP to compress the target files. Set to NONE (the default) or do
     * not use to leave the files uncompressed.
     *

     *

     *

     *

     * Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string
     *

     *

     * JSON syntax:
     *

     *

     * { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType": "none"|"gzip" }
     *

     *
     * @param dmsTransferSettings
     *        The settings in JSON format for the DMS transfer type of source endpoint.

     *

     *        Attributes include the following:
     *

     *

     *

     *

     *        serviceAccessRoleArn - The IAM role that has permission to access the Amazon S3 bucket.
     *

     *

     *

     *

     *        BucketName - The name of the S3 bucket to use.
     *

     *

     *

     *

     *        compressionType - An optional parameter to use GZIP to compress the target files. Set to NONE (the
     *        default) or do not use to leave the files uncompressed.
     *

     *

     *

     *

     *        Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string
     *

     *

     *        JSON syntax:
     *

     *

     *        { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType": "none"|"gzip" }
     */

    public void setDmsTransferSettings(DmsTransferSettings dmsTransferSettings) {
        this.dmsTransferSettings = dmsTransferSettings;
    }

    /**
     *

     * The settings in JSON format for the DMS transfer type of source endpoint.
     *

     *

     * Attributes include the following:
     *

     *

     *

     *

     * serviceAccessRoleArn - The IAM role that has permission to access the Amazon S3 bucket.
     *

     *

     *

     *

     * BucketName - The name of the S3 bucket to use.
     *

     *

     *

     *

     * compressionType - An optional parameter to use GZIP to compress the target files. Set to NONE (the default) or do
     * not use to leave the files uncompressed.
     *

     *

     *

     *

     * Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string
     *

     *

     * JSON syntax:
     *

     *

     * { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType": "none"|"gzip" }
     *

     *
     * @return The settings in JSON format for the DMS transfer type of source endpoint.

     *

     *         Attributes include the following:
     *

     *

     *

     *

     *         serviceAccessRoleArn - The IAM role that has permission to access the Amazon S3 bucket.
     *

     *

     *

     *

     *         BucketName - The name of the S3 bucket to use.
     *

     *

     *

     *

     *         compressionType - An optional parameter to use GZIP to compress the target files. Set to NONE (the
     *         default) or do not use to leave the files uncompressed.
     *

     *

     *

     *

     *         Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string
     *

     *

     *         JSON syntax:
     *

     *

     *         { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType": "none"|"gzip" }
     */

    public DmsTransferSettings getDmsTransferSettings() {
        return this.dmsTransferSettings;
    }

    /**
     *

     * The settings in JSON format for the DMS transfer type of source endpoint.
     *

     *

     * Attributes include the following:
     *

     *

     *

     *

     * serviceAccessRoleArn - The IAM role that has permission to access the Amazon S3 bucket.
     *

     *

     *

     *

     * BucketName - The name of the S3 bucket to use.
     *

     *

     *

     *

     * compressionType - An optional parameter to use GZIP to compress the target files. Set to NONE (the default) or do
     * not use to leave the files uncompressed.
     *

     *

     *

     *

     * Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string
     *

     *

     * JSON syntax:
     *

     *

     * { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType": "none"|"gzip" }
     *

     *
     * @param dmsTransferSettings
     *        The settings in JSON format for the DMS transfer type of source endpoint.

     *

     *        Attributes include the following:
     *

     *

     *

     *

     *        serviceAccessRoleArn - The IAM role that has permission to access the Amazon S3 bucket.
     *

     *

     *

     *

     *        BucketName - The name of the S3 bucket to use.
     *

     *

     *

     *

     *        compressionType - An optional parameter to use GZIP to compress the target files. Set to NONE (the
     *        default) or do not use to leave the files uncompressed.
     *

     *

     *

     *

     *        Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string
     *

     *

     *        JSON syntax:
     *

     *

     *        { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType": "none"|"gzip" }
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withDmsTransferSettings(DmsTransferSettings dmsTransferSettings) {
        setDmsTransferSettings(dmsTransferSettings);
        return this;
    }

    /**
     *

     * Settings in JSON format for the source MongoDB endpoint. For more information about the available settings, see
     * the configuration properties section in  Using MongoDB as a Target for
     * AWS Database Migration Service in the AWS Database Migration Service User Guide.
     *

     *
     * @param mongoDbSettings
     *        Settings in JSON format for the source MongoDB endpoint. For more information about the available
     *        settings, see the configuration properties section in  Using MongoDB as a
     *        Target for AWS Database Migration Service in the AWS Database Migration Service User Guide.
     */

    public void setMongoDbSettings(MongoDbSettings mongoDbSettings) {
        this.mongoDbSettings = mongoDbSettings;
    }

    /**
     *

     * Settings in JSON format for the source MongoDB endpoint. For more information about the available settings, see
     * the configuration properties section in  Using MongoDB as a Target for
     * AWS Database Migration Service in the AWS Database Migration Service User Guide.
     *

     *
     * @return Settings in JSON format for the source MongoDB endpoint. For more information about the available
     *         settings, see the configuration properties section in  Using MongoDB as a
     *         Target for AWS Database Migration Service in the AWS Database Migration Service User Guide.
     */

    public MongoDbSettings getMongoDbSettings() {
        return this.mongoDbSettings;
    }

    /**
     *

     * Settings in JSON format for the source MongoDB endpoint. For more information about the available settings, see
     * the configuration properties section in  Using MongoDB as a Target for
     * AWS Database Migration Service in the AWS Database Migration Service User Guide.
     *

     *
     * @param mongoDbSettings
     *        Settings in JSON format for the source MongoDB endpoint. For more information about the available
     *        settings, see the configuration properties section in  Using MongoDB as a
     *        Target for AWS Database Migration Service in the AWS Database Migration Service User Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withMongoDbSettings(MongoDbSettings mongoDbSettings) {
        setMongoDbSettings(mongoDbSettings);
        return this;
    }

    /**
     *

     * Settings in JSON format for the target Amazon Kinesis Data Streams endpoint. For more information about the
     * available settings, see Using Object Mapping to Migrate Data to a Kinesis Data Stream in the AWS Database Migration User
     * Guide.
     *

     *
     * @param kinesisSettings
     *        Settings in JSON format for the target Amazon Kinesis Data Streams endpoint. For more information about
     *        the available settings, see Using Object Mapping to Migrate Data to a Kinesis Data Stream in the AWS Database Migration User
     *        Guide.
     */

    public void setKinesisSettings(KinesisSettings kinesisSettings) {
        this.kinesisSettings = kinesisSettings;
    }

    /**
     *

     * Settings in JSON format for the target Amazon Kinesis Data Streams endpoint. For more information about the
     * available settings, see Using Object Mapping to Migrate Data to a Kinesis Data Stream in the AWS Database Migration User
     * Guide.
     *

     *
     * @return Settings in JSON format for the target Amazon Kinesis Data Streams endpoint. For more information about
     *         the available settings, see Using Object Mapping to Migrate Data to a Kinesis Data Stream in the AWS Database Migration User
     *         Guide.
     */

    public KinesisSettings getKinesisSettings() {
        return this.kinesisSettings;
    }

    /**
     *

     * Settings in JSON format for the target Amazon Kinesis Data Streams endpoint. For more information about the
     * available settings, see Using Object Mapping to Migrate Data to a Kinesis Data Stream in the AWS Database Migration User
     * Guide.
     *

     *
     * @param kinesisSettings
     *        Settings in JSON format for the target Amazon Kinesis Data Streams endpoint. For more information about
     *        the available settings, see Using Object Mapping to Migrate Data to a Kinesis Data Stream in the AWS Database Migration User
     *        Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withKinesisSettings(KinesisSettings kinesisSettings) {
        setKinesisSettings(kinesisSettings);
        return this;
    }

    /**
     *

     * Settings in JSON format for the target Elasticsearch endpoint. For more information about the available settings,
     * see Extra Connection Attributes When Using Elasticsearch as a Target for AWS DMS in the AWS Database
     * Migration User Guide.
     *

     *
     * @param elasticsearchSettings
     *        Settings in JSON format for the target Elasticsearch endpoint. For more information about the available
     *        settings, see Extra Connection Attributes When Using Elasticsearch as a Target for AWS DMS in the AWS Database
     *        Migration User Guide.
     */

    public void setElasticsearchSettings(ElasticsearchSettings elasticsearchSettings) {
        this.elasticsearchSettings = elasticsearchSettings;
    }

    /**
     *

     * Settings in JSON format for the target Elasticsearch endpoint. For more information about the available settings,
     * see Extra Connection Attributes When Using Elasticsearch as a Target for AWS DMS in the AWS Database
     * Migration User Guide.
     *

     *
     * @return Settings in JSON format for the target Elasticsearch endpoint. For more information about the available
     *         settings, see Extra Connection Attributes When Using Elasticsearch as a Target for AWS DMS in the AWS Database
     *         Migration User Guide.
     */

    public ElasticsearchSettings getElasticsearchSettings() {
        return this.elasticsearchSettings;
    }

    /**
     *

     * Settings in JSON format for the target Elasticsearch endpoint. For more information about the available settings,
     * see Extra Connection Attributes When Using Elasticsearch as a Target for AWS DMS in the AWS Database
     * Migration User Guide.
     *

     *
     * @param elasticsearchSettings
     *        Settings in JSON format for the target Elasticsearch endpoint. For more information about the available
     *        settings, see Extra Connection Attributes When Using Elasticsearch as a Target for AWS DMS in the AWS Database
     *        Migration User Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withElasticsearchSettings(ElasticsearchSettings elasticsearchSettings) {
        setElasticsearchSettings(elasticsearchSettings);
        return this;
    }

    /**
     * @param redshiftSettings
     */

    public void setRedshiftSettings(RedshiftSettings redshiftSettings) {
        this.redshiftSettings = redshiftSettings;
    }

    /**
     * @return
     */

    public RedshiftSettings getRedshiftSettings() {
        return this.redshiftSettings;
    }

    /**
     * @param redshiftSettings
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ModifyEndpointRequest withRedshiftSettings(RedshiftSettings redshiftSettings) {
        setRedshiftSettings(redshiftSettings);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getEndpointArn() != null)
            sb.append("EndpointArn: ").append(getEndpointArn()).append(",");
        if (getEndpointIdentifier() != null)
            sb.append("EndpointIdentifier: ").append(getEndpointIdentifier()).append(",");
        if (getEndpointType() != null)
            sb.append("EndpointType: ").append(getEndpointType()).append(",");
        if (getEngineName() != null)
            sb.append("EngineName: ").append(getEngineName()).append(",");
        if (getUsername() != null)
            sb.append("Username: ").append(getUsername()).append(",");
        if (getPassword() != null)
            sb.append("Password: ").append("***Sensitive Data Redacted***").append(",");
        if (getServerName() != null)
            sb.append("ServerName: ").append(getServerName()).append(",");
        if (getPort() != null)
            sb.append("Port: ").append(getPort()).append(",");
        if (getDatabaseName() != null)
            sb.append("DatabaseName: ").append(getDatabaseName()).append(",");
        if (getExtraConnectionAttributes() != null)
            sb.append("ExtraConnectionAttributes: ").append(getExtraConnectionAttributes()).append(",");
        if (getCertificateArn() != null)
            sb.append("CertificateArn: ").append(getCertificateArn()).append(",");
        if (getSslMode() != null)
            sb.append("SslMode: ").append(getSslMode()).append(",");
        if (getServiceAccessRoleArn() != null)
            sb.append("ServiceAccessRoleArn: ").append(getServiceAccessRoleArn()).append(",");
        if (getExternalTableDefinition() != null)
            sb.append("ExternalTableDefinition: ").append(getExternalTableDefinition()).append(",");
        if (getDynamoDbSettings() != null)
            sb.append("DynamoDbSettings: ").append(getDynamoDbSettings()).append(",");
        if (getS3Settings() != null)
            sb.append("S3Settings: ").append(getS3Settings()).append(",");
        if (getDmsTransferSettings() != null)
            sb.append("DmsTransferSettings: ").append(getDmsTransferSettings()).append(",");
        if (getMongoDbSettings() != null)
            sb.append("MongoDbSettings: ").append(getMongoDbSettings()).append(",");
        if (getKinesisSettings() != null)
            sb.append("KinesisSettings: ").append(getKinesisSettings()).append(",");
        if (getElasticsearchSettings() != null)
            sb.append("ElasticsearchSettings: ").append(getElasticsearchSettings()).append(",");
        if (getRedshiftSettings() != null)
            sb.append("RedshiftSettings: ").append(getRedshiftSettings());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ModifyEndpointRequest == false)
            return false;
        ModifyEndpointRequest other = (ModifyEndpointRequest) obj;
        if (other.getEndpointArn() == null ^ this.getEndpointArn() == null)
            return false;
        if (other.getEndpointArn() != null && other.getEndpointArn().equals(this.getEndpointArn()) == false)
            return false;
        if (other.getEndpointIdentifier() == null ^ this.getEndpointIdentifier() == null)
            return false;
        if (other.getEndpointIdentifier() != null && other.getEndpointIdentifier().equals(this.getEndpointIdentifier()) == false)
            return false;
        if (other.getEndpointType() == null ^ this.getEndpointType() == null)
            return false;
        if (other.getEndpointType() != null && other.getEndpointType().equals(this.getEndpointType()) == false)
            return false;
        if (other.getEngineName() == null ^ this.getEngineName() == null)
            return false;
        if (other.getEngineName() != null && other.getEngineName().equals(this.getEngineName()) == false)
            return false;
        if (other.getUsername() == null ^ this.getUsername() == null)
            return false;
        if (other.getUsername() != null && other.getUsername().equals(this.getUsername()) == false)
            return false;
        if (other.getPassword() == null ^ this.getPassword() == null)
            return false;
        if (other.getPassword() != null && other.getPassword().equals(this.getPassword()) == false)
            return false;
        if (other.getServerName() == null ^ this.getServerName() == null)
            return false;
        if (other.getServerName() != null && other.getServerName().equals(this.getServerName()) == false)
            return false;
        if (other.getPort() == null ^ this.getPort() == null)
            return false;
        if (other.getPort() != null && other.getPort().equals(this.getPort()) == false)
            return false;
        if (other.getDatabaseName() == null ^ this.getDatabaseName() == null)
            return false;
        if (other.getDatabaseName() != null && other.getDatabaseName().equals(this.getDatabaseName()) == false)
            return false;
        if (other.getExtraConnectionAttributes() == null ^ this.getExtraConnectionAttributes() == null)
            return false;
        if (other.getExtraConnectionAttributes() != null && other.getExtraConnectionAttributes().equals(this.getExtraConnectionAttributes()) == false)
            return false;
        if (other.getCertificateArn() == null ^ this.getCertificateArn() == null)
            return false;
        if (other.getCertificateArn() != null && other.getCertificateArn().equals(this.getCertificateArn()) == false)
            return false;
        if (other.getSslMode() == null ^ this.getSslMode() == null)
            return false;
        if (other.getSslMode() != null && other.getSslMode().equals(this.getSslMode()) == false)
            return false;
        if (other.getServiceAccessRoleArn() == null ^ this.getServiceAccessRoleArn() == null)
            return false;
        if (other.getServiceAccessRoleArn() != null && other.getServiceAccessRoleArn().equals(this.getServiceAccessRoleArn()) == false)
            return false;
        if (other.getExternalTableDefinition() == null ^ this.getExternalTableDefinition() == null)
            return false;
        if (other.getExternalTableDefinition() != null && other.getExternalTableDefinition().equals(this.getExternalTableDefinition()) == false)
            return false;
        if (other.getDynamoDbSettings() == null ^ this.getDynamoDbSettings() == null)
            return false;
        if (other.getDynamoDbSettings() != null && other.getDynamoDbSettings().equals(this.getDynamoDbSettings()) == false)
            return false;
        if (other.getS3Settings() == null ^ this.getS3Settings() == null)
            return false;
        if (other.getS3Settings() != null && other.getS3Settings().equals(this.getS3Settings()) == false)
            return false;
        if (other.getDmsTransferSettings() == null ^ this.getDmsTransferSettings() == null)
            return false;
        if (other.getDmsTransferSettings() != null && other.getDmsTransferSettings().equals(this.getDmsTransferSettings()) == false)
            return false;
        if (other.getMongoDbSettings() == null ^ this.getMongoDbSettings() == null)
            return false;
        if (other.getMongoDbSettings() != null && other.getMongoDbSettings().equals(this.getMongoDbSettings()) == false)
            return false;
        if (other.getKinesisSettings() == null ^ this.getKinesisSettings() == null)
            return false;
        if (other.getKinesisSettings() != null && other.getKinesisSettings().equals(this.getKinesisSettings()) == false)
            return false;
        if (other.getElasticsearchSettings() == null ^ this.getElasticsearchSettings() == null)
            return false;
        if (other.getElasticsearchSettings() != null && other.getElasticsearchSettings().equals(this.getElasticsearchSettings()) == false)
            return false;
        if (other.getRedshiftSettings() == null ^ this.getRedshiftSettings() == null)
            return false;
        if (other.getRedshiftSettings() != null && other.getRedshiftSettings().equals(this.getRedshiftSettings()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getEndpointArn() == null) ? 0 : getEndpointArn().hashCode());
        hashCode = prime * hashCode + ((getEndpointIdentifier() == null) ? 0 : getEndpointIdentifier().hashCode());
        hashCode = prime * hashCode + ((getEndpointType() == null) ? 0 : getEndpointType().hashCode());
        hashCode = prime * hashCode + ((getEngineName() == null) ? 0 : getEngineName().hashCode());
        hashCode = prime * hashCode + ((getUsername() == null) ? 0 : getUsername().hashCode());
        hashCode = prime * hashCode + ((getPassword() == null) ? 0 : getPassword().hashCode());
        hashCode = prime * hashCode + ((getServerName() == null) ? 0 : getServerName().hashCode());
        hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode());
        hashCode = prime * hashCode + ((getDatabaseName() == null) ? 0 : getDatabaseName().hashCode());
        hashCode = prime * hashCode + ((getExtraConnectionAttributes() == null) ? 0 : getExtraConnectionAttributes().hashCode());
        hashCode = prime * hashCode + ((getCertificateArn() == null) ? 0 : getCertificateArn().hashCode());
        hashCode = prime * hashCode + ((getSslMode() == null) ? 0 : getSslMode().hashCode());
        hashCode = prime * hashCode + ((getServiceAccessRoleArn() == null) ? 0 : getServiceAccessRoleArn().hashCode());
        hashCode = prime * hashCode + ((getExternalTableDefinition() == null) ? 0 : getExternalTableDefinition().hashCode());
        hashCode = prime * hashCode + ((getDynamoDbSettings() == null) ? 0 : getDynamoDbSettings().hashCode());
        hashCode = prime * hashCode + ((getS3Settings() == null) ? 0 : getS3Settings().hashCode());
        hashCode = prime * hashCode + ((getDmsTransferSettings() == null) ? 0 : getDmsTransferSettings().hashCode());
        hashCode = prime * hashCode + ((getMongoDbSettings() == null) ? 0 : getMongoDbSettings().hashCode());
        hashCode = prime * hashCode + ((getKinesisSettings() == null) ? 0 : getKinesisSettings().hashCode());
        hashCode = prime * hashCode + ((getElasticsearchSettings() == null) ? 0 : getElasticsearchSettings().hashCode());
        hashCode = prime * hashCode + ((getRedshiftSettings() == null) ? 0 : getRedshiftSettings().hashCode());
        return hashCode;
    }

    @Override
    public ModifyEndpointRequest clone() {
        return (ModifyEndpointRequest) super.clone();
    }

}


text:
package org.apache.metron.rest.controller;

import org.apache.metron.common.configuration.SensorParserConfig;
import org.apache.metron.rest.model.TopologyStatusCode;
import org.apache.metron.rest.service.GlobalConfigService;
import org.apache.metron.rest.service.SensorParserConfigService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.env.Environment;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;

import java.util.HashMap;
import java.util.Map;

import static org.apache.metron.rest.MetronRestConstants.TEST_PROFILE;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasSize;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic;
import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles(TEST_PROFILE)
public class StormControllerIntegrationTest {

  @Autowired
  private Environment environment;

  @Autowired
  private WebApplicationContext wac;

  @Autowired
  private GlobalConfigService globalConfigService;

  @Autowired
  private SensorParserConfigService sensorParserConfigService;

  private MockMvc mockMvc;

  private String stormUrl = "/api/v1/storm";
  private String user = "user";
  private String password = "password";

  private String metronVersion;

  @Before
  public void setup() throws Exception {
    this.metronVersion = this.environment.getProperty("metron.version");
    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).apply(springSecurity()).build();
  }

  @Test
  public void testSecurity() throws Exception {
    this.mockMvc.perform(get(stormUrl))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/broTest"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/parser/start/broTest"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/parser/stop/broTest"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/parser/activate/broTest"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/parser/deactivate/broTest"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get("/enrichment"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/enrichment/start"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/enrichment/stop"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/enrichment/activate"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/enrichment/deactivate"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get("/indexing"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/indexing/start"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/indexing/stop"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/indexing/activate"))
            .andExpect(status().isUnauthorized());

    this.mockMvc.perform(get(stormUrl + "/indexing/deactivate"))
            .andExpect(status().isUnauthorized());
  }

  @Test
  public void test() throws Exception {
    this.mockMvc.perform(get(stormUrl).with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$", hasSize(0)));

    this.mockMvc.perform(get(stormUrl + "/broTest").with(httpBasic(user,password)))
            .andExpect(status().isNotFound());

    Map<String, Object> globalConfig = globalConfigService.get();
    if (globalConfig == null) {
      globalConfig = new HashMap<>();
    }
    globalConfigService.delete();
    sensorParserConfigService.delete("broTest");

    this.mockMvc.perform(get(stormUrl + "/parser/stop/broTest?stopNow=true").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.STOP_ERROR.toString()));

    this.mockMvc.perform(get(stormUrl + "/parser/activate/broTest").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.TOPOLOGY_NOT_FOUND.name()));

    this.mockMvc.perform(get(stormUrl + "/parser/deactivate/broTest").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.TOPOLOGY_NOT_FOUND.name()));

    this.mockMvc.perform(get(stormUrl + "/parser/start/broTest").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.GLOBAL_CONFIG_MISSING.name()));

    globalConfigService.save(globalConfig);

    this.mockMvc.perform(get(stormUrl + "/parser/start/broTest").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.SENSOR_PARSER_CONFIG_MISSING.name()));

    SensorParserConfig sensorParserConfig = new SensorParserConfig();
    sensorParserConfig.setParserClassName("org.apache.metron.parsers.bro.BasicBroParser");
    sensorParserConfig.setSensorTopic("broTest");
    sensorParserConfigService.save(sensorParserConfig);

    this.mockMvc.perform(get(stormUrl + "/parser/start/broTest").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.STARTED.name()));

    this.mockMvc.perform(get(stormUrl + "/broTest").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8")))
            .andExpect(jsonPath("$.name").value("broTest"))
            .andExpect(jsonPath("$.id", containsString("broTest")))
            .andExpect(jsonPath("$.status").value("ACTIVE"))
            .andExpect(jsonPath("$.latency").exists())
            .andExpect(jsonPath("$.throughput").exists())
            .andExpect(jsonPath("$.emitted").exists())
            .andExpect(jsonPath("$.acked").exists());

    this.mockMvc.perform(get(stormUrl).with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8")))
            .andExpect(jsonPath("$[?(@.name == 'broTest' && @.status == 'ACTIVE')]").exists());

    this.mockMvc.perform(get(stormUrl + "/parser/stop/broTest?stopNow=true").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.STOPPED.name()));

    this.mockMvc.perform(get(stormUrl + "/enrichment").with(httpBasic(user,password)))
            .andExpect(status().isNotFound());

    this.mockMvc.perform(get(stormUrl + "/enrichment/activate").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.TOPOLOGY_NOT_FOUND.name()));

    this.mockMvc.perform(get(stormUrl + "/enrichment/deactivate").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.TOPOLOGY_NOT_FOUND.name()));

    this.mockMvc.perform(get(stormUrl + "/enrichment/stop?stopNow=true").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.STOP_ERROR.toString()));

    this.mockMvc.perform(get(stormUrl + "/enrichment/start").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.STARTED.toString()));

    this.mockMvc.perform(get(stormUrl + "/enrichment/deactivate").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.INACTIVE.name()));

    this.mockMvc.perform(get(stormUrl + "/enrichment/deactivate").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.INACTIVE.name()));

    this.mockMvc.perform(get(stormUrl + "/enrichment/activate").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.ACTIVE.name()));

    this.mockMvc.perform(get(stormUrl + "/enrichment").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8")))
            .andExpect(jsonPath("$.name").value("enrichment"))
            .andExpect(jsonPath("$.id", containsString("enrichment")))
            .andExpect(jsonPath("$.status").value("ACTIVE"))
            .andExpect(jsonPath("$.latency").exists())
            .andExpect(jsonPath("$.throughput").exists())
            .andExpect(jsonPath("$.emitted").exists())
            .andExpect(jsonPath("$.acked").exists());

    this.mockMvc.perform(get(stormUrl).with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8")))
            .andExpect(jsonPath("$[?(@.name == 'enrichment' && @.status == 'ACTIVE')]").exists());

    this.mockMvc.perform(get(stormUrl + "/enrichment/stop").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.STOPPED.name()));

    this.mockMvc.perform(get(stormUrl + "/indexing").with(httpBasic(user,password)))
            .andExpect(status().isNotFound());

    this.mockMvc.perform(get(stormUrl + "/indexing/activate").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.TOPOLOGY_NOT_FOUND.name()));

    this.mockMvc.perform(get(stormUrl + "/indexing/deactivate").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.TOPOLOGY_NOT_FOUND.name()));

    this.mockMvc.perform(get(stormUrl + "/indexing/stop?stopNow=true").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("ERROR"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.STOP_ERROR.toString()));

    this.mockMvc.perform(get(stormUrl + "/indexing/start").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.STARTED.toString()));

    this.mockMvc.perform(get(stormUrl + "/indexing/deactivate").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.INACTIVE.name()));

    this.mockMvc.perform(get(stormUrl + "/indexing/activate").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.ACTIVE.name()));

    this.mockMvc.perform(get(stormUrl + "/indexing").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8")))
            .andExpect(jsonPath("$.name").value("indexing"))
            .andExpect(jsonPath("$.id", containsString("indexing")))
            .andExpect(jsonPath("$.status").value("ACTIVE"))
            .andExpect(jsonPath("$.latency").exists())
            .andExpect(jsonPath("$.throughput").exists())
            .andExpect(jsonPath("$.emitted").exists())
            .andExpect(jsonPath("$.acked").exists());

    this.mockMvc.perform(get(stormUrl).with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.parseMediaType("application/json;charset=UTF-8")))
            .andExpect(jsonPath("$[?(@.name == 'indexing' && @.status == 'ACTIVE')]").exists());

    this.mockMvc.perform(get(stormUrl + "/indexing/stop").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status").value("SUCCESS"))
            .andExpect(jsonPath("$.message").value(TopologyStatusCode.STOPPED.name()));

    this.mockMvc.perform(get(stormUrl + "/client/status").with(httpBasic(user,password)))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.stormClientVersionInstalled").value("1.0.1"))
            .andExpect(jsonPath("$.parserScriptPath").value("/usr/metron/" + metronVersion + "/bin/start_parser_topology.sh"))
            .andExpect(jsonPath("$.enrichmentScriptPath").value("/usr/metron/" + metronVersion + "/bin/start_enrichment_topology.sh"))
            .andExpect(jsonPath("$.indexingScriptPath").value("/usr/metron/" + metronVersion + "/bin/start_elasticsearch_topology.sh"));

    globalConfigService.delete();
    sensorParserConfigService.delete("broTest");
  }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Secret Santa 2014/Xmas</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="msapplication-config" content="none"/>
    <link rel="stylesheet" href="../static/css/bootstrap.css">

Edit

Id: 862

Lyrics: Νίκος Καβαδίας

Musician: Θάνος Μικρούτσικος

No YouTube Link found

        Original Lyrics:
Ο Γουίλι ο μαύρος θερμαστής από το Τζιμπουτί
όταν από τη βάρδια του τη βραδινή σχολούσε
στην κάμαρά μου ερχότανε γελώντας να με βρει
κι ώρες πολλές για πράγματα περίεργα μου μιλούσε

Μου `λεγε πώς καπνίζουνε στο Αλγέρι το χασίς
και στο Άντεν πώς χορεύοντας πίνουν την άσπρη σκόνη
κι έπειτα πώς φωνάζουνε και πώς μονολογούν
όταν η ζάλη μ' όνειρα περίεργα τους κυκλώνει

Μου `λεγε ακόμα ότι είδε αυτός μια νύχτα που `χε πιει
πως πάνω σ' άτι εκάλπαζε στην πλάτη της θαλάσσης
και πίσωθε του ετρέχανε γοργόνες με φτερά
σαν πάμε στ' Άντεν μου `λεγε κι εσύ θα δοκιμάσεις

Εγώ γλυκά του χάριζα και λάμες ξυραφιών
και του `λεγα πως το χασίς τον άνθρωπο σκοτώνει
και τότε αυτός συνήθιζε γελώντας τρανταχτά
με το `να χέρι του ψηλά πολύ να με σηκώνει

Μες στο τεράστιο σώμα του είχε μια αθώα καρδιά
κάποια νυχτιά μέσα στο μπαρ Ρετζίνα στη Μαρσίλια
για να φυλάξει εμένα από έναν Ισπανό
έφαγε αυτός μια αδειανή στην κεφαλή μποτίλια

Μια μέρα τον αφήσαμε στεγνό απ' τον πυρετό
πέρα στην Άπω Ανατολή να φλέγεται να λιώνει
θεέ των μαύρων, τον καλό συγχώρεσε Γουίλ
και δώσ' του εκεί που βρίσκεται λίγη απ' την άσπρη σκόνη

        Transcribed Lyrics:
O Gouili o mavros thermastis apo to Tzimpouti
otan apo ti vardia tou ti vradini scholouse
stin kamara mou erchotane gelontas na me vrei
ki ores polles gia pragmata perierga mou milouse

Mou `lege pos kapnizoune sto Algeri to chasis
kai sto Anten pos chorevontas pinoun tin aspri skoni
ki epeita pos fonazoune kai pos monologoun
otan i zali m' oneira perierga tous kyklonei

Mou `lege akoma oti eide aftos mia nychta pou `che piei
pos pano s' ati ekalpaze stin plati tis thalassis
kai pisothe tou etrechane gorgones me ftera
san pame st' Anten mou `lege ki esy tha dokimaseis

Ego glyka tou chariza kai lames xyrafion
kai tou `lega pos to chasis ton anthropo skotonei
kai tote aftos synithize gelontas trantachta
me to `na cheri tou psila poly na me sikonei

Mes sto terastio soma tou eiche mia athoa kardia
kapoia nychtia mesa sto bar Retzina sti Marsilia
gia na fylaxei emena apo enan Ispano
efage aftos mia adeiani stin kefali botilia

Mia mera ton afisame stegno ap' ton pyreto
pera stin Apo Anatoli na flegetai na lionei
thee ton mavron, ton kalo synchorese Gouil
kai dos' tou ekei pou vrisketai ligi ap' tin aspri skoni

        Translated Lyrics:
Willie, the black boiler man from Djibouti
right when he got off his night shift
he came to find me in my bedroom, laughing
and talked to me about weird thing for hours

He told me how they smoke weed in Algeria
and how they snort the white powder in Aden
and how they shout and talk to themselves afterwards
when the grogginess surrounds them with weird dreams

He also told me that one night after snorting he had seen
that he was riding on horses on the back of the sea
and mermaids with wings were running behind him
"when we go to Aden", he told me, "you will try it too"

I gave him sweets and razor blades
and told him that hashish kills
and then he used to laugh loudly and
lift me high above the ground with his hand

Inside his huge body he had an innocent heart
one night in the bar "Redginda" in Marseille
in order to protect me from a Spaniard
he took a hit on the head from an empty bottle

One day we left him dry from the fever
burning up over there in the Far East
God of black people forgive the kind Will
and give him, wherever he is, some white powder


text:
/*=============================================================================

    This file is part of FLINT.

    FLINT is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    FLINT is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with FLINT; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

=============================================================================*/
/******************************************************************************

    Copyright (C) 2006, 2011 William Hart

******************************************************************************/

#ifndef QSIEVE_H
#define QSIEVE_H

#include <mpir.h>
#include "flint.h"
#include "fmpz.h"

#ifdef __cplusplus
 extern "C" {
#endif

#if FLINT_BITS==64
   #ifndef uint64_t
   #define uint64_t unsigned long
   #endif
#else
   #include <stdint.h>
#endif

/*
    Debug verbosity (bits are as follows):
     >0   - print headings for each phase of the sieve and some
            simple data about the number of FB primes used, etc.
      2   - print poly A coeffs
      4   - print polynomials used
      8   - print relations
      16  - print statistics for sieve contents
      32  - print X values for each sieve entry that passes initial sieve test
      64  - print information about the number of duplicate relations
      128 - print lanczos information and errors
*/
#define QS_DEBUG 0

#define CACHE_SIZE 65536 /* size of L1 cache */

typedef struct prime_t
{
   mp_limb_t pinv; /* precomputed inverse */
   int p; /* prime */
   char size;
} prime_t;

typedef struct fac_t /* struct for factors of relations */
{
   long ind;
   long exp;
} fac_t;

typedef struct la_col_t /* matrix column */
{
	long * data;		/* The list of occupied rows in this column */
	long weight;		/* Number of nonzero entries in this column */
	long orig;         /* Original relation number */
} la_col_t;

typedef struct qs_s
{
   mp_limb_t hi; /* Number to factor */
   mp_limb_t lo;

   mp_bitcnt_t bits; /* Number of bits of n */

   ulong ks_primes; /* number of Knuth-Schroeppel primes */

   mp_limb_t k; /* Multiplier */
   fmpz_t kn; /* kn as a multiprecision integer */

   long num_primes; /* number of factor base primes including k and 2 */
   long small_primes; /* number of primes to not sieve with */
   long sieve_size; /* size of sieve to use */

   prime_t * factor_base; /* data about factor base primes */

   int * sqrts; /* square roots of kn mod factor base primes */

   char sieve_bits; /* number of bits to exceed in sieve */

   /******************
     Polynomial data
   ******************/

   mp_limb_t A; /* coefficient A */
   mp_limb_t B; /* coefficient B */
   fmpz_t C; /* coefficient C */

   mp_limb_t * A_ind; /* indices of factor base primes dividing A */
   mp_limb_t * A_modp; /* (A/p) mod p for each prime p dividing A */
   mp_limb_t * inv_p2; /* newton inverse of p^2 for each factor p of A */

   mp_limb_t * B_terms; /*
                           Let A_i = (A/p) mod p where p is the i-th prime
                           which is a factor of A, then B_terms[i] is
                           {p^(1/2) / A_i} mod p * (A/p) where we take
                           the smaller square root of p
                        */

   mp_limb_t * A_inv; /* A^(-1) mod p */

   mp_limb_t ** A_inv2B; /* A_inv[j][i] = 2*B_terms[j]*A^(-1) mod p */

   mp_limb_t * soln1; /* first root of poly */
   mp_limb_t * soln2; /* second root of poly */

   mp_limb_t target_A; /* approximate target value for A coeff of poly */

   long s; /* number of prime factors of A coeff */
   long min; /* minimum FB prime that can appear as factor of A */
   long span; /* size of set of possible prime factors of A */
   long fact; /* middle of set of possible prime factors of A */
   long mid; /* start of range for middle factor */
   long high; /* end of range for middle factor */

   /*********************
     Relations data
   **********************/

   long qsort_rels; /* number of relations to accumulate before sorting */
   long extra_rels; /* number of extra relations beyond num_primes */
   long max_factors; /* maximum number of factors a relation can have */

   long * small; /* exponents of small prime factors in relations */
   fac_t * factor; /* factors for a relation */
   fmpz * Y_arr; /* array of Y's corresponding to relations */
   long * curr_rel; /* current relation in array of relations */
   long * relation; /* relation array */

   long buffer_size; /* size of buffer of relations */
   long num_relations; /* number of relations so far */

   long num_factors; /* number of factors found in a relation */

   /*********************
     Linear algebra data
   **********************/

   la_col_t * matrix; /* the main matrix over GF(2) in sparse format */
   la_col_t * unmerged; /* unmerged matrix columns */
   la_col_t ** qsort_arr; /* array of columns ready to be sorted */

   long num_unmerged; /* number of columns unmerged */
   long columns; /* number of columns in matrix so far */

   /*********************
     Square root data
   **********************/

   long * prime_count; /* counts of the exponents of primes appearing in the square */

   /*********************
     Statistics
   **********************/

#if (QS_DEBUG & 16)
   long * sieve_tally;
#endif

} qs_s;

typedef qs_s qs_t[1];

/*
   Tuning parameters { bits, ks_primes, fb_primes, small_primes }
   for qsieve_ll_factor where:
     * bits is the number of bits of n
     * ks_primes is the max number of primes to try in Knuth-Schroeppel algo
     * fb_primes is the number of factor base primes to use (including k and 2)
     * small_primes is the number of small primes to not factor with (including k and 2)
     * sieve_size is the size of the sieve to use
*/
static const mp_limb_t qsieve_ll_tune[][5] =
{
    {0, 50, 80, 2, 14000 },
    {30, 50, 80, 2, 16000 },
    {40, 50, 100, 3, 18000 },
    {50, 50, 120, 3, 20000 },
    {60, 50, 140, 4, 22000 },
    {70, 50, 160, 4, 24000 },
    {80, 100, 180, 5, 26000 },
    {90, 100, 200, 5, 28000 },
    {100, 100, 250, 6, 30000 },
    {110, 100, 300, 6, 34000 },
    {120, 100, 500, 7, 40000 },
    {130, 100, 550, 7, 60000 }
};

/* number of entries in the tuning table */
#define QS_LL_TUNE_SIZE (sizeof(qsieve_ll_tune)/(5*sizeof(mp_limb_t)))

#define P_GOODNESS 100 /* within what factor of target_A must A be */
#define P_GOODNESS2 200 /* within what factor of target_A must A be when s = 2 */

#define BITS_ADJUST 10 /* no. bits less than f(X) to qualify for trial division */

void qsieve_ll_init(qs_t qs_inf, mp_limb_t hi, mp_limb_t lo);

void qsieve_ll_clear(qs_t qs_inf);

mp_limb_t qsieve_ll_knuth_schroeppel(qs_t qs_inf);

mp_limb_t qsieve_ll_primes_init(qs_t qs_inf);

mp_limb_t qsieve_ll_poly_init(qs_t qs_inf);

void qsieve_ll_linalg_init(qs_t qs_inf);

void qsieve_ll_compute_poly_data(qs_t qs_inf);

void qsieve_ll_compute_A_factor_offsets(qs_t qs_inf);

void qsieve_ll_compute_C(qs_t qs_inf);

long qsieve_ll_collect_relations(qs_t qs_inf, char * sieve);

long qsieve_ll_merge_sort(qs_t qs_inf);

long qsieve_ll_merge_relations(qs_t qs_inf);

long qsieve_ll_insert_relation(qs_t qs_inf, fmpz_t Y);

mp_limb_t qsieve_ll_factor(mp_limb_t hi, mp_limb_t lo);

static __inline__ void insert_col_entry(la_col_t * col, long entry)
{
   if (((col->weight >> 4) << 4) == col->weight) /* need more space */
   {
       if (col->weight != 0) col->data =
           (long *) flint_realloc(col->data, (col->weight + 16)*sizeof(long));
       else col->data = (long *) flint_malloc(16*sizeof(long));
   }

   col->data[col->weight] = entry;
   col->weight++;
}

static __inline__ void copy_col(la_col_t * col2, la_col_t * col1)
{
   col2->weight = col1->weight;
   col2->data = col1->data;
   col2->orig = col1->orig;
}

static __inline__ void swap_cols(la_col_t * col2, la_col_t * col1)
{
   la_col_t temp;

   temp.weight = col1->weight;
   temp.data = col1->data;
   temp.orig = col1->orig;

   col1->weight = col2->weight;
   col1->data = col2->data;
   col1->orig = col2->orig;

   col2->weight = temp.weight;
   col2->data = temp.data;
   col2->orig = temp.orig;
}

static __inline__ void clear_col(la_col_t * col)
{
   col->weight = 0;
}

static __inline__ void free_col(la_col_t * col)
{
   if (col->weight) flint_free(col->data);
}

uint64_t get_null_entry(uint64_t * nullrows, long i, long l);

void reduce_matrix(qs_t qs_inf, long * nrows, long * ncols, la_col_t * cols);

uint64_t * block_lanczos(flint_rand_t state, long nrows, long dense_rows,
                                                       long ncols, la_col_t *B);

void qsieve_ll_square_root(fmpz_t X, fmpz_t Y, qs_t qs_inf,
                             uint64_t * nullrows, long ncols, long l, fmpz_t N);

#ifdef __cplusplus
}
#endif

#endif


text:
/* ============
 * CSS Helper
 * ============
 *
 * A CSS helper for BEM structured styling.
 */

export default {
  /**
   * The element separator.
   */
  elementSeparator: '__',

  /**
   * The modifier separator.
   */
  modifierSeparator: '--',

  /**
   * Method which transform an element to a BEM-element
   *
   * @param {string} block   The name of the block.
   * @param {string} element The name of the element.
   *
   * @returns {string} The corrected CSS class.
   */
  has(block, element) {
    return block + this.elementSeparator + element;
  },

  /**
   * Method which transform an item to a BEM-element.
   *
   * @param {string} item    The name of the item.
   * @param {string} variant The name of the variant.
   *
   * @returns {string} The corrected CSS class.
   */
  variant(item, variant) {
    return item + this.modifierSeparator + variant;
  },

  /**
   * Method which transforms a collection of variants to a collection of BEM-elements.
   *
   * @param {string} item     The name of the item.
   * @param {Array}  variants The variants.
   *
   * @returns {Array} The corrected CSS classes.
   */
  variants(item, variants = []) {
    return variants.map(variant => this.variant(item, variant));
  },

  /**
   * Method used to compute the class names for an item with the given variants.
   *
   * @param {string} item     The name of the item.
   * @param {Array}  variants The variants.
   *
   * @returns {Array} The collection of class names.
   */
  getClassNames(item, variants = []) {
    const classNames = [item];

    return variants.length > 0 ?
      classNames.concat(this.variants(item, variants)) :
      classNames;
  },

  /**
   * Method used to compute the class names for a block.
   *
   * @param {string} block    The name of the block.
   * @param {Array}  variants The variants of the block.
   *
   * @returns {Array} The collection of class names.
   */
  getBlockClasses(block, variants = []) {
    return this.getClassNames(block, variants);
  },

  /**
   * Method used to computed the class names for a element.
   *
   * @param {string} block    The name of the block.
   * @param {string} element  The name of the element.
   * @param {Array}  variants The variants of the element.
   *
   * @returns {Array} The collection of class names.
   */
  getElementClasses(block, element, variants = []) {
    const elementClass = this.has(block, element);

    return this.getClassNames(elementClass, variants);
  },
};


text:
(function() {
	"use strict";
    angular
        .module('Bookly.register', [
            "ui.router"
        ])
        .config(["$stateProvider", function($stateProvider) {
            $stateProvider
                .state("register", {
                    url: "/register",
                    views: {
                        "content": {
                            templateUrl: "register/tmpl/register.html",
                            controller: "RegisterCtrl",
                            controllerAs: "vm"
                        }
                    },
                });
        }]);
}());