text:
package com.swfarm.biz.salechannel.srv.impl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Restrictions;

import com.swfarm.biz.aliexpress.dto.SearchAliExpressAccountsCriteria;
import com.swfarm.biz.aliexpress.srv.AliExpressService;
import com.swfarm.biz.amazon.dto.SearchAmazonAccountsCriteria;
import com.swfarm.biz.amazon.srv.AmazonService;
import com.swfarm.biz.chain.bo.CustomerOrder;
import com.swfarm.biz.chain.bo.CustomerOrderItem;
import com.swfarm.biz.chain.srv.ChainService;
import com.swfarm.biz.ebay.dto.SearchEbayAccountsCriteria;
import com.swfarm.biz.ebay.srv.EbayService;
import com.swfarm.biz.oa.srv.UserService;
import com.swfarm.biz.salechannel.bo.SkuOnSaleReportItem;
import com.swfarm.biz.salechannel.dto.SearchSkuOnSaleReportItemsCriteria;
import com.swfarm.biz.salechannel.srv.SaleChannelService;
import com.swfarm.biz.warehouse.srv.WarehouseService;
import com.swfarm.biz.wish.dto.SearchWishAccountsCriteria;
import com.swfarm.biz.wish.srv.WishService;
import com.swfarm.pub.framework.PaginationSupport;
import com.swfarm.pub.framework.srv.PersistenceService;
import com.swfarm.pub.utils.DbUtils;

public class SaleChannelServiceImpl implements SaleChannelService {

	Logger logger = Logger.getLogger(SaleChannelServiceImpl.class);

	private EbayService ebayService;

	private AliExpressService aliExpressService;

	private WishService wishService;

	private AmazonService amazonService;

	private UserService userService;

	private WarehouseService warehouseService;

	private ChainService chainService;

	private PersistenceService persistenceService;

	public void setPersistenceService(PersistenceService persistenceService) {
		this.persistenceService = persistenceService;
	}

	public void setEbayService(EbayService ebayService) {
		this.ebayService = ebayService;
	}

	public void setAliExpressService(AliExpressService aliExpressService) {
		this.aliExpressService = aliExpressService;
	}

	public void setWishService(WishService wishService) {
		this.wishService = wishService;
	}

	public void setAmazonService(AmazonService amazonService) {
		this.amazonService = amazonService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public void setWarehouseService(WarehouseService warehouseService) {
		this.warehouseService = warehouseService;
	}

	public void setChainService(ChainService chainService) {
		this.chainService = chainService;
	}

	public List getResponsibleEbayAccounts(String username) {
		List responsibleAccounts = new ArrayList();
		SearchEbayAccountsCriteria criteria = new SearchEbayAccountsCriteria();
		criteria.setSaleManagerUsername(username);
		List ebayAccounts = this.ebayService.searchEbayAccounts(criteria);
		responsibleAccounts.addAll(ebayAccounts);
		criteria = new SearchEbayAccountsCriteria();
		criteria.setSupervisorUsername(username);
		ebayAccounts = this.ebayService.searchEbayAccounts(criteria);
		responsibleAccounts.addAll(ebayAccounts);
		return responsibleAccounts;
	}

	public List getResponsibleAliExpressAccounts(String username) {
		List responsibleAccounts = new ArrayList();
		SearchAliExpressAccountsCriteria criteria = new SearchAliExpressAccountsCriteria();
		criteria.setSaleManagerUsername(username);
		List aliExpressAccounts = this.aliExpressService.searchAliExpressAccounts(criteria);
		responsibleAccounts.addAll(aliExpressAccounts);
		criteria = new SearchAliExpressAccountsCriteria();
		criteria.setSupervisorUsername(username);
		aliExpressAccounts = this.aliExpressService.searchAliExpressAccounts(criteria);
		responsibleAccounts.addAll(aliExpressAccounts);
		return responsibleAccounts;
	}

	public List getResponsibleAmazonAccounts(String username) {
		List responsibleAccounts = new ArrayList();
		SearchAmazonAccountsCriteria criteria = new SearchAmazonAccountsCriteria();
		criteria.setSaleManagerUsername(username);
		List amazonAccounts = this.amazonService.searchAmazonAccounts(criteria);
		responsibleAccounts.addAll(amazonAccounts);
		criteria = new SearchAmazonAccountsCriteria();
		criteria.setSupervisorUsername(username);
		amazonAccounts = this.amazonService.searchAmazonAccounts(criteria);
		responsibleAccounts.addAll(amazonAccounts);
		return responsibleAccounts;
	}

	public List getResponsibleWishAccounts(String username) {
		List responsibleAccounts = new ArrayList();
		SearchWishAccountsCriteria criteria = new SearchWishAccountsCriteria();
		criteria.setSaleManagerUsername(username);
		List wishAccounts = this.wishService.searchWishAccounts(criteria);
		responsibleAccounts.addAll(wishAccounts);
		criteria = new SearchWishAccountsCriteria();
		criteria.setSupervisorUsername(username);
		wishAccounts = this.wishService.searchWishAccounts(criteria);
		responsibleAccounts.addAll(wishAccounts);
		return responsibleAccounts;
	}

	@Override
	public List<Map<String, Object>> findSkuOnSaleByCount(List<Map<String, Object>> skuMapList) {
		List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();

		if (CollectionUtils.isNotEmpty(skuMapList)) {
			String createSql = "CREATE TEMPORARY TABLE TEMPORARY_SALECHANNELSKU (ID INT AUTO_INCREMENT PRIMARY KEY,"
					+ "SKUARTICLENUMBER VARCHAR(255),SALECHANNEL VARCHAR(255),"
					+ "KEY INDEX_SKUARTICLENUMBER(SKUARTICLENUMBER),KEY INDEX_SALECHANNEL(SALECHANNEL))";
			logger.warn("createSql [" + createSql + "]");

			String insertSql = "INSERT INTO TEMPORARY_SALECHANNELSKU(SKUARTICLENUMBER,SALECHANNEL) VALUES(?,?)";
			logger.warn("insertSql [" + insertSql + "]");

			String querySql = "SELECT SKUARTICLENUMBER,SALECHANNEL,COUNT(*) AS SKUCOUNT "
					+ "FROM TEMPORARY_SALECHANNELSKU GROUP BY SKUARTICLENUMBER,SALECHANNEL";
			logger.warn("querySql [" + querySql + "]");

			String dropSql = "DROP TEMPORARY TABLE IF EXISTS TEMPORARY_SALECHANNELSKU";
			logger.warn("dropSql [" + dropSql + "]");

			Connection conn = null;
			Statement stmt = null;
			PreparedStatement queryPstmt = null;
			ResultSet rs = null;
			try {
				conn = DbUtils.getConnection();
				stmt = conn.createStatement();
				stmt.executeUpdate(dropSql);
				stmt.executeUpdate(createSql);
				queryPstmt = conn.prepareStatement(insertSql);
				for (int i = 0; i < skuMapList.size(); i++) {
					queryPstmt.setString(1, skuMapList.get(i).get("sku").toString());
					queryPstmt.setString(2, skuMapList.get(i).get("salechannel").toString());
					queryPstmt.addBatch();
					if (i % 5000 == 0) {
						queryPstmt.executeBatch();
						queryPstmt.clearBatch();
					}
				}
				queryPstmt.executeBatch();
				rs = stmt.executeQuery(querySql);
				while (rs.next()) {
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("sku", rs.getString(1));
					map.put("salechannel", rs.getString(2));
					map.put("skuCount", rs.getInt(3));
					listMap.add(map);
				}
				stmt.executeUpdate(dropSql);
			} catch (SQLException e) {
				logger.warn(e.getMessage(), e);
			} finally {
				DbUtils.closeResultSet(rs);
				DbUtils.closeStatement(stmt);
				DbUtils.closeStatement(queryPstmt);
				DbUtils.closeConnection(conn);
			}
		}

		return listMap;
	}

	@Override
	public void saveSkuOnSaleReportItem(List<SkuOnSaleReportItem> list) {
		String deleteSql = "DELETE FROM skuOnSaleReportItem";
		logger.warn("deleteSql [" + deleteSql + "]");

		String insertSql = "INSERT INTO skuOnSaleReportItem(skuArticleNumber,wishProductCount,ebayListingCount,"
				+ "amazonProductCount,smtProductCount) VALUES(?,?,?,?,?)";
		logger.warn("insertSql [" + insertSql + "]");
		Connection conn = null;
		Statement stmt = null;
		PreparedStatement preparedStatement = null;
		try {
			conn = DbUtils.getConnection();
			stmt = conn.createStatement();
			stmt.executeUpdate(deleteSql);
			preparedStatement = conn.prepareStatement(insertSql);
			for (int i = 0; i < list.size(); i++) {
				preparedStatement.setString(1, list.get(i).getSkuArticleNumber());
				preparedStatement.setInt(2, list.get(i).getWishProductCount());
				preparedStatement.setInt(3, list.get(i).getEbayListingCount());
				preparedStatement.setInt(4, list.get(i).getAmazonProductCount());
				preparedStatement.setInt(5, list.get(i).getSmtProductCount());
				preparedStatement.addBatch();
				if (i % 5000 == 0) {
					preparedStatement.executeBatch();
					preparedStatement.clearBatch();
				}
			}
			preparedStatement.executeBatch();
		} catch (SQLException e) {
			logger.warn(e.getMessage(), e);
		} finally {
			DbUtils.closeStatement(stmt);
			DbUtils.closeStatement(preparedStatement);
			DbUtils.closeConnection(conn);
		}
	}

	@Override
	public PaginationSupport searchSkuOnSaleReportItem(SearchSkuOnSaleReportItemsCriteria criteria, int pageSize,
			int startIndex) {
		DetachedCriteria detachedCriteria = DetachedCriteria.forClass(SkuOnSaleReportItem.class);
		if (StringUtils.isNotEmpty(criteria.getSkuArticleNumber())) {
			detachedCriteria
					.add(Restrictions.like("skuArticleNumber", criteria.getSkuArticleNumber(), MatchMode.ANYWHERE));
		}
		if (criteria.getWishProductCount() != null) {
			detachedCriteria.add(Restrictions.ge("wishProductCount", criteria.getWishProductCount()));
		}
		if (criteria.getEbayListingCount() != null) {
			detachedCriteria.add(Restrictions.ge("ebayListingCount", criteria.getEbayListingCount()));
		}
		if (criteria.getAmazonProductCount() != null) {
			detachedCriteria.add(Restrictions.ge("amazonProductCount", criteria.getAmazonProductCount()));
		}
		if (criteria.getSmtProductCount() != null) {
			detachedCriteria.add(Restrictions.ge("smtProductCount", criteria.getSmtProductCount()));
		}
		PaginationSupport ps = persistenceService.findPageByCriteria(detachedCriteria, pageSize, startIndex);
		return ps;
	}

	public void pushWishTrackingCode(String customerOrderId) {
		CustomerOrder customerOrder = this.chainService.findCustomerOrder(customerOrderId);
		if (customerOrder.getIsCombinationCustomerOrder() == true) {
			String accountNumber = customerOrder.getAccountNumber();
			String shippingOrderNo = customerOrder.getShippingOrderNo();
			List wishOrderIds = new ArrayList();
			for (Iterator itemIter = customerOrder.getCustomerOrderItems().iterator(); itemIter.hasNext();) {
				CustomerOrderItem customerOrderItem = (CustomerOrderItem) itemIter.next();
				String wishOrderId = customerOrderItem.getOriginSaleChannelOrderId();
				if (!wishOrderIds.contains(wishOrderId)) {
				}
			}
		} else {
			String accountNumber = customerOrder.getAccountNumber();
			String wishOrderId = customerOrder.getSaleChannelOrderId();
			CustomerOrder wishCustomerOrder = this.wishService.retrieveOrderTrackingInfo(accountNumber, wishOrderId);
			logger.warn("account [" + accountNumber + "] wishorderid [" + wishOrderId + "] tracking confirmed ["
					+ wishCustomerOrder.getWishTrackingUpdated() + "] tracking number ["
					+ wishCustomerOrder.getShippingOrderNo() + "]");
		}
	}
}


text:
/**
 * @author Runtian Zhai
 * @license MIT
 *
 */

import java.awt.Color;
import java.io.Serializable;

/** Color Library.
 *  The colors used in the code.
 */
class ColorLibrary implements Serializable {
	private static final long serialVersionUID = 7335988726121101891L;
	Color colorTag;
	Color colorTagLabel;
	Color colorLink;
	Color colorAttributeName;
	Color colorAttributeValue;
	Color colorContent;
	Color colorComment;
	Color colorBackground;
	Color colorJsonAttributeName;
	Color colorJsonAttributeValue;
	Color colorCSSAttributeName;
	Color colorCSSAttributeValue;
	Color colorCSSVariable;
	Color colorCSSComment;
	Color colorComma;
	Color colorCodeRetain;
	Color colorCodeVariable;
	Color colorCodeFunction;
	Color colorCodeString;
	int indentSpace;
	int operationOnClickLink;
	int operationOnShowWebsite;
	int defaultBrowser;

