Examples of HostPort


Examples of gov.nist.core.HostPort

        if (sipRequest.getHeader(Route.NAME) != null
                && transaction.getDialog() != null) {
            final RouteList routes = sipRequest.getRouteHeaders();
            final Route route = (Route) routes.getFirst();
            final SipUri uri = (SipUri) route.getAddress().getURI();
            final HostPort hostPort = uri.getHostPort();
            int port;
            if (hostPort.hasPort()) {
                port = hostPort.getPort();
            } else {
                if (listeningPoint.getTransport().equalsIgnoreCase(
                        ListeningPoint.TLS))
                    port = 5061;
                else
                    port = 5060;
            }
            String host = hostPort.getHost().encode();
            if ((host.equals(listeningPoint.getIPAddress()) || host
                    .equalsIgnoreCase(listeningPoint.getSentBy()))
                    && port == listeningPoint.getPort()) {
                if (routes.size() == 1)
                    sipRequest.removeHeader(Route.NAME);
View Full Code Here

Examples of gov.nist.core.HostPort

  }

 
  public void sendHeartbeat(String ipAddress, int port) throws IOException {
   
    HostPort targetHostPort  = new HostPort();
    targetHostPort.setHost(new Host( ipAddress));
    targetHostPort.setPort(port);
    MessageChannel messageChannel = this.messageProcessor.createMessageChannel(targetHostPort);
    SIPRequest siprequest = new SIPRequest();
    siprequest.setNullRequest();
    messageChannel.sendMessage(siprequest);
   
View Full Code Here

Examples of gov.nist.core.HostPort

  /** set the Host of the Via Header
       * @param host String to set
       */
  public void setHost(Host host) {
    if (sentBy == null) {
      sentBy = new HostPort();
    }
    sentBy.setHost(host);
  }
View Full Code Here

Examples of gov.nist.core.HostPort

   * @throws ParseException which signals that an error has been reached
   * unexpectedly while parsing the host value.
   */
  public void setHost(String host) throws ParseException {
    if (sentBy == null)
      sentBy = new HostPort();
    try {
      Host h = new Host(host);
      sentBy.setHost(h);
    } catch (Exception e) {
      throw new NullPointerException(" host parameter is null");
View Full Code Here

Examples of gov.nist.core.HostPort

    if ( port!=-1 && (port<1 || port>65535)) {
      throw new InvalidArgumentException( "Port value out of range -1, [1..65535]" );
    }
       
    if (sentBy == null)
      sentBy = new HostPort();
    sentBy.setPort(port);
  }
View Full Code Here

Examples of gov.nist.core.HostPort

    /**
     * Get the hostport structure of this message channel.
     */
    public HostPort getHostPort() {
        HostPort retval = new HostPort();
        retval.setHost(new Host(this.getHost()));
        retval.setPort(this.getPort());
        return retval;
    }
View Full Code Here

Examples of gov.nist.core.HostPort

     * Get the peer host and port.
     *
     * @return a HostPort structure for the peer.
     */
    public HostPort getPeerHostPort() {
        HostPort retval = new HostPort();
        retval.setHost(new Host(this.getPeerAddress()));
        retval.setPort(this.getPeerPort());
        return retval;
    }
View Full Code Here

Examples of gov.nist.core.HostPort

     * the request.
     *
     * @return a host:port structure
     */
    public HostPort getViaHostPort() {
        HostPort retval = new HostPort();
        retval.setHost(new Host(this.getViaHost()));
        retval.setPort(this.getViaPort());
        return retval;
    }
View Full Code Here

Examples of gov.nist.core.HostPort

        char la = lexer.lookAhead(0);
        // JvB: allow IPv6 addresses in generic URI strings
        // e.g. http://[::1]
        if ( la == '[' ) {
          HostNameParser hnp = new HostNameParser(this.getLexer());
          HostPort hp = hnp.hostPort( false );
          retval.append(hp.toString());
          continue;
        }
        break;
      }
      retval.append(next);
View Full Code Here

Examples of gov.nist.core.HostPort

        // then userOrHost was a host, backtrack just in case a ';' was eaten...
        lexer.rewindInputPosition( startOfUser );
      }

      HostNameParser hnp = new HostNameParser(this.getLexer());
      HostPort hp = hnp.hostPort( false );
      retval.setHostPort(hp);

      lexer.selectLexer("charLexer");
      while (lexer.hasMoreChars()) {
        if (lexer.lookAhead(0) != ';')
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.