java.lang.Object
de.iip_ecosphere.platform.services.environment.Starter
de.iip_ecosphere.platform.services.environment.spring.Starter
test.de.iip_ecosphere.platform.simpleStream.spring.Test
All Implemented Interfaces:
org.springframework.boot.CommandLineRunner

@SpringBootApplication @EnableScheduling @ComponentScan({"test.de.iip_ecosphere.platform.simpleStream.spring","de.iip_ecosphere.platform.services.environment.spring","de.iip_ecosphere.platform.transport.spring"}) public class Test extends de.iip_ecosphere.platform.services.environment.spring.Starter
Defines the test stream to be processed. We assume that a broker is running.
Author:
Holger Eichelberger, SSE
  • Nested Class Summary

    Nested classes/interfaces inherited from class de.iip_ecosphere.platform.services.environment.Starter

    de.iip_ecosphere.platform.services.environment.Starter.Plugin
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
     
    private de.iip_ecosphere.platform.services.environment.spring.SpringAsyncServiceBase
     
     
    private static final String
     
    private static final String
     
    private static final String
     
    private de.iip_ecosphere.platform.support.metrics.Counter
     
    private de.iip_ecosphere.platform.support.metrics.Counter
     
    private de.iip_ecosphere.platform.support.metrics.Timer
     
    private static String
     
    private boolean
     
    private int
     
    private de.iip_ecosphere.platform.support.metrics.Counter
     
    private de.iip_ecosphere.platform.support.metrics.Counter
     
    private de.iip_ecosphere.platform.support.metrics.Timer
     
    private de.iip_ecosphere.platform.services.environment.spring.metricsProvider.MetricsProvider
     
    private static final String
     
    private static final String
     
    private static final String
     
    private static final String
     
    private static final String
     

    Fields inherited from class de.iip_ecosphere.platform.services.environment.spring.Starter

    EXTERNAL_BINDER_NAME, OPT_SPRING_BINDER_POSTFIX, OPT_SPRING_BINDINGS_PREFIX, OPT_SPRING_FUNCTION_DEF

    Fields inherited from class de.iip_ecosphere.platform.services.environment.Starter

    ARG_AAS_NOTIFICATION, DFLT_LOCAL_TRANSPORT_SETUP_SUPPLIER, IIP_APP_NOAAS, IIP_APP_PREFIX, IIP_TEST, IIP_TEST_PLUGIN, IIP_TEST_PREFIX, PARAM_IIP_APP_ID, PARAM_IIP_APP_PLUGINS, PARAM_IIP_APP_PLUGINS_NO_PLUGINS, PARAM_IIP_ENFORCE_START_SEQUENCE, PARAM_IIP_PORT, PARAM_IIP_PROTOCOL, PARAM_IIP_START_SERVER, PARAM_IIP_START_SERVER_ONLY, PARAM_IIP_TEST_AAS_PORT, PARAM_IIP_TEST_AASREG_PORT, PARAM_IIP_TEST_SERVICE_AUTOSTART, PARAM_IIP_TEST_SM_PORT, PARAM_IIP_TEST_SMREG_PORT, PARAM_IIP_TEST_TRANSPORT_PORT, PARAM_IIP_TRANSPORT_GLOBAL, PROPERTY_JAVA8
  • Constructor Summary

    Constructors
    Constructor
    Description
    Test(org.springframework.core.env.Environment environment)
    Creates an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates the data.
    protected List<de.iip_ecosphere.platform.services.environment.Service>
    createServices(de.iip_ecosphere.platform.services.environment.YamlArtifact artifact)
     
    void
    Called during shutdown.
    static String
    Composes a channel suffix id for a service possibly including the application instance id.
    private void
    ingest(Object data)
    Asynchronously ingests data.
    log()
    Consumes the received data.
    private Consumer<String>
    Simplified logging reception for async calls.
    static void
    main(String[] args)
    Main function.
    void
    Called after constructor.
    static void
    Stops the application.

    Methods inherited from class de.iip_ecosphere.platform.services.environment.spring.Starter

    augmentByAppId, augmentByAppId, createMetricsClient, createMetricsClient, getContext, getEnvironment, initialize, main, mapService, mapService, parseExternConnections, run

    Methods inherited from class de.iip_ecosphere.platform.services.environment.Starter

    addAppEnvironment, addAppEnvironment, autostartService, composeArgument, considerInstalledDependencies, enablesLocalTransport, enforceStartSequence, expectAas, extractProcessArtifacts, findArtifact, getAppId, getApplicationSetupAsStream, getMappedService, getProtocolBuilder, getServiceAutostart, getServiceCommandNetworkMgrKey, getServiceId, getServiceId, getServiceMapper, getServicePort, getServicePortName, getServiceProcessNetworkMgrKey, getSetup, inTest, loadOktoPlugins, mapService, mapService, normalizeServiceId, parse, registerAfterPluginInitializer, registerDefaultPlugins, registerPlugin, runPlugin, setAasNotificationMode, setCmdServerConfigurer, setLocalTransportSetupSupplier, setOnServiceAutostartAttachShutdownHook, setServiceAutostart, shutdown, start, startDataForMappedServices, startServer, transferArgsToEnvironment

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SUPPLIER_GAUGE_ID

      private static final String SUPPLIER_GAUGE_ID
      See Also:
    • SUPPLIER_COUNTER_ID

      private static final String SUPPLIER_COUNTER_ID
      See Also:
    • CONSUMER_GAUGE_ID

      private static final String CONSUMER_GAUGE_ID
      See Also:
    • CONSUMER_COUNTER_ID

      private static final String CONSUMER_COUNTER_ID
      See Also:
    • CONSUMER_RECV_ID

      private static final String CONSUMER_RECV_ID
      See Also:
    • REST_GAUGE_ID

      private static final String REST_GAUGE_ID
      See Also:
    • REST_COUNTER_ID

      private static final String REST_COUNTER_ID
      See Also:
    • REST_TIMER_ID

      private static final String REST_TIMER_ID
      See Also:
    • fileName

      private static String fileName
    • config

      @Autowired private Configuration config
    • ingestCount

      private int ingestCount
    • metrics

      @Autowired private de.iip_ecosphere.platform.services.environment.spring.metricsProvider.MetricsProvider metrics
    • first

      private boolean first
    • logSent

      private de.iip_ecosphere.platform.support.metrics.Counter logSent
    • logReceived

      private de.iip_ecosphere.platform.support.metrics.Counter logReceived
    • logTime

      private de.iip_ecosphere.platform.support.metrics.Timer logTime
    • createSent

      private de.iip_ecosphere.platform.support.metrics.Counter createSent
    • createReceived

      private de.iip_ecosphere.platform.support.metrics.Counter createReceived
    • createTime

      private de.iip_ecosphere.platform.support.metrics.Timer createTime
    • base

      private de.iip_ecosphere.platform.services.environment.spring.SpringAsyncServiceBase base
    • appInstId

      private String appInstId
  • Constructor Details

    • Test

      @Autowired public Test(org.springframework.core.env.Environment environment)
      Creates an instance.
      Parameters:
      environment - the Spring environment
  • Method Details

    • getAppInstIdSuffix

      public static String getAppInstIdSuffix(String separator)
      Composes a channel suffix id for a service possibly including the application instance id.
      Parameters:
      separator - the separator string to insert between the ids
      Returns:
      the id suffix, may be empty
    • create

      @Bean public Supplier<String> create()
      Creates the data.
      Returns:
      the data (generator)
    • stop

      public static void stop()
      Stops the application.
    • log

      @Bean public Consumer<String> log()
      Consumes the received data.
      Returns:
      the data receiver
    • logAsync

      private Consumer<String> logAsync()
      Simplified logging reception for async calls. Non-spring, no metrics.
      Returns:
      the data receiver
    • postConstruct

      @PostConstruct public void postConstruct()
      Called after constructor.
    • destroy

      @PreDestroy public void destroy()
      Called during shutdown.
    • ingest

      private void ingest(Object data)
      Asynchronously ingests data.
      Parameters:
      data - the data to ingest
    • createServices

      protected List<de.iip_ecosphere.platform.services.environment.Service> createServices(de.iip_ecosphere.platform.services.environment.YamlArtifact artifact)
      Specified by:
      createServices in class de.iip_ecosphere.platform.services.environment.spring.Starter
    • main

      public static void main(String[] args)
      Main function.
      Parameters:
      args - command line arguments