	@Override
	public ColorLibrary clone() {
		ColorLibrary lib = new ColorLibrary();
		lib.colorTag = colorTag;
		lib.colorTagLabel = colorTagLabel;
		lib.colorLink = colorLink;
		lib.colorAttributeName = colorAttributeName;
		lib.colorAttributeValue = colorAttributeValue;
		lib.colorContent = colorContent;
		lib.colorComment = colorComment;
		lib.colorBackground = colorBackground;
		lib.colorJsonAttributeName = colorJsonAttributeName;
		lib.colorJsonAttributeValue = colorJsonAttributeValue;
		lib.colorCSSVariable = colorCSSVariable;
		lib.colorCSSComment = colorCSSComment;
		lib.colorComma = colorComma;
		lib.indentSpace = indentSpace;
		lib.colorCodeRetain = colorCodeRetain;
		lib.colorCodeVariable = colorCodeVariable;
		lib.colorCodeFunction = colorCodeFunction;
		lib.colorCSSAttributeName = colorCSSAttributeName;
		lib.colorCSSAttributeValue = colorCSSAttributeValue;
		lib.colorCodeString = colorCodeString;
		lib.operationOnClickLink = operationOnClickLink;
		lib.operationOnShowWebsite = operationOnShowWebsite;
		lib.defaultBrowser = defaultBrowser;
		return lib;
	}

}

redpajama_set_name: RedPajamaGithub


text:
<component name="ArtifactManager">
  <artifact name="standalone-jps">
    <output-path>$PROJECT_DIR$/build/lib/jps</output-path>
    <root id="root">
      <element id="archive" name="util.jar">
        <element id="module-output" name="intellij.platform.util" />
        <element id="module-output" name="intellij.platform.util.rt" />
        <element id="module-output" name="intellij.platform.annotations.java5" />
        <element id="module-output" name="intellij.platform.annotations.common" />
      </element>
      <element id="archive" name="jps-model.jar">
        <element id="module-output" name="intellij.platform.jps.model" />
        <element id="module-output" name="intellij.platform.jps.model.impl" />
        <element id="module-output" name="intellij.platform.jps.model.serialization" />
      </element>
      <element id="archive" name="jps-builders.jar">
        <element id="module-output" name="intellij.java.guiForms.compiler" />
        <element id="module-output" name="intellij.java.guiForms.rt" />
        <element id="module-output" name="intellij.java.compiler.instrumentationUtil" />
        <element id="module-output" name="intellij.java.rt" />
        <element id="module-output" name="intellij.platform.jps.build" />
        <element id="module-output" name="intellij.tools.jps.build.standalone" />
        <element id="module-output" name="intellij.java.compiler.instrumentationUtil.java8" />
      </element>
      <element id="archive" name="groovy-jps-plugin.jar">
        <element id="module-output" name="intellij.groovy.jps" />
      </element>
      <element id="archive" name="groovy_rt.jar">
        <element id="module-output" name="intellij.groovy.rt" />
      </element>
      <element id="archive" name="ui-designer-jps-plugin.jar">
        <element id="module-output" name="intellij.java.guiForms.jps" />
      </element>
      <element id="archive" name="antlayout.jar">
        <element id="module-output" name="intellij.tools.jps.antTasks" />
      </element>
      <element id="archive" name="groovy-rt-constants.jar">
        <element id="module-output" name="intellij.groovy.constants.rt" />
      </element>
      <element id="archive" name="jps-builders-6.jar">
        <element id="module-output" name="intellij.platform.jps.build.javac.rt" />
      </element>
      <element id="archive" name="aether-dependency-resolver.jar">
        <element id="module-output" name="intellij.java.aetherDependencyResolver" />
      </element>
      <element id="archive" name="testFramework.core.jar">
        <element id="module-output" name="intellij.platform.testFramework.core" />
      </element>
    </root>
  </artifact>
</component>


text:
package com.telefonica.fiware.commons.properties.mbeans;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.Properties;

import javax.management.Attribute;
import javax.management.AttributeNotFoundException;
import javax.management.InstanceAlreadyExistsException;
import javax.management.InstanceNotFoundException;
import javax.management.InvalidAttributeValueException;
import javax.management.MBeanException;
import javax.management.MBeanRegistrationException;
import javax.management.MalformedObjectNameException;
import javax.management.NotCompliantMBeanException;

import org.junit.Test;

import com.telefonica.fiware.commons.properties.PropertiesProvider;
import com.telefonica.fiware.commons.properties.impl.PropertiesDAO;
import com.telefonica.fiware.commons.properties.impl.PropertiesProviderImpl;

/**
 * Tests for class MBeanUtils
 */
public class MBeanUtilsTest {

