Package java.net

Examples of java.net.UnknownHostException


                    updateLookupTable( name );
                }
            }
        }
        if( addr == UNKNOWN_ADDRESS ) {
            throw new UnknownHostException( name.toString() );
        }
        return addr;
    }
View Full Code Here


        try {
            NbtAddress[] addrs = CLIENT.getNodeStatus( addr );
            cacheAddressArray( addrs );
            return addrs;
        } catch( UnknownHostException uhe ) {
            throw new UnknownHostException( "no name with type 0x" +
                            Hexdump.toHexString( addr.hostName.hexCode, 2 ) +
                            ((( addr.hostName.scope == null ) ||
                            ( addr.hostName.scope.length() == 0 )) ?
                            " with no scope" : " with scope " + addr.hostName.scope ) +
                            " for host " + addr.getHostAddress() );
View Full Code Here

                if ("2.0.0.127.bl.spamcop.net.".equals(host)) {
                    return InetAddress.getByName("127.0.0.1");
                } else if ("3.0.0.127.bl.spamcop.net.".equals(host)) {
                    return InetAddress.getByName("127.0.0.1");
                } else if ("1.0.168.192.bl.spamcop.net.".equals(host)) {
                    throw new UnknownHostException(host);
                }
                throw new UnsupportedOperationException("getByName("+host+") not implemented in DNSRBLHandlerTest mock");
            }
        };
       
View Full Code Here

      if (server.isUnresolved()) {
        throw NetUtils.wrapException(server.getHostName(),
            server.getPort(),
            null,
            0,
            new UnknownHostException());
      }
      this.rpcTimeout = remoteId.getRpcTimeout();
      this.maxIdleTime = remoteId.getMaxIdleTime();
      this.maxRetries = remoteId.getMaxRetries();
      this.tcpNoDelay = remoteId.getTcpNoDelay();
View Full Code Here

    protected final AtomicBoolean shouldCloseConnection = new AtomicBoolean()// indicate if the connection is closed
    protected IOException closeException; // close reason

    Connection(ConnectionId remoteId) throws IOException {
      if (remoteId.getAddress().isUnresolved()) {
        throw new UnknownHostException("unknown host: " +
                                       remoteId.getAddress().getHostName());
      }
      this.remoteId = remoteId;
      User ticket = remoteId.getTicket();
      Class<? extends VersionedProtocol> protocol = remoteId.getProtocol();
View Full Code Here

      throw new BindException("Problem binding to " + address);
    } catch (SocketException e) {
      // If they try to bind to a different host's address, give a better
      // error message.
      if ("Unresolved address".equals(e.getMessage())) {
        throw new UnknownHostException("Invalid hostname for server: " +
                                       address.getHostName());
      } else {
        throw e;
      }
    }
View Full Code Here

  public static Text buildTokenService(InetSocketAddress addr) {
    String host = null;
    if (useIpForTokenService) {
      if (addr.isUnresolved()) { // host has no ip address
        throw new IllegalArgumentException(
            new UnknownHostException(addr.getHostName())
        );
      }
      host = addr.getAddress().getHostAddress();
    } else {
      host = addr.getHostName().toLowerCase();
View Full Code Here

                name = resolveHostCommand.getHostName(); //If IP can't be resolved takes took long on windows
                ip = resolveHostCommand.getHostAddress();

                if (exitValue != EXIT_VAL_SUCCESS || ip.equals(name)) {
                    throw new UnknownHostException(ip);
                }

                //handler.setHostState(host, Host.State.RESOLVABLE);
                state = Host.State.RESOLVABLE;
                host.setHostname(name);
View Full Code Here

      return hostname;
  }

  public void writeToDataOutputStream(DataOutputStream dos) throws IOException {
    InetAddress addr = this.getAddress();
    if (addr == null) throw new UnknownHostException();
    byte[] data = addr.getAddress();
    if(data.length == 4)
      dos.write(0);
    else
      dos.write(255);
View Full Code Here

        assertTrue(failureDetector.isAvailable(node));

        failureDetector.recordException(node,
                                        0,
                                        new UnreachableStoreException("intentionalerror",
                                                                      new UnknownHostException("intentionalerror")));
        assertEquals(false, failureDetector.isAvailable(node));
        time.sleep(BANNAGE_MILLIS + 1);
        assertTrue(failureDetector.isAvailable(node));

        failureDetector.recordException(node,
View Full Code Here

TOP

Related Classes of java.net.UnknownHostException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.