private MetadataKey buildServiceKey(ForwardingSoapClient connection, WebServiceDefinition ws) { String serviceId = ws.getServiceId(); SoapMetadataResolver resolver = connection.getSoapClient(serviceId).getMetadataResolver(); MetadataKeyBuilder key = newKey(serviceId).withDisplayName(ws.getFriendlyName()); List<String> excludedOperations = ws.getExcludedOperations(); resolver.getAvailableOperations().stream() .filter(ope -> !excludedOperations.contains(ope)) .forEach(ope -> key.withChild(newKey(ope).withDisplayName(NameUtils.titleize(ope)))); return key.build(); } }
public static MetadataKey buildAmericaKey() { return newKey(AMERICA).withDisplayName(AMERICA) .withChild(newKey(ARGENTINA).withChild(newKey(BUENOS_AIRES)).withChild(newKey(LA_PLATA))) .withChild(newKey(USA).withDisplayName(USA_DISPLAY_NAME).withChild(newKey(SAN_FRANCISCO))).build(); }
public static MetadataKey buildAmericaKey() { return newKey(AMERICA).withDisplayName(AMERICA) .withChild(newKey(ARGENTINA).withChild(newKey(BUENOS_AIRES)).withChild(newKey(LA_PLATA))) .withChild(newKey(USA).withDisplayName(USA_DISPLAY_NAME).withChild(newKey(SAN_FRANCISCO))).build(); }
public static MetadataKey buildEuropeKey() { return newKey(EUROPE).withDisplayName(EUROPE).withChild(newKey(FRANCE).withChild(newKey(PARIS))).build(); }
public static MetadataKey buildEuropeKey() { return newKey(EUROPE).withDisplayName(EUROPE).withChild(newKey(FRANCE).withChild(newKey(PARIS))).build(); }
@Override public MetadataKey resolveChilds(MetadataContext context, LocationKey partial) throws MetadataResolvingException, ConnectionException { // This is incomplete but you get the idea if (AMERICA.equalsIgnoreCase(partial.getContinent())) { if (ARGENTINA.equalsIgnoreCase(partial.getCountry())) { return newKey(AMERICA).withDisplayName(AMERICA) .withChild(newKey(ARGENTINA) .withChild(newKey(BUENOS_AIRES)) .withChild(newKey(LA_PLATA))) .build(); } return buildAmericaKey(); } else if (EUROPE.equalsIgnoreCase(partial.getContinent())) { return buildEuropeKey(); } else { throw new MetadataResolvingException("Invalid Continent", FailureCode.INVALID_METADATA_KEY); } }
private MetadataKey toMetadataKey(JsonElement jsonElement) { if (jsonElement.isJsonNull()) { return null; } JsonObject metadataKey = jsonElement.getAsJsonObject(); if (metadataKey.entrySet().isEmpty()) { return new NullMetadataKey(); } JsonElement id = metadataKey.get("id"); JsonElement displayName = metadataKey.get("displayName"); JsonElement partName = metadataKey.get("partName"); JsonElement childs = metadataKey.get("childs"); if (id != null && displayName != null && partName != null && childs != null) { MetadataKeyBuilder key = MetadataKeyBuilder.newKey(id.getAsString()) .withDisplayName(displayName.getAsString()) .withPartName(partName.getAsString()); childs.getAsJsonArray() .forEach(child -> key.withChild(toMetadataKey(child))); return key.build(); } return null; } }
public static MetadataKey buildAmericaKey() { return newKey(AMERICA).withDisplayName(AMERICA) .withChild(newKey(ARGENTINA).withChild(newKey(BUENOS_AIRES)).withChild(newKey(LA_PLATA))) .withChild(newKey(USA).withDisplayName(USA_DISPLAY_NAME).withChild(newKey(SAN_FRANCISCO))).build(); }
public static MetadataKey buildAmericaKey() { return newKey(AMERICA).withDisplayName(AMERICA) .withChild(newKey(ARGENTINA).withChild(newKey(BUENOS_AIRES)).withChild(newKey(LA_PLATA))) .withChild(newKey(USA).withDisplayName(USA_DISPLAY_NAME).withChild(newKey(SAN_FRANCISCO))).build(); }
public static MetadataKey buildEuropeKey() { return newKey(EUROPE).withDisplayName(EUROPE).withChild(newKey(FRANCE).withChild(newKey(PARIS))).build(); }
public static MetadataKey buildEuropeKey() { return newKey(EUROPE).withDisplayName(EUROPE).withChild(newKey(FRANCE).withChild(newKey(PARIS))).build(); }
@Override public MetadataKey resolveChilds(MetadataContext context, LocationKey partial) throws MetadataResolvingException, ConnectionException { // This is incomplete but you get the idea if (AMERICA.equalsIgnoreCase(partial.getContinent())) { if (ARGENTINA.equalsIgnoreCase(partial.getCountry())) { return newKey(AMERICA).withDisplayName(AMERICA) .withChild(newKey(ARGENTINA) .withChild(newKey(BUENOS_AIRES)) .withChild(newKey(LA_PLATA))) .build(); } return buildAmericaKey(); } else if (EUROPE.equalsIgnoreCase(partial.getContinent())) { return buildEuropeKey(); } else { throw new MetadataResolvingException("Invalid Continent", FailureCode.INVALID_METADATA_KEY); } }