private void connectMasterToDriver ( final MasterServer master, final org.eclipse.scada.configuration.infrastructure.Driver driver, final Endpoint ep ) { String tt = driver.getProtocolTypeTag (); if ( tt == null || tt.isEmpty () ) { tt = "ngp"; } final DataAccessConnection connection; switch ( tt ) { case "sfp": connection = OsgiFactory.eINSTANCE.createSfpDataAccessConnection (); break; case "ngp": connection = OsgiFactory.eINSTANCE.createDataAccessConnection (); break; default: throw new IllegalStateException ( String.format ( "Protocol type '%s' is unsupported", tt ) ); } connection.setEndpoint ( ep ); connection.setName ( Worlds.makeConnectionName ( driver ) ); connection.setCredentials ( EcoreUtil.copy ( Worlds.findConnectionPassword ( driver ) ) ); final org.eclipse.scada.configuration.world.osgi.MasterServer mappedMaster = this.ctxMap.get ( master ).getImplementation (); mappedMaster.getConnections ().add ( connection ); }
newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.EQUINOX_APPLICATION__CONNECTIONS, OsgiFactory.eINSTANCE.createDataAccessConnection () ) );
newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.EQUINOX_APPLICATION__CONNECTIONS, OsgiFactory.eINSTANCE.createDataAccessConnection () ) );
newChildDescriptors.add ( createChildParameter ( OsgiPackage.Literals.EQUINOX_APPLICATION__CONNECTIONS, OsgiFactory.eINSTANCE.createDataAccessConnection () ) );
final DataAccessConnection selfConnection = OsgiFactory.eINSTANCE.createDataAccessConnection (); selfConnection.setCredentials ( EcoreUtil.copy ( findLocalCredentials ( infraMaster ) ) ); selfConnection.setName ( "self" ); //$NON-NLS-1$