Class DynamicPlugin

java.lang.Object
org.apache.wayang.core.plugin.DynamicPlugin
All Implemented Interfaces:
Plugin

public class DynamicPlugin extends Object implements Plugin
This Plugin can be arbitrarily customized.
  • Constructor Details

    • DynamicPlugin

      public DynamicPlugin()
  • Method Details

    • loadYaml

      public static DynamicPlugin loadYaml(String yamlUrl)
      Loads a YAML file of the following format:
      
       # mappings to be loaded by this plugin
       mappings:
         include:
           - <expression that evaluates to a Mapping instance or Collection of such>
           - ...
         exclude:
           - <expression that evaluates to a Mapping instance or Collection of such>
           - ...
      
       # channel conversions to be loaded by this plugin
       conversions:
         include:
           - <expression that evaulates to a ChannelConversion instance or Collection of such>
           - ..
         exclude:
           - <expression that evaulates to a ChannelConversion instance or Collection of such>
           - ..
      
       # properties configured by this plugin
       properties:
         <property name>: <property value>
      
       # required platforms
       platforms:
         include:
           - <expression that evaluates to a Platform instance or Collection of such>
           - ..
         exclude:
           - <expression that evaluates to a Platform instance or Collection of such>
           - ..
      
       
      Parameters:
      yamlUrl - an URL to a YAML file of the above format
      Returns:
      the configured instance
      See Also:
    • ifPresent

      public static <T> void ifPresent(Object o, Class<? super T> t, Consumer<T> consumer)
      Checks and casts the given Object. If it is not null, feed it to a Consumer.
      Parameters:
      o - to be casted
      t - to that should be casted
      consumer - accepts the casted o unless it is null
    • addRequiredPlatform

      public void addRequiredPlatform(Platform platform)
    • excludeRequiredPlatform

      public void excludeRequiredPlatform(Platform platform)
    • getRequiredPlatforms

      public Collection<Platform> getRequiredPlatforms()
      Description copied from interface: Plugin
      Provides the Platforms required by this instance.
      Specified by:
      getRequiredPlatforms in interface Plugin
      Returns:
      the Platforms
    • getExcludedRequiredPlatforms

      public Collection<Platform> getExcludedRequiredPlatforms()
      Description copied from interface: Plugin
      Provides the required Platforms excluded by this instance.
      Specified by:
      getExcludedRequiredPlatforms in interface Plugin
      Returns:
      the Platforms
    • addMapping

      public void addMapping(Mapping mapping)
    • excludeMapping

      public void excludeMapping(Mapping mapping)
    • getMappings

      public Collection<Mapping> getMappings()
      Description copied from interface: Plugin
      Provides the Mappings shipped with this instance.
      Specified by:
      getMappings in interface Plugin
      Returns:
      the Mappings
    • getExcludedMappings

      public Collection<Mapping> getExcludedMappings()
      Description copied from interface: Plugin
      Provides the Mappings excluded by this instance.
      Specified by:
      getExcludedMappings in interface Plugin
      Returns:
      the Mappings
    • addChannelConversion

      public void addChannelConversion(ChannelConversion channelConversion)
    • excludeChannelConversion

      public void excludeChannelConversion(ChannelConversion channelConversion)
    • getChannelConversions

      public Collection<ChannelConversion> getChannelConversions()
      Description copied from interface: Plugin
      Provides the ChannelConversions shipped with this instance.
      Specified by:
      getChannelConversions in interface Plugin
      Returns:
      the ChannelConversions
    • getExcludedChannelConversions

      public Collection<ChannelConversion> getExcludedChannelConversions()
      Description copied from interface: Plugin
      Provides the ChannelConversions excluded by this instance.
      Specified by:
      getExcludedChannelConversions in interface Plugin
      Returns:
      the ChannelConversions
    • addProperty

      public void addProperty(String key, Object value)
    • setProperties

      public void setProperties(Configuration configuration)
      Description copied from interface: Plugin
      Provides relevant Configuration properties.
      Specified by:
      setProperties in interface Plugin
      Parameters:
      configuration - accepts the properties