Examples of Privacy


Examples of gov.nist.javax.sip.header.ims.Privacy

      this.headerName(TokenTypes.PRIVACY);
     
      while (lexer.lookAhead(0) != '\n') {
        this.lexer.SPorHT();
       
        Privacy privacy = new Privacy();
        privacy.setHeaderName(SIPHeaderNamesIms.PRIVACY);

        this.lexer.match(TokenTypes.ID);
        Token token = lexer.getNextToken();
        privacy.setPrivacy(token.getTokenValue());
        this.lexer.SPorHT();
        privacyList.add(privacy);
       
        // Parsing others option-tags
        while (lexer.lookAhead(0) == ';')
        {
          this.lexer.match(';');
          this.lexer.SPorHT();
          privacy = new Privacy();
          this.lexer.match(TokenTypes.ID);
          token = lexer.getNextToken();
          privacy.setPrivacy(token.getTokenValue());
          this.lexer.SPorHT();

          privacyList.add(privacy);
        }
      }
View Full Code Here

Examples of gov.nist.javax.sip.header.ims.Privacy

            this.headerName(TokenTypes.PRIVACY);

            while (lexer.lookAhead(0) != '\n') {
                this.lexer.SPorHT();

                Privacy privacy = new Privacy();
                privacy.setHeaderName(SIPHeaderNamesIms.PRIVACY);

                this.lexer.match(TokenTypes.ID);
                Token token = lexer.getNextToken();
                privacy.setPrivacy(token.getTokenValue());
                this.lexer.SPorHT();
                privacyList.add(privacy);

                // Parsing others option-tags
                while (lexer.lookAhead(0) == ';')
                {
                    this.lexer.match(';');
                    this.lexer.SPorHT();
                    privacy = new Privacy();
                    this.lexer.match(TokenTypes.ID);
                    token = lexer.getNextToken();
                    privacy.setPrivacy(token.getTokenValue());
                    this.lexer.SPorHT();

                    privacyList.add(privacy);
                }
            }
View Full Code Here

Examples of org.jivesoftware.smack.packet.Privacy

                if (packet == null || packet.getError() != null) {
                    return;
                }
                // The packet is correct.
                Privacy privacy = (Privacy) packet;
               
                // Notifies the event to the listeners.
                synchronized (listeners) {
                    for (PrivacyListListener listener : listeners) {
                        // Notifies the created or updated privacy lists
                        for (Map.Entry<String,List<PrivacyItem>> entry : privacy.getItemLists().entrySet()) {
                            String listName = entry.getKey();
                            List<PrivacyItem> items = entry.getValue();
                            if (items.isEmpty()) {
                                listener.updatedPrivacyList(listName);
                            } else {
View Full Code Here

Examples of org.jivesoftware.smack.packet.Privacy

       
        // Send create & join packet.
        connection.sendPacket(requestPrivacy);
       
        // Wait up to a certain number of seconds for a reply.
        Privacy privacyAnswer =
            (Privacy) response.nextResult(SmackConfiguration.getPacketReplyTimeout());
       
        // Stop queuing results
        response.cancel();

        // Interprete the result and answer the privacy only if it is valid
        if (privacyAnswer == null) {
            throw new XMPPException("No response from server.");
        }
        else if (privacyAnswer.getError() != null) {
            throw new XMPPException(privacyAnswer.getError());
        }
        return privacyAnswer;
  }
View Full Code Here

Examples of org.jivesoftware.smack.packet.Privacy

     * @throws XMPPException if an error occurs.
   */
  private Privacy getPrivacyWithListNames() throws XMPPException {
   
    // The request of the list is an empty privacy message
    Privacy request = new Privacy();
   
    // Send the package to the server and get the answer
    return getRequest(request);
  }
View Full Code Here

Examples of org.jivesoftware.smack.packet.Privacy

     *
     * @return the privacy list of the active list.
     * @throws XMPPException if an error occurs.
     */
    public PrivacyList getActiveList() throws XMPPException {
        Privacy privacyAnswer = this.getPrivacyWithListNames();
        String listName = privacyAnswer.getActiveName();
        boolean isDefaultAndActive = privacyAnswer.getActiveName() != null
                && privacyAnswer.getDefaultName() != null
                && privacyAnswer.getActiveName().equals(
                privacyAnswer.getDefaultName());
        return new PrivacyList(true, isDefaultAndActive, listName, getPrivacyListItems(listName));
    }
View Full Code Here

Examples of org.jivesoftware.smack.packet.Privacy

     *
     * @return the privacy list of the default list.
     * @throws XMPPException if an error occurs.
     */
    public PrivacyList getDefaultList() throws XMPPException {
        Privacy privacyAnswer = this.getPrivacyWithListNames();
        String listName = privacyAnswer.getDefaultName();
        boolean isDefaultAndActive = privacyAnswer.getActiveName() != null
                && privacyAnswer.getDefaultName() != null
                && privacyAnswer.getActiveName().equals(
                privacyAnswer.getDefaultName());
        return new PrivacyList(isDefaultAndActive, true, listName, getPrivacyListItems(listName));
    }
View Full Code Here

Examples of org.jivesoftware.smack.packet.Privacy

     * @throws XMPPException if an error occurs.
     */
    private List<PrivacyItem> getPrivacyListItems(String listName) throws XMPPException {
       
        // The request of the list is an privacy message with an empty list
        Privacy request = new Privacy();
        request.setPrivacyList(listName, new ArrayList<PrivacyItem>());
       
        // Send the package to the server and get the answer
        Privacy privacyAnswer = getRequest(request);
       
        return privacyAnswer.getPrivacyList(listName);
    }
View Full Code Here

Examples of org.jivesoftware.smack.packet.Privacy

     *
     * @return an array of privacy lists.
     * @throws XMPPException if an error occurs.
     */
    public PrivacyList[] getPrivacyLists() throws XMPPException {
        Privacy privacyAnswer = this.getPrivacyWithListNames();
        Set<String> names = privacyAnswer.getPrivacyListNames();
        PrivacyList[] lists = new PrivacyList[names.size()];
        boolean isActiveList;
        boolean isDefaultList;
        int index=0;
        for (String listName : names) {
            isActiveList = listName.equals(privacyAnswer.getActiveName());
            isDefaultList = listName.equals(privacyAnswer.getDefaultName());
            lists[index] = new PrivacyList(isActiveList, isDefaultList,
                    listName, getPrivacyListItems(listName));
            index = index + 1;
        }
        return lists;
View Full Code Here

Examples of org.jivesoftware.smack.packet.Privacy

   * @exception XMPPException if the request or the answer failed, it raises an exception.
   */
  public void setActiveListName(String listName) throws XMPPException {
   
    // The request of the list is an privacy message with an empty list
    Privacy request = new Privacy();
    request.setActiveName(listName);
   
    // Send the package to the server
    setRequest(request);
  }
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.