You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by di...@apache.org on 2004/08/11 14:39:33 UTC

cvs commit: ws-fx/wss4j/src/org/apache/ws/security/message WSSAddUsernameToken.java

dims        2004/08/11 05:39:33

  Modified:    wss4j/src/org/apache/ws/security/message
                        WSSAddUsernameToken.java
  Log:
  enhance WSSAddUsernameToken to allow specifying id's.
  
  Revision  Changes    Path
  1.8       +22 -1     ws-fx/wss4j/src/org/apache/ws/security/message/WSSAddUsernameToken.java
  
  Index: WSSAddUsernameToken.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/security/message/WSSAddUsernameToken.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WSSAddUsernameToken.java	9 Aug 2004 17:53:45 -0000	1.7
  +++ WSSAddUsernameToken.java	11 Aug 2004 12:39:33 -0000	1.8
  @@ -38,7 +38,8 @@
       private String passwordType = WSConstants.PASSWORD_DIGEST;
   
       private UsernameToken ut = null;
  -
  +    private String id = null;
  +    
       /**
        * Constructor.
        */
  @@ -109,6 +110,24 @@
       }
   
       /**
  +     * set the id
  +     * @param id
  +     */ 
  +    public void setId(String id) {
  +        this.id = id;
  +        if (ut != null)
  +            ut.setID(id);
  +    }
  +
  +    /**
  +     * get the id
  +     * @return
  +     */ 
  +    public String getId() {
  +        return id;
  +    }
  +
  +    /**
        * Adds a new <code>UsernameToken</code> to a soap envelope.
        * <p/>
        * A complete <code>UsernameToken</code> is constructed and added to
  @@ -125,6 +144,8 @@
           ut = new UsernameToken(wssConfig, doc, passwordType);
           ut.setName(username);
           ut.setPassword(password);
  +        if (id != null)
  +            ut.setID(id);
           WSSecurityUtil.prependChildElement(doc, securityHeader, ut.getElement(), true);
           return doc;
       }