congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Instance.setStatus
Code IndexAdd Tabnine to your IDE (free)

How to use
setStatus
method
in
net.roboconf.core.model.beans.Instance

Best Java code snippets using net.roboconf.core.model.beans.Instance.setStatus (Showing top 20 results out of 315)

origin: net.roboconf/roboconf-dm

/**
 * Acknowledges a heart beat.
 * @param scopedInstance a root instance
 */
public void acknowledgeHeartBeat( Instance scopedInstance ) {
  String count = scopedInstance.data.get( MISSED_HEARTBEATS );
  if( count != null
      && Integer.parseInt( count ) > THRESHOLD )
    this.logger.info( "Agent " + InstanceHelpers.computeInstancePath( scopedInstance ) + " is alive and reachable again." );
  // Store the moment the first ACK (without interruption) was received.
  // If we were deploying, store it.
  // If we were in problem, store it.
  // If we were already deployed and started, do NOT override it.
  if( scopedInstance.getStatus() != InstanceStatus.DEPLOYED_STARTED
      || ! scopedInstance.data.containsKey( Instance.RUNNING_FROM ))
    scopedInstance.data.put( Instance.RUNNING_FROM, String.valueOf( new Date().getTime()));
  scopedInstance.setStatus( InstanceStatus.DEPLOYED_STARTED );
  scopedInstance.data.remove( MISSED_HEARTBEATS );
}
origin: net.roboconf/roboconf-dm-rest-commons

instance.setStatus( InstanceStatus.whichStatus( n.textValue()));
origin: net.roboconf/roboconf-agent

instance.setStatus( InstanceStatus.DEPLOYED_STOPPED );
    childInstance.setStatus( InstanceStatus.DEPLOYED_STOPPED );
origin: net.roboconf/roboconf-target-api

scopedInstance.setStatus( InstanceStatus.PROBLEM );
scopedInstance.data.put( Instance.LAST_PROBLEM, "Configuration failed. " + t.getMessage());
origin: roboconf/roboconf-platform

scopedInstance.setStatus( InstanceStatus.PROBLEM );
scopedInstance.data.put( Instance.LAST_PROBLEM, "Configuration failed. " + t.getMessage());
origin: net.roboconf/roboconf-dm

instance.setStatus( message.getNewStatus());
ImportHelpers.updateImports( instance, message.getNewImports());
origin: net.roboconf/roboconf-dm

int count = countAs == null ? 0 : Integer.parseInt( countAs );
if( ++ count > THRESHOLD ) {
  scopedInstance.setStatus( InstanceStatus.PROBLEM );
  notificationMngr.instance( scopedInstance, this.application, EventType.CHANGED );
  this.logger.severe( "Agent " + InstanceHelpers.computeInstancePath( scopedInstance ) + " has not sent heart beats for quite a long time. Status changed to PROBLEM." );
origin: net.roboconf/roboconf-dm

for( Instance i : InstanceHelpers.buildHierarchicalList( scopedInstance )) {
  InstanceStatus oldstatus = i.getStatus();
  i.setStatus( InstanceStatus.NOT_DEPLOYED );
origin: net.roboconf/roboconf-agent

  @Override
  public void changeInstanceState(
      Instance instance,
      PluginInterface plugin,
      InstanceStatus newStatus,
      Map<String,byte[]> fileNameToFileContent )
  throws IOException, PluginException {

    // We can undeploy
    if( newStatus == InstanceStatus.NOT_DEPLOYED )
      undeploy( instance, plugin );

    // Stop is only a status change, no script or notification run
    else if( newStatus == InstanceStatus.DEPLOYED_STOPPED ) {
      instance.setStatus( InstanceStatus.DEPLOYED_STOPPED );
      this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, instance ));

      List<Instance> childrenInstances = InstanceHelpers.buildHierarchicalList( instance );
      childrenInstances.remove( instance );

      for( Instance childInstance : childrenInstances ) {
        // Unresolved can only have "deployed stopped", "not deployed" and "waiting for ancestor" child status.
        if( childInstance.getStatus() == InstanceStatus.WAITING_FOR_ANCESTOR ) {
          childInstance.setStatus( InstanceStatus.DEPLOYED_STOPPED );
          this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, childInstance ));
        }
      }
    }
  }
}
origin: net.roboconf/roboconf-agent

  || instance.getParent().getStatus() == InstanceStatus.WAITING_FOR_ANCESTOR ) {
instance.setStatus( InstanceStatus.WAITING_FOR_ANCESTOR );
this.logger.fine( instancePath + " will start as soon as its parent starts." );
      + " cannot be started, dependencies are missing. Requesting exports from other agents." );
  instance.setStatus( InstanceStatus.UNRESOLVED );
  this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, instance ));
  this.messagingClient.requestExportsFromOtherAgents( instance );
