Examples of AddressImpl


Examples of com.ericsson.ssa.sip.AddressImpl

            Header contactHeader = request.getRawHeader(Header.CONTACT);
            if (contactHeader != null) {
                // There is a contact, we need to add the BE-KEY to it
                try {
                    AddressImpl addressValue = (AddressImpl) contactHeader.getAddressValue();
                    if (addressValue != null) {
                        // Fetch current read-only status
                        boolean readOnly = addressValue.isReadOnly();
                        // Allow writes on Address object
                        addressValue.setReadOnly(false);
                        URIImpl uriImpl = (URIImpl) addressValue.getURI();
                        if(uriImpl != null){
                            uriImpl.encodeBeKey(hashkey);
                        }
                        // Reset read-only status
                        addressValue.setReadOnly(readOnly);
                    }
                } catch (ServletParseException e) {
                    throw new SipRoutingException("Malformed Contact", e);
                }
            }

            replaceTopVia(request, via);

            if (logger.isLoggable(Level.FINER)) {
                logger.log(Level.FINER,
                        "The request originates from this instance, altered request: " + request);
            }

            return null;
        } else if (request.isRecordRouteIndicated()) {
            // This request was proxied, save ID of incoming connection.
            String encodedConnection;
            if ((encodedConnection=getEncondedConnection(request)) == null) {
                throw new SipRoutingException("Could not find connection information in a proxied request, shall never happen!");
            } else {
                via.setParameter(CLBConstants.CONNID_PARAM, encodedConnection);
            }


            Header rrHeader = request.getRawHeader(Header.RECORD_ROUTE);
            AddressImpl rrAddr;
            try {
                rrAddr = (AddressImpl) rrHeader.getAddressValue();
            } catch (ServletParseException e) {
                throw new SipRoutingException("Malformed record-Route", e);
            }

            // The R-R was added by the application, thus we shall set 'bekey'
            // Fetch current read-only status
            boolean readOnly = rrAddr.isReadOnly();
            // Allow writes on Address object
            rrAddr.setReadOnly(false);
            URIImpl uriImpl = (URIImpl) rrAddr.getURI();
            if (uriImpl != null) {
                uriImpl.encodeBeKey(hashkey);
            }
            // Reset read-only status
            rrAddr.setReadOnly(readOnly);

            replaceTopVia(request, via);

            if (logger.isLoggable(Level.FINER)) {
                logger.log(Level.FINER,
View Full Code Here

Examples of com.ericsson.ssa.sip.AddressImpl

            if (response.isContactIndicated()) {
                // This is a UAS.
                Header contactHeader = response.getRawHeader(Header.CONTACT);

                if (contactHeader != null) {
                    AddressImpl contactAddress;

                    try {
                        contactAddress = (AddressImpl) (contactHeader.getAddressValue());
                    } catch (ServletParseException e) {
                        throw new SipRoutingException("Malformed Contact", e);
                    }

                    URIImpl contactUri = ((URIImpl) contactAddress.getURI());

                    contactAddress = ((AddressImpl) contactAddress.clone(true, true));
                    contactUri = (URIImpl) contactUri.clone();
                    contactUri.encodeBeKey(hashkey);
                    // Allow writes on cloned Address object
                    contactAddress.setReadOnly(false);
                    contactAddress.setURI(contactUri);
                    contactHeader.setReadOnly(false);
                    contactHeader.removeValues();
                    contactHeader.setValue(contactAddress.toString(), true);
                    contactHeader.setReadOnly(true);
                }
            } else if (response.getMethod().equalsIgnoreCase("INVITE") && response.getStatus() >= 300){
                // This is a non-2xx response to an INVITE, set bekey in the To-header
                Header toHeader = response.getRawHeader(Header.TO);

                if (toHeader != null) {
                    AddressImpl toAddress;

                    try {
                        toAddress = (AddressImpl) (toHeader.getAddressValue());
                    } catch (ServletParseException e) {
                        throw new SipRoutingException("Malformed To-header", e);
                    }

                    URIImpl toUri = ((URIImpl) toAddress.getURI());

                    toAddress = ((AddressImpl) toAddress.clone(true, true));
                    toUri = (URIImpl) toUri.clone();
                    toUri.encodeBeKey(hashkey);
                    // Allow writes on cloned Address object
                    toAddress.setReadOnly(false);
                    toAddress.setURI(toUri);
                    toHeader.setReadOnly(false);
                    toHeader.removeValues();
                    toHeader.setValue(toAddress.toString(), true);
                    toHeader.setReadOnly(true);
                }
            }
        }
View Full Code Here

Examples of com.ericsson.ssa.sip.AddressImpl

        }
    }
   
    private boolean isInternal(String aRoute) throws ServletParseException {
        // precondition: aRoute != null
         AddressImpl adr = (AddressImpl)SipFactoryImpl.getInstance().createAddress(aRoute);
        return adr.isLocal();
    }
