public static Connection findConnection ( final EquinoxApplication source, final Collection<Endpoint> target ) { if ( source == null ) { return null; } for ( final Endpoint ep : target ) { for ( final Connection connection : source.getConnections () ) { if ( connection.getEndpoint () == null ) { continue; } if ( connection.getEndpoint ().equals ( ep ) ) { return connection; } } } return null; }
public static Connection findConnection ( final EquinoxApplication source, final Collection<Endpoint> target ) { if ( source == null ) { return null; } for ( final Endpoint ep : target ) { for ( final Connection connection : source.getConnections () ) { if ( connection.getEndpoint () == null ) { continue; } if ( connection.getEndpoint ().equals ( ep ) ) { return connection; } } } return null; }
final Exporter exporter = map.get ( con.getEndpoint () ); logger.debug ( "Connection points to - exporter: {}, endpoint: {}", exporter.getName (), con.getEndpoint ().getName () ); result.add ( con.getEndpoint () );
final Exporter exporter = map.get ( con.getEndpoint () ); logger.debug ( "Connection points to - exporter: {}, endpoint: {}", exporter.getName (), con.getEndpoint ().getName () ); result.add ( con.getEndpoint () );
/** * Find all connections of the give type from master server <q>from</q> to * master server <q>to</q> */ public static <T extends Connection> List<T> findPossibleConnections ( final EquinoxApplication from, final EquinoxApplication to, final Class<T> clazz ) { final List<T> result = new LinkedList<> (); for ( final T connection : findConnections ( from, clazz ) ) { for ( final Exporter exporter : to.getExporter () ) { final EList<Endpoint> possibleEndpoints = connection.getPossibleEndpoints ( exporter ); if ( possibleEndpoints.isEmpty () ) { continue; } if ( possibleEndpoints.contains ( connection.getEndpoint () ) ) { result.add ( connection ); } } } return result; }
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 ); } }
/** * Find all connections of the give type from master server <q>from</q> to * master server <q>to</q> */ public static <T extends Connection> List<T> findPossibleConnections ( final EquinoxApplication from, final EquinoxApplication to, final Class<T> clazz ) { final List<T> result = new LinkedList<> (); for ( final T connection : findConnections ( from, clazz ) ) { for ( final Exporter exporter : to.getExporter () ) { final EList<Endpoint> possibleEndpoints = connection.getPossibleEndpoints ( exporter ); if ( possibleEndpoints.isEmpty () ) { continue; } if ( possibleEndpoints.contains ( connection.getEndpoint () ) ) { result.add ( connection ); } } } return result; }
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 ); } }