Utils.logException( this.logger, e );
instance.setStatus( InstanceStatus.DEPLOYED_STOPPED );
this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, instance ));
origin: net.roboconf/roboconf-agent

  continue;
i.setStatus( InstanceStatus.STOPPING );
this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, i ));
this.messagingClient.listenToRequestsFromOtherAgents( ListenerCommand.STOP, i );
  newStatus = InstanceStatus.WAITING_FOR_ANCESTOR;
i.setStatus( newStatus );
forNotifications.add( i );
origin: net.roboconf/roboconf-agent

impactedInstance.setStatus( InstanceStatus.STARTING );
try {
  this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, impactedInstance ));
  plugin.start( impactedInstance );
  impactedInstance.setStatus( InstanceStatus.DEPLOYED_STARTED );
  this.logger.severe( "An error occured while starting " + InstanceHelpers.computeInstancePath( impactedInstance ));
  Utils.logException( this.logger, e );
  impactedInstance.setStatus( oldState );
  this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, impactedInstance ));
origin: net.roboconf/roboconf-dm

try {
  scopedInstance.setStatus( InstanceStatus.UNDEPLOYING );
  this.notificationMngr.instance( scopedInstance, ma.getApplication(), EventType.CHANGED );
  scopedInstance.setStatus( initialStatus );
  scopedInstance.data.put( Instance.MACHINE_ID, machineId );
  this.notificationMngr.instance( scopedInstance, ma.getApplication(), EventType.CHANGED );
origin: net.roboconf/roboconf-agent

instance.setStatus( InstanceStatus.DEPLOYING );
try {
  this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, instance ));
  instance.setStatus( InstanceStatus.DEPLOYED_STOPPED );
  this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, instance ));
  Utils.logException( this.logger, e );
  instance.setStatus( InstanceStatus.NOT_DEPLOYED );
  this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, instance ));
origin: net.roboconf/roboconf-agent

  continue;
i.setStatus( InstanceStatus.UNDEPLOYING );
this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, i ));
this.messagingClient.unpublishExports( i );
i.setStatus( newStatus );
this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.appName, i ));
origin: net.roboconf/roboconf-agent

this.scopedInstance.setStatus( InstanceStatus.DEPLOYED_STARTED );
this.messagingClient.sendMessageToTheDm( new MsgNotifInstanceChanged( this.agent.getApplicationName(), this.scopedInstance ));
origin: roboconf/roboconf-platform

@Test
public void testDuplicateInstance_singleInstance() {
  Instance original = new Instance( "inst" ).channel( "chan" ).component( new Component( "comp" ));
  original.overriddenExports.put( "test", "test" );
  original.overriddenExports.put( "A.port", "8012" );
  original.data.put( "some", "data" );
  original.getImports().put( "facet-name", new ArrayList<Import> ());
  original.setStatus( InstanceStatus.DEPLOYED_STARTED );
  Instance copy = InstanceHelpers.replicateInstance( original );
  Assert.assertEquals( original.getName(), copy.getName());
  Assert.assertEquals( original.channels, copy.channels );
  Assert.assertEquals( original.overriddenExports.size(), copy.overriddenExports.size());
  Assert.assertEquals( "test", copy.overriddenExports.get( "test" ));
  Assert.assertEquals( "8012", copy.overriddenExports.get( "A.port" ));
  Assert.assertEquals( 0, copy.getImports().size());
  Assert.assertEquals( original.getComponent(), copy.getComponent());
  Assert.assertEquals( InstanceStatus.NOT_DEPLOYED, copy.getStatus());
}
origin: roboconf/roboconf-platform

@Test
public void testHasAllRequiredImports_optional() throws Exception {
  Component clusterNodeComponent = new Component( "cluster" ).installerName( "whatever" );
  clusterNodeComponent.addImportedVariable( new ImportedVariable( "cluster.ip", true, false ));
  clusterNodeComponent.addImportedVariable( new ImportedVariable( "cluster.port", true, false ));
  clusterNodeComponent.addExportedVariable( new ExportedVariable( "cluster.ip", null ));
  clusterNodeComponent.addExportedVariable( new ExportedVariable( "cluster.port", "9007" ));
  Instance i1 = new Instance( "inst 1" ).component( clusterNodeComponent );
  i1.overriddenExports.put( "cluster.ip", "192.168.1.15" );
  i1.setStatus( InstanceStatus.STARTING );
  Instance i2 = new Instance( "inst 2" ).component( clusterNodeComponent );
  i2.overriddenExports.put( "cluster.ip", "192.168.1.28" );
  // The cluster node does not know about the other node
  Assert.assertTrue( ImportHelpers.hasAllRequiredImports( i1, null ));
  Assert.assertTrue( ImportHelpers.hasAllRequiredImports( i2, null ));
  // The node is now aware of another node
  ImportHelpers.addImport( i1, "cluster", new Import( i2 ));
  i1.setStatus( InstanceStatus.STARTING );
  Assert.assertTrue( ImportHelpers.hasAllRequiredImports( i1, null ));
  Assert.assertTrue( ImportHelpers.hasAllRequiredImports( i2, null ));
  i1.getImports().clear();
  Assert.assertTrue( ImportHelpers.hasAllRequiredImports( i1, null ));
  Assert.assertTrue( ImportHelpers.hasAllRequiredImports( i2, null ));
}
origin: roboconf/roboconf-platform