View Full Code Here

Examples of com.ericsson.ssa.sip.AddressImpl

        throws Exception {
        URI uri = null;
        String uriStr = null;

        if ((uriStr = req.getHeader(Header.ROUTE)) != null) {
            AddressImpl address = new AddressImpl(uriStr);
            uri = address.getURI();
        } else {
            uri = req.getRequestURI();
        }

        if (myDnsResolver.isTelephoneNumber(uri)) {
View Full Code Here

Examples of com.inspiresoftware.lib.dto.geda.examples.addressbook.domain.impl.AddressImpl

        return person;
    }

    public Address addAddress(final Person person, final String street, final String city, final String postCode, final String country) {

        final Address address = new AddressImpl();
        address.setAddressLine1(street);
        address.setCity(city);
        address.setPostCode(postCode);
        address.setCountry(country);

        addresses.put(person, address);

        return address;
View Full Code Here

Examples of com.volantis.mcs.interaction.sample.model.AddressImpl

public abstract class FlintstoneTestAbstract
        extends TestCaseAbstract {

    public Address createFlintStoneAddress() {
        Address address = new AddressImpl();
        List lines = address.getLines();
        lines.add("301 Cobblestone Way");
        lines.add("Bedrock");
        lines.add("70777");
        return address;
    }
View Full Code Here

Examples of com.volantis.mcs.interaction.sample.model.AddressImpl

                Person.ADDRESS);

        // Set the proxy, this should cause the model objects for all the
        // parent proxies to be created but it should not affect the model
        // object associated with the person2Proxy.
        Address address1 = new AddressImpl();
        address1Proxy.setModelObject(address1);

        // The proxy for the address of the second Person object.
        BeanProxy address2Proxy = (BeanProxy) person2Proxy.getPropertyProxy(
                Person.ADDRESS);
View Full Code Here

Examples of eu.planets_project.ifr.core.security.impl.model.AddressImpl

  @Resource
  EJBContext ejbcontext;

  public UserSignupBean() {
    this.user = new UserImpl("");
    this.user.setAddress(new AddressImpl());
    this.user.setAccountEnabled(false);
    password = "";
    confirmPassword = "";
  }
View Full Code Here

Examples of gov.nist.javax.sip.address.AddressImpl

                while (li.hasPrevious()) {
                    RecordRoute rr = (RecordRoute) li.previous();

                    if (addRoute) {
                        Route route = new Route();
                        AddressImpl address = ((AddressImpl) ((AddressImpl) rr.getAddress())
                                .clone());

                        route.setAddress(address);
                        route.setParameters((NameValueList) rr.getParameters().clone());

                        this.routeList.add(route);
                    }
                }
            } else {
                // This is a server dialog. The top most record route
                // header is the one that is closest to us. We extract the
                // route list in the same order as the addresses in the
                // incoming request.
                this.routeList = new RouteList();
                ListIterator li = recordRouteList.listIterator();
                boolean addRoute = true;
                while (li.hasNext()) {
                    RecordRoute rr = (RecordRoute) li.next();

                    if (addRoute) {
                        Route route = new Route();
                        AddressImpl address = ((AddressImpl) ((AddressImpl) rr.getAddress())
                                .clone());
                        route.setAddress(address);
                        route.setParameters((NameValueList) rr.getParameters().clone());
                        routeList.add(route);
                    }
View Full Code Here

Examples of gov.nist.javax.sip.address.AddressImpl

                while (li.hasPrevious()) {
                    RecordRoute rr = (RecordRoute) li.previous();

                    if (addRoute) {
                        Route route = new Route();
                        AddressImpl address = ((AddressImpl) ((AddressImpl) rr.getAddress())
                                .clone());

                        route.setAddress(address);
                        route.setParameters((NameValueList) rr.getParameters().clone());

                        this.routeList.add(route);
                    }
                }
            } else {
                // This is a server dialog. The top most record route
                // header is the one that is closest to us. We extract the
                // route list in the same order as the addresses in the
                // incoming request.
                this.routeList = new RouteList();
                ListIterator li = recordRouteList.listIterator();
                boolean addRoute = true;
                while (li.hasNext()) {
                    RecordRoute rr = (RecordRoute) li.next();

                    if (addRoute) {
                        Route route = new Route();
                        AddressImpl address = ((AddressImpl) ((AddressImpl) rr.getAddress())
                                .clone());
                        route.setAddress(address);
                        route.setParameters((NameValueList) rr.getParameters().clone());
                        routeList.add(route);
                    }
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.