    /**
     * Should register MBean
     *
     * @throws NotCompliantMBeanException
     * @throws InstanceAlreadyExistsException
     * @throws MalformedObjectNameException
     * @throws MBeanRegistrationException
     */
    @Test
    public void shouldRegisterMBean() throws NotCompliantMBeanException, InstanceAlreadyExistsException,
            MalformedObjectNameException, MBeanException, AttributeNotFoundException, InvalidAttributeValueException {
        // given
        PropertiesDAO propertiesDAO = mock(PropertiesDAO.class);
        PropertiesProvider propertiesProvider = new PropertiesProviderImpl(propertiesDAO);

        Properties properties = new Properties();
        properties.setProperty("test1.key", "value1");
        when(propertiesDAO.load("/test2.properties")).thenReturn(properties);
        PropertiesProviderMBean mbean = new PropertiesProviderMBean("/test2.properties", propertiesProvider);
        // when
        MBeanUtils.register(mbean, "/servlet:service=SystemConfiguration-filename.properties");

        mbean.setAttribute(new Attribute("test2.key", "value 2"));

        // then
        verify(propertiesDAO).load("/test2.properties");
        assertNotNull(mbean);
        assertEquals("value1", mbean.getAttribute("test1.key"));
        assertEquals("value 2", mbean.getAttribute("test2.key"));
        assertNotNull(mbean.getAttributes(new String[] { "test1.key", "test2.key" }));
    }

    /**
     * Should unRegister MBean
     */
    @Test
    public void shouldUnRegisterMBean() throws MalformedObjectNameException, InstanceNotFoundException,
            MBeanRegistrationException {
        // given

        // when
        MBeanUtils.unregister("/servlet:service=SystemConfiguration-filename.properties");

        // then
    }
}


text:
require 'test/unit'
require 'optparse'

class TestOptionParser < Test::Unit::TestCase
  def setup
    @opt = OptionParser.new
    @flag = self.class		# cannot set by option
  end

