use of com.evolveum.midpoint.xml.ns._public.common.common_3.EntryType in project airavata by apache.
the class StorageCreator method findServerName.
protected String findServerName(String besUrl, EndpointReferenceType smsEpr) throws Exception {
int besIndex = besUrl.indexOf("StorageFactory?res");
String ss = besUrl.substring(0, besIndex);
ss = ss + "Registry";
EndpointReferenceType eprt = WSUtilities.makeServiceEPR(ss, "default_registry", Registry.REGISTRY_PORT);
RegistryClient registry = new RegistryClient(eprt, secProps);
// first, check if server name is already in the EPR...
String dn = WSUtilities.extractServerIDFromEPR(smsEpr);
if (dn != null) {
return dn;
}
// otherwise find a matching service in the registry
String url = smsEpr.getAddress().getStringValue();
if (url.contains("/services/"))
url = url.substring(0, url.indexOf("/services"));
if (log.isDebugEnabled())
log.debug("Checking for services at " + url);
for (EntryType entry : registry.listEntries()) {
if (entry.getMemberServiceEPR().getAddress().getStringValue().startsWith(url)) {
dn = WSUtilities.extractServerIDFromEPR(entry.getMemberServiceEPR());
if (dn != null) {
return dn;
}
}
}
return null;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.EntryType in project midpoint by Evolveum.
the class ParamsTypeUtil method fromParamsType.
public static Map<String, Serializable> fromParamsType(ParamsType paramsType, PrismContext prismContext) throws SchemaException {
if (paramsType != null) {
Map<String, Serializable> params = new HashMap<>();
for (EntryType entry : paramsType.getEntry()) {
Serializable realValue;
if (entry.getEntryValue() != null) {
Serializable value = (Serializable) entry.getEntryValue().getValue();
if (value instanceof RawType) {
RawType raw = (RawType) value;
if (raw.isParsed()) {
realValue = raw.getAlreadyParsedValue().getRealValue();
} else {
realValue = raw.guessFormattedValue();
}
} else {
realValue = value;
}
} else {
realValue = null;
}
params.put(entry.getKey(), realValue);
}
return params;
}
return null;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.EntryType in project midpoint by Evolveum.
the class ParamsTypeUtil method fromParamsType.
public static Map<String, Collection<String>> fromParamsType(ParamsType paramsType) {
if (paramsType != null) {
Map<String, Collection<String>> params = new HashMap<>();
for (EntryType entry : paramsType.getEntry()) {
if (entry.getEntryValue() != null) {
String newValue = extractString(entry.getEntryValue());
Collection<String> values = params.computeIfAbsent(entry.getKey(), k -> new ArrayList<>());
values.add(newValue);
}
}
return params;
}
return null;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.EntryType in project midpoint by Evolveum.
the class ParamsTypeUtil method createEntryElement.
private static EntryType createEntryElement(String key, String value) {
EntryType entryType = new EntryType();
entryType.setKey(key);
if (value != null) {
entryType.setEntryValue(new JAXBElement<>(SchemaConstants.C_PARAM_VALUE, Serializable.class, value));
}
return entryType;
}
Aggregations