protected void buildApiClient() throws NoSuchAlgorithmException, KeyManagementException {

    Client client;

    String pattern;
    String url;

    if (configuration.getApiSSLAuthentication()) {
      pattern = "https://localhost:%s/";
      url = String.format(pattern, configuration.getClientSSLApiPort());

      // Create a trust manager that does not validate certificate chains
      TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
        @Override
        public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {

        }

        @Override
        public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {

        }

        @Override
        public X509Certificate[] getAcceptedIssuers() {
          return null;
        }


      }};

      //Create SSL context
      SSLContext sc = SSLContext.getInstance("TLS");
      sc.init(null, trustAllCerts, new SecureRandom());

      //Install all trusting cert SSL context for jersey client
      ClientConfig config = new ClientConfig();
      /*config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, new HTTPSProperties(
        new HostnameVerifier() {
          @Override
          public boolean verify( String s, SSLSession sslSession ) {
            return true;
          }
        },
        sc
      ));*/

      client = ClientBuilder.newBuilder().sslContext(sc).withConfig(config)
              .build();

    } else {
      client = ClientBuilder.newBuilder().build();
      pattern = "http://localhost:%s/";
      url = String.format(pattern, configuration.getClientApiPort());
    }

    this.ambariClient = client;
    this.ambariWebResource = client.target(url);

    //Install auth filters
    ClientRequestFilter csrfFilter = new CsrfProtectionFilter("RequestSchedule");
    ClientRequestFilter tokenFilter = new InternalTokenClientFilter(tokenStorage);
    ambariWebResource.register(csrfFilter);
    ambariWebResource.register(tokenFilter);

  }
This class handles scheduling request execution for managed clusters
ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionScheduleManager.java