@Override public void process ( final Module module, final Collection<ApplicationModule> modules, final EquinoxBase app, final org.eclipse.scada.configuration.world.osgi.EquinoxApplication implApp ) { final Profile p = Profiles.createOrGetCustomizationProfile ( implApp ); for ( final String bundle : BUNDLES ) { p.getInstallationUnits ().add ( bundle ); Profiles.addStartBundle ( p, bundle ); } }
@Override public void process ( final Module module, final Collection<ApplicationModule> modules, final EquinoxBase app, final org.eclipse.scada.configuration.world.osgi.EquinoxApplication implApp ) { final Profile p = Profiles.createOrGetCustomizationProfile ( implApp ); for ( final String bundle : BUNDLES ) { p.getInstallationUnits ().add ( bundle ); Profiles.addStartBundle ( p, bundle ); } }
@Override public void process ( final Module module, final Collection<ApplicationModule> modules, final EquinoxBase app, final org.eclipse.scada.configuration.world.osgi.EquinoxApplication implApp ) { final DSFileBackend s = (DSFileBackend)module; final Profile p = Profiles.createOrGetCustomizationProfile ( implApp ); final Map<String, String> vars = new HashMap<> (); vars.put ( "name", app.getName () ); Profiles.addSystemProperty ( p, "org.eclipse.scada.ds.storage.file.root", makePath ( vars, s ) ); // mark for installation p.getInstallationUnits ().add ( "org.eclipse.scada.ds.storage.file" ); // mark for startup Profiles.addStartBundle ( p, "org.eclipse.scada.ds.storage.file" ); }
@Override public void process ( final Module module, final Collection<ApplicationModule> modules, final EquinoxBase app, final org.eclipse.scada.configuration.world.osgi.EquinoxApplication implApp ) { final ConfigurationAdminFileBackend s = (ConfigurationAdminFileBackend)module; final Profile p = Profiles.createOrGetCustomizationProfile ( implApp ); final Map<String, String> vars = new HashMap<> (); vars.put ( "name", app.getName () ); Profiles.addSystemProperty ( p, "org.eclipse.scada.ca.file.root", makePath ( vars, s ) ); // mark for installation p.getInstallationUnits ().add ( "org.eclipse.scada.ca.file" ); // mark for startup Profiles.addStartBundle ( p, "org.eclipse.scada.ca.file" ); }
@Override protected void process ( final EventInjectorPostgres module ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( this.app ); processCommon ( BUNDLE_NAME, module ); profile.getInstallationUnits ().add ( BUNDLE_NAME ); Profiles.addStartBundle ( profile, BUNDLE_NAME ); Profiles.addSystemProperty ( profile, BUNDLE_NAME + ".limit", module.getLimit () ); //$NON-NLS-1$ }
@Override protected void process ( final EventInjectorPostgres module ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( this.app ); processCommon ( BUNDLE_NAME, module ); profile.getInstallationUnits ().add ( BUNDLE_NAME ); Profiles.addStartBundle ( profile, BUNDLE_NAME ); Profiles.addSystemProperty ( profile, BUNDLE_NAME + ".limit", module.getLimit () ); //$NON-NLS-1$ }
@Override protected void process ( final ProfileConfiguration item, final EquinoxApplication app, final OscarContext ctx, final IProgressMonitor monitor ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( app ); for ( final String bundle : item.getStartBundles () ) { Profiles.addStartBundle ( profile, bundle ); profile.getInstallationUnits ().add ( bundle ); } for ( final String bundle : item.getInstallBundles () ) { profile.getInstallationUnits ().add ( bundle ); } for ( final PropertyEntry pe : item.getProperties () ) { Profiles.addSystemProperty ( profile, pe.getKey (), pe.getValue () ); } }
@Override protected void process ( final EventInjectorSyslog item, final EquinoxApplication app, final OscarContext ctx, final IProgressMonitor monitor ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( app ); Profiles.addStartBundle ( profile, BUNDLE ); profile.getInstallationUnits ().add ( BUNDLE ); final String id = String.format ( "%s_%s", item.getBindAddress (), item.getEndpoint ().getPortNumber () ); //$NON-NLS-1$ final Map<String, String> data = new HashMap<> (); data.put ( "port", "" + item.getEndpoint ().getPortNumber () ); if ( item.getBindAddress () != null ) { data.put ( "host", item.getBindAddress () ); } ctx.addData ( FACTORY_ID, id, data ); }
@Override protected void process ( final EventInjectorSyslog item, final EquinoxApplication app, final OscarContext ctx, final IProgressMonitor monitor ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( app ); Profiles.addStartBundle ( profile, BUNDLE ); profile.getInstallationUnits ().add ( BUNDLE ); final String id = String.format ( "%s_%s", item.getBindAddress (), item.getEndpoint ().getPortNumber () ); //$NON-NLS-1$ final Map<String, String> data = new HashMap<> (); data.put ( "port", "" + item.getEndpoint ().getPortNumber () ); if ( item.getBindAddress () != null ) { data.put ( "host", item.getBindAddress () ); } ctx.addData ( FACTORY_ID, id, data ); }
static void mergeIntoProfile ( final Profile source, final Profile target ) { target.getInstallationUnits ().addAll ( source.getInstallationUnits () ); target.getJvmArguments ().addAll ( source.getJvmArguments () ); target.getArguments ().addAll ( source.getArguments () ); target.getNotes ().addAll ( source.getNotes () ); target.getSetbsl ().addAll ( EcoreUtil.copyAll ( source.getSetbsl () ) ); target.getStart ().addAll ( EcoreUtil.copyAll ( source.getStart () ) ); target.getProperty ().addAll ( EcoreUtil.copyAll ( source.getProperty () ) ); // merge sub profiles for ( final SubProfile subProfile : source.getProfile () ) { mergeSubProfile ( subProfile, findTargetSubProfile ( subProfile.getName (), target ) ); } }
static void mergeIntoProfile ( final Profile source, final Profile target ) { target.getInstallationUnits ().addAll ( source.getInstallationUnits () ); target.getJvmArguments ().addAll ( source.getJvmArguments () ); target.getArguments ().addAll ( source.getArguments () ); target.getNotes ().addAll ( source.getNotes () ); target.getSetbsl ().addAll ( EcoreUtil.copyAll ( source.getSetbsl () ) ); target.getStart ().addAll ( EcoreUtil.copyAll ( source.getStart () ) ); target.getProperty ().addAll ( EcoreUtil.copyAll ( source.getProperty () ) ); // merge sub profiles for ( final SubProfile subProfile : source.getProfile () ) { mergeSubProfile ( subProfile, findTargetSubProfile ( subProfile.getName (), target ) ); } }
@Override public void process ( final Module module, final Collection<ApplicationModule> modules, final EquinoxBase app, final org.eclipse.scada.configuration.world.osgi.EquinoxApplication implApp ) { final Profile p = Profiles.createOrGetCustomizationProfile ( implApp ); for ( final String bundle : BUNDLES ) { p.getInstallationUnits ().add ( bundle ); Profiles.addStartBundle ( p, bundle ); } final EventInjectorSyslog s = OsgiFactory.eINSTANCE.createEventInjectorSyslog (); final org.eclipse.scada.configuration.infrastructure.EventInjectorSyslog m = (org.eclipse.scada.configuration.infrastructure.EventInjectorSyslog)module; final Endpoint ep = Endpoints.registerEndpoint ( implApp, m.getPort (), Endpoints.reference ( s ), "Syslog Receiver Endpoint" ); s.setBindAddress ( m.getBindAddress () ); s.setEndpoint ( ep ); modules.add ( s ); } }
private void processPullEvents ( final PullEvents pull ) { final Map<String, String> data = new HashMap<String, String> (); final DatabaseSettings db = pull.getDatabase (); data.put ( "driverName", db.getDriverName () ); if ( db.getLoginTimeout () != null ) { data.put ( "loginTimeout", "" + db.getLoginTimeout () ); } Helper.addOptional ( data, "customDeleteSql", pull.getCustomDeleteSql () ); Helper.addOptional ( data, "customSelectSql", pull.getCustomSelectSql () ); data.putAll ( Properties.makeAttributes ( "jdbcProperties", db.getProperties () ) ); Helper.addOptional ( data, "delay", pull.getJobInterval () ); addData ( Factories.FACTORY_AE_PULL_EVENTS, Names.makeName ( pull ), data ); final Profile p = Profiles.createOrGetCustomizationProfile ( this.app ); p.getInstallationUnits ().addAll ( db.getBundles () ); }
private void processPullEvents ( final PullEvents pull ) { final Map<String, String> data = new HashMap<String, String> (); final DatabaseSettings db = pull.getDatabase (); data.put ( "driverName", db.getDriverName () ); if ( db.getLoginTimeout () != null ) { data.put ( "loginTimeout", "" + db.getLoginTimeout () ); } Helper.addOptional ( data, "customDeleteSql", pull.getCustomDeleteSql () ); Helper.addOptional ( data, "customSelectSql", pull.getCustomSelectSql () ); data.putAll ( Properties.makeAttributes ( "jdbcProperties", db.getProperties () ) ); Helper.addOptional ( data, "delay", pull.getJobInterval () ); addData ( Factories.FACTORY_AE_PULL_EVENTS, Names.makeName ( pull ), data ); final Profile p = Profiles.createOrGetCustomizationProfile ( this.app ); p.getInstallationUnits ().addAll ( db.getBundles () ); }
@Override protected void process ( final EventInjectorJdbc module ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( this.app ); processCommon ( BUNDLE_NAME, module ); profile.getInstallationUnits ().add ( BUNDLE_NAME ); Profiles.addStartBundle ( profile, BUNDLE_NAME ); Profiles.addSystemProperty ( profile, BUNDLE_NAME + ".selectSql", module.getSelectSql () ); //$NON-NLS-1$ Profiles.addSystemProperty ( profile, BUNDLE_NAME + ".deleteSql", module.getDeleteSql () ); //$NON-NLS-1$ Profiles.addSystemProperty ( profile, BUNDLE_NAME + ".existsSql", module.getExistsSql () ); //$NON-NLS-1$ }
@Override protected void process ( final EventInjectorJdbc module ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( this.app ); processCommon ( BUNDLE_NAME, module ); profile.getInstallationUnits ().add ( BUNDLE_NAME ); Profiles.addStartBundle ( profile, BUNDLE_NAME ); Profiles.addSystemProperty ( profile, BUNDLE_NAME + ".selectSql", module.getSelectSql () ); //$NON-NLS-1$ Profiles.addSystemProperty ( profile, BUNDLE_NAME + ".deleteSql", module.getDeleteSql () ); //$NON-NLS-1$ Profiles.addSystemProperty ( profile, BUNDLE_NAME + ".existsSql", module.getExistsSql () ); //$NON-NLS-1$ }
public static void addJdbcSystemProperties ( final Profile profile, final String prefix, final DatabaseSettings database ) { if ( database.getBundles () != null ) { for ( final String bundle : database.getBundles () ) { Profiles.addStartBundle ( profile, bundle ); } profile.getInstallationUnits ().addAll ( database.getBundles () ); } addSystemProperty ( profile, prefix + ".driver", database.getDriverName () ); addSystemProperty ( profile, prefix + ".loginTimeout", database.getLoginTimeout () ); for ( final PropertyEntry entry : database.getProperties () ) { addSystemProperty ( profile, prefix + ".properties." + entry.getKey (), entry.getValue () ); } }
public static void addJdbcSystemProperties ( final Profile profile, final String prefix, final DatabaseSettings database ) { if ( database.getBundles () != null ) { for ( final String bundle : database.getBundles () ) { Profiles.addStartBundle ( profile, bundle ); } profile.getInstallationUnits ().addAll ( database.getBundles () ); } addSystemProperty ( profile, prefix + ".driver", database.getDriverName () ); addSystemProperty ( profile, prefix + ".loginTimeout", database.getLoginTimeout () ); for ( final PropertyEntry entry : database.getProperties () ) { addSystemProperty ( profile, prefix + ".properties." + entry.getKey (), entry.getValue () ); } }
protected void processCommon ( final AbstractEventStorageJdbc module ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( this.app ); final DatabaseSettings db = module.getDatabase (); for ( final String bundle : db.getBundles () ) { Profiles.addStartBundle ( profile, bundle ); profile.getInstallationUnits ().add ( bundle ); } Profiles.addJdbcSystemProperties ( profile, "org.eclipse.scada.ae.server.storage.jdbc", db ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.schema", module.getSchema () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.instance", module.getInstanceName () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.enableReplication", module.isEnableReplication () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.replicationDataFormat", module.getReplicationDataFormat ().getLiteral () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.cleanupPeriodSeconds", module.getCleanupPeriodSeconds () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.archiveDays", module.getArchiveDays () ); }
protected void processCommon ( final AbstractEventStorageJdbc module ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( this.app ); final DatabaseSettings db = module.getDatabase (); for ( final String bundle : db.getBundles () ) { Profiles.addStartBundle ( profile, bundle ); profile.getInstallationUnits ().add ( bundle ); } Profiles.addJdbcSystemProperties ( profile, "org.eclipse.scada.ae.server.storage.jdbc", db ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.schema", module.getSchema () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.instance", module.getInstanceName () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.enableReplication", module.isEnableReplication () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.replicationDataFormat", module.getReplicationDataFormat ().getLiteral () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.cleanupPeriodSeconds", module.getCleanupPeriodSeconds () ); Profiles.addSystemProperty ( profile, "org.eclipse.scada.ae.server.storage.jdbc.archiveDays", module.getArchiveDays () ); }