public static String makeConnectionName ( final Driver driver ) { final Node node = driver.getNode (); String name = node.getName (); if ( name == null ) { name = node.getHostName (); } return "driver." + driver.getName () + ".on." + name; }
private Integer makePort ( final JMXSettings s, final EquinoxBase app ) { if ( s.getPort () != null ) { return s.getPort (); } if ( s.getInstancePortOffset () != null ) { return s.getInstancePortOffset () + app.getInstanceNumber (); } return null; }
protected Configuration findSecurityConfiguration ( final org.eclipse.scada.configuration.infrastructure.EquinoxApplication app ) { if ( app.getSecurityConfiguration () != null ) { return app.getSecurityConfiguration (); } else { return this.infrastructure.getDefaultSecurityConfiguration (); } }
/** * Generate a generic driver label */ protected static String getDriverLabel ( final Driver driver, final String type ) { final String label; if ( driver.getNode () != null ) { label = String.format ( "%s @ %s", driver.getName (), driver.getNode ().getHostName () ); } else { label = String.format ( "%s @ <none>", driver.getName () ); } return type + " " + label; //$NON-NLS-1$ }
/** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ @Override public String getText ( final Object object ) { final String label = String.format ( "%s @ %s", ( (ExternalDriver)object ).getName (), ( (ExternalDriver)object ).getNode ().getHostName () ); return label == null || label.length () == 0 ? getString ( "_UI_ExternalDriver_type" ) : //$NON-NLS-1$ getString ( "_UI_ExternalDriver_type" ) + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ }
public static AbstractFactoryDriver findDriverForDevice ( final org.eclipse.scada.configuration.infrastructure.MasterServer master, final Device device ) { for ( final Driver driver : master.getDriver () ) { if ( ! ( driver instanceof AbstractFactoryDriver ) ) { continue; } if ( ( (AbstractFactoryDriver)driver ).getDevices ().contains ( device ) ) { return (AbstractFactoryDriver)driver; } } return null; }
public static String makeHostname ( final Node from, final Node to ) { if ( isLocal ( from, to ) ) { return "localhost"; //$NON-NLS-1$ } else { return to.getHostName (); } }
@Override public java.util.Collection<?> getChoiceOfValues ( final Object object ) { return HttpServices.findLocal ( object ); }; } );
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; }
protected static Credentials findExternalConnectionPassword ( final ExternalDriver driver ) { if ( driver.getAccessCredentials () != null ) { return driver.getAccessCredentials (); } return findDefaultAccessCredentials ( driver ); }
protected static Credentials findCommonConnectionPassword ( final AbstractCommonDriver driver ) { if ( driver.getPassword () != null ) { return driver.getPassword (); } return findDefaultAccessCredentials ( driver ); }
public Credentials findLocalCredentials ( final org.eclipse.scada.configuration.infrastructure.EquinoxApplication app ) { logger.debug ( "Looking for credentials: {}", app ); if ( app.getLocalCredentials () != null ) { logger.debug ( "Using local: {}", app.getLocalCredentials () ); return app.getLocalCredentials (); } else { logger.debug ( "Using global: {}", this.infrastructure.getDefaultCredentials () ); return this.infrastructure.getDefaultCredentials (); } }
public static Configuration findSecurityConfiguration ( final EquinoxBase eDriver ) { final World world = Containers.findContainer ( eDriver, World.class ); if ( eDriver.getSecurityConfiguration () != null ) { return eDriver.getSecurityConfiguration (); } else if ( world != null ) { return world.getDefaultSecurityConfiguration (); } return null; }
public void setInfrastructure ( final org.eclipse.scada.configuration.infrastructure.World infrastructure ) { this.infrastructure = infrastructure; this.options = infrastructure.getOptions (); }
/** * Generate a generic driver label */ protected static String getDriverLabel ( final Driver driver, final String type ) { final String label; if ( driver.getNode () != null ) { label = String.format ( "%s @ %s", driver.getName (), driver.getNode ().getHostName () ); } else { label = String.format ( "%s @ <none>", driver.getName () ); } return type + " " + label; //$NON-NLS-1$ }
public static AbstractFactoryDriver findDriverForDevice ( final org.eclipse.scada.configuration.infrastructure.MasterServer master, final Device device ) { for ( final Driver driver : master.getDriver () ) { if ( ! ( driver instanceof AbstractFactoryDriver ) ) { continue; } if ( ( (AbstractFactoryDriver)driver ).getDevices ().contains ( device ) ) { return (AbstractFactoryDriver)driver; } } return null; }
@Override public java.util.Collection<?> getChoiceOfValues ( final Object object ) { return HttpServices.findLocal ( object ); }; } );
public WorldGenerator ( final org.eclipse.scada.configuration.infrastructure.World infrastructure ) { this.infrastructure = infrastructure; this.options = infrastructure.getOptions (); }
@Override protected Collection<?> getComboBoxObjects ( final Object object ) { return HttpServices.findLocal ( object ); } } );
@Override protected Collection<?> getComboBoxObjects ( final Object object ) { return HttpServices.findLocal ( object ); } } );