Tabnine Logo
org.kie.server.router.utils
Code IndexAdd Tabnine to your IDE (free)

How to use org.kie.server.router.utils

Best Java code snippets using org.kie.server.router.utils (Showing top 20 results out of 315)

origin: org.kie.server/kie-server-router-proxy

public static SSLContextBuilder builder() {
  return new SSLContextBuilder();
}
origin: kiegroup/droolsjbpm-integration

protected void pushToController(String releaseId, String containerId, String alias) throws Exception {
  String[] gav = releaseId.split(":");
  String jsonPayload = CONTAINER_SPEC_JSON
      .replaceFirst("#1@", containerId)
      .replaceFirst("#2@", alias)
      .replaceFirst("#3@", gav[0])
      .replaceFirst("#4@", gav[1])
      .replaceFirst("#5@", gav[2]);
  HttpUtils.putHttpCall(CONTROLLER + "/management/servers/" + KieServerInfoHandler.getRouterId() + "/containers/" + containerId, jsonPayload);        
  log.infof("Added %s container into controller at %s ", containerId, CONTROLLER);        
}

origin: org.kie.server/kie-server-router-proxy

public static void getHttpCall(String url) throws Exception {
  URL controllerURL = new URL(url);
  HttpURLConnection con = (HttpURLConnection) controllerURL.openConnection();
  con.setRequestMethod("GET");
  con.setRequestProperty(Headers.ACCEPT_STRING, "application/json");
  con.setRequestProperty(Headers.CONTENT_TYPE_STRING, "application/json");
  con.setRequestProperty(Headers.AUTHORIZATION_STRING, getAuthorization());
  con.setDoOutput(true);
  log.debugf("Sending 'GET' request to URL : %s", controllerURL);
  int responseCode = con.getResponseCode();
  log.debugf("Response Code : %s", responseCode);
  
  if (responseCode != 200) {
    throw new IOException("Unsucessful response code " + responseCode);
  }
}
origin: kiegroup/droolsjbpm-integration

@Test
public void testSecondAlias() {
  try {
    SSLContextBuilder.builder()
        .setKeyStorePath(KEYSTORE_PATH)
        .setKeyStorePassword(KEYSTORE_PASSWORD)
        .setKeyAlias(KEYSTORE_ALIAS_TWO)
        .build();
  } catch (RuntimeException e) {
    fail(e.getMessage());
  }
}
origin: kiegroup/droolsjbpm-integration

