/** * Given two schema's checks if there exists compatibility or equality. * * @param output Set of output {@link Schema}. * @param input Set of input {@link Schema}. * @return true if and only if they are equal or compatible with constraints */ public static boolean checkSchema(Set<Schema> output, Set<Schema> input) { return findSchema(output, input) != null; }
private void setError(Throwable cause) { error(cause); }
public static ApplicationSpecificationAdapter create() { return create(null); }
/** * Returns the {@link Plugin} information for the given plugin id that were configured via this context. */ private Plugin getExtraPlugin(String pluginId) { // Get the map of plugins from either the configurer (handler method) or the extra plugins map (executor) Map<String, PluginWithLocation> plugins = pluginConfigurer == null ? extraPlugins : pluginConfigurer.getPlugins(); PluginWithLocation plugin = plugins.get(pluginId); if (plugin == null) { throw new IllegalArgumentException("Plugin with id " + pluginId + " does not exist"); } return plugin.getPlugin(); }
@Nullable @Override public <T> T usePlugin(String pluginType, String pluginName, String pluginId, PluginProperties properties, PluginSelector selector) { return pluginConfigurer.usePlugin(pluginType, pluginName, pluginId, properties, selector); }
@Nullable @Override public <T> Class<T> usePluginClass(String pluginType, String pluginName, String pluginId, PluginProperties properties, PluginSelector selector) { return pluginConfigurer.usePluginClass(pluginType, pluginName, pluginId, properties, selector); } }
public String toJson(ApplicationSpecification appSpec) { StringBuilder builder = new StringBuilder(); toJson(appSpec, builder); return builder.toString(); }
public static ApplicationSpecificationAdapter create() { return new ApplicationSpecificationAdapter(addTypeAdapters(new GsonBuilder()).create()); }
public ApplicationSpecification fromJson(InputSupplier<? extends Reader> inputSupplier) throws IOException { try (Reader reader = inputSupplier.getInput()) { return fromJson(reader); } }
/** * Adds the dataset and plugins at the application level so that they can be used by any program in the application. * * @param configurer the program's configurer */ private void addDatasetsAndPlugins(AbstractConfigurer configurer) { addDatasets(configurer); addPlugins(configurer.getPlugins()); }
/** * Returns the {@link Plugin} information for the given plugin id that were configured via this context. */ private Plugin getExtraPlugin(String pluginId) { // Get the map of plugins from either the configurer (handler method) or the extra plugins map (executor) Map<String, PluginWithLocation> plugins = pluginConfigurer == null ? extraPlugins : pluginConfigurer.getPlugins(); PluginWithLocation plugin = plugins.get(pluginId); if (plugin == null) { throw new IllegalArgumentException("Plugin with id " + pluginId + " does not exist"); } return plugin.getPlugin(); }
@Nullable @Override public <T> T usePlugin(String pluginType, String pluginName, String pluginId, PluginProperties properties, PluginSelector selector) { return pluginConfigurer.usePlugin(pluginType, pluginName, pluginId, properties, selector); }
@Nullable @Override public <T> Class<T> usePluginClass(String pluginType, String pluginName, String pluginId, PluginProperties properties, PluginSelector selector) { return pluginConfigurer.usePluginClass(pluginType, pluginName, pluginId, properties, selector); } }
/** * Constructor with hit for handling type. */ public LocalArtifactLoaderStage(CConfiguration cConf, Store store, ArtifactRepository artifactRepository, Impersonator impersonator, AuthorizationEnforcer authorizationEnforcer, AuthenticationContext authenticationContext) { super(TypeToken.of(AppDeploymentInfo.class)); this.cConf = cConf; this.store = store; this.adapter = ApplicationSpecificationAdapter.create(); this.artifactRepository = artifactRepository; this.impersonator = impersonator; this.authorizationEnforcer = authorizationEnforcer; this.authenticationContext = authenticationContext; }
public void toJson(ApplicationSpecification appSpec, OutputSupplier<? extends Writer> outputSupplier) throws IOException { try (Writer writer = outputSupplier.getOutput()) { toJson(appSpec, writer); } }
public static ApplicationSpecificationAdapter create(SchemaGenerator generator) { return new ApplicationSpecificationAdapter(generator, addTypeAdapters(new GsonBuilder()).create()); }
/** * Given two schema's checks if there exists compatibility or equality. * * @param output Set of output {@link Schema}. * @param input Set of input {@link Schema}. * @return true if and only if they are equal or compatible with constraints */ public static boolean checkSchema(Set<Schema> output, Set<Schema> input) { return findSchema(output, input) != null; }
private void setError(Throwable cause) { error(cause); }
/** * Adds the dataset and plugins at the application level so that they can be used by any program in the application. * * @param configurer the program's configurer */ private void addDatasetsAndPlugins(AbstractConfigurer configurer) { addDatasets(configurer); addPlugins(configurer.getPlugins()); }
/** * Returns the {@link Plugin} information for the given plugin id that were configured via this context. */ private Plugin getExtraPlugin(String pluginId) { // Get the map of plugins from either the configurer (handler method) or the extra plugins map (executor) Map<String, PluginWithLocation> plugins = pluginConfigurer == null ? extraPlugins : pluginConfigurer.getPlugins(); PluginWithLocation plugin = plugins.get(pluginId); if (plugin == null) { throw new IllegalArgumentException("Plugin with id " + pluginId + " does not exist"); } return plugin.getPlugin(); }