import javax.naming.*;
import com.sap.engine.frame.core.configuration.*;
import com.sap.engine.frame.core.configuration.addons.*;
import com.sap.engine.services.configuration.appconfiguration.*;
public void showMeThePasswords(String[] i_ids, String[] i_versions, ResultList o_ids, ResultList o_versions, ResultList o_properties, ResultList o_values, Container container) throws StreamTransformationException
{
try
{
javax.naming.Context ctx = new InitialContext();
ApplicationConfigHandlerFactory appCfgHdlFctry = (ApplicationConfigHandlerFactory)ctx.lookup("ApplicationConfiguration");
if (appCfgHdlFctry != null){
ConfigurationHandlerFactory fullFactory = appCfgHdlFctry.getConfigurationHandlerFactory();
ConfigurationHandler fullHandler = fullFactory.getConfigurationHandler();
int context_len = i_ids.length;
String strPath;
for (int index = 0; index < context_len; index++) {
strPath = "cluster_config/system/custom_global/cfg/apps/sap.com/com.sap.xi.directory/appcfg/Channel/" + i_ids[index] + "/" + i_versions[index];
try
{
Configuration conf = fullHandler.openConfiguration(strPath, 0,true);
boolean bTryAgain = true;
Map entries = null;
while (bTryAgain) {
bTryAgain = false;
try {
entries = conf.getAllConfigEntries();
} catch (InconsistentReadException ire) {
bTryAgain = true;
}
}
if (entries != null)
{
Object key = null;
Object value = null;
for (Iterator iter = entries.keySet().iterator(); iter.hasNext(); ) {
key = iter.next();
value = entries.get(key);
if (key != null && value != null && !"".equals(value.toString())) {
o_ids.addValue(i_ids[index]);
o_versions.addValue(i_versions[index]);
o_properties.addValue(key.toString());
o_values.addValue(value.toString());
}
}
}else{
o_ids.addValue(i_ids[index]);
o_versions.addValue(i_versions[index]);
o_properties.addValue("");
o_values.addValue("");
}
}catch (Exception e){
o_ids.addValue(i_ids[index]);
o_versions.addValue(i_versions[index]);
o_properties.addValue("");
o_values.addValue("");
}
}
}
}catch (Exception e){
o_ids.addValue(e.getMessage());
o_versions.addValue(e.getMessage());
o_properties.addValue(e.getMessage());
o_values.addValue(e.getMessage());
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 |