public String getPackageName () { return Nodes.makeName ( this.applicationNode ) + "-configuration"; }
/** * Register a new endpoint <br/> * The endpoint must not exists if the binding service is set, but will * exists after the call returns * * @return the newly created endpoint */ public static Endpoint registerEndpoint ( final Application app, final int port, final ServiceBinding serviceBinding, final String name ) { return registerEndpoint ( Nodes.fromApp ( app ), port, serviceBinding, name ); }
public static void setSourceConnectionFromEndpoints ( final SourceItem item, final MasterServer master, final Collection<Endpoint> endpoints ) { final Connection connection = Locator.findConnection ( master, endpoints ); if ( connection == null ) { final String nodeName = Nodes.makeName ( Nodes.fromApp ( master ) ); throw new IllegalStateException ( String.format ( "Master '%s' on node '%s' does not have a connection to endpoints %s", master.getName (), nodeName, StringHelper.join ( endpoints, ", " ) ) ); } if ( ! ( connection instanceof DataAccessConnection ) ) { throw new IllegalStateException ( String.format ( "Connection is of type %s but must be of type %s (Endpoints: %s)", connection.getClass ().getName (), DataAccessConnection.class.getName (), StringHelper.join ( endpoints, ", " ) ) ); } item.setConnection ( (DataAccessConnection)connection ); }
public static boolean isLocal ( final Node node1, final Endpoint ep ) { return isLocal ( node1, ep.getNode () ); }
/** * Register a new endpoint <br/> * The endpoint must not exists if the binding service is set, but will * exists after the call returns * * @return the newly created endpoint */ public static Endpoint registerEndpoint ( final Application app, final int port, final ServiceBinding serviceBinding, final String name ) { return registerEndpoint ( Nodes.fromApp ( app ), port, serviceBinding, name ); }
public static void setSourceConnectionFromEndpoints ( final SourceItem item, final MasterServer master, final Collection<Endpoint> endpoints ) { final Connection connection = Locator.findConnection ( master, endpoints ); if ( connection == null ) { final String nodeName = Nodes.makeName ( Nodes.fromApp ( master ) ); throw new IllegalStateException ( String.format ( "Master '%s' on node '%s' does not have a connection to endpoints %s", master.getName (), nodeName, StringHelper.join ( endpoints, ", " ) ) ); } if ( ! ( connection instanceof DataAccessConnection ) ) { throw new IllegalStateException ( String.format ( "Connection is of type %s but must be of type %s (Endpoints: %s)", connection.getClass ().getName (), DataAccessConnection.class.getName (), StringHelper.join ( endpoints, ", " ) ) ); } item.setConnection ( (DataAccessConnection)connection ); }
public static boolean isLocal ( final Node node1, final Endpoint ep ) { return isLocal ( node1, ep.getNode () ); }
protected void addDebianDependency ( final MasterServer master, final String dependecy ) { try { new TypeWalker<> ( DebianDeploymentMechanism.class ).walk ( Nodes.fromApp ( master ).getDeployments (), new TypeVisitor<DebianDeploymentMechanism> () { @Override public void visit ( final DebianDeploymentMechanism item ) throws Exception { item.getAdditionalDependencies ().add ( dependecy ); } } ); } catch ( final Exception e ) { throw new RuntimeException ( e ); } }
public String getPackageName () { return Nodes.makeName ( this.applicationNode ) + "-configuration"; }
private void createConnection ( final Connection connection ) { final Map<String, String> data = new HashMap<> ( 1 ); final String configurationId = Names.makeName ( connection ); final Endpoint ep = connection.getEndpoint (); final boolean isLocal = Nodes.isLocal ( ep.getNode (), this.app ); data.put ( "connection.uri", connection.makeUri ( isLocal ) ); //$NON-NLS-1$ addData ( connection.getFactoryId (), configurationId, data ); } }
@Override protected <T extends Item> void itemAdded ( final T item, final CustomizationRequest customizationRequest, final List<String> originalLocalTags, final Set<MasterListener<T>> masterListeners ) { super.itemAdded ( item, customizationRequest, originalLocalTags, masterListeners ); registerMappedItem ( this.ctx, this.component, originalLocalTags, item ); if ( isArchive ( item, customizationRequest ) ) { logger.debug ( "Archive item: {}", item ); final ValueArchiveServer archive = this.ctx.getArchiveServer ( this.master.getImplementation () ); if ( archive == null ) { final Node node = Nodes.fromApp ( this.master.getImplementation () ); throw new IllegalStateException ( String.format ( "Item %s should be archived but no archive server is configured for %s on %s", item, this.master, node ) ); } Items.addArchive ( archive, item ); } }
public void process ( @Named ( "phase" ) final String phase, final World world, final IContainer output, final IProgressMonitor monitor ) throws Exception { monitor.beginTask ( "Processing world", world.getNodes ().size () ); for ( final Node node : world.getNodes () ) { monitor.subTask ( String.format ( "Processing node: %s", Nodes.makeName ( node ) ) ); if ( node instanceof ApplicationNode ) { processNode ( phase, world, (ApplicationNode)node, output, new SubProgressMonitor ( monitor, 1 ) ); } } monitor.done (); }
private void createConnection ( final Connection connection ) { final Map<String, String> data = new HashMap<> ( 1 ); final String configurationId = Names.makeName ( connection ); final Endpoint ep = connection.getEndpoint (); final boolean isLocal = Nodes.isLocal ( ep.getNode (), this.app ); data.put ( "connection.uri", connection.makeUri ( isLocal ) ); //$NON-NLS-1$ addData ( connection.getFactoryId (), configurationId, data ); } }
public static Profile makeProfile ( final EquinoxApplication app ) { final Profile profile = flatten ( EcoreUtil.copy ( app.getProfile () ) ); if ( profile == null ) { throw new IllegalStateException ( "Application implemenation did not return a profile" ); } if ( app.getCustomizationProfile () != null ) { mergeIntoProfile ( flatten ( EcoreUtil.copy ( app.getCustomizationProfile () ) ), profile ); } profile.setName ( String.format ( "Custom profile for %s on node %s", app.getName (), Nodes.fromApp ( app ).getHostName () ) ); profile.setDescription ( null ); // finally clear null system properties clearNulls ( profile ); return profile; }
public void process ( @Named ( "phase" ) final String phase, final World world, final IContainer output, final IProgressMonitor monitor ) throws Exception { monitor.beginTask ( "Processing world", world.getNodes ().size () ); for ( final Node node : world.getNodes () ) { monitor.subTask ( String.format ( "Processing node: %s", Nodes.makeName ( node ) ) ); if ( node instanceof ApplicationNode ) { processNode ( phase, world, (ApplicationNode)node, output, new SubProgressMonitor ( monitor, 1 ) ); } } monitor.done (); }
private void processAknProxy ( final AknProxy proxy ) { final Map<String, String> data = new HashMap<String, String> (); final boolean isLocal = Nodes.isLocal ( proxy.getConnection ().getEndpoint ().getNode (), this.app ); data.put ( "pattern", "" + proxy.getPattern () ); data.put ( "authorative", "" + proxy.isAuthorative () ); data.put ( "connection.id", proxy.getConnection ().makeUri ( isLocal ) ); data.put ( "priority", "" + proxy.getPriority () ); addData ( Factories.FACTORY_AE_AKN_PROXY, String.format ( "%s-%s", proxy.getConnection ().getEndpoint ().getNode ().getHostName (), proxy.getPriority () ), data ); }