@Test public void testUrlWssWebSocketVersionExecute() { SparkRunConfiguration sparkRunConfiguration = new SparkRunConfiguration(); sparkRunConfiguration.setName( "Spark Configuration" ); sparkRunConfiguration.setSchema( "http: sparkRunConfiguration.setUrl( " 127.0.0.2:8121 " ); TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration(); sparkRunConfigurationExecutor .execute( sparkRunConfiguration, transExecutionConfiguration, abstractMeta, variableSpace, null ); verify( variableSpace ).setVariable( "engine.protocol", "http" ); verify( variableSpace ).setVariable( "engine.host", "127.0.0.2" ); verify( variableSpace ).setVariable( "engine.port", "8121" ); }
@Override public void execute( RunConfiguration runConfiguration, ExecutionConfiguration configuration, AbstractMeta meta, VariableSpace variableSpace, Repository repository ) { ICapability securityCapability = capabilityManager.getCapabilityById( AEL_SECURITY_CAPABILITY_ID ); ICapability jaasCapability = capabilityManager.getCapabilityById( JAAS_CAPABILITY_ID ); if ( securityCapability != null && securityCapability.isInstalled() ) { if ( jaasCapability != null && !jaasCapability.isInstalled() ) { jaasCapability.install(); } } SparkRunConfiguration sparkRunConfiguration = (SparkRunConfiguration) runConfiguration; String runConfigSchema = Const.NVL( sparkRunConfiguration.getSchema(), "" ); String runConfigURL = Const.NVL( sparkRunConfiguration.getUrl(), "" ); URI uri = URI.create( runConfigSchema.trim() + runConfigURL.trim() ); String protocol = uri.getScheme(); String host = uri.getHost(); String port = uri.getPort() == -1 ? null : String.valueOf( uri.getPort() ); variableSpace.setVariable( "engine.protocol", Const.NVL( protocol, DEFAULT_PROTOCOL ) ); variableSpace.setVariable( "engine.host", Const.NVL( host, DEFAULT_HOST ) ); variableSpace.setVariable( "engine.port", Const.NVL( port, DEFAULT_WEBSOCKET_PORT ) ); variableSpace.setVariable( "engine", "remote" ); variableSpace.setVariable( "engine.remote", "spark" ); }
SparkRunConfigurationExecutor implements RunConfigurationExecutor { @Override public void execute( RunConfiguration runConfiguration, ExecutionConfiguration configuration, AbstractMeta meta, VariableSpace variableSpace, Repository repository ) { ICapability securityCapability = capabilityManager.getCapabilityById( AEL_SECURITY_CAPABILITY_ID ); ICapability jaasCapability = capabilityManager.getCapabilityById( JAAS_CAPABILITY_ID ); if ( securityCapability != null && securityCapability.isInstalled() ) { if ( jaasCapability != null && !jaasCapability.isInstalled() ) { jaasCapability.install(); } } SparkRunConfiguration sparkRunConfiguration = (SparkRunConfiguration) runConfiguration; String runConfigSchema = Const.NVL( sparkRunConfiguration.getSchema(), "" ); String runConfigURL = Const.NVL( sparkRunConfiguration.getUrl(), "" ); URI uri = URI.create( runConfigSchema.trim() + runConfigURL.trim() ); String protocol = uri.getScheme(); String host = uri.getHost(); String port = uri.getPort() == -1 ? null : String.valueOf( uri.getPort() ); variableSpace.setVariable( "engine.protocol", Const.NVL( protocol, DEFAULT_PROTOCOL ) ); variableSpace.setVariable( "engine.host", Const.NVL( host, DEFAULT_HOST ) ); variableSpace.setVariable( "engine.port", Const.NVL( port, DEFAULT_WEBSOCKET_PORT ) ); variableSpace.setVariable( "engine", "remote" ); variableSpace.setVariable( "engine.remote", "spark" ); } }
SparkRunConfigurationExecutor implements RunConfigurationExecutor { @Override public void execute( RunConfiguration runConfiguration, ExecutionConfiguration configuration, AbstractMeta meta, VariableSpace variableSpace, Repository repository ) { ICapability securityCapability = capabilityManager.getCapabilityById( AEL_SECURITY_CAPABILITY_ID ); ICapability jaasCapability = capabilityManager.getCapabilityById( JAAS_CAPABILITY_ID ); if ( securityCapability != null && securityCapability.isInstalled() ) { if ( jaasCapability != null && !jaasCapability.isInstalled() ) { jaasCapability.install(); } } SparkRunConfiguration sparkRunConfiguration = (SparkRunConfiguration) runConfiguration; String runConfigSchema = Const.NVL( sparkRunConfiguration.getSchema(), "" ); String runConfigURL = Const.NVL( sparkRunConfiguration.getUrl(), "" ); URI uri = URI.create( runConfigSchema.trim() + runConfigURL.trim() ); String protocol = uri.getScheme(); String host = uri.getHost(); String port = uri.getPort() == -1 ? null : String.valueOf( uri.getPort() ); variableSpace.setVariable( "engine.protocol", Const.NVL( protocol, DEFAULT_PROTOCOL ) ); variableSpace.setVariable( "engine.host", Const.NVL( host, DEFAULT_HOST ) ); variableSpace.setVariable( "engine.port", Const.NVL( port, DEFAULT_WEBSOCKET_PORT ) ); variableSpace.setVariable( "engine", "remote" ); variableSpace.setVariable( "engine.remote", "spark" ); } SparkRunConfigurationExecutor( ConfigurationAdmin configurationAdmin ); }
SparkRunConfigurationExecutor implements RunConfigurationExecutor { @Override public void execute( RunConfiguration runConfiguration, ExecutionConfiguration configuration, AbstractMeta meta, VariableSpace variableSpace, Repository repository ) { ICapability securityCapability = capabilityManager.getCapabilityById( AEL_SECURITY_CAPABILITY_ID ); ICapability jaasCapability = capabilityManager.getCapabilityById( JAAS_CAPABILITY_ID ); if ( securityCapability != null && securityCapability.isInstalled() ) { if ( jaasCapability != null && !jaasCapability.isInstalled() ) { jaasCapability.install(); } } SparkRunConfiguration sparkRunConfiguration = (SparkRunConfiguration) runConfiguration; String runConfigSchema = Const.NVL( sparkRunConfiguration.getSchema(), "" ); String runConfigURL = Const.NVL( sparkRunConfiguration.getUrl(), "" ); URI uri = URI.create( runConfigSchema.trim() + runConfigURL.trim() ); String protocol = uri.getScheme(); String host = uri.getHost(); String port = uri.getPort() == -1 ? null : String.valueOf( uri.getPort() ); variableSpace.setVariable( "engine.protocol", Const.NVL( protocol, DEFAULT_PROTOCOL ) ); variableSpace.setVariable( "engine.host", Const.NVL( host, DEFAULT_HOST ) ); variableSpace.setVariable( "engine.port", Const.NVL( port, DEFAULT_WEBSOCKET_PORT ) ); variableSpace.setVariable( "engine", "remote" ); variableSpace.setVariable( "engine.remote", "spark" ); } SparkRunConfigurationExecutor( ConfigurationAdmin configurationAdmin ); @Override void execute( RunConfiguration runConfiguration, ExecutionConfiguration configuration,
                                 AbstractMeta meta, VariableSpace variableSpace, Repository repository ); }
SparkRunConfigurationExecutor implements RunConfigurationExecutor { @Override public void execute( RunConfiguration runConfiguration, ExecutionConfiguration configuration, AbstractMeta meta, VariableSpace variableSpace, Repository repository ) { ICapability securityCapability = capabilityManager.getCapabilityById( AEL_SECURITY_CAPABILITY_ID ); ICapability jaasCapability = capabilityManager.getCapabilityById( JAAS_CAPABILITY_ID ); if ( securityCapability != null && securityCapability.isInstalled() ) { if ( jaasCapability != null && !jaasCapability.isInstalled() ) { jaasCapability.install(); } } SparkRunConfiguration sparkRunConfiguration = (SparkRunConfiguration) runConfiguration; String runConfigSchema = Const.NVL( sparkRunConfiguration.getSchema(), "" ); String runConfigURL = Const.NVL( sparkRunConfiguration.getUrl(), "" ); URI uri = URI.create( runConfigSchema.trim() + runConfigURL.trim() ); String protocol = uri.getScheme(); String host = uri.getHost(); String port = uri.getPort() == -1 ? null : String.valueOf( uri.getPort() ); variableSpace.setVariable( "engine.protocol", Const.NVL( protocol, DEFAULT_PROTOCOL ) ); variableSpace.setVariable( "engine.host", Const.NVL( host, DEFAULT_HOST ) ); variableSpace.setVariable( "engine.port", Const.NVL( port, DEFAULT_WEBSOCKET_PORT ) ); variableSpace.setVariable( "engine", "remote" ); variableSpace.setVariable( "engine.remote", "spark" ); } SparkRunConfigurationExecutor( ConfigurationAdmin configurationAdmin ); @Override void execute( RunConfiguration runConfiguration, ExecutionConfiguration configuration,
                                 AbstractMeta meta, VariableSpace variableSpace, Repository repository ); static String JAAS_CAPABILITY_ID; static String AEL_SECURITY_CAPABILITY_ID; static String DEFAULT_PROTOCOL; static String DEFAULT_HOST; static String DEFAULT_WEBSOCKET_PORT; }