while (it.hasNext()) {
  FailedHostInfo fHost = (FailedHostInfo) it.next();
  if (attemptsLimit == fHost.getAttempts()) {
    it.remove();
    log.info("Host " + fHost.getServerUrl() + " has reached reconnect attempts limit " + attemptsLimit + " quiting");
    continue;
    HttpUtils.getHttpCall(fHost.getServerUrl());
    log.info("Server at " + fHost.getServerUrl() + " is back online");
    failedHostsReconnects.cancel(false);
      for (String containerId : fHost.getContainers()) {
        configuration.addContainerHost(containerId, fHost.getServerUrl());
      configuration.addServerHost(fHost.getServerId(), fHost.getServerUrl());
    log.debug("Host " + fHost.getServerUrl() + " is still not available, attempting to reconnect in " + interval + " seconds, error " + e.getMessage());
  } finally {
    fHost.attempted();
origin: org.kie.server/kie-server-router-proxy

protected void dropFromController(String containerId) throws Exception {
  HttpUtils.deleteHttpCall(CONTROLLER + "/management/servers/" + KieServerInfoHandler.getRouterId() + "/containers/" + containerId);
  
  log.infof("Removed %s container from controller at %s ", containerId, CONTROLLER);
}

origin: org.kie.server/kie-server-router-proxy

  );
FailedHostInfo failedHost = new FailedHostInfo(serverId, serverUrl, containers);
return failedHost;
origin: kiegroup/droolsjbpm-integration

@Test
public void testFirstAlias() {
  try {
    SSLContextBuilder.builder()
        .setKeyStorePath(KEYSTORE_PATH)
        .setKeyStorePassword(KEYSTORE_PASSWORD)
        .setKeyAlias(KEYSTORE_ALIAS_ONE)
        .build();
  } catch (RuntimeException e) {
    fail(e.getMessage());
  }
}
origin: org.kie.server/kie-server-router-proxy

while (it.hasNext()) {
  FailedHostInfo fHost = (FailedHostInfo) it.next();
  if (attemptsLimit == fHost.getAttempts()) {
    it.remove();
    log.info("Host " + fHost.getServerUrl() + " has reached reconnect attempts limit " + attemptsLimit + " quiting");
    continue;
    HttpUtils.getHttpCall(fHost.getServerUrl());
    log.info("Server at " + fHost.getServerUrl() + " is back online");
    failedHostsReconnects.cancel(false);
      for (String containerId : fHost.getContainers()) {
        configuration.addContainerHost(containerId, fHost.getServerUrl());
      configuration.addServerHost(fHost.getServerId(), fHost.getServerUrl());
    log.debug("Host " + fHost.getServerUrl() + " is still not available, attempting to reconnect in " + interval + " seconds, error " + e.getMessage());
  } finally {
    fHost.attempted();
origin: kiegroup/droolsjbpm-integration

protected void dropFromController(String containerId) throws Exception {
  HttpUtils.deleteHttpCall(CONTROLLER + "/management/servers/" + KieServerInfoHandler.getRouterId() + "/containers/" + containerId);
  
  log.infof("Removed %s container from controller at %s ", containerId, CONTROLLER);
}

origin: org.kie.server/kie-server-router-proxy

public static void deleteHttpCall(String url) throws Exception {
  URL controllerURL = new URL(url);
  HttpURLConnection con = (HttpURLConnection) controllerURL.openConnection();
  con.setRequestMethod("DELETE");
  con.setRequestProperty(Headers.ACCEPT_STRING, "application/json");
  con.setRequestProperty(Headers.CONTENT_TYPE_STRING, "application/json");
  con.setRequestProperty(Headers.AUTHORIZATION_STRING, getAuthorization());
  con.setDoOutput(true);
  log.debugf("Sending 'DELETE' request to URL : %s", controllerURL);
  int responseCode = con.getResponseCode();
  log.debugf("Response Code : %s", responseCode);
  if (responseCode > 204) {
    throw new IOException("Unsucessful response code " + responseCode);
  }
}

origin: kiegroup/droolsjbpm-integration

public static SSLContextBuilder builder() {
  return new SSLContextBuilder();
}
origin: org.kie.server/kie-server-router-proxy

protected void pushToController(String releaseId, String containerId, String alias) throws Exception {
  String[] gav = releaseId.split(":");
  String jsonPayload = CONTAINER_SPEC_JSON
      .replaceFirst("#1@", containerId)
      .replaceFirst("#2@", alias)
      .replaceFirst("#3@", gav[0])
      .replaceFirst("#4@", gav[1])
      .replaceFirst("#5@", gav[2]);
  HttpUtils.putHttpCall(CONTROLLER + "/management/servers/" + KieServerInfoHandler.getRouterId() + "/containers/" + containerId, jsonPayload);        
  log.infof("Added %s container into controller at %s ", containerId, CONTROLLER);        
}

origin: kiegroup/droolsjbpm-integration

  );
FailedHostInfo failedHost = new FailedHostInfo(serverId, serverUrl, containers);
return failedHost;
origin: kiegroup/droolsjbpm-integration

  @Test
  public void testIncorrectPassword() {
    try {
      SSLContextBuilder.builder()
          .setKeyStorePath(KEYSTORE_PATH)
          .setKeyStorePassword("bla")
          .setKeyAlias(KEYSTORE_ALIAS_ONE)
          .build();
      // should fail
      fail("Exception not thrown");
    } catch (RuntimeException e) {
      assertTrue(e.getCause() instanceof IOException);
    }
  }
}
origin: kiegroup/droolsjbpm-integration

protected void disconnectToController() {
  if (CONTROLLER == null) {
    return;
  }
  try {
    HttpUtils.deleteHttpCall(CONTROLLER + "/server/" + KieServerInfoHandler.getRouterId() + "/?location=" + URLEncoder.encode(KieServerInfoHandler.getLocationUrl(),
                                                                 "UTF-8"));
    log.infof("KieServerRouter disconnected from controller at " + CONTROLLER);
  } catch (Exception e) {
    log.error("Error when disconnecting from controller at " + CONTROLLER,
         e);
  }
}
origin: kiegroup/droolsjbpm-integration

public static void deleteHttpCall(String url) throws Exception {
  URL controllerURL = new URL(url);
  HttpURLConnection con = (HttpURLConnection) controllerURL.openConnection();
  con.setRequestMethod("DELETE");
  con.setRequestProperty(Headers.ACCEPT_STRING, "application/json");
  con.setRequestProperty(Headers.CONTENT_TYPE_STRING, "application/json");
  con.setRequestProperty(Headers.AUTHORIZATION_STRING, getAuthorization());
  con.setDoOutput(true);
  log.debugf("Sending 'DELETE' request to URL : %s", controllerURL);
  int responseCode = con.getResponseCode();
  log.debugf("Response Code : %s", responseCode);
  if (responseCode > 204) {
    throw new IOException("Unsucessful response code " + responseCode);
  }
}

origin: kiegroup/droolsjbpm-integration

@Test
public void testNonExistingAlias() {
  try {
    SSLContextBuilder.builder()
        .setKeyStorePath(KEYSTORE_PATH)
        .setKeyStorePassword(KEYSTORE_PASSWORD)
        .setKeyAlias("bla")
        .build();
    // should fail
    fail("Exception not thrown");
  } catch (RuntimeException e) {
    assertTrue(e.getCause() instanceof IllegalArgumentException);
  }
}
origin: org.kie.server/kie-server-router-proxy

protected void disconnectToController() {
  if (CONTROLLER == null) {
    return;
  }
  try {
    HttpUtils.deleteHttpCall(CONTROLLER + "/server/" + KieServerInfoHandler.getRouterId() + "/?location=" + URLEncoder.encode(KieServerInfoHandler.getLocationUrl(),
                                                                 "UTF-8"));
    log.infof("KieServerRouter disconnected from controller at " + CONTROLLER);
  } catch (Exception e) {
    log.error("Error when disconnecting from controller at " + CONTROLLER,
         e);
  }
}
origin: kiegroup/droolsjbpm-integration

public static void getHttpCall(String url) throws Exception {
  URL controllerURL = new URL(url);
  HttpURLConnection con = (HttpURLConnection) controllerURL.openConnection();
  con.setRequestMethod("GET");
  con.setRequestProperty(Headers.ACCEPT_STRING, "application/json");
  con.setRequestProperty(Headers.CONTENT_TYPE_STRING, "application/json");
  con.setRequestProperty(Headers.AUTHORIZATION_STRING, getAuthorization());
  con.setDoOutput(true);
  log.debugf("Sending 'GET' request to URL : %s", controllerURL);
  int responseCode = con.getResponseCode();
  log.debugf("Response Code : %s", responseCode);
  
  if (responseCode != 200) {
    throw new IOException("Unsucessful response code " + responseCode);
  }
}
org.kie.server.router.utils

Most used classes

  • SSLContextBuilder
  • AliasedX509ExtendedKeyManager
    KeyManager to select a key with desired alias while delegating processing to specified KeyManager Ca
  • FailedHostInfo
  • HttpUtils
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now