Search in sources :

Example 1 with HopTwoWayPasswordEncoder

use of org.apache.hop.core.encryption.HopTwoWayPasswordEncoder in project hop by apache.

the class HopConfig method buildMetadataProvider.

private void buildMetadataProvider() throws HopException {
    List<IHopMetadataProvider> providers = new ArrayList<>();
    String folder = variables.getVariable(Const.HOP_METADATA_FOLDER);
    if (StringUtils.isEmpty(folder)) {
        providers.add(new JsonMetadataProvider());
    } else {
        ITwoWayPasswordEncoder passwordEncoder = Encr.getEncoder();
        if (passwordEncoder == null) {
            passwordEncoder = new HopTwoWayPasswordEncoder();
        }
        providers.add(new JsonMetadataProvider(passwordEncoder, folder, variables));
    }
    metadataProvider = new MultiMetadataProvider(Encr.getEncoder(), providers, variables);
}
Also used : HopTwoWayPasswordEncoder(org.apache.hop.core.encryption.HopTwoWayPasswordEncoder) ITwoWayPasswordEncoder(org.apache.hop.core.encryption.ITwoWayPasswordEncoder) ArrayList(java.util.ArrayList) IHopMetadataProvider(org.apache.hop.metadata.api.IHopMetadataProvider) JsonMetadataProvider(org.apache.hop.metadata.serializer.json.JsonMetadataProvider) MultiMetadataProvider(org.apache.hop.metadata.serializer.multi.MultiMetadataProvider)

Example 2 with HopTwoWayPasswordEncoder

use of org.apache.hop.core.encryption.HopTwoWayPasswordEncoder in project hop by apache.

the class MultiMetadataProviderTest method testSetProviders.

public void testSetProviders() {
    List<IHopMetadataProvider> list = multiMetadataProvider.getProviders();
    MemoryMetadataProvider provider4 = new MemoryMetadataProvider(new HopTwoWayPasswordEncoder(), Variables.getADefaultVariableSpace());
    provider4.setDescription("Provider4");
    list.add(provider4);
    multiMetadataProvider.setProviders(list);
    assertEquals(4, multiMetadataProvider.getProviders().size());
    // see if the description has changed...
    // 
    assertEquals("Multi Metadata Provider: Provider1, Provider2, Provider3, Provider4", multiMetadataProvider.getDescription());
}
Also used : HopTwoWayPasswordEncoder(org.apache.hop.core.encryption.HopTwoWayPasswordEncoder) MemoryMetadataProvider(org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider) IHopMetadataProvider(org.apache.hop.metadata.api.IHopMetadataProvider)

Example 3 with HopTwoWayPasswordEncoder

use of org.apache.hop.core.encryption.HopTwoWayPasswordEncoder in project hop by apache.

the class MetadataTestBase method setUp.

@Override
protected void setUp() throws Exception {
    HopClientEnvironment.init();
    PluginRegistry registry = PluginRegistry.getInstance();
    registry.registerPluginType(MetadataPluginType.class);
    registry.registerPluginClass(MetadataType1.class.getName(), MetadataPluginType.class, HopMetadata.class);
    assertNotNull(registry.findPluginWithId(MetadataPluginType.class, "type-1"));
    registry.registerPluginClass(MetadataType2.class.getName(), MetadataPluginType.class, HopMetadata.class);
    assertNotNull(registry.findPluginWithId(MetadataPluginType.class, "type-2"));
    IVariables variables = Variables.getADefaultVariableSpace();
    ITwoWayPasswordEncoder twoWayPasswordEncoder = new HopTwoWayPasswordEncoder();
    provider1 = new MemoryMetadataProvider(twoWayPasswordEncoder, variables);
    provider1.setDescription("Provider1");
    provider2 = new MemoryMetadataProvider(twoWayPasswordEncoder, variables);
    provider2.setDescription("Provider2");
    provider3 = new MemoryMetadataProvider(twoWayPasswordEncoder, variables);
    provider3.setDescription("Provider3");
    List<IHopMetadataProvider> providers = new ArrayList<>(Arrays.asList(provider1, provider2, provider3));
    multiMetadataProvider = new MultiMetadataProvider(twoWayPasswordEncoder, providers, variables);
}
Also used : HopTwoWayPasswordEncoder(org.apache.hop.core.encryption.HopTwoWayPasswordEncoder) ITwoWayPasswordEncoder(org.apache.hop.core.encryption.ITwoWayPasswordEncoder) MemoryMetadataProvider(org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider) IVariables(org.apache.hop.core.variables.IVariables) PluginRegistry(org.apache.hop.core.plugins.PluginRegistry) ArrayList(java.util.ArrayList) IHopMetadataProvider(org.apache.hop.metadata.api.IHopMetadataProvider) MetadataPluginType(org.apache.hop.metadata.plugin.MetadataPluginType)

Example 4 with HopTwoWayPasswordEncoder

use of org.apache.hop.core.encryption.HopTwoWayPasswordEncoder in project hop by apache.

the class HopSearch method buildMetadataProvider.

private void buildMetadataProvider() throws HopException {
    List<IHopMetadataProvider> providers = new ArrayList<>();
    String folder = variables.getVariable(Const.HOP_METADATA_FOLDER);
    if (StringUtils.isEmpty(folder)) {
        providers.add(new JsonMetadataProvider());
    } else {
        ITwoWayPasswordEncoder passwordEncoder = Encr.getEncoder();
        if (passwordEncoder == null) {
            passwordEncoder = new HopTwoWayPasswordEncoder();
        }
        providers.add(new JsonMetadataProvider(passwordEncoder, folder, variables));
    }
    metadataProvider = new MultiMetadataProvider(Encr.getEncoder(), providers, variables);
}
Also used : HopTwoWayPasswordEncoder(org.apache.hop.core.encryption.HopTwoWayPasswordEncoder) ITwoWayPasswordEncoder(org.apache.hop.core.encryption.ITwoWayPasswordEncoder) IHopMetadataProvider(org.apache.hop.metadata.api.IHopMetadataProvider) JsonMetadataProvider(org.apache.hop.metadata.serializer.json.JsonMetadataProvider) MultiMetadataProvider(org.apache.hop.metadata.serializer.multi.MultiMetadataProvider)

Aggregations

HopTwoWayPasswordEncoder (org.apache.hop.core.encryption.HopTwoWayPasswordEncoder)4 IHopMetadataProvider (org.apache.hop.metadata.api.IHopMetadataProvider)4 ITwoWayPasswordEncoder (org.apache.hop.core.encryption.ITwoWayPasswordEncoder)3 ArrayList (java.util.ArrayList)2 JsonMetadataProvider (org.apache.hop.metadata.serializer.json.JsonMetadataProvider)2 MemoryMetadataProvider (org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider)2 MultiMetadataProvider (org.apache.hop.metadata.serializer.multi.MultiMetadataProvider)2 PluginRegistry (org.apache.hop.core.plugins.PluginRegistry)1 IVariables (org.apache.hop.core.variables.IVariables)1 MetadataPluginType (org.apache.hop.metadata.plugin.MetadataPluginType)1