  class DummyOutput < String
    alias write <<
  end
  def assert_no_error(*args)
    $stderr, stderr = DummyOutput.new, $stderr
    assert_nothing_raised(*args) {return yield}
  ensure
    stderr, $stderr = $stderr, stderr
    $!.backtrace.delete_if {|e| /\A#{Regexp.quote(__FILE__)}:#{__LINE__-2}/o =~ e} if $!
    assert_empty(stderr)
  end
  alias no_error assert_no_error

  def test_permute
    assert_equal(%w"", no_error {@opt.permute!(%w"")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo bar", no_error {@opt.permute!(%w"foo bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"- foo bar", no_error {@opt.permute!(%w"- foo bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo bar", no_error {@opt.permute!(%w"-- foo bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo - bar", no_error {@opt.permute!(%w"foo - bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo bar", no_error {@opt.permute!(%w"foo -- bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo --help bar", no_error {@opt.permute!(%w"foo -- --help bar")})
    assert_equal(self.class, @flag)
  end

  def test_order
    assert_equal(%w"", no_error {@opt.order!(%w"")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo bar", no_error {@opt.order!(%w"foo bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"- foo bar", no_error {@opt.order!(%w"- foo bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo bar", no_error {@opt.permute!(%w"-- foo bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo - bar", no_error {@opt.order!(%w"foo - bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo -- bar", no_error {@opt.order!(%w"foo -- bar")})
    assert_equal(self.class, @flag)
    assert_equal(%w"foo -- --help bar", no_error {@opt.order!(%w"foo -- --help bar")})
    assert_equal(self.class, @flag)
  end

  def test_regexp
    return unless defined?(@reopt)
    assert_equal(%w"", no_error {@opt.parse!(%w"--regexp=/foo/")})
    assert_equal(/foo/, @reopt)
    assert_equal(%w"", no_error {@opt.parse!(%w"--regexp=/foo/i")})
    assert_equal(/foo/i, @reopt)
    assert_equal(%w"", no_error {@opt.parse!(%w"--regexp=/foo/n")})
    assert_equal(/foo/n, @reopt)
  end
end


text:
using System;
using System.Linq;
using Helpers.TestsHelper;
using Search.SearchAlgorithm;
using Xunit;

namespace Search.BinaryImpl.Tests
{
    public class BinarySearchTests : BaseTestsHelper
    {
        private readonly ISearchAlgorithm _alg;

        public BinarySearchTests()
        {
            _alg = new BinarySearch();
        }

        [Fact]
        public void Search_ShouldBe_Ok()
        {
            var array = GetSortedSequence();
            var randIndex = new Random().Next(0, array.Count - 1);
            var searchValue = array[randIndex];

            var result = _alg.Find(array, searchValue);

            Assert.Equal(searchValue, array[result]);
        }

        [Fact]
        public void Search_Should_Not_Be_Ok()
        {
            int n = new Random().Next(100);
            var array = GetSortedSequence(n);  // range between 0 and n
            var searchValue = 1000;

            var result = _alg.Find(array, searchValue);

            Assert.Equal(-1, result);
        }
    }
}


text:
package org.wso2.carbon.webapp.authenticator.framework.config;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
import org.wso2.carbon.utils.CarbonUtils;
import org.wso2.carbon.webapp.authenticator.framework.AuthenticationFrameworkUtil;
import org.wso2.carbon.webapp.authenticator.framework.AuthenticatorFrameworkException;
import org.xml.sax.SAXException;

import javax.xml.XMLConstants;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import java.io.File;
import java.util.List;

@XmlRootElement(name = "WebappAuthenticatorConfig")
public class WebappAuthenticatorConfig {

    private List<AuthenticatorConfig> authenticators;
    private static WebappAuthenticatorConfig config;

    private static final Log log = LogFactory.getLog(WebappAuthenticatorConfig.class);
    private static final String AUTHENTICATOR_CONFIG_PATH =
            CarbonUtils.getEtcCarbonConfigDirPath() + File.separator + "webapp-authenticator-config.xml";
    private static final String AUTHENTICATOR_CONFIG_SCHEMA_PATH =
            "resources/config/schema/webapp-authenticator-config-schema.xsd";

    private WebappAuthenticatorConfig() {
    }

    public static WebappAuthenticatorConfig getInstance() {
        if (config == null) {
            throw new InvalidConfigurationStateException("Webapp Authenticator Configuration is not " +
                    "initialized properly");
        }
        return config;
    }

    @XmlElementWrapper(name = "Authenticators", required = true)
    @XmlElement(name = "Authenticator", required = true)
    public List<AuthenticatorConfig> getAuthenticators() {
        return authenticators;
    }

    @SuppressWarnings("unused")
    public void setAuthenticators(List<AuthenticatorConfig> authenticators) {
        this.authenticators = authenticators;
    }

    public static void init() throws AuthenticatorFrameworkException {
        try {
            File authConfig = new File(WebappAuthenticatorConfig.AUTHENTICATOR_CONFIG_PATH);
            Document doc = AuthenticationFrameworkUtil.convertToDocument(authConfig);

            /* Un-marshaling Webapp Authenticator configuration */
            JAXBContext ctx = JAXBContext.newInstance(WebappAuthenticatorConfig.class);
            Unmarshaller unmarshaller = ctx.createUnmarshaller();
            //unmarshaller.setSchema(getSchema());
            config = (WebappAuthenticatorConfig) unmarshaller.unmarshal(doc);
        } catch (JAXBException e) {
            throw new AuthenticatorFrameworkException("Error occurred while un-marshalling Webapp Authenticator " +
                    "Framework Config", e);
        }
    }

}


text:
require 'ivapi/client'
require 'ivapi/default'

module Ivapi
  extend Ivapi::Configuration

  class << self
    def client
      @client = Ivapi::Client.new(options) unless defined?(@client) && @client.same_options?(options)

      @client
    end

    private

    def method_missing(method_name, *args, &block)
      return super unless client.respond_to?(method_name)

      client.send(method_name, *args, &block)
    end

    def respond_to_missing?(method_name, include_private = false)
      client.respond_to?(method_name, include_private)
    end
  end
end

Ivapi.setup


text:
<!--
  ~ Copyright 2013. AppDynamics LLC and its affiliates.
  ~  * All Rights Reserved.
  ~  * This is unpublished proprietary source code of AppDynamics LLC and its affiliates.
  ~  * The copyright notice above does not evidence any actual or intended publication of such source code.
  -->
<metricStats>

    <metric-config name="resourceManagerMonitor">
        <stat url="ws/v1/cluster/metrics" metric-type="AVG.AVG.COL">
            <metric attr="clusterMetrics|appsSubmitted" alias="Cluster|Apps|Submitted"/>
            <metric attr="clusterMetrics|appsCompleted" alias="Cluster|Apps|Completed"/>
            <metric attr="clusterMetrics|appsPending" alias="Cluster|Apps|Pending"/>
            <metric attr="clusterMetrics|appsRunning" alias="Cluster|Apps|Running"/>
            <metric attr="clusterMetrics|appsFailed" alias="Cluster|Apps|Failed"/>
            <metric attr="clusterMetrics|appsKilled" alias="Cluster|Apps|Killed"/>
            <metric attr="clusterMetrics|reservedMB" alias="Cluster|Memory|Reserved (MB)"/>
            <metric attr="clusterMetrics|availableMB" alias="Cluster|Memory|Available (MB)"/>
            <metric attr="clusterMetrics|allocatedMB" alias="Cluster|Memory|Allocated (MB)"/>
            <metric attr="clusterMetrics|totalMB" alias="Cluster|Memory|Total (MB)"/>
            <metric attr="clusterMetrics|reservedVirtualCores" alias="Cluster|VirtualCores|Reserved"/>
            <metric attr="clusterMetrics|availableVirtualCores" alias="Cluster|VirtualCores|Available"/>
            <metric attr="clusterMetrics|allocatedVirtualCores" alias="Cluster|VirtualCores|Allocated"/>
            <metric attr="clusterMetrics|totalVirtualCores" alias="Cluster|VirtualCores|Total"/>
            <metric attr="clusterMetrics|containersAllocated" alias="Cluster|Containers|Allocated"/>
            <metric attr="clusterMetrics|containersReserved" alias="Cluster|Containers|Reserved"/>
            <metric attr="clusterMetrics|containersPending" alias="Cluster|Containers|Pending"/>
            <metric attr="clusterMetrics|totalNodes" alias="Cluster|Nodes|Total"/>
            <metric attr="clusterMetrics|lostNodes" alias="Cluster|Nodes|Lost"/>
            <metric attr="clusterMetrics|unhealthyNodes" alias="Cluster|Nodes|Unhealthy"/>
            <metric attr="clusterMetrics|decommissionedNodes" alias="Cluster|Nodes|Decommissioned"/>
            <metric attr="clusterMetrics|rebootedNodes" alias="Cluster|Nodes|Rebooted"/>
            <metric attr="clusterMetrics|activeNodes" alias="Cluster|Nodes|Active"/>
        </stat>

        <stat url="ws/v1/cluster/nodes" children="nodes|node" label="Nodes" metric-type="AVG.AVG.COL">
            <metric attr="state" alias="{nodeHostName}|State" converter="node-state-converter"/>
            <metric attr="numContainers" alias="{nodeHostName}|Num of Containers"/>
            <metric attr="usedMemoryMB" alias="{nodeHostName}|Memory Used (MB)"/>
            <metric attr="availMemoryMB" alias="{nodeHostName}|Memory Available (MB)"/>
            <metric attr="usedVirtualCores" alias="{nodeHostName}|Virtual Cores Used"/>
            <metric attr="availableVirtualCores" alias="{nodeHostName}|Virtual Cores Available"/>
        </stat>

        <stat name="capacitySchedulerQueue" metric-type="AVG.AVG.COL">
            <metric attr="state" alias="{queueName}|State" converter="node-state-converter"/>
            <metric attr="capacity" alias="{queueName}|Capacity"/>
            <metric attr="usedCapacity" alias="{queueName}|Capacity Used"/>
            <metric attr="maxCapacity" alias="{queueName}|Capacity Max"/>
            <metric attr="resourcesUsed|memory" alias="{queueName}|Memory Used"/>
            <metric attr="resourcesUsed|vCores" alias="{queueName}|Virtual Cores Used"/>

            <metric attr="numActiveApplications" alias="{queueName}|Applications Active"/>
            <metric attr="numApplications" alias="{queueName}|Applications"/>
            <metric attr="numContainers" alias="{queueName}|Containers"/>

        </stat>
        <stat name="fairSchedulerQueue" metric-type="AVG.AVG.COL">
            <metric attr="maxResources|memory" alias="{queueName}|Memory|Max"/>
            <metric attr="minResources|memory" alias="{queueName}|Memory|Min"/>
            <metric attr="usedResources|memory" alias="{queueName}|Memory|Used"/>
            <metric attr="maxResources|vCores" alias="{queueName}|Virtual Cores|Max"/>
            <metric attr="minResources|vCores" alias="{queueName}|Virtual Cores|Min"/>
            <metric attr="usedResources|vCores" alias="{queueName}|Virtual Cores|Used"/>
        </stat>

        <stat name="fifoScheduler" metric-type="AVG.AVG.COL">
            <metric attr="capacity" alias="Capacity"/>
            <metric attr="usedCapacity" alias="Capacity Used"/>
            <metric attr="qstate" alias="Queue State" converter="node-state-converter"/>
            <metric attr="minQueueMemoryCapacity" alias="Min Queue Memory Capacity"/>
            <metric attr="maxQueueMemoryCapacity" alias="Max Queue Memory Capacity"/>
            <metric attr="numNodes" alias="Node|Count"/>
            <metric attr="usedNodeCapacity" alias="Node|Used Capacity"/>
            <metric attr="availNodeCapacity" alias="Node|Available Capacity"/>
            <metric attr="totalNodeCapacity" alias="Node|Total Capacity"/>
            <metric attr="numContainers" alias="Containers"/>
        </stat>

        <converter-group name="node-state-converter">
            <!-- Less Than 10 CRITICAL-->
            <converter str="UNHEALTHY" value="2"/>
            <converter str="DECOMMISSIONED" value="3"/>
            <converter str="LOST" value="4"/>
            <!-- Less Than 20 WARNING-->
            <converter str="NEW" value="10"/>
            <converter str="REBOOTED" value="11"/>

            <converter str="RUNNING" value="100"/>

        </converter-group>
    </metric-config>

    <metric-config name="ambariMonitor">
        <stat url="**/clusters?fields=Clusters,hosts,services" children="items" metric-type="AVG.AVG.COL">
            <metric attr="Clusters|total_hosts" alias="Cluster Total Hosts"/>
            <metric attr="Clusters|health_report|Host/host_state/HEALTHY" alias="Cluster Health|State|Healthy"/>
            <metric attr="Clusters|health_report|Host/host_state/UNHEALTHY" alias="Cluster Health|State|Unhealthy"/>
            <metric attr="Clusters|health_report|Host/host_state/HEARTBEAT_LOST" alias="Cluster Health|State|Heartbeat Lost"/>
            <metric attr="Clusters|health_report|Host/host_state/INIT" alias="Cluster Health|State|Init"/>
            <metric attr="Clusters|health_report|Host/host_status/HEALTHY" alias="Cluster Health|Status|Healthy"/>
            <metric attr="Clusters|health_report|Host/host_status/UNHEALTHY" alias="Cluster Health|Status|Unhealthy"/>
            <metric attr="Clusters|health_report|Host/host_status/UNKNOWN" alias="Cluster Health|Status|Unknown"/>
            <metric attr="Clusters|health_report|Host/host_status/ALERT" alias="Cluster Health|Status|Alert"/>
            <stat url-attr="hosts|href">
                <filter name="clusters" url-index="-3"/>
                <filter name="hosts" url-index="-1"/>
            </stat>
            <stat url-attr="services|href">
                <filter name="clusters" url-index="-3"/>
                <filter name="services" url-index="-1"/>
            </stat>
        </stat>

        <stat url="**/clusters/*/hosts/*" label="Clusters|{-3}|Hosts|{-1}" metric-type="AVG.AVG.COL">
            <metric attr="Hosts|cpu_count" alias="CPU|Count"/>
            <metric-group name="cpu"/>
            <metric-group name="disks"/>
            <metric-group name="memory"/>
            <metric-group name="network"/>
            <metric-group name="processes"/>
            <!--
            <stat children="Hosts|disk_info" label="Volumes">
                <metric attr="size" label="{mountpoint}|Total (GB)" multiplier="1e-6"/>
                <metric attr="percent" label="{mountpoint}|Used %"/>
            </stat>
            -->
            <stat url-attr="host_components|href"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/APP_TIMELINE_SERVER" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/DATANODE" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
            <metric-group name="cpu"/>
            <metric-group name="jvm"/>
            <metric-group name="memory"/>
            <metric-group name="network"/>
            <metric-group name="processes"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/HBASE_CLIENT" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/HBASE_MASTER" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
            <metric-group name="jvm"/>
            <metric attr="metrics|master|Server|averageLoad" alias="Server|averageLoad"/>
            <metric attr="metrics|master|Server|numDeadRegionServers" alias="Server|numDeadRegionServers"/>
            <metric attr="metrics|master|Server|numRegionServers" alias="Server|numRegionServers"/>
            <metric attr="metrics|master|Server|masterStartTime" alias="Server|masterStartTime"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/HBASE_REGIONSERVER" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
            <metric-group name="jvm"/>
            <metric-group name="cpu"/>
            <metric-group name="disks"/>
            <metric-group name="memory"/>
            <metric-group name="network"/>
            <metric-group name="processes"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/NAMENODE" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
            <metric-group name="jvm"/>
            <metric-group name="cpu"/>
            <metric-group name="disks"/>
            <metric-group name="memory"/>
            <metric-group name="network"/>
            <metric-group name="processes"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/NODEMANAGER" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
            <metric-group name="jvm"/>
            <metric-group name="cpu"/>
            <metric-group name="disks"/>
            <metric-group name="memory"/>
            <metric-group name="network"/>
            <metric-group name="processes"/>
            <metric attr="metrics|nodemanager|AllocatedContainers" alias="NodeManager|AllocatedContainers"/>
            <metric attr="metrics|nodemanager|AllocatedGB" alias="NodeManager|AllocatedGB"/>
            <metric attr="metrics|nodemanager|AllocatedVCores" alias="NodeManager|AllocatedVCores"/>
            <metric attr="metrics|nodemanager|BadLocalDirs" alias="NodeManager|BadLocalDirs"/>
            <metric attr="metrics|nodemanager|BadLogDirs" alias="NodeManager|BadLogDirs"/>
            <metric attr="metrics|nodemanager|ContainersFailed" alias="NodeManager|ContainersFailed"/>
            <metric attr="metrics|nodemanager|GoodLocalDirsDiskUtilizationPerc" alias="NodeManager|GoodLocalDirsDiskUtilizationPerc"/>
            <metric attr="metrics|nodemanager|GoodLogDirsDiskUtilizationPerc" alias="NodeManager|GoodLogDirsDiskUtilizationPerc"/>

            <metric attr="metrics|yarn|AllocatedGB" alias="Yarn|AllocatedGB"/>
            <metric attr="metrics|yarn|AvailableGB" alias="Yarn|AvailableGB"/>
            <metric attr="metrics|yarn|AllocatedVCores" alias="Yarn|AllocatedVCores"/>
            <metric attr="metrics|yarn|BadLocalDirs" alias="Yarn|BadLocalDirs"/>
            <metric attr="metrics|yarn|BadLogDirs" alias="Yarn|BadLogDirs"/>
            <metric attr="metrics|yarn|ContainerLaunchDurationAvgTime" alias="Yarn|ContainerLaunchDurationAvgTime"/>
            <metric attr="metrics|yarn|ContainerLaunchDurationNumOps" alias="Yarn|ContainerLaunchDurationNumOps"/>
            <metric attr="metrics|yarn|ContainersFailed" alias="Yarn|ContainersFailed"/>
            <metric attr="metrics|yarn|ContainersCompleted" alias="Yarn|ContainersCompleted"/>
            <metric attr="metrics|yarn|ContainersIniting" alias="Yarn|ContainersIniting"/>
            <metric attr="metrics|yarn|ContainersKilled" alias="Yarn|ContainersKilled"/>
            <metric attr="metrics|yarn|ContainersLaunched" alias="Yarn|ContainersLaunched"/>
            <metric attr="metrics|yarn|ContainersRunning" alias="Yarn|ContainersRunning"/>
            <metric attr="metrics|yarn|GoodLocalDirsDiskUtilizationPerc" alias="Yarn|GoodLocalDirsDiskUtilizationPerc"/>
            <metric attr="metrics|yarn|GoodLogDirsDiskUtilizationPerc" alias="Yarn|GoodLogDirsDiskUtilizationPerc"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/HISTORYSERVER" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
            <metric attr="metrics|jvm|MemHeapCommittedM" alias="JVM|Memory|Heap Committed MB"/>
            <metric attr="metrics|jvm|MemHeapUsedM" alias="JVM|Memory|Heap Usage MB"/>
            <metric attr="metrics|jvm|MemNonHeapCommittedM" alias="JVM|Memory|Non-Heap Committed MB"/>
            <metric attr="metrics|jvm|MemNonHeapUsedM" alias="JVM|Memory|Non-Heap Usage MB"/>

            <metric attr="metrics|jvm|GcCount" alias="JVM|GC|Count" calculate-per-min="true"/>
            <metric attr="metrics|jvm|GcTimeMillis" alias="JVM|GC|Time (ms)" calculate-per-min="true"/>

            <metric attr="metrics|jvm|ThreadsBlocked" alias="JVM|Threads|Blocked"/>
            <metric attr="metrics|jvm|ThreadsNew" alias="JVM|Threads|New"/>
            <metric attr="metrics|jvm|ThreadsRunnable" alias="JVM|Threads|Runnable"/>
            <metric attr="metrics|jvm|ThreadsTerminated" alias="JVM|Threads|Terminated"/>
            <metric attr="metrics|jvm|ThreadsTimedWaiting" alias="JVM|Threads|Timed Waiting"/>
            <metric attr="metrics|jvm|ThreadsWaiting" alias="JVM|Threads|Waiting"/>

            <metric attr="metrics|BufferPool|direct|Count" alias="BufferPool|direct|Count"/>
            <metric attr="metrics|BufferPool|direct|MemoryUsed" alias="BufferPool|direct|MemoryUsed" multiplier="0.001"/>
            <metric attr="metrics|BufferPool|direct|TotalCapacity" alias="BufferPool|direct|TotalCapacity"  multiplier="0.001"/>
            <metric attr="metrics|BufferPool|mapred|Count" alias="BufferPool|mapred|Count"/>
            <metric attr="metrics|BufferPool|mapred|MemoryUsed" alias="BufferPool|mapred|MemoryUsed" multiplier="0.001"/>
            <metric attr="metrics|BufferPool|mapred|TotalCapacity" alias="BufferPool|mapred|TotalCapacity"  multiplier="0.001"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/RESOURCEMANAGER" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
            <metric-group name="jvm"/>
            <metric-group name="cpu"/>
            <metric-group name="disks"/>
            <metric-group name="memory"/>
            <metric-group name="network"/>
            <metric-group name="processes"/>
            <metric attr="metrics|yarn|ClusterMetrics|NumLostNMs" alias="Yarn|ClusterMetrics|NumLostNMs"/>
            <metric attr="metrics|yarn|ClusterMetrics|NumRebootedNMs" alias="Yarn|ClusterMetrics|NumRebootedNMs"/>
            <metric attr="metrics|yarn|ClusterMetrics|NumUnhealthyNMs" alias="Yarn|ClusterMetrics|NumUnhealthyNMs"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/HDFS_CLIENT" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>
        <stat url="**/clusters/*/hosts/*/host_components/MAPREDUCE2_CLIENT" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>
        <stat url="**/clusters/*/hosts/*/host_components/METRICS_COLLECTOR" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/SECONDARY_NAMENODE" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/YARN_CLIENT" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>
        <stat url="**/clusters/*/hosts/*/host_components/ZOOKEEPER_CLIENT" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>

        <stat url="**/clusters/*/hosts/*/host_components/METRICS_MONITOR" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>
        <!-- Catch all for all other host_components-->
        <stat url="**/clusters/*/hosts/*/host_components/*" metric-type="AVG.AVG.COL"
              label="Clusters|{-5}|Hosts|{-3}|Components|{-1}">
            <metric attr="HostRoles|state" alias="State" converter="state-converter"/>
        </stat>

        <stat url="**/clusters/*/services/*/components/HBASE_MASTER" label="Clusters|{-5}|Services|{-3}|Components|{-1}"
              metric-type="AVG.AVG.COL">
            <metric attr="ServiceComponentInfo|state" alias="state" converter="state-converter"/>
            <metric attr="ServiceComponentInfo|installed_count" alias="installed_count"/>
            <metric attr="ServiceComponentInfo|started_count" alias="started_count"/>
            <metric attr="ServiceComponentInfo|AverageLoad" alias="AverageLoad"/>
            <metric attr="ServiceComponentInfo|HeapMemoryMax" alias="HeapMemoryMax" multiplier="1e-6"/>
            <metric attr="ServiceComponentInfo|HeapMemoryUsed" alias="HeapMemoryUsed" multiplier="1e-6"/>
            <metric attr="ServiceComponentInfo|NonHeapMemoryUsed" alias="NonHeapMemoryUsed" multiplier="1e-6"/>
        </stat>

        <stat url="**/clusters/*/services/*" label="Clusters|{-3}|Services|{-1}"
              metric-type="AVG.AVG.COL">
            <metric attr="ServiceInfo|state" alias="State" converter="state-converter"/>
            <metric-group name="alerts-summary"/>
            <stat url-attr="components|href"/>
        </stat>

        <stat url="**/clusters/*/services/*/components/*" label="Clusters|{-5}|Services|{-3}|Components|{-1}"
              metric-type="AVG.AVG.COL">
            <metric attr="ServiceComponentInfo|state" alias="state" converter="state-converter"/>
            <metric attr="ServiceComponentInfo|installed_count" alias="installed_count"/>
            <metric attr="ServiceComponentInfo|started_count" alias="started_count"/>
        </stat>

        <metric-group name="processes">
            <metric attr="metrics|process|proc_run" alias="Processes|Running"/>
            <metric attr="metrics|process|proc_total" alias="Processes|Total"/>
        </metric-group>
        <metric-group name="network">
            <metric attr="metrics|network|bytes_in" alias="Network|Incoming MB" multiplier="1e-6"
                    calculate-per-min="true" show-only-per-min="true"/>
            <metric attr="metrics|network|bytes_out" alias="Network|Outgoing MB" multiplier="1e-6"
                    calculate-per-min="true" show-only-per-min="true"/>
            <metric attr="metrics|network|pkts_in" alias="Network|Incoming Packets" multiplier="1e-6"
                    calculate-per-min="true" show-only-per-min="true"/>
            <metric attr="metrics|network|pkts_out" alias="Network|Outgoing Packets" multiplier="1e-6"
                    calculate-per-min="true" show-only-per-min="true"/>
        </metric-group>
        <metric-group name="memory">
            <metric attr="metrics|memory|mem_cached" alias="Memory|Cached MB" multiplier="0.001"/>
            <metric attr="metrics|memory|mem_free" alias="Memory|Free MB" multiplier="0.001"/>
            <metric attr="metrics|memory|mem_shared" alias="Memory|Shared MB" multiplier="0.001"/>
            <metric attr="metrics|memory|mem_total" alias="Memory|Total MB" multiplier="0.001"/>
            <metric attr="metrics|memory|swap_free" alias="Memory|Swap Free MB" multiplier="0.001"/>
        </metric-group>
        <metric-group name="disks">
            <metric attr="metrics|disk|disk_free" alias="Disks|Free (GB)"/>
            <metric attr="metrics|disk|disk_total" alias="Disks|Total (GB)"/>
            <metric attr="metrics|disk|read_bytes" alias="Disks|Read MB" multiplier="1.25e-7"
                    calculate-per-min="true" show-only-per-min="true"/>
            <metric attr="metrics|disk|write_bytes" alias="Disks|Write MB" multiplier="1.25e-7"
                    calculate-per-min="true" show-only-per-min="true"/>
            <metric attr="metrics|disk|read_count" alias="Disks|Reads"
                    calculate-per-min="true" show-only-per-min="true"/>
            <metric attr="metrics|disk|write_count" alias="Disks|Writes"
                    calculate-per-min="true" show-only-per-min="true"/>
        </metric-group>
        <metric-group name="cpu">
            <metric attr="metrics|cpu|cpu_idle" alias="CPU|Idle %"/>
            <metric attr="metrics|cpu|cpu_system" alias="CPU|System %"/>
            <metric attr="metrics|cpu|cpu_user" alias="CPU|User %"/>
            <metric attr="metrics|cpu|cpu_nice" alias="CPU|Nice %"/>
        </metric-group>

        <metric-group name="alerts-summary">
            <metric attr="alerts_summary|CRITICAL" alias="Alerts|CRITICAL"/>
            <metric attr="alerts_summary|MAINTENANCE" alias="Alerts|MAINTENANCE"/>
            <metric attr="alerts_summary|OK" alias="Alerts|OK"/>
            <metric attr="alerts_summary|UNKNOWN" alias="Alerts|UNKNOWN"/>
            <metric attr="alerts_summary|WARNING" alias="Alerts|WARNING"/>
        </metric-group>

        <metric-group name="jvm">
            <metric attr="metrics|jvm|memHeapCommittedM" alias="JVM|Memory|Heap Committed MB"/>
            <metric attr="metrics|jvm|memHeapUsedM" alias="JVM|Memory|Heap Usage MB"/>
            <metric attr="metrics|jvm|memNonHeapCommittedM" alias="JVM|Memory|Non-Heap Committed MB"/>
            <metric attr="metrics|jvm|memNonHeapUsedM" alias="JVM|Memory|Non-Heap Usage MB"/>

            <metric attr="metrics|jvm|gcCount" alias="JVM|GC|Count" calculate-per-min="true"/>
            <metric attr="metrics|jvm|gcTimeMillis" alias="JVM|GC|Time (ms)" calculate-per-min="true"/>

            <metric attr="metrics|jvm|threadsBlocked" alias="JVM|Threads|Blocked"/>
            <metric attr="metrics|jvm|threadsNew" alias="JVM|Threads|New"/>
            <metric attr="metrics|jvm|threadsRunnable" alias="JVM|Threads|Runnable"/>
            <metric attr="metrics|jvm|threadsTerminated" alias="JVM|Threads|Terminated"/>
            <metric attr="metrics|jvm|threadsTimedWaiting" alias="JVM|Threads|Timed Waiting"/>
            <metric attr="metrics|jvm|threadsWaiting" alias="JVM|Threads|Waiting"/>
        </metric-group>

        <converter-group name="state-converter">
            <converter str="STOPPED" value="0"/>
            <converter str="STOPPING" value="1"/>
            <converter str="STARTING" value="2"/>
            <converter str="STARTED" value="100"/>

            <converter str="INIT" value="10"/>
            <converter str="INSTALLING" value="11"/>
            <converter str="INSTALLED" value="12"/>
            <converter str="INSTALL_FAILED" value="13"/>
            <converter str="UNINSTALLING" value="14"/>
            <converter str="UNINSTALLED" value="15"/>
            <converter str="WIPING_OUT" value="16"/>
            <converter str="UPGRADING" value="17"/>
            <converter str="MAINTENANCE" value="18"/>

            <converter str="UNKNOWN" value="20"/>
        </converter-group>
    </metric-config>
</metricStats>


text:
+++
Talk_date = ""
Talk_start_time = ""
Talk_end_time = ""
Title = "Continuous Integration is DEAD!"
Type = "talk"
Speakers = ["johan-bäckström"]
+++

CI is dead, or is it? Scaling CI for distributed systems becomes increasingly complex to the point where it's more or less impossible.

This talk will explore the mechanisms of CI and some alternative approaches to "traditional" CI.


text: SELECT * FROM func1_sql_setint_imm(5) order by 1;


text:
package opendata.tools.data;

import java.util.Map;

@SuppressWarnings("serial")
public class AddressParseException extends Exception {

	Map<String, String> validaitonErrors;

	public AddressParseException(Map<String, String> errors) {
		super(toErrorMessage(errors));
		this.validaitonErrors = errors;
	}

	static String toErrorMessage(Map<String, String> errors){
		return errors.toString();
	}

	public Map<String, String> getValidationErrors(){
		return this.validaitonErrors;
	}

}


text:
/**
 * External dependencies
 */
import styled from 'styled-components';
import {
  memo,
  useMemo,
  useRef,
  useState,
  useResizeEffect,
} from '@googleforcreators/react';
import PropTypes from 'prop-types';

/**
 * Internal dependencies
 */
import { ChecklistProvider } from '../checklist';
import { KeyboardShortcutsMenuProvider } from '../keyboardShortcutsMenu/keyboardShortcutsMenuContext';
import FooterLayout from './footerLayout';
import { VERY_WIDE_WORKSPACE_LIMIT, VERY_WIDE_MARGIN } from './constants';

const Outer = styled.section`
  height: 100%;
`;
const Inner = styled(Outer)`
  margin-right: ${({ marginRight }) => marginRight}px;
`;

function Footer({ footer, zIndex }) {
  const ref = useRef();
  const [workspaceWidth, setWorkspaceWidth] = useState(0);

  useResizeEffect(ref, ({ width }) => setWorkspaceWidth(width), []);
  const margin = useMemo(
    () => (workspaceWidth >= VERY_WIDE_WORKSPACE_LIMIT ? VERY_WIDE_MARGIN : 0),
    [workspaceWidth]
  );

  return (
    <ChecklistProvider>
      <KeyboardShortcutsMenuProvider>
        <Outer ref={ref}>
          <Inner marginRight={margin}>
            <FooterLayout footer={footer} zIndex={zIndex} />
          </Inner>
        </Outer>
      </KeyboardShortcutsMenuProvider>
    </ChecklistProvider>
  );
}

Footer.propTypes = {
  footer: PropTypes.object,
  zIndex: PropTypes.number,
};

// Don't rerender the workspace footer needlessly e.g. on element selection change.
export default memo(Footer);


text:
$(function() {
   $('.date').datepicker({ dateFormat: 'dd-mm-yy' });
});


text:
namespace blink {

ChromeOS::ChromeOS() = default;

CrosWindowManagement* ChromeOS::windowManagement(
    ExecutionContext* execution_context) {
  return &CrosWindowManagement::From(*execution_context);
}

CrosHID* ChromeOS::hid(ExecutionContext* execution_context) {
  return &CrosHID::From(*execution_context);
}

void ChromeOS::Trace(Visitor* visitor) const {
  ScriptWrappable::Trace(visitor);
}

}  // namespace blink


text:
package boolgebra

// Quine-McCluskey is an algorithm to simplify a sum of prod.

//reduce combine together all minterms of x into prime implicants
func reduce(x expression) expression {
	// to reduce we need to cluster minterms of x into number of non neg ID

	var cluster [][]minterm // index minterm by their 1s. store them in a slice
	var primes []minterm    // also keep primes all together

	// fill the first cluster
	cluster = make([][]minterm, 1+len(x.IDs()))
	for _, m := range x {
		ones := positives(m)
		cluster[ones] = append(cluster[ones], m)
	}

	emptycluster := false // combinations in the current cluster are moved to the next cluster. we repeat until the "next" cluster is empty
	for !emptycluster {
		// the next cluster will become the current one soon, so we already set the bool to true, because we start with an empty one
		emptycluster = true // we start with an empty next one, let see if it get filled
		next := make([][]minterm, len(cluster))

		// attempt all possible combinations.
		// a minterm with n Positive IDs, can only be combined with another one with n or n+1 ( or n-1 but combination is symetric so we don't care)
		// that is the reason why we built the cluster in the first place
		// so we loop over all the minterms couples that *could* be mixed
		for i, ms := range cluster {
			// loop over all cluster minterms
			for mi, m := range ms {
				//m is left candidate
				misprime := true // by default m is assumed to be prime, but this will be tested

				// check m against peers in the same cluster
				for mj, r := range ms {
					if mj != mi {
						// except self combination check it
						if c, ok := combine(m, r); ok {
							misprime = false // it has been combined, so it's not a prime anymore
							// append it in the next cluster
							emptycluster = false         // mark the next as non empty
							next[i] = append(next[i], c) // we know that the number of 1s cannot be reduced
							// proof: every ID can have only three possible values 1, 0, or _ (don't care)
							// to be combined they have to bo identical on all bits but one.
							// number of ones on those "identical" bits are equals obviously, therefore
							// the number of 1 on the bit that is different must be equal too, so this cannot be a 1.
							// so this can only b a 0 and a _ reduced to be _, so the total amount of 1 is unchanged

						}
					}
				}

				// check against minterms in the next cluster
				if i+1 < len(cluster) {

					for _, r := range cluster[i+1] {
						if c, ok := combine(m, r); ok {
							misprime = false // it has been combined, so it's not a prime anymore
							// append it in the next cluster
							emptycluster = false         // mark the next as non empty
							next[i] = append(next[i], c) // we know that the number of 1s cannot be reduced
							// proof: every ID can have only three possible values 1, 0, or _ (don't care)
							// to be combined they have to bo identical on all bits but one.
							// number of ones on those "identical" bits are equals obviously
							// r has an extra 1 compared to m ( by definition of the cluster[i+1]
							// therefore on this bit, r has a 1, and m has either a 0 or a _, so on this bit, c is now _
							// and has the exact same amount of 1s as m
						}
					}
				}

				// check against minterms in the previous cluster. those checks have already been made, but this is *just* to
				// find out if m is still a prime. Indeed if it has been combined with a lower minterm, it is not a prime one
				if misprime && i-1 >= 0 {
					// so far m has been tested against self, and next in cluster, but it might have be used previously ( i.e cluster - 1
					// therefore we are testing backward to see if it was used previously
					for _, r := range cluster[i-1] {
						if _, ok := combine(m, r); ok {
							misprime = false // it has been combined previously, so it's not a prime anymore
							// no other side effect, because they have already been made when testing the
						}
					}
				}

				if misprime {

					primes = appendunique(primes, m)
				}
			}

		}
		// done with filling the next cluster
		cluster = next
	}
	//done, we now have all the prime implicant
	return expression(primes)
}

// appenunique behave like 'append' except for items in 'terms' that are present in 'set': they
// are not appended in this case.
func appendunique(set []minterm, terms ...minterm) []minterm {
termsloop:
	for _, m := range terms {
		for _, x := range set {
			if equals(x, m) {
				// noting to append
				continue termsloop
			}
		}
		set = append(set, m)
	}
	return set
}

// combine computes c, if possible, that combines x and y
//
// x and y must be identical but on exactly one identifier.
//
// the combined is then then intersection of x and y.
func combine(x, y minterm) (c minterm, ok bool) {
	// alg: find out the one and only one difference between x,y
	// so scan for differences and count.
	var d string // the identifier that is different (if diffs == 1))
	diffs := 0   // number of differences
	for k, v := range x {
		w, exists := y[k]
		if !exists || v != w {
			// this one is different, store it
			d = k
			diffs++
			if diffs > 1 {
				return c, false
			}
		}
	}
	// same goes backward too ( to check for missing in x only

	for k := range y {
		_, exists := x[k]
		if !exists {
			// this one is different, store it
			d = k
			diffs++
			if diffs > 1 {
				return c, false
			}
		}
	}
	if diffs != 1 {
		return c, false
	}
	// we hit the one difference !
	// build c accordingly then
	// x and y are guaranteed to be identical but on 'd'
	// so copy x but 'd'
	c = make(minterm)
	for k, v := range x {
		if k != d {
			c[k] = v
		}
	}
	return c, true

}

// equals return true if and only if m and n are both minterm, then they are semantically equals
func equals(m, n minterm) bool {
	if len(m) != len(n) {
		return false
	}
	for k, v := range m {
		if w, exists := n[k]; !exists || v != w {
			return false
		}
	}
	return true
}

// positives returns the number of positive identifiers
func positives(m minterm) int {
	count := 0
	for _, v := range m {
		if v {
			count++
		}
	}
	return count
}

//inter computes the intersection of x inter  y
func inter(x, y minterm) minterm {
	res := make(minterm)
	for k, v := range x {
		if w, exists := y[k]; exists && v == w {
			res[k] = v
		}
	}
	return res

}

//div computes x/y i.e z so that And(z,y) = x
// can be seen as x removed from items in y
func div(x, y minterm) minterm {
	res := make(minterm)
	for k, v := range x {
		if w, exists := y[k]; !exists || v != w {
			res[k] = v
		}
	}
	return res
}


text:
/*jshint expr:true*/
/*globals mapperViewModel*/
describe('main', function () {
  it('should exist', function () {
    mapperViewModel.should.exist;
  });

  it('should be an object', function () {
    mapperViewModel.should.be.a('object');
  });

  describe('mappers', function () {
    it('should exist', function () {
      mapperViewModel.mappers.should.exist;
    });

    it('should be an observable array', function () {
      mapperViewModel.mappers().should.be.a('array');
    });
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright (c) 1991 - 1993, Julianne Frances Haugh
   Copyright (c) 2007 - 2011, Nicolas François
   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. The name of the copyright holders or contributors may not be used to
      endorse or promote products derived from this software without
      specific prior written permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   ``AS IS'' AND ANY EXPRESS 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 COPYRIGHT
   HOLDERS OR 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.
-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY MAX_MEMBERS_PER_GROUP SYSTEM "login.defs.d/MAX_MEMBERS_PER_GROUP.xml">
<!-- SHADOW-CONFIG-HERE -->
]>
<refentry id='groupdel.8'>
  <!-- $Id$ -->
  <refentryinfo>
    <author>
      <firstname>Julianne Frances</firstname>
      <surname>Haugh</surname>
      <contrib>Creation, 1991</contrib>
    </author>
    <author>
      <firstname>Thomas</firstname>
      <surname>Kłoczko</surname>
      <email>kloczek@pld.org.pl</email>
      <contrib>shadow-utils maintainer, 2000 - 2007</contrib>
    </author>
    <author>
      <firstname>Nicolas</firstname>
      <surname>François</surname>
      <email>nicolas.francois@centraliens.net</email>
      <contrib>shadow-utils maintainer, 2007 - now</contrib>
    </author>
  </refentryinfo>
  <refmeta>
    <refentrytitle>groupdel</refentrytitle>
    <manvolnum>8</manvolnum>
    <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
    <refmiscinfo class="source">shadow-utils</refmiscinfo>
    <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
  </refmeta>
  <refnamediv id='name'>
    <refname>groupdel</refname>
    <refpurpose>delete a group</refpurpose>
  </refnamediv>
  <!-- body begins here -->
  <refsynopsisdiv id='synopsis'>
    <cmdsynopsis>
      <command>groupdel</command>
      <arg choice='opt'>
        <replaceable>options</replaceable>
      </arg>
      <arg choice='plain'><replaceable>GROUP</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id='description'>
    <title>DESCRIPTION</title>
    <para> The <command>groupdel</command> command modifies the system
      account files, deleting all entries that refer to
      <replaceable>GROUP</replaceable>. The named group must exist.
    </para>
  </refsect1>

  <refsect1 id='options'>
    <title>OPTIONS</title>
    <para>
      The options which apply to the <command>groupdel</command> command
      are:
    </para>
    <variablelist remap='IP'>
      <varlistentry>
	<term><option>-h</option>, <option>--help</option></term>
	<listitem>
	  <para>Display help message and exit.</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term>
	  <option>-R</option>, <option>--root</option> <replaceable>CHROOT_DIR</replaceable>
	</term>
	<listitem>
	  <para>
	    Apply changes in the <replaceable>CHROOT_DIR</replaceable>
	    directory and use the configuration files from the
	    <replaceable>CHROOT_DIR</replaceable> directory.
	  </para>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1 id='caveats'>
    <title>CAVEATS</title>
    <para>
      You may not remove the primary group of any existing user. You
      must remove the user before you remove the group.
    </para>
    <para>
      You should manually check all file systems to ensure that no files
      remain owned by this group.
    </para>
  </refsect1>

  <refsect1 id='configuration'>
    <title>CONFIGURATION</title>
    <para>
      The following configuration variables in
      <filename>/etc/login.defs</filename> change the behavior of this
      tool:
    </para>
    <variablelist>
      &MAX_MEMBERS_PER_GROUP;
    </variablelist>
  </refsect1>

  <refsect1 id='files'>
    <title>FILES</title>
    <variablelist>
      <varlistentry>
	<term><filename>/etc/group</filename></term>
	<listitem>
	  <para>Group account information.</para>
	</listitem>
      </varlistentry>
      <varlistentry condition="gshadow">
	<term><filename>/etc/gshadow</filename></term>
	<listitem>
	  <para>Secure group account information.</para>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1 id='exit_values'>
    <title>EXIT VALUES</title>
    <para>
      The <command>groupdel</command> command exits with the following values:
      <variablelist>
	<varlistentry>
	  <term><replaceable>0</replaceable></term>
	  <listitem>
	    <para>success</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><replaceable>2</replaceable></term>
	  <listitem>
	    <para>invalid command syntax</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><replaceable>6</replaceable></term>
	  <listitem>
	    <para>specified group doesn't exist</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><replaceable>8</replaceable></term>
	  <listitem>
	    <para>can't remove user's primary group</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><replaceable>10</replaceable></term>
	  <listitem>
	    <para>can't update group file</para>
	  </listitem>
	</varlistentry>
      </variablelist>
    </para>
  </refsect1>

  <refsect1 id='see_also'>
    <title>SEE ALSO</title>
    <para>
      <citerefentry>
	<refentrytitle>chfn</refentrytitle><manvolnum>1</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>chsh</refentrytitle><manvolnum>1</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>passwd</refentrytitle><manvolnum>1</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>gpasswd</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>groupadd</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>groupmod</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>useradd</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>userdel</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>,
      <citerefentry>
	<refentrytitle>usermod</refentrytitle><manvolnum>8</manvolnum>
      </citerefentry>.
    </para>
  </refsect1>
</refentry>


text:
package org.elasticsearch.xpack.monitoring.exporter.http;

import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.common.Nullable;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import java.util.Objects;

/**
 * {@code SecurityHttpClientConfigCallback} configures a {@link RestClient} for user authentication and SSL / TLS.
 */
class SecurityHttpClientConfigCallback implements RestClientBuilder.HttpClientConfigCallback {

    /**
     * The optional {@link CredentialsProvider} for all requests to enable user authentication.
     */
    @Nullable
    private final CredentialsProvider credentialsProvider;
    /**
     * The {@link SSLIOSessionStrategy} for all requests to enable SSL / TLS encryption.
     */
    private final SSLIOSessionStrategy sslStrategy;

    /**
     * Create a new {@link SecurityHttpClientConfigCallback}.
     *
     * @param credentialsProvider The credential provider, if a username/password have been supplied
     * @param sslStrategy The SSL strategy, if SSL / TLS have been supplied
     * @throws NullPointerException if {@code sslStrategy} is {@code null}
     */
    SecurityHttpClientConfigCallback(final SSLIOSessionStrategy sslStrategy,
                                     @Nullable final CredentialsProvider credentialsProvider) {
        this.sslStrategy = Objects.requireNonNull(sslStrategy);
        this.credentialsProvider = credentialsProvider;
    }

    /**
     * Get the {@link CredentialsProvider} that will be added to the HTTP client.
     *
     * @return Can be {@code null}.
     */
    @Nullable
    CredentialsProvider getCredentialsProvider() {
        return credentialsProvider;
    }

    /**
     * Get the {@link SSLIOSessionStrategy} that will be added to the HTTP client.
     *
     * @return Never {@code null}.
     */
    SSLIOSessionStrategy getSSLStrategy() {
        return sslStrategy;
    }

    /**
     * Sets the {@linkplain HttpAsyncClientBuilder#setDefaultCredentialsProvider(CredentialsProvider) credential provider},
     * {@linkplain HttpAsyncClientBuilder#setSSLContext(SSLContext) SSL context}, and
     * {@linkplain HttpAsyncClientBuilder#setSSLHostnameVerifier(HostnameVerifier) SSL Hostname Verifier}.
     *
     * @param httpClientBuilder The client to configure.
     * @return Always {@code httpClientBuilder}.
     */
    @Override
    public HttpAsyncClientBuilder customizeHttpClient(final HttpAsyncClientBuilder httpClientBuilder) {
        // enable SSL / TLS
        httpClientBuilder.setSSLStrategy(sslStrategy);

        // enable user authentication
        if (credentialsProvider != null) {
            httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
        }

        return httpClientBuilder;
    }

}