public TcpConnection(SourceURL url) { super(url); this.host = url.getHost(); this.port = url.getPort(); }
/** * @param url */ public TcpListener(SourceURL url) { super(url); port = url.getPort(); try { inputStream = new TcpInputStream(port); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } }
public TcpConnection(SourceURL url) { super(url); this.host = url.getHost(); this.port = url.getPort(); }
/** * <p> * Returns a string representing the connection url (works currently only * with tcp connections). * </p> * * TODO Better: Implement and call SourceURL.toString() method * * @return a string representing the connection url */ protected String getConnectionString() { if (urlCache == null) { StringBuilder sb = new StringBuilder(url.getProtocol()); sb.append("://"); sb.append(url.getHost()); sb.append(":"); sb.append(url.getPort()); urlCache = sb.toString(); } return urlCache; }
/** * <p> * Returns a string representing the connection url (works currently only * with tcp connections). * </p> * * TODO Better: Implement and call SourceURL.toString() method * * @return a string representing the connection url */ protected String getConnectionString() { if (urlCache == null) { StringBuilder sb = new StringBuilder(url.getProtocol()); sb.append("://"); sb.append(url.getHost()); sb.append(":"); sb.append(url.getPort()); urlCache = sb.toString(); } return urlCache; }
public SSLConnection(SourceURL url) throws Exception { super(url); this.host = url.getHost(); this.port = url.getPort(); if (url.getParameters().containsKey("keystorePassword")) this.password = url.getParameters().get("keystorePassword") .toCharArray(); else this.password = null; if (url.getParameters().containsKey("keystoreUrl")) { SourceURL ksUrl = new SourceURL(url.getParameters().get( "keystoreUrl")); loadKeyStore(ksUrl, password); } else this.keyStore = null; if (url.getParameters().containsKey("truststoreUrl")) { this.trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); SourceURL tsUrl = new SourceURL(url.getParameters().get( "truststoreUrl")); String trustpw = url.getParameters().get("truststorePassword"); if (trustpw == null) { trustpw = new String(password); } loadTrustStore(tsUrl, trustpw.toCharArray()); } else { this.trustStore = this.keyStore; } }
public SSLConnection(SourceURL url) throws Exception { super(url); this.host = url.getHost(); this.port = url.getPort(); if (url.getParameters().containsKey("keystorePassword")) this.password = url.getParameters().get("keystorePassword") .toCharArray(); else this.password = null; if (url.getParameters().containsKey("keystoreUrl")) { SourceURL ksUrl = new SourceURL(url.getParameters().get( "keystoreUrl")); loadKeyStore(ksUrl, password); } else this.keyStore = null; if (url.getParameters().containsKey("truststoreUrl")) { this.trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); SourceURL tsUrl = new SourceURL(url.getParameters().get( "truststoreUrl")); String trustpw = url.getParameters().get("truststorePassword"); if (trustpw == null) { trustpw = new String(password); } loadTrustStore(tsUrl, trustpw.toCharArray()); } else { this.trustStore = this.keyStore; } }