Tabnine Logo
Instance.setName
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: net.roboconf/roboconf-dm-rest-commons

instance.setName( n.textValue());
origin: roboconf/roboconf-platform

instance.setName( ModelUtils.getPropertyValue( currentBlock, ParsingConstants.PROPERTY_INSTANCE_NAME ));
instance.channels.addAll( ModelUtils.getPropertyValues( currentBlock, ParsingConstants.PROPERTY_INSTANCE_CHANNELS ));
origin: net.roboconf/roboconf-dm

  @Override
  public void execute() throws CommandException {

    Instance instance = resolveInstance( this.instr, this.instr.getInstancePath(), false );
    Instance scopedInstance = InstanceHelpers.findScopedInstance( instance );
    if( scopedInstance.getStatus() != InstanceStatus.NOT_DEPLOYED )
      throw new CommandException( "Only instances that are not yet managed by an agent can be renamed." );

    instance.setName( this.instr.getNewInstanceName());
  }
}
origin: roboconf/roboconf-platform

@Test
public void testInstance() {
  Instance inst = new Instance();
  Iterator<ModelError> iterator = RuntimeModelValidator.validate( inst ).iterator();
  Assert.assertEquals( ErrorCode.RM_EMPTY_INSTANCE_NAME, iterator.next().getErrorCode());
  Assert.assertEquals( ErrorCode.RM_EMPTY_INSTANCE_COMPONENT, iterator.next().getErrorCode());
  Assert.assertFalse( iterator.hasNext());
  inst.setName( "?my instance?" );
  iterator = RuntimeModelValidator.validate( inst ).iterator();
  Assert.assertEquals( ErrorCode.RM_INVALID_INSTANCE_NAME, iterator.next().getErrorCode());
  Assert.assertEquals( ErrorCode.RM_EMPTY_INSTANCE_COMPONENT, iterator.next().getErrorCode());
  Assert.assertFalse( iterator.hasNext());
  inst.setName( "my-instance" );
  iterator = RuntimeModelValidator.validate( inst ).iterator();
  Assert.assertEquals( ErrorCode.RM_EMPTY_INSTANCE_COMPONENT, iterator.next().getErrorCode());
  Assert.assertFalse( iterator.hasNext());
  inst.setComponent( new Component( "comp" ));
  Assert.assertEquals( 0, RuntimeModelValidator.validate( inst ).size());
  inst.setName( "my instance" );
  Assert.assertEquals( 0, RuntimeModelValidator.validate( inst ).size());
  inst.overriddenExports.put( "inst.value", "whatever" );
  iterator = RuntimeModelValidator.validate( inst ).iterator();
  Assert.assertEquals( ErrorCode.RM_MAGIC_INSTANCE_VARIABLE, iterator.next().getErrorCode());
  Assert.assertFalse( iterator.hasNext());
}
origin: roboconf/roboconf-platform

@Test
public void testHaveSamePath() {
  Instance instance1 = new Instance( "inst1" );
  Assert.assertTrue( InstanceHelpers.haveSamePath( instance1, instance1 ));
  Instance instance2 = new Instance( "inst2" );
  Assert.assertFalse( InstanceHelpers.haveSamePath( instance1, instance2 ));
  instance2.setName( "inst1" );
  Assert.assertTrue( InstanceHelpers.haveSamePath( instance1, instance2 ));
}
origin: roboconf/roboconf-platform

@Test
public void testComputeInstancePath() {
  Instance instance1 = new Instance();
  Assert.assertEquals( "/", InstanceHelpers.computeInstancePath( instance1 ));
  instance1.setName( "inst1" );
  Assert.assertEquals( "/inst1", InstanceHelpers.computeInstancePath( instance1 ));
  Instance instance2 = new Instance( "inst2" );
  Assert.assertEquals( "/inst2", InstanceHelpers.computeInstancePath( instance2 ));
  instance1.getChildren().add( instance2 );
  instance2.setParent( instance1 );
  Assert.assertEquals( "/inst1", InstanceHelpers.computeInstancePath( instance1 ));
  Assert.assertEquals( "/inst1/inst2", InstanceHelpers.computeInstancePath( instance2 ));
}
origin: net.roboconf/roboconf-dm

  @Override
  public void execute() throws CommandException {

    // Resolve runtime structure
    Instance rootInstance = resolveInstance( this.instr, this.instr.getReplicatedInstancePath(), true );
    ManagedApplication ma = resolveManagedApplication( this.manager, this.instr );

    // Verify we can create new VMs in the model
    CreateInstanceCommandExecution.verify( this.executionContext, rootInstance.getComponent());

    try {
      // Copy the instance
      Instance copy = InstanceHelpers.replicateInstance( rootInstance );
      copy.setName( this.instr.getNewInstanceName());
      this.manager.instancesMngr().addInstance( ma, null, copy );

      // Associate this new instance with the same target, if it has one
      String targetId = this.manager.targetsMngr().findTargetId( ma.getApplication(), "/" + rootInstance.getName(), true );
      if( targetId != null )
        this.manager.targetsMngr().associateTargetWith( targetId, ma.getApplication(), "/" + copy.getName());

      // Register meta-data
      CreateInstanceCommandExecution.update( this.executionContext, copy );

    } catch( Exception e ) {
      throw new CommandException( e );
    }
  }
}
origin: roboconf/roboconf-platform

Assert.assertEquals( 3, InstanceHelpers.getAllInstances( app ).size());
instWithInvalidName.setName( "whatever" );
Assert.assertTrue( InstanceHelpers.tryToInsertChildInstance( app, vmInstance, instWithInvalidName ));
Assert.assertEquals( 4, InstanceHelpers.getAllInstances( app ).size());
net.roboconf.core.model.beansInstancesetName

Popular methods of Instance

  • getName
  • getComponent
  • getStatus
  • <init>
  • getImports
  • setStatus
  • component
  • getParent
  • getChildren
  • 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 post requests using okhttp
  • setContentView (Activity)
  • startActivity (Activity)
  • getSystemService (Context)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • BoxLayout (javax.swing)
  • Best IntelliJ 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