@Test
public void testHasAllRequiredImports_withWildcard() throws Exception {
  // Same test than "testHasAllRequiredImports_required"
  // but here, variable imports use a wild card.
  Component dbComponent = new Component( "database" ).installerName( "whatever" );
  dbComponent.addExportedVariable( new ExportedVariable( "database.ip", null ));
  dbComponent.addExportedVariable( new ExportedVariable( "database.port", "3009" ));
  dbComponent.addExportedVariable( new ExportedVariable( "database.collection", "whatever" ));
  Component appServerComponent = new Component( "app-server" ).installerName( "whatever" );
  appServerComponent.addExportedVariable( new ExportedVariable( "app-server.ip", null ));
  appServerComponent.addExportedVariable( new ExportedVariable( "app-server.port", "8009" ));
  appServerComponent.addImportedVariable( new ImportedVariable( "database.*", false, false ));
  Instance appServer = new Instance( "app server" ).component( appServerComponent );
  appServer.overriddenExports.put( "app-server.ip", "192.168.1.15" );
  appServer.setStatus( InstanceStatus.STARTING );
  Instance database = new Instance( "database" ).component( dbComponent );
  database.overriddenExports.put( "database.ip", "192.168.1.28" );
  // The application server does not know about the database
  Assert.assertFalse( ImportHelpers.hasAllRequiredImports( appServer, Logger.getAnonymousLogger()));
  // The application server is now aware of the database
  ImportHelpers.addImport( appServer, "database", new Import( database ));
  Assert.assertTrue( ImportHelpers.hasAllRequiredImports( appServer, null ));
  appServer.getImports().clear();
  Assert.assertFalse( ImportHelpers.hasAllRequiredImports( appServer, null ));
}
origin: roboconf/roboconf-platform

@Test
public void testHasAllRequiredImports_required() throws Exception {
  Component dbComponent = new Component( "database" ).installerName( "whatever" );
  dbComponent.addExportedVariable( new ExportedVariable( "database.ip", null ));
  dbComponent.addExportedVariable( new ExportedVariable( "database.port", "3009" ));
  dbComponent.addExportedVariable( new ExportedVariable( "database.collection", "whatever" ));
  Component appServerComponent = new Component( "app-server" ).installerName( "whatever" );
  appServerComponent.addExportedVariable( new ExportedVariable( "app-server.ip", null ));
  appServerComponent.addExportedVariable( new ExportedVariable( "app-server.port", "8009" ));
  appServerComponent.addImportedVariable( new ImportedVariable( "database.ip", false, false ));
  appServerComponent.addImportedVariable( new ImportedVariable( "database.port", false, false ));
  appServerComponent.addImportedVariable( new ImportedVariable( "database.collection", true, false ));
  Instance appServer = new Instance( "app server" ).component( appServerComponent );
  appServer.overriddenExports.put( "app-server.ip", "192.168.1.15" );
  appServer.setStatus( InstanceStatus.STARTING );
  Instance database = new Instance( "database" ).component( dbComponent );
  database.overriddenExports.put( "database.ip", "192.168.1.28" );
  // The application server does not know about the database
  Assert.assertFalse( ImportHelpers.hasAllRequiredImports( appServer, Logger.getAnonymousLogger()));
  // The application server is now aware of the database
  ImportHelpers.addImport( appServer, "database", new Import( database ));
  Assert.assertTrue( ImportHelpers.hasAllRequiredImports( appServer, null ));
  appServer.getImports().clear();
  Assert.assertFalse( ImportHelpers.hasAllRequiredImports( appServer, null ));
}
net.roboconf.core.model.beansInstancesetStatus

Popular methods of Instance

  • getName
  • getComponent
  • getStatus
  • <init>
  • getImports
  • component
  • getParent
  • getChildren
  • setName
  • setComponent
  • channel
    Adds a channel in a chain approach.
  • name
    Sets the name in a chain approach.
  • channel,
  • name,
  • setParent,
  • status,
  • equals,
  • parent,
  • toString

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Runner (org.openjdk.jmh.runner)
  • Top Vim plugins
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