Examples of ContactList


Examples of GUI.ContactList

      for(Contact contact : this.contacts){
        contacts[i] = contact;
        i++;
      }

      contactList = new ContactList(settings, contacts);
      contactList.addContactListListener(this);
      mainWindow.setContactList(contactList);
    }
  }
View Full Code Here

Examples of Singleton.ContactList

   
    System.out.println("SINGLETON DEMO");
    System.out.println();
   
    //Create a contact list
    ContactList myContacts = ContactList.getInstance();
   
    //Add a contact
    Contact newContact1 = new Contact ("Mr", "Fred", "Bloggs", "01234 567890");
    myContacts.addContact(newContact1);
   
    Contact newContact2 = new Contact ("Mrs", "Sheila", "Bloggs", "09876 543210");
    myContacts.addContact(newContact2);
   
    //Output the contacts
    //Get the list name
    System.out.println(myContacts.getListName());
    System.out.print(myContacts.toString());
    System.out.println();
   
    //Prove the contacts list is a Singleton
    System.out.println("Attempt to get new contact list...");
    System.out.println("The Singleton will return the current instance... so it cannot be instaniated again.");
    ContactList theContacts = ContactList.getInstance();
    System.out.println(theContacts.getListName());
    System.out.println(theContacts.toString());
    System.out.println();
   
  }
View Full Code Here

Examples of gov.nist.javax.sip.header.ContactList

            } else if (this.dialogState == CONFIRMED_STATE) {
                // cannot add route list after the dialog is initialized.
                // Remote target is updated on RE-INVITE but not
                // the route list.
                if (sipResponse.getStatusCode() / 100 == 2 && !this.isServer()) {
                    ContactList contactList = sipResponse.getContactHeaders();
                    if (contactList != null
                            && SIPRequest.isTargetRefresh(sipResponse.getCSeq().getMethod())) {
                        this.setRemoteTarget((ContactHeader) contactList.getFirst());
                    }
                }
                if (! this.pendingRouteUpdateOn202Response ) return;
            }

            // Update route list on response if I am a client dialog.
            if (!isServer() || this.pendingRouteUpdateOn202Response) {

                // only update the route set if the dialog is not in the confirmed state.
                if ((this.getState() != DialogState.CONFIRMED
                        && this.getState() != DialogState.TERMINATED) ||
                        this.pendingRouteUpdateOn202Response ) {
                    RecordRouteList rrlist = sipResponse.getRecordRouteHeaders();
                    // Add the route set from the incoming response in reverse
                    // order for record route headers.
                    if (rrlist != null) {
                        this.addRoute(rrlist);
                    } else {
                        // Set the rotue list to the last seen route list.
                        this.routeList = new RouteList();
                    }
                }

                ContactList contactList = sipResponse.getContactHeaders();
                if (contactList != null) {
                    this.setRemoteTarget((ContactHeader) contactList.getFirst());
                }
            }

        } finally {
            if (sipStack.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
View Full Code Here

Examples of gov.nist.javax.sip.header.ContactList

            this.routeList = new RouteList();
        }

        // put the contact header from the incoming request into
        // the route set. JvB: some duplication here, ref. doTargetRefresh
        ContactList contactList = sipRequest.getContactHeaders();
        if (contactList != null) {
            this.setRemoteTarget((ContactHeader) contactList.getFirst());
        }
    }
View Full Code Here

Examples of gov.nist.javax.sip.header.ContactList

     * extensions may define different target refresh requests for dialogs established in other
     * ways.
     */
    private void doTargetRefresh(SIPMessage sipMessage) {

        ContactList contactList = sipMessage.getContactHeaders();

        /*
         * INVITE is the target refresh for INVITE dialogs. SUBSCRIBE is the target refresh for
         * subscribe dialogs from the client side. This modifies the remote target URI potentially
         */
        if (contactList != null) {

            Contact contact = (Contact) contactList.getFirst();
            this.setRemoteTarget(contact);

        }

    }
View Full Code Here

Examples of gov.nist.javax.sip.header.ContactList

            } else if (this.dialogState == CONFIRMED_STATE) {
                // cannot add route list after the dialog is initialized.
                // Remote target is updated on RE-INVITE but not
                // the route list.
                if (sipResponse.getStatusCode() / 100 == 2 && !this.isServer()) {
                    ContactList contactList = sipResponse.getContactHeaders();
                    if (contactList != null
                            && SIPRequest.isTargetRefresh(sipResponse.getCSeq().getMethod())) {
                        this.setRemoteTarget((ContactHeader) contactList.getFirst());
                    }
                }
                if (! this.pendingRouteUpdateOn202Response ) return;
            }

            // Update route list on response if I am a client dialog.
            if (!isServer() || this.pendingRouteUpdateOn202Response) {

                // only update the route set if the dialog is not in the confirmed state.
                if ((this.getState() != DialogState.CONFIRMED
                        && this.getState() != DialogState.TERMINATED) ||
                        this.pendingRouteUpdateOn202Response ) {
                    RecordRouteList rrlist = sipResponse.getRecordRouteHeaders();
                    // Add the route set from the incoming response in reverse
                    // order for record route headers.
                    if (rrlist != null) {
                        this.addRoute(rrlist);
                    } else {
                        // Set the rotue list to the last seen route list.
                        this.routeList = new RouteList();
                    }
                }

                ContactList contactList = sipResponse.getContactHeaders();
                if (contactList != null) {
                    this.setRemoteTarget((ContactHeader) contactList.getFirst());
                }
            }

        } finally {
            if (sipStack.isLoggingEnabled()) {
View Full Code Here

Examples of gov.nist.javax.sip.header.ContactList

            this.routeList = new RouteList();
        }

        // put the contact header from the incoming request into
        // the route set. JvB: some duplication here, ref. doTargetRefresh
        ContactList contactList = sipRequest.getContactHeaders();
        if (contactList != null) {
            this.setRemoteTarget((ContactHeader) contactList.getFirst());
        }
    }
View Full Code Here

Examples of gov.nist.javax.sip.header.ContactList

     * extensions may define different target refresh requests for dialogs established in other
     * ways.
     */
    private void doTargetRefresh(SIPMessage sipMessage) {

        ContactList contactList = sipMessage.getContactHeaders();

        /*
         * INVITE is the target refresh for INVITE dialogs. SUBSCRIBE is the target refresh for
         * subscribe dialogs from the client side. This modifies the remote target URI potentially
         */
        if (contactList != null) {

            Contact contact = (Contact) contactList.getFirst();
            this.setRemoteTarget(contact);

        }

    }
View Full Code Here

Examples of gov.nist.javax.sip.header.ContactList

            } else if (this.dialogState == CONFIRMED_STATE) {
                // cannot add route list after the dialog is initialized.
                // Remote target is updated on RE-INVITE but not
                // the route list.
                if (sipResponse.getStatusCode() / 100 == 2 && !this.isServer()) {
                    ContactList contactList = sipResponse.getContactHeaders();
                    if (contactList != null
                            && SIPRequest.isTargetRefresh(sipResponse.getCSeq()
                                    .getMethod())) {
                        this.setRemoteTarget((ContactHeader) contactList
                                .getFirst());
                    }
                }
                if (!this.pendingRouteUpdateOn202Response)
                    return;
            }

            // Update route list on response if I am a client dialog.
            if (!isServer() || this.pendingRouteUpdateOn202Response) {

                // only update the route set if the dialog is not in the
                // confirmed state.
                if ((this.getState() != DialogState.CONFIRMED && this
                        .getState() != DialogState.TERMINATED)
                        || this.pendingRouteUpdateOn202Response) {
                    RecordRouteList rrlist = sipResponse
                            .getRecordRouteHeaders();
                    // Add the route set from the incoming response in reverse
                    // order for record route headers.
                    if (rrlist != null) {
                        this.addRoute(rrlist);
                    } else {
                        // Set the rotue list to the last seen route list.
                        this.routeList = new RouteList();
                    }
                }

                ContactList contactList = sipResponse.getContactHeaders();
                if (contactList != null) {
                    this
                            .setRemoteTarget((ContactHeader) contactList
                                    .getFirst());
                }
            }

        } finally {
View Full Code Here

Examples of gov.nist.javax.sip.header.ContactList

            this.routeList = new RouteList();
        }

        // put the contact header from the incoming request into
        // the route set. JvB: some duplication here, ref. doTargetRefresh
        ContactList contactList = sipRequest.getContactHeaders();
        if (contactList != null) {
            this.setRemoteTarget((ContactHeader) contactList.getFirst());
        }
    }
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.