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);
}
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());
}
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);
}
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);
}
Aggregations