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

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

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

origin: net.roboconf/roboconf-agent

@Override
public void start( Instance instance ) throws PluginException {
  String name = instance != null ? instance.getName() : null;
  this.logger.info( this.agentId + " is starting instance " + name + "." );
  this.currentState = InstanceStatus.DEPLOYED_STARTED;
}
origin: net.roboconf/roboconf-agent

@Override
public void undeploy( Instance instance ) throws PluginException {
  String name = instance != null ? instance.getName() : null;
  this.logger.info( this.agentId + " is undeploying instance " + name + "." );
  this.currentState = InstanceStatus.NOT_DEPLOYED;
}
origin: net.roboconf/roboconf-agent

@Override
public void deploy( Instance instance ) throws PluginException {
  String name = instance != null ? instance.getName() : null;
  this.logger.info( this.agentId + " is deploying instance " + name + "." );
  this.currentState = InstanceStatus.DEPLOYED_STOPPED;
}
origin: net.roboconf/roboconf-agent

@Override
public void update( Instance instance, Import importChanged, InstanceStatus statusChanged ) throws PluginException {
  String name = instance != null ? instance.getName() : null;
  this.logger.info( this.agentId + " is updating instance " + name + "." );
}
origin: net.roboconf/roboconf-agent

@Override
public void stop( Instance instance ) throws PluginException {
  String name = instance != null ? instance.getName() : null;
  this.logger.info( this.agentId + " is stopping instance " + name + "." );
  this.currentState = InstanceStatus.DEPLOYED_STOPPED;
}
origin: net.roboconf/roboconf-agent

@Override
public void initialize( Instance instance ) throws PluginException {
  String name = instance != null ? instance.getName() : null;
  this.logger.fine( this.agentId + " is initializing the plug-in for " + name + "." );
  // This class is mainly used for test and dev' purpose.
  // So, we can store the information in the instance without any major impact.
  if( instance != null )
    instance.data.put( INIT_PROPERTY, "true" );
}
origin: roboconf/roboconf-platform

/**
 * Details for an instance.
 * @param instance the instance
 * @return an object with error details
 */
public static ErrorDetails instance( Instance instance ) {
  return new ErrorDetails( instance.getName(), ErrorDetailsKind.INSTANCE );
}
origin: net.roboconf/roboconf-plugin-puppet

@Override
public void initialize( Instance instance ) throws PluginException {
  this.logger.fine( this.agentId + " is initializing the plug-in for " + instance.getName());
  try {
    installPuppetModules( instance );
  } catch( Exception e ) {
    throw new PluginException( e );
  }
}
origin: roboconf/roboconf-platform

/**
 * Determines whether an instance name is not already used by a sibling instance.
 * @param application the application (not null)
 * @param parentInstance the parent instance (can be null to indicate a root instance)
 * @param nameToSearch the name to search
 * @return true if a child instance of <code>parentInstance</code> has the same name, false otherwise
 */
public static boolean hasChildWithThisName( AbstractApplication application, Instance parentInstance, String nameToSearch ) {
  boolean hasAlreadyAChildWithThisName = false;
  Collection<Instance> list = parentInstance == null ? application.getRootInstances() : parentInstance.getChildren();
  for( Iterator<Instance> it = list.iterator(); it.hasNext() && ! hasAlreadyAChildWithThisName; ) {
    hasAlreadyAChildWithThisName = Objects.equals( nameToSearch, it.next().getName());
  }
  return hasAlreadyAChildWithThisName;
}
origin: roboconf/roboconf-platform

/**
 * Builds a map with the variables defined by this class.
 * @param instance a non-null instance
 * @return a non-null map where all the properties here are mapped to their values for this instance
 */
public static Map<String,String> buildReferenceMap( Instance instance ) {
  Map<String,String> result = new HashMap<> ();
  String instancePath = InstanceHelpers.computeInstancePath( instance );
  result.put( ROBOCONF_INSTANCE_NAME, instance.getName());
  result.put( ROBOCONF_INSTANCE_PATH, instancePath );
  result.put( ROBOCONF_COMPONENT_NAME, instance.getComponent().getName());
  result.put( ROBOCONF_CLEAN_INSTANCE_PATH, cleanInstancePath( instancePath ));
  result.put( ROBOCONF_CLEAN_REVERSED_INSTANCE_PATH, cleanReversedInstancePath( instancePath ));
  return result;
}
origin: net.roboconf/roboconf-plugin-puppet

@Override
public void start( Instance instance ) throws PluginException {
  this.logger.fine( this.agentId + " is starting instance " + instance.getName());
  File instanceDirectory = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
  try {
    callPuppetScript( instance, "start", PuppetState.RUNNING, null, false, instanceDirectory );
  } catch( Exception e ) {
    throw new PluginException( e );
  }
}
origin: net.roboconf/roboconf-plugin-puppet

@Override
public void deploy( Instance instance ) throws PluginException {
  this.logger.fine( this.agentId + " is deploying instance " + instance.getName());
  File instanceDirectory = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
  try {
    callPuppetScript( instance, "deploy", PuppetState.STOPPED, null, false, instanceDirectory );
  } catch( Exception e ) {
    throw new PluginException( e );
  }
}
origin: net.roboconf/roboconf-plugin-puppet

@Override
public void stop( Instance instance ) throws PluginException {
  this.logger.fine( this.agentId + " is stopping instance " + instance.getName());
  File instanceDirectory = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
  try {
    callPuppetScript( instance, "stop", PuppetState.STOPPED, null, false, instanceDirectory );
  } catch( Exception e ) {
    throw new PluginException( e );
  }
}
origin: net.roboconf/roboconf-plugin-puppet

@Override
public void undeploy( Instance instance ) throws PluginException {
  this.logger.fine( this.agentId + " is undeploying instance " + instance.getName());
  File instanceDirectory = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
  try {
    callPuppetScript( instance, "undeploy", PuppetState.UNDEF, null, false, instanceDirectory );
  } catch( Exception e ) {
    throw new PluginException( e );
  }
}
origin: net.roboconf/roboconf-plugin-puppet

@Override
public void update(Instance instance, Import importChanged, InstanceStatus statusChanged) throws PluginException {
  this.logger.fine( this.agentId + " is updating instance " + instance.getName());
  File instanceDirectory = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
  try {
    callPuppetScript(
        instance, "update",
        PuppetState.UNDEF,
        importChanged,
        (statusChanged == InstanceStatus.DEPLOYED_STARTED),
        instanceDirectory );
  } catch( Exception e ) {
    throw new PluginException( e );
  }
}
origin: net.roboconf/roboconf-messaging-api

/**
 * Constructor.
 * @param instance
 */
public MsgCmdAddInstance( Instance instance ) {
  this.parentInstancePath = instance.getParent() == null ? null : InstanceHelpers.computeInstancePath( instance.getParent());
  this.instanceName = instance.getName();
  this.componentName = instance.getComponent() != null ? instance.getComponent().getName() : null;
  this.channels = instance.channels;
  this.data = instance.data;
  this.overridenExports = instance.overriddenExports;
}
origin: roboconf/roboconf-platform

/**
 * Constructor.
 * @param instance
 */
public MsgCmdAddInstance( Instance instance ) {
  this.parentInstancePath = instance.getParent() == null ? null : InstanceHelpers.computeInstancePath( instance.getParent());
  this.instanceName = instance.getName();
  this.componentName = instance.getComponent() != null ? instance.getComponent().getName() : null;
  this.channels = instance.channels;
  this.data = instance.data;
  this.overridenExports = instance.overriddenExports;
}
origin: roboconf/roboconf-platform

@Test
public void testGetAllInstances() {
  Application app = new Application( new ApplicationTemplate());
  Instance[] rootInstances = new Instance[ 8 ];
  for( int i=0; i<rootInstances.length; i++ ) {
    rootInstances[ i ] = new Instance( "i-" + i );
    InstanceHelpers.insertChild( rootInstances[ i ], new Instance( "child-" + i ));
  }
  app.getRootInstances().addAll( Arrays.asList( rootInstances ));
  List<Instance> allInstances = InstanceHelpers.getAllInstances( app );
  Assert.assertEquals( rootInstances.length * 2, allInstances.size());
  for( Instance rootInstance : rootInstances )
    Assert.assertTrue( rootInstance.getName(), allInstances.contains( rootInstance ));
}
origin: roboconf/roboconf-platform

@Test
public void testChain() {
  Instance inst = new Instance().name( "ins" ).status( InstanceStatus.DEPLOYING ).component( null ).parent( null );
  Assert.assertEquals( 0, inst.channels.size());
  Assert.assertEquals( "ins", inst.getName());
  Assert.assertEquals( InstanceStatus.DEPLOYING, inst.getStatus());
  Assert.assertNull( inst.getComponent());
  Assert.assertNull( inst.getParent());
  Assert.assertEquals( 1, inst.channel( "woo" ).channels.size());
  Assert.assertEquals( 2, inst.channel( "yeah" ).channels.size());
  Assert.assertEquals( 2, inst.channel( "woo" ).channels.size());
}
origin: roboconf/roboconf-platform

@Test
public void testBuildRoutingKeyForAgent_Instance() {
  Instance inst = new Instance( "my-root" );
  Assert.assertNotNull( MessagingUtils.buildTopicNameForAgent( inst ));
  Assert.assertEquals(
      MessagingUtils.buildTopicNameForAgent( inst ),
      MessagingUtils.buildTopicNameForAgent( inst.getName()));
  Instance childInstance = new Instance( "child" );
  InstanceHelpers.insertChild( inst, childInstance );
  Assert.assertEquals(
      MessagingUtils.buildTopicNameForAgent( childInstance ),
      MessagingUtils.buildTopicNameForAgent( inst ));
}
net.roboconf.core.model.beansInstancegetName

Popular methods of Instance

  • getComponent
  • getStatus
  • <init>
  • getImports
  • setStatus
  • 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

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Top Sublime Text 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