Tabnine Logo
ServerInstanceKey.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.kie.server.controller.api.model.runtime.ServerInstanceKey
constructor

Best Java code snippets using org.kie.server.controller.api.model.runtime.ServerInstanceKey.<init> (Showing top 20 results out of 315)

origin: org.kie.server/kie-server-controller-api

  public static ServerInstanceKey newServerInstanceKey(String serverTemplateId, String url) {
    try {
      URL serverUrl = new URL(url);
      String serverInstanceId = null;
      if (serverUrl.getPort() == -1) {
        serverInstanceId = serverTemplateId + "@" + serverUrl.getHost();
      } else {
        serverInstanceId = serverTemplateId + "@" + serverUrl.getHost() + ":" + serverUrl.getPort();
      }
      return new ServerInstanceKey(serverTemplateId, serverInstanceId, serverInstanceId, url);
    } catch (MalformedURLException e) {
      throw new IllegalArgumentException("Invalid server url " + url);
    }

  }
}
origin: kiegroup/droolsjbpm-integration

  public static ServerInstanceKey newServerInstanceKey(String serverTemplateId, String url) {
    try {
      URL serverUrl = new URL(url);
      String serverInstanceId = null;
      if (serverUrl.getPort() == -1) {
        serverInstanceId = serverTemplateId + "@" + serverUrl.getHost();
      } else {
        serverInstanceId = serverTemplateId + "@" + serverUrl.getHost() + ":" + serverUrl.getPort();
      }
      return new ServerInstanceKey(serverTemplateId, serverInstanceId, serverInstanceId, url);
    } catch (MalformedURLException e) {
      throw new IllegalArgumentException("Invalid server url " + url);
    }

  }
}
origin: org.kie.server/kie-server-controller-api

public ServerInstanceKey getServerInstanceKey() {
  return new ServerInstanceKey(getServerTemplateId(), serverInstanceId, serverInstanceId, getUrl());
}
origin: kiegroup/droolsjbpm-integration

public ServerInstanceKey getServerInstanceKey() {
  return new ServerInstanceKey(getServerTemplateId(), serverInstanceId, serverInstanceId, getUrl());
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

public static ServerInstanceKey toKey( final ServerInstance serverInstance ) {
  return new ServerInstanceKey( serverInstance.getServerTemplateId(),
                 serverInstance.getServerName(),
                 serverInstance.getServerInstanceId(),
                 serverInstance.getUrl() );
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

  @Test
  public void testSetup() {
    final Container container = new Container( "containerSpecId", "containerName", new ServerInstanceKey(), Collections.<Message>emptyList(), null, null );
    presenter.setup( Collections.singletonList( container ) );

    verify( containerCardPresenter ).setup( container );
    verify( view ).addCard( any( Widget.class ) );
  }
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testOnSelectedServerInstance() {
  final RemotePresenter.View remoteView = mock( RemotePresenter.View.class );
  when( remotePresenter.getView() ).thenReturn( remoteView );
  presenter.onSelected( new ServerInstanceSelected( new ServerInstanceKey() ) );
  verify( view ).setContent( remoteView );
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testLoadContainers() {
  final Container container = new Container("containerSpecId",
                       "containerName",
                       new ServerInstanceKey(),
                       Collections.<Message>emptyList(),
                       null,
                       null);
  containerSpecData.getContainers().add(container);
  presenter.loadContainers(containerSpecData);
  verifyLoad(true,
        1);
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testRemoveError() {
  final ServerInstanceKey serverInstanceKey = new ServerInstanceKey( "templateId", "serverName", "serverInstanceId", "url" );
  presenter.onSelect( new ServerInstanceSelected( serverInstanceKey ) );
  doThrow( new RuntimeException() ).when( specManagementService ).deleteServerInstance( serverInstanceKey );
  presenter.remove();
  final ArgumentCaptor<NotificationEvent> notificationCaptor = ArgumentCaptor.forClass( NotificationEvent.class );
  verify( notification ).fire( notificationCaptor.capture() );
  assertEquals( NotificationEvent.NotificationType.ERROR, notificationCaptor.getValue().getType() );
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testRemove() {
  final ServerInstanceKey serverInstanceKey = new ServerInstanceKey( "templateId", "serverName", "serverInstanceId", "url" );
  presenter.onSelect( new ServerInstanceSelected( serverInstanceKey ) );
  presenter.remove();
  verify( specManagementService ).deleteServerInstance( serverInstanceKey );
  verify( notification ).fire( any( NotificationEvent.class ) );
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testLoadContainersNonStoped() {
  final Container container = new Container("containerSpecId",
                       "containerName",
                       new ServerInstanceKey(),
                       Collections.<Message>emptyList(),
                       null,
                       null);
  container.setStatus(KieContainerStatus.STARTED);
  containerSpecData.getContainers().add(container);
  presenter.loadContainers(containerSpecData);
  verifyLoad(false,
        1);
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testOnDeleteWithoutCurrentServer() {
  final ServerInstanceKey serverInstanceKey = new ServerInstanceKey( "serverInstanceKeyId", "serverName", "serverInstanceId", "url" );
  presenter.onDelete( new ServerInstanceDeleted( serverInstanceKey.getServerInstanceId() ) );
  verify( specManagementService, never() ).listServerTemplateKeys();
}
origin: org.jbpm/jbpm-wb-common-client

@Test
public void testServerTemplateUpdatedWithServerInstance() {
  final String serverTemplateId = "id1";
  final ServerTemplate st1 = new ServerTemplate(serverTemplateId,
                         "kie-server-template1");
  st1.addServerInstance(new ServerInstanceKey());
  when(specManagementService.listServerTemplates()).thenReturn(new ServerTemplateList(singletonList(st1)));
  serverTemplateSelectorMenuBuilder.onServerTemplateUpdated(new ServerTemplateUpdated(st1));
  verifyNoMoreInteractions(view);
}
origin: org.jbpm/jbpm-wb-common-client

@Test
public void testOneServerTemplate() {
  final String serverTemplateId = "id1";
  final ServerTemplate st1 = new ServerTemplate(serverTemplateId,
                         "kie-server-template1");
  st1.addServerInstance(new ServerInstanceKey());
  when(specManagementService.listServerTemplates()).thenReturn(new ServerTemplateList(singletonList(st1)));
  serverTemplateSelectorMenuBuilder.init();
  verify(specManagementService).listServerTemplates();
  verify(view).setServerTemplateChangeHandler(any(ParameterizedCommand.class));
  verify(view).removeAllServerTemplates();
  verify(view).addServerTemplate(serverTemplateId);
  verify(view).selectServerTemplate(serverTemplateId);
  verify(view).setVisible(false);
  verifyNoMoreInteractions(view);
}
origin: kiegroup/jbpm-wb

@Test
public void testServerTemplateUpdatedWithServerInstance() {
  final String serverTemplateId = "id1";
  final ServerTemplate st1 = new ServerTemplate(serverTemplateId,
                         "kie-server-template1");
  st1.addServerInstance(new ServerInstanceKey());
  when(specManagementService.listServerTemplates()).thenReturn(new ServerTemplateList(singletonList(st1)));
  serverTemplateSelectorMenuBuilder.onServerTemplateUpdated(new ServerTemplateUpdated(st1));
  verifyNoMoreInteractions(view);
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testOnDelete() {
  final ServerInstanceKey serverInstanceKey = new ServerInstanceKey( "serverInstanceKeyId", "serverName", "serverInstanceId", "url" );
  final ServerTemplate serverTemplate = new ServerTemplate( "ServerTemplateId", "ServerTemplateName" );
  serverTemplate.addServerInstance( serverInstanceKey );
  when( serverTemplatePresenter.getCurrentServerTemplate() ).thenReturn( serverTemplate );
  final ServerTemplateKey serverTemplateKey = new ServerTemplateKey( "ServerTemplateKeyId", "ServerTemplateKeyName" );
  final List<ServerTemplateKey> serverTemplateKeys = Collections.singletonList( serverTemplateKey );
  when( specManagementService.listServerTemplateKeys() ).thenReturn( new ServerTemplateKeyList(serverTemplateKeys) );
  presenter.onDelete( new ServerInstanceDeleted( serverInstanceKey.getServerInstanceId() ) );
  verify( navigationPresenter ).setup( serverTemplateKey, serverTemplateKeys );
  final ArgumentCaptor<ServerTemplateSelected> templateSelectedCaptor = ArgumentCaptor.forClass( ServerTemplateSelected.class );
  verify( serverTemplateSelectedEvent ).fire( templateSelectedCaptor.capture() );
  assertEquals( serverTemplateKey, templateSelectedCaptor.getValue().getServerTemplateKey() );
}
origin: org.kie.server/kie-server-controller-impl

@Test
public void testGetContainersByTemplate() {
  when(kieServerInstanceManager.getContainers(any(), any())).thenReturn(singletonList(container));
  org.kie.server.controller.api.model.runtime.ServerInstanceKey instanceKey = new ServerInstanceKey("instanceId", "test server", serverTemplate.getId(), "http://fake.url.org");
  serverTemplate.addServerInstance(instanceKey);
  specManagementService.saveServerTemplate(serverTemplate);
  ContainerList containers = runtimeManagementService.getContainers(serverTemplate, containerSpec);
  assertNotNull(containers);
  assertEquals(1, containers.getContainers().length);
  assertEquals(container, containers.getContainers()[0]);
  verify(kieServerInstanceManager).getContainers(any(), any());
}
origin: org.kie.server/kie-server-controller-impl

@Test
public void testGetContainersByInstance() {
  when(kieServerInstanceManager.getContainers(any(ServerInstanceKey.class))).thenReturn(singletonList(container));
  org.kie.server.controller.api.model.runtime.ServerInstanceKey instanceKey = new ServerInstanceKey(serverTemplate.getId(), "test server", "instanceId", "http://fake.url.org");
  serverTemplate.addServerInstance(instanceKey);
  specManagementService.saveServerTemplate(serverTemplate);
  ContainerList containers = runtimeManagementService.getContainers(instanceKey);
  assertNotNull(containers);
  assertEquals(1, containers.getContainers().length);
  assertEquals(container, containers.getContainers()[0]);
  verify(kieServerInstanceManager).getContainers(any());
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testSelectAndRefreshEmptyContainers() {
  final ServerInstanceKey serverInstanceKey = new ServerInstanceKey( "templateId", "serverName", "serverInstanceId", "url" );
  when( runtimeManagementService.getContainersByServerInstance(
      serverInstanceKey.getServerTemplateId(),
      serverInstanceKey.getServerInstanceId() ) ).thenReturn(
      Collections.<Container>emptyList()
  );
  presenter.onSelect( new ServerInstanceSelected( serverInstanceKey ) );
  verify( view ).clear();
  verify( view ).setServerName( serverInstanceKey.getServerName() );
  verify( view ).setServerURL( serverInstanceKey.getUrl() );
  verify( view ).setEmptyView( remoteEmptyPresenter.getView() );
}
origin: org.kie.workbench.screens/kie-wb-common-server-ui-client

@Test
public void testOnServerInstanceSelect() {
  final ServerInstanceKey serverInstanceKey = new ServerInstanceKey( "serverInstanceKeyId", "serverName", "serverInstanceId", "url" );
  presenter.onServerInstanceSelect( new ServerInstanceSelected( serverInstanceKey ) );
  verify( view ).selectServerInstance( serverInstanceKey.getServerTemplateId(), serverInstanceKey.getServerInstanceId() );
}
org.kie.server.controller.api.model.runtimeServerInstanceKey<init>

Popular methods of ServerInstanceKey

  • getServerInstanceId
  • getServerTemplateId
  • getUrl
  • getServerName
  • equals
  • hashCode

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JPanel (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
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