protected Map<String, Object> getSshFlags() {
Map<String, Object> result = Maps.newLinkedHashMap();
StringConfigMap globalConfig = ((EntityInternal)getEntity()).getManagementContext().getConfig();
Map<ConfigKey<?>, Object> mgmtConfig = globalConfig.getAllConfig();
Map<ConfigKey<?>, Object> entityConfig = ((EntityInternal)getEntity()).getAllConfig();
Map<ConfigKey<?>, Object> allConfig = MutableMap.<ConfigKey<?>, Object>builder().putAll(mgmtConfig).putAll(entityConfig).build();
for (ConfigKey<?> key : allConfig.keySet()) {
if (key.getName().startsWith(SshTool.BROOKLYN_CONFIG_KEY_PREFIX)) {
Object val = ((EntityInternal)getEntity()).getConfigMap().getRawConfig(key);
if (val!=null) {
val = getEntity().getConfig(key);
} else {
val = globalConfig.getRawConfig(key);
if (val!=null) val = globalConfig.getConfig(key);
}
if (val!=null) {
result.put(ConfigUtils.unprefixedKey(SshTool.BROOKLYN_CONFIG_KEY_PREFIX, key).getName(), val);
}
}
}
return result;
}