org.n3r.eql.dbfieldcryptor.refer.ReferSecretFieldsConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eql Show documentation
Show all versions of eql Show documentation
a simple wrapper framework for jdbc to seperate sql and java code
package org.n3r.eql.dbfieldcryptor.refer;
import com.google.common.base.Splitter;
import com.google.common.collect.Sets;
import lombok.val;
import org.n3r.eql.dbfieldcryptor.EqlSecretFieldsConnectionProxy;
import org.n3r.eql.dbfieldcryptor.SecretFieldsConfigable;
import org.n3r.eql.util.S;
import java.util.Set;
public class ReferSecretFieldsConfig implements SecretFieldsConfigable {
private Set secretFieldsConfig;
public ReferSecretFieldsConfig() {
val eqlConfig = EqlSecretFieldsConnectionProxy.threadLocal.get();
if (eqlConfig == null) return;
val secureDatabaseFields = eqlConfig.getStr("securetDatabaseFields.define");
if (S.isBlank(secureDatabaseFields)) return;
val splitter = Splitter.onPattern("\\s+").trimResults().omitEmptyStrings();
Iterable secureFields = splitter.split(secureDatabaseFields.toUpperCase());
secretFieldsConfig = Sets.newHashSet(secureFields);
}
@Override
public Set getSecretFieldsConfig() {
return secretFieldsConfig;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy