userservicestag.java

来自「First of all, the Applet-phone is a SIP 」· Java 代码 · 共 120 行

JAVA
120
字号
/* * UserServicesTag.java * * Created on July 31, 2003, 11:14 AM */package gov.nist.struts.webapp.upload;/** * Class representing a user in a xml mapping file * All services of the users are stored in a xml mapping file * if the server is shutdown we can retrieve easily  * all the services and their state. * @author  DERUELLE Jean */public class UserServicesTag {    /**the user name of the user*/    private String userName=null;    /**the password of the user*/    private String password=null;    /**the sip URI with which the services of the user will register with our stateless proxy*/    private String uri=null;    /**all the services of the user**/    private java.util.Vector services=null;        /** Creates a new instance of UserServicesTag */    public UserServicesTag() {        if(services==null)            services=new java.util.Vector();    }        /** Creates a new instance of UserServicesTag      * @param userName - the user name of the user     * @param password - the password of the user     * @param uri - the sip URI with which the services of the user will register with our stateless proxy     * @param services - all the services of the user     */    public UserServicesTag(String userName,String password,String uri,java.util.Vector services) {        this.userName=userName;        this.password=password;        this.uri=uri;        this.services=services;        if(this.services==null)            this.services=new java.util.Vector();    }        /**     * Retrieve the user name of the user     * @return the user name of the user     */    public String getUserName() {        return userName;    }    /**     * Set the user name of the user     * @param userName - the user name of the user     */    public void setUserName(String userName) {        this.userName=userName;    }    /**     * Retrieve the password of the user     * @return the password of the user     */    public String getPassword() {        return password;    }    /**     * Set the password of the user     * @param password - the password of the user     */    public void setPassword(String password) {        this.password=password;    }    /**     * Retrieve all the services of the user     * @return all the services of the user     */    public java.util.Vector getServices() {        return services;    }    /**     * Set all the services of the user     * @param services - all the services of the user     */    public void setServices(java.util.Vector services) {        this.services=services;    }    /**     * Set the sip URI with which the services of the user will register with our stateless proxy     * @param uri - the sip URI with which the services of the user will register with our stateless proxy     */    public void setUri(String uri) {        this.uri=uri;    }    /**     * Retrieve the sip URI with which the services of the user will register with our stateless proxy     * @return the sip URI with which the services of the user will register with our stateless proxy     */    public String getUri() {        return uri;    }    /**     * Get XML String representation of the user     * @return the XML String representation of the user     */    public String toXMLString(){        String content="<user name=\""+userName+                "\" password=\""+password+                "\" uri=\""+uri+"\" >\n";        content+="<services>\n";        for(int i=0;i<services.size();i++){            content+=((ServiceTag)services.elementAt(i)).toXMLString()+"\n";        }                            content+="</services>\n";        content+="</user>";        return content;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?