/** * Get KDC network transport addresses according to krb client setting. * @param setting The krb setting * @return UDP and TCP addresses pair * @throws KrbException e */ public static TransportPair getTransportPair( AdminSetting setting) throws KrbException { TransportPair result = new TransportPair(); int tcpPort = setting.checkGetKdcTcpPort(); if (tcpPort > 0) { result.tcpAddress = new InetSocketAddress( setting.getKdcHost(), tcpPort); } int udpPort = setting.checkGetKdcUdpPort(); if (udpPort > 0) { result.udpAddress = new InetSocketAddress( setting.getKdcHost(), udpPort); } return result; } }
/** * Get KDC network transport addresses according to krb client setting. * @param setting The krb setting * @return UDP and TCP addresses pair * @throws KrbException e */ public static TransportPair getTransportPair( AdminSetting setting) throws KrbException { TransportPair result = new TransportPair(); int tcpPort = setting.checkGetKdcTcpPort(); if (tcpPort > 0) { result.tcpAddress = new InetSocketAddress( setting.getKdcHost(), tcpPort); } int udpPort = setting.checkGetKdcUdpPort(); if (udpPort > 0) { result.udpAddress = new InetSocketAddress( setting.getKdcHost(), udpPort); } return result; } }