@Test public void testToCredentials() { Assert.assertEquals("960:10vehu;vehu10", RpcUriUtils.toCredentials("960", "10vehu", "vehu10", null, null)); assertEquals("10vehu;vehu10", RpcUriUtils.toCredentials(null, "10vehu", "vehu10", null, null)); assertThat(RpcUriUtils.toCredentials(null, "10vehu", null, null, null), nullValue()); assertThat(RpcUriUtils.toCredentials(null, null, "vehu10", null, null), nullValue()); assertThat(RpcUriUtils.toCredentials(null, null, null, null, null), nullValue()); assertThat(RpcUriUtils.toCredentials(new AccessVerifyConnectionSpec("960", "10vehu", "vehu10", "123.45.67.89", "www.example.org")), is(RpcUriUtils.toCredentials("960", "10vehu", "vehu10", "123.45.67.89", "www.example.org"))); }
public static String toCredentials(ConnectionSpec auth) { if (auth instanceof ChangeVerifyCodeConnectionSpec) { ChangeVerifyCodeConnectionSpec cvc = (ChangeVerifyCodeConnectionSpec) auth; return toCredentials(cvc.getDivision(), cvc.getAccessCode(), cvc.getVerifyCode(), cvc.getNewVerifyCode(), cvc.getConfirmNewVerifyCode(), cvc.getClientAddress(), cvc.getClientHostName()); } else if (auth instanceof AccessVerifyConnectionSpec) { AccessVerifyConnectionSpec av = (AccessVerifyConnectionSpec) auth; return toCredentials(av.getDivision(), av.getAccessCode(), av.getVerifyCode(), av.getClientAddress(), av.getClientHostName()); } else if (auth instanceof AppHandleConnectionSpec) { AppHandleConnectionSpec h = (AppHandleConnectionSpec) auth; return toCredentials(h.getDivision(), h.getHandle(), h.getClientAddress(), h.getClientHostName()); } else if (auth instanceof AnonymousConnectionSpec) { return AnonymousConnectionSpec.ANONYMOUS; } return null; }
RpcUriUtils { public static String toCredentials(ConnectionSpec auth) { if (auth instanceof ChangeVerifyCodeConnectionSpec) { ChangeVerifyCodeConnectionSpec cvc = (ChangeVerifyCodeConnectionSpec) auth; return toCredentials(cvc.getDivision(), cvc.getAccessCode(), cvc.getVerifyCode(), cvc.getNewVerifyCode(), cvc.getConfirmNewVerifyCode(), cvc.getClientAddress(), cvc.getClientHostName()); } else if (auth instanceof AccessVerifyConnectionSpec) { AccessVerifyConnectionSpec av = (AccessVerifyConnectionSpec) auth; return toCredentials(av.getDivision(), av.getAccessCode(), av.getVerifyCode(), av.getClientAddress(), av.getClientHostName()); } else if (auth instanceof AppHandleConnectionSpec) { AppHandleConnectionSpec h = (AppHandleConnectionSpec) auth; return toCredentials(h.getDivision(), h.getHandle(), h.getClientAddress(), h.getClientHostName()); } else if (auth instanceof AnonymousConnectionSpec) { return AnonymousConnectionSpec.ANONYMOUS; } return null; } }
RpcUriUtils { public static String toCredentials(ConnectionSpec auth) { if (auth instanceof ChangeVerifyCodeConnectionSpec) { ChangeVerifyCodeConnectionSpec cvc = (ChangeVerifyCodeConnectionSpec) auth; return toCredentials(cvc.getDivision(), cvc.getAccessCode(), cvc.getVerifyCode(), cvc.getNewVerifyCode(), cvc.getConfirmNewVerifyCode(), cvc.getClientAddress(), cvc.getClientHostName()); } else if (auth instanceof AccessVerifyConnectionSpec) { AccessVerifyConnectionSpec av = (AccessVerifyConnectionSpec) auth; return toCredentials(av.getDivision(), av.getAccessCode(), av.getVerifyCode(), av.getClientAddress(), av.getClientHostName()); } else if (auth instanceof AppHandleConnectionSpec) { AppHandleConnectionSpec h = (AppHandleConnectionSpec) auth; return toCredentials(h.getDivision(), h.getHandle(), h.getClientAddress(), h.getClientHostName()); } else if (auth instanceof AnonymousConnectionSpec) { return AnonymousConnectionSpec.ANONYMOUS; } return null; }  }
RpcUriUtils { public static String toCredentials(ConnectionSpec auth) { if (auth instanceof ChangeVerifyCodeConnectionSpec) { ChangeVerifyCodeConnectionSpec cvc = (ChangeVerifyCodeConnectionSpec) auth; return toCredentials(cvc.getDivision(), cvc.getAccessCode(), cvc.getVerifyCode(), cvc.getNewVerifyCode(), cvc.getConfirmNewVerifyCode(), cvc.getClientAddress(), cvc.getClientHostName()); } else if (auth instanceof AccessVerifyConnectionSpec) { AccessVerifyConnectionSpec av = (AccessVerifyConnectionSpec) auth; return toCredentials(av.getDivision(), av.getAccessCode(), av.getVerifyCode(), av.getClientAddress(), av.getClientHostName()); } else if (auth instanceof AppHandleConnectionSpec) { AppHandleConnectionSpec h = (AppHandleConnectionSpec) auth; return toCredentials(h.getDivision(), h.getHandle(), h.getClientAddress(), h.getClientHostName()); } else if (auth instanceof AnonymousConnectionSpec) { return AnonymousConnectionSpec.ANONYMOUS; } return null; }  @Deprecated static void isVistaRpcUri(URI uri); @Deprecated static void isVistaLinkUri(URI uri); @Deprecated static URI toURI(RpcRequest request); @Deprecated static URI toURI(RpcHost host, String rpcContext, String rpcName, List params, int timeout); static UriComponents toUriComponents(String uri); static UriComponents toUriComponents(RpcRequest request); static UriComponents toUriComponents(RpcHost host, String rpcContext, String rpcName, List params, int timeout); static UriComponents toUriComponents(RpcHost host, ConnectionSpec auth); static String toUriString(RpcHost host, ConnectionSpec auth); static String toAuthority(String vistaId, String division, String accessCode, String verifyCode, String clientAddress, String clientHostName); static String toAuthority(String vistaId, String division, String accessCode, String verifyCode, String newVerifyCode, String confirmNewVerifyCode, String clientAddress, String clientHostName); static String toAuthority(RpcHost host, String division, String accessCode, String verifyCode); static String toAuthority(RpcHost host, String credentials); static String toAuthority(String vistaId, String division, String appHandle, String clientAddress, String clientHostName); static String toPath(String rpcContext, String rpcName); static String toQuery(RpcRequest request); static String toQuery(List params, int timeout); static String toCredentials(ConnectionSpec auth); static String toCredentials(String division, String accessCode, String verifyCode, String clientAddress, String clientHostName); static String toCredentials(String division, String accessCode, String verifyCode, String newVerifyCode, String confirmNewVerifyCode, String clientAddress, String clientHostName); static String toCredentials(String division, String appHandle, String clientAddress, String clientHostName); static String extractUserInfo(String uri); static String extractDivision(String uri); @Deprecated static String extractDivision(URI uri); static String extractAccessCode(String uri); static String extractVerifyCode(String uri); static String extractCredentials(String uri); @Deprecated static String extractCredentials(URI uri); @Deprecated static String extractAccessCode(URI uri); @Deprecated static String extractVerifyCode(URI uri); @Deprecated static String extractRpcContext(URI uri); @Deprecated static String extractRpcName(URI uri); static String extractScheme(String uri); @Deprecated static String extractScheme(URI uri); static String extractHostname(String uri); @Deprecated static String extractHostname(URI uri); static int extractPort(String uri); @Deprecated static int extractPort(URI uri); static RpcHost extractHost(String uri); @Deprecated static RpcHost extractHost(URI uri); static String extractRpcContext(String uri); static String extractRpcName(String uri); static String sanitize(String uri, ConnectionSpec auth); @Deprecated static String sanitize(URI uri, ConnectionSpec auth); @Deprecated static URI toURI(String location); @Deprecated static URI toURI(String uri, List params); @Deprecated static URI toSafeURI(String uriString); static ConnectionSpec extractConnectionSpec(String uriString); }
RpcUriUtils { public static String toCredentials(ConnectionSpec auth) { if (auth instanceof ChangeVerifyCodeConnectionSpec) { ChangeVerifyCodeConnectionSpec cvc = (ChangeVerifyCodeConnectionSpec) auth; return toCredentials(cvc.getDivision(), cvc.getAccessCode(), cvc.getVerifyCode(), cvc.getNewVerifyCode(), cvc.getConfirmNewVerifyCode(), cvc.getClientAddress(), cvc.getClientHostName()); } else if (auth instanceof AccessVerifyConnectionSpec) { AccessVerifyConnectionSpec av = (AccessVerifyConnectionSpec) auth; return toCredentials(av.getDivision(), av.getAccessCode(), av.getVerifyCode(), av.getClientAddress(), av.getClientHostName()); } else if (auth instanceof AppHandleConnectionSpec) { AppHandleConnectionSpec h = (AppHandleConnectionSpec) auth; return toCredentials(h.getDivision(), h.getHandle(), h.getClientAddress(), h.getClientHostName()); } else if (auth instanceof AnonymousConnectionSpec) { return AnonymousConnectionSpec.ANONYMOUS; } return null; }  @Deprecated static void isVistaRpcUri(URI uri); @Deprecated static void isVistaLinkUri(URI uri); @Deprecated static URI toURI(RpcRequest request); @Deprecated static URI toURI(RpcHost host, String rpcContext, String rpcName, List params, int timeout); static UriComponents toUriComponents(String uri); static UriComponents toUriComponents(RpcRequest request); static UriComponents toUriComponents(RpcHost host, String rpcContext, String rpcName, List params, int timeout); static UriComponents toUriComponents(RpcHost host, ConnectionSpec auth); static String toUriString(RpcHost host, ConnectionSpec auth); static String toAuthority(String vistaId, String division, String accessCode, String verifyCode, String clientAddress, String clientHostName); static String toAuthority(String vistaId, String division, String accessCode, String verifyCode, String newVerifyCode, String confirmNewVerifyCode, String clientAddress, String clientHostName); static String toAuthority(RpcHost host, String division, String accessCode, String verifyCode); static String toAuthority(RpcHost host, String credentials); static String toAuthority(String vistaId, String division, String appHandle, String clientAddress, String clientHostName); static String toPath(String rpcContext, String rpcName); static String toQuery(RpcRequest request); static String toQuery(List params, int timeout); static String toCredentials(ConnectionSpec auth); static String toCredentials(String division, String accessCode, String verifyCode, String clientAddress, String clientHostName); static String toCredentials(String division, String accessCode, String verifyCode, String newVerifyCode, String confirmNewVerifyCode, String clientAddress, String clientHostName); static String toCredentials(String division, String appHandle, String clientAddress, String clientHostName); static String extractUserInfo(String uri); static String extractDivision(String uri); @Deprecated static String extractDivision(URI uri); static String extractAccessCode(String uri); static String extractVerifyCode(String uri); static String extractCredentials(String uri); @Deprecated static String extractCredentials(URI uri); @Deprecated static String extractAccessCode(URI uri); @Deprecated static String extractVerifyCode(URI uri); @Deprecated static String extractRpcContext(URI uri); @Deprecated static String extractRpcName(URI uri); static String extractScheme(String uri); @Deprecated static String extractScheme(URI uri); static String extractHostname(String uri); @Deprecated static String extractHostname(URI uri); static int extractPort(String uri); @Deprecated static int extractPort(URI uri); static RpcHost extractHost(String uri); @Deprecated static RpcHost extractHost(URI uri); static String extractRpcContext(String uri); static String extractRpcName(String uri); static String sanitize(String uri, ConnectionSpec auth); @Deprecated static String sanitize(URI uri, ConnectionSpec auth); @Deprecated static URI toURI(String location); @Deprecated static URI toURI(String uri, List params); @Deprecated static URI toSafeURI(String uriString); static ConnectionSpec extractConnectionSpec(String uriString); static final String VISTA_RPC_BROKER_SCHEME; static final String VISTALINK_SCHEME; static final int DEFAULT_PORT; static final String DIVISION_CREDENTIALS_DELIMITER; static final String ACCESS_VERIFY_CODE_DELIMITER; }