if (att.getNodeName().equals("uri") || att.getNodeName().endsWith("Uri")) { final String value = att.getNodeValue(); String before = ObjectHelper.before(value, "?"); String after = ObjectHelper.after(value, "?");
if (att.getNodeName().equals("uri") || att.getNodeName().endsWith("Uri")) { final String value = att.getNodeValue(); String before = ObjectHelper.before(value, "?"); String after = ObjectHelper.after(value, "?");
@Override protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { AsynchChildEndpoint endpoint = new AsynchChildEndpoint(uri, this); // parse URI - "service:operation" String endpointURI = ObjectHelper.after(uri, ":"); if (endpointURI != null && endpointURI.startsWith("//")) { endpointURI = endpointURI.substring(2); } Assert.hasText(endpointURI, "Asynch-child endpoint URI must not be empty"); // endpointURI = "service:operation" String serviceName = ObjectHelper.before(endpointURI, ":"); String operationName = ObjectHelper.after(endpointURI, ":"); if (operationName != null && operationName.contains("?")) { operationName = ObjectHelper.before(operationName, "?"); } Assert.hasText(serviceName, "Service name can't be empty for asynch-child component"); Assert.hasText(operationName, "Operation name can't be empty for asynch-child component"); endpoint.setService(serviceName); endpoint.setOperationName(operationName); setProperties(endpoint, parameters); return endpoint; }
@Override public Endpoint createEndpoint(String uri) throws Exception { String endpointURI = ObjectHelper.after(uri, ":"); if (endpointURI != null && endpointURI.startsWith("//")) { endpointURI = endpointURI.substring(2); } Assert.hasText(endpointURI, "External Call endpoint URI must not be empty"); String keyTypeString = ObjectHelper.before(endpointURI, ":"); Assert.notNull(keyTypeString, "External Call endpoint URI must be in format [keyType]:[targetURI]"); String targetURI = ObjectHelper.after(endpointURI, ":"); if (targetURI != null && targetURI.startsWith("//")) { targetURI = targetURI.substring(2); } Assert.hasText(keyTypeString, "External Call key type must not be empty"); Assert.hasText(targetURI, "External Call target URI must not be empty"); ExternalCallKeyType keyType = null; for (ExternalCallKeyType aKeyType : ExternalCallKeyType.values()) { if (aKeyType.name().equalsIgnoreCase(keyTypeString)) { keyType = aKeyType; break; } } Assert.notNull(keyType, String.format("External Call key type \"%s\" is invalid. It must be one of: %s", keyTypeString, Arrays.toString(ExternalCallKeyType.values()))); return new ExternalCallEndpoint(uri, this, keyType, targetURI); }
uriStr = ObjectHelper.before(uriStr, "?");
requestType = ObjectHelper.before(endpointURI, ":"); operationName = ObjectHelper.after(endpointURI, ":"); } else {
@Override public void configure(URI uri) { super.configure(uri); // after configure the directory has been resolved, so we can use it for directoryName // (directoryName is the name we use in the other file components, to use consistent name) setDirectoryName(getDirectory()); setProtocol(uri.getScheme()); setDefaultPort(); // UserInfo can contain both username and password as: user:pwd@ftpserver // see: http://en.wikipedia.org/wiki/URI_scheme String username = uri.getUserInfo(); String pw = null; if (username != null && username.contains(":")) { pw = ObjectHelper.after(username, ":"); username = ObjectHelper.before(username, ":"); } if (username != null) { setUsername(username); } if (pw != null) { setPassword(pw); } setHost(uri.getHost()); setPort(uri.getPort()); }
key = ObjectHelper.before(key, "?");
key = ObjectHelper.before(key, "?");
host = ObjectHelper.before(remaining, "/"); if (host == null) { host = remaining;
String scheme = ObjectHelper.before(uri, ":"); String after = ObjectHelper.after(uri, ":");