public static Map<String, String> makeAttributes ( final Collection<PropertyEntry> properties ) { return makeAttributes ( null, properties ); }
public static String getProperty ( final Collection<PropertyEntry> properties, final String name, final String defaultValue ) { return get ( properties, name, defaultValue ); }
public void validate () { final String version = Properties.get ( this.os.getProperties (), POSTGRES_VERSION_KEY, null ); if ( version == null ) { this.ctx.add ( "Operating system does not provide PostgreSQL" ); } else if ( !POSTGRES_VERSION_VALUE.equals ( version ) ) { this.ctx.add ( "Requires '{0}' = {1} but found ({2})", POSTGRES_VERSION_KEY, POSTGRES_VERSION_VALUE, version ); } final Map<String, String> props = Properties.makeAttributes ( this.os.getProperties () ); getConfigurationFile ( props ); getHostBasedAccessFile ( props ); } }
if ( !Properties.isEmpty ( entry ) )
public static Boolean isProperty ( final OperatingSystemDescriptor operatingSystem, final String name, final Boolean defaultValue ) { OperatingSystemDescriptor os = operatingSystem; while ( os != null ) { final Boolean value = Properties.isProperty ( operatingSystem.getProperties (), name, null ); if ( value != null ) { return value; } os = os.getParent (); } return defaultValue; }
public static String getProperty ( final OperatingSystemDescriptor operatingSystem, final String name, final String defaultValue ) { OperatingSystemDescriptor os = operatingSystem; while ( os != null ) { final String value = Properties.getProperty ( operatingSystem.getProperties (), name, null ); if ( value != null ) { return value; } os = os.getParent (); } return defaultValue; }
@Override protected Map<String, String> makeData ( final EventHandler eventHandler, final String id ) { final MailEventHandler handler = (MailEventHandler)eventHandler; final Map<String, String> result = new HashMap<> (); result.put ( "queue.id", id ); // the next line might override the queue id, if present Properties.putNonEmpty ( result, "queue.id", handler.getQueueId () ); Properties.putNonEmpty ( result, "username", handler.getUsername () ); Properties.putNonEmpty ( result, "password", handler.getPassword () ); Properties.putNonEmpty ( result, "from", handler.getFrom () ); int i = 0; for ( final String to : handler.getTo () ) { result.put ( "to." + i, to ); i++; } for ( final PropertyEntry pe : handler.getSessionProperties () ) { result.put ( "session." + pe.getKey (), pe.getValue () ); } return result; }
if ( !Properties.isEmpty ( entry ) )
public static Boolean isProperty ( final OperatingSystemDescriptor operatingSystem, final String name, final Boolean defaultValue ) { OperatingSystemDescriptor os = operatingSystem; while ( os != null ) { final Boolean value = Properties.isProperty ( operatingSystem.getProperties (), name, null ); if ( value != null ) { return value; } os = os.getParent (); } return defaultValue; }
public static String getProperty ( final OperatingSystemDescriptor operatingSystem, final String name, final String defaultValue ) { OperatingSystemDescriptor os = operatingSystem; while ( os != null ) { final String value = Properties.getProperty ( operatingSystem.getProperties (), name, null ); if ( value != null ) { return value; } os = os.getParent (); } return defaultValue; }
@Override protected Map<String, String> makeData ( final EventHandler eventHandler, final String id ) { final MailEventHandler handler = (MailEventHandler)eventHandler; final Map<String, String> result = new HashMap<> (); result.put ( "queue.id", id ); // the next line might override the queue id, if present Properties.putNonEmpty ( result, "queue.id", handler.getQueueId () ); Properties.putNonEmpty ( result, "username", handler.getUsername () ); Properties.putNonEmpty ( result, "password", handler.getPassword () ); Properties.putNonEmpty ( result, "from", handler.getFrom () ); int i = 0; for ( final String to : handler.getTo () ) { result.put ( "to." + i, to ); i++; } for ( final PropertyEntry pe : handler.getSessionProperties () ) { result.put ( "session." + pe.getKey (), pe.getValue () ); } return result; }
public static Map<String, String> makeAttributes ( final Collection<PropertyEntry> properties ) { return makeAttributes ( null, properties ); }
public static String getProperty ( final Collection<PropertyEntry> properties, final String name, final String defaultValue ) { return get ( properties, name, defaultValue ); }
if ( !Properties.isEmpty ( entry ) )
private void processJdbc ( final JdbcDataMapper dataMapper ) { final Map<String, String> data = new HashMap<String, String> (); data.put ( "jdbcDriver", dataMapper.getJdbcDriver () ); data.put ( "sql", dataMapper.getSql () ); data.putAll ( Properties.makeAttributes ( "properties.", dataMapper.getProperties () ) ); addData ( Factories.FACTORY_JDBC_DATA_MAPPER, Names.makeName ( dataMapper ), data ); }
if ( !Properties.isEmpty ( entry ) )
private void processJdbc ( final JdbcDataMapper dataMapper ) { final Map<String, String> data = new HashMap<String, String> (); data.put ( "jdbcDriver", dataMapper.getJdbcDriver () ); data.put ( "sql", dataMapper.getSql () ); data.putAll ( Properties.makeAttributes ( "properties.", dataMapper.getProperties () ) ); addData ( Factories.FACTORY_JDBC_DATA_MAPPER, Names.makeName ( dataMapper ), data ); }
private void createExternalEventMonitor ( final ExternalEventMonitor eventMonitor ) { final Map<String, String> data = new HashMap<String, String> (); data.put ( "filter", eventMonitor.getFilter () ); //$NON-NLS-1$ Configurations.applyInfoAttributes ( Properties.makeAttributes ( eventMonitor.getProperties () ), data ); addData ( Factories.FACTORY_AE_EXTERNAL, Names.makeName ( eventMonitor ), data ); }
private void createExternalEventMonitor ( final ExternalEventMonitor eventMonitor ) { final Map<String, String> data = new HashMap<String, String> (); data.put ( "filter", eventMonitor.getFilter () ); //$NON-NLS-1$ Configurations.applyInfoAttributes ( Properties.makeAttributes ( eventMonitor.getProperties () ), data ); addData ( Factories.FACTORY_AE_EXTERNAL, Names.makeName ( eventMonitor ), data ); }
@Override protected void process ( final RestExporter exporter, final EquinoxApplication app, final OscarContext ctx, final IProgressMonitor monitor ) { final Profile profile = Profiles.createOrGetCustomizationProfile ( app ); Profiles.addStartBundle ( profile, "org.eclipse.scada.da.server.exporter.rest" ); final Map<String, String> data = new HashMap<String, String> ( exporter.getItems ().size () + exporter.getHiveProperties ().size () ); data.putAll ( Properties.makeAttributes ( "hive.", exporter.getHiveProperties () ) ); for ( final Item item : exporter.getItems () ) { data.put ( "items." + item.getName (), item.getName () ); } ctx.addData ( Factories.FACTORY_DA_REST_EXPORTER, exporter.getContextId (), data ); }