public void setInfrastructure ( final org.eclipse.scada.configuration.infrastructure.World infrastructure ) { this.infrastructure = infrastructure; this.options = infrastructure.getOptions (); }
public WorldGenerator ( final org.eclipse.scada.configuration.infrastructure.World infrastructure ) { this.infrastructure = infrastructure; this.options = infrastructure.getOptions (); }
public static void addUserService ( final EquinoxApplication application, final EquinoxBase base ) { final World world = Containers.findContainer ( base, World.class ); addUserService ( application, findUserService ( base ), world.getOptions () ); }
public static UserService findUserService ( final EquinoxBase app ) { if ( app.getUserService () != null ) { return app.getUserService (); } final World world = Containers.findContainer ( app, World.class ); final Options options = world.getOptions (); if ( options != null && options.getDefaultUserService () != null ) { return options.getDefaultUserService (); } return null; }
@Override public Driver createDriver ( final World world, final AbstractFactoryDriver driver, final Map<Node, org.eclipse.scada.configuration.world.Node> nodes ) { final T result = createDriver (); final EquinoxDriver eDriver = (EquinoxDriver)driver; final DataAccessExporter exporter = OsgiFactory.eINSTANCE.createDataAccessExporter (); exporter.setName ( "exporter" ); //$NON-NLS-1$ result.getExporter ().add ( exporter ); exporter.getEndpoints ().add ( Endpoints.registerEndpoint ( nodes.get ( driver.getNode () ), world.getOptions ().getBaseDaNgpPort () + eDriver.getInstanceNumber (), Endpoints.reference ( exporter ), "EquinoxDriver Endpoint: " + driver.getName () ) ); final ConfigurationAdministratorExporter caExporter = OsgiFactory.eINSTANCE.createConfigurationAdministratorExporter (); caExporter.setName ( "caExporter" ); //$NON-NLS-1$ result.getExporter ().add ( caExporter ); caExporter.getEndpoints ().add ( Endpoints.registerEndpoint ( nodes.get ( driver.getNode () ), world.getOptions ().getBaseCaNgpPort () + eDriver.getInstanceNumber (), Endpoints.reference ( caExporter ), "CA Exporter: " + driver.getName () ) ); Worlds.addUserService ( result, eDriver ); result.setSecurityConfiguration ( Worlds.findSecurityConfiguration ( eDriver ) ); result.getModules ().addAll ( WorldGenerator.makeModules ( world, eDriver, result ) ); configureDriver ( driver, result, nodes ); return result; }
@SuppressWarnings ( "unchecked" ) @Override public Driver process ( final org.eclipse.scada.configuration.infrastructure.Driver infraDriver, final Map<Node, org.eclipse.scada.configuration.world.Node> nodes ) { final T driver = (T)infraDriver; final S result = createDriver ( driver, nodes ); result.setName ( driver.getName () ); result.setSecurityConfiguration ( Worlds.findSecurityConfiguration ( driver ) ); Worlds.addUserService ( result, driver ); final World world = Containers.findContainer ( infraDriver, World.class ); final DataAccessExporter exporter = OsgiFactory.eINSTANCE.createDataAccessExporter (); exporter.setName ( "exporter" ); //$NON-NLS-1$ result.getExporter ().add ( exporter ); exporter.getEndpoints ().add ( Endpoints.registerEndpoint ( nodes.get ( driver.getNode () ), world.getOptions ().getBaseDaNgpPort () + driver.getInstanceNumber (), Endpoints.reference ( exporter ), "EquinoxDriver Endpoint: " + driver.getName () ) ); final ConfigurationAdministratorExporter caExporter = OsgiFactory.eINSTANCE.createConfigurationAdministratorExporter (); caExporter.setName ( "caExporter" ); //$NON-NLS-1$ result.getExporter ().add ( caExporter ); caExporter.getEndpoints ().add ( Endpoints.registerEndpoint ( nodes.get ( driver.getNode () ), world.getOptions ().getBaseCaNgpPort () + driver.getInstanceNumber (), Endpoints.reference ( caExporter ), "CA Exporter: " + driver.getName () ) ); result.getModules ().addAll ( WorldGenerator.makeModules ( world, driver, result ) ); return result; }
createExporter ( OsgiPackage.Literals.CONFIGURATION_ADMINISTRATOR_EXPORTER, node, master, this.infrastructure.getOptions ().getBaseCaNgpPort () + in ); createExporter ( OsgiPackage.Literals.ALARMS_EVENTS_EXPORTER, node, master, this.infrastructure.getOptions ().getBaseAeNgpPort () + in ); final Endpoint ep = createExporter ( OsgiPackage.Literals.DATA_ACCESS_EXPORTER, node, master, this.infrastructure.getOptions ().getBaseDaNgpPort () + in ); createExporter ( OsgiPackage.Literals.HISTORICAL_DATA_EXPORTER, node, archive, this.infrastructure.getOptions ().getBaseHdNgpPort () + in ); createExporter ( OsgiPackage.Literals.CONFIGURATION_ADMINISTRATOR_EXPORTER, node, archive, this.infrastructure.getOptions ().getBaseCaNgpPort () + in ); createExporter ( OsgiPackage.Literals.HISTORICAL_DATA_EXPORTER, node, app, this.infrastructure.getOptions ().getBaseHdNgpPort () + in ); createExporter ( OsgiPackage.Literals.CONFIGURATION_ADMINISTRATOR_EXPORTER, node, app, this.infrastructure.getOptions ().getBaseCaNgpPort () + in );