//only datastores supposed at this time, TODO: fix this
return Collections.emptySet();
}
//find this store object data access factory
DataAccessFactory factory;
try {
factory = getCatalog().getResourcePool().getDataStoreFactory((DataStoreInfo) info);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Error looking up factory for store : " + info + ". Unable to " +
"encrypt connection parameters.", e);
return Collections.emptySet();
}
if (factory == null) {
LOGGER.warning("Could not find factory for store : " + info + ". Unable to encrypt " +
"connection parameters.");
return Collections.emptySet();
}
//if factory returns no info no need to continue
if (factory.getParametersInfo() == null) {
return Collections.emptySet();
}
Set<String> toEncrypt = CACHE.get(factory.getClass());
if (toEncrypt!=null) {
return toEncrypt;
}
synchronized (CACHE) {
toEncrypt = CACHE.get(info.getClass());
if (toEncrypt!=null) {
return toEncrypt;
}
toEncrypt = Collections.emptySet();
if (info != null && info.getConnectionParameters() != null) {
toEncrypt = new HashSet<String>(3);
for (Param p : factory.getParametersInfo()) {
if (p.isPassword()) {
toEncrypt.add(p.getName());
}
}
}
CACHE.put(factory.getClass(), toEncrypt);
}
return toEncrypt;
}