/* * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ package net.java.sip.communicator.plugin.jabberaccregwizz; import java.util.*; import net.java.sip.communicator.service.protocol.*; /** * The JabberAccountRegistration is used to store all user input data * through the JabberAccountRegistrationWizard. * * @author Yana Stamcheva */ public class JabberAccountRegistration { /** * The default value of server port for jabber accounts. */ public static final String DEFAULT_PORT = "5222"; /** * The default value of the priority property. */ public static final String DEFAULT_PRIORITY = "10"; /** * The default value of the resource property. */ public static final String DEFAULT_RESOURCE = "sip-comm"; /** * The default value of stun server port for jabber accounts. */ public static final String DEFAULT_STUN_PORT = "3478"; /** * The user identifier. */ private String userID; /** * The password. */ private String password; /** * Indicates if the password should be remembered. */ private boolean rememberPassword = true; /** * The server address. */ private String serverAddress; /** * The port. */ private int port = new Integer(DEFAULT_PORT).intValue(); /** * The resource property, initialized to the default resource. */ private String resource = DEFAULT_RESOURCE; /** * The priority property. */ private int priority = new Integer(DEFAULT_PRIORITY).intValue(); /** * Indicates if keep alive packets should be send. */ private boolean sendKeepAlive = true; /** * Indicates if gmail notifications should be enabled. */ private boolean enableGmailNotification = false; /** * Indicates if ICE should be used. */ private boolean isUseIce = false; /** * Indicates if STUN server should be automatically discovered. */ private boolean isAutoDiscoverStun = false; /** * Indicates if default STUN server should be used. */ private boolean isUseDefaultStunServer = false; /** * The list of additional STUN servers entered by user. */ private List additionalStunServers = new ArrayList(); /** * Indicates if JingleNodes relays should be used. */ private boolean isUseJingleNodes = false; /** * Indicates if JingleNodes relay server should be automatically discovered. */ private boolean isAutoDiscoverJingleNodes = false; /** * The list of additional JingleNodes (tracker or relay) entered by user. */ private List additionalJingleNodes = new ArrayList(); /** * Returns the password of the jabber registration account. * @return the password of the jabber registration account. */ public String getPassword() { return password; } /** * Sets the password of the jabber registration account. * @param password the password of the jabber registration account. */ public void setPassword(String password) { this.password = password; } /** * Returns TRUE if password has to remembered, FALSE otherwise. * @return TRUE if password has to remembered, FALSE otherwise */ public boolean isRememberPassword() { return rememberPassword; } /** * Sets the rememberPassword value of this jabber account registration. * @param rememberPassword TRUE if password has to remembered, FALSE * otherwise */ public void setRememberPassword(boolean rememberPassword) { this.rememberPassword = rememberPassword; } /** * Returns the User ID of the jabber registration account. * @return the User ID of the jabber registration account. */ public String getUserID() { return userID; } /** * The address of the server we will use for this account * @return String */ public String getServerAddress() { return serverAddress; } /** * The port on the specified server * @return int */ public int getPort() { return port; } /** * Determines whether sending of keep alive packets is enabled. * * @return true if keep alive packets are to be sent for this * account and false otherwise. */ public boolean isSendKeepAlive() { return sendKeepAlive; } /** * Determines whether SIP Communicator should be querying Gmail servers * for unread mail messages. * * @return true if we are to enable Gmail notifications and * false otherwise. */ public boolean isGmailNotificationEnabled() { return enableGmailNotification; } /** * Sets the User ID of the jabber registration account. * * @param userID the identifier of the jabber registration account. */ public void setUserID(String userID) { this.userID = userID; } /** * Sets the server * * @param serverAddress the IP address or FQDN of the server. */ public void setServerAddress(String serverAddress) { this.serverAddress = serverAddress; } /** * Sets the server port number. * * @param port the server port number */ public void setPort(int port) { this.port = port; } /** * Specifies whether SIP Communicator should send send keep alive packets * to keep this account registered. * * @param sendKeepAlive true if we are to send keep alive packets * and false otherwise. */ public void setSendKeepAlive(boolean sendKeepAlive) { this.sendKeepAlive = sendKeepAlive; } /** * Specifies whether SIP Communicator should be querying Gmail servers * for unread mail messages. * * @param enabled true if we are to enable Gmail notification and * false otherwise. */ public void setGmailNotificationEnabled(boolean enabled) { this.enableGmailNotification = enabled; } /** * Returns the resource. * @return the resource */ public String getResource() { return resource; } /** * Sets the resource. * @param resource the resource for the jabber account */ public void setResource(String resource) { this.resource = resource; } /** * Returns the priority property. * @return priority */ public int getPriority() { return priority; } /** * Sets the priority property. * @param priority the priority to set */ public void setPriority(int priority) { this.priority = priority; } /** * Indicates if ice should be used for this account. * @return true if ICE should be used for this account, otherwise * returns false */ public boolean isUseIce() { return isUseIce; } /** * Sets the useIce property. * @param isUseIce true to indicate that ICE should be used for * this account, false - otherwise. */ public void setUseIce(boolean isUseIce) { this.isUseIce = isUseIce; } /** * Indicates if the stun server should be automatically discovered. * @return true if the stun server should be automatically * discovered, otherwise returns false. */ public boolean isAutoDiscoverStun() { return isAutoDiscoverStun; } /** * Sets the autoDiscoverStun property. * @param isAutoDiscover true to indicate that stun server should * be auto-discovered, false - otherwise. */ public void setAutoDiscoverStun(boolean isAutoDiscover) { this.isAutoDiscoverStun = isAutoDiscover; } /** * Indicates if the stun server should be automatically discovered. * @return true if the stun server should be automatically * discovered, otherwise returns false. */ public boolean isUseDefaultStunServer() { return isUseDefaultStunServer; } /** * Sets the useDefaultStunServer property. * @param isUseDefaultStunServer true to indicate that default * stun server should be used if no others are available, false * otherwise. */ public void setUseDefaultStunServer(boolean isUseDefaultStunServer) { this.isUseDefaultStunServer = isUseDefaultStunServer; } /** * Adds the given stunServer to the list of additional stun servers. * * @param stunServer the StunServer to add */ public void addStunServer(StunServerDescriptor stunServer) { additionalStunServers.add(stunServer); } /** * Returns the List of all additional stun servers entered by the * user. The list is guaranteed not to be null. * * @return the List of all additional stun servers entered by the * user. */ public List getAdditionalStunServers() { return additionalStunServers; } /** * Sets the autoDiscoverJingleNodes property. * * @param isAutoDiscover true to indicate that relay server should * be auto-discovered, false - otherwise. */ public void setAutoDiscoverJingleNodes(boolean isAutoDiscover) { this.isAutoDiscoverJingleNodes = isAutoDiscover; } /** * Indicates if the JingleNodes relay server should be automatically * discovered. * * @return true if the relay server should be automatically * discovered, otherwise returns false. */ public boolean isAutoDiscoverJingleNodes() { return isAutoDiscoverJingleNodes; } /** * Sets the useJingleNodes/tt> property. * * @param isUseJingleNodes true to indicate that Jingle Nodes * should be used for this account, false - otherwise. */ public void setUseJingleNodes(boolean isUseJingleNodes) { this.isUseJingleNodes = isUseJingleNodes; } /** * Sets the useJingleNodes property. * * @param isUseJingleNodes true to indicate that JingleNodes relays * should be used for this account, false - otherwise. */ public void isUseJingleNodes(boolean isUseJingleNodes) { this.isUseJingleNodes = isUseJingleNodes; } /** * Indicates if JingleNodes relay should be used. * * @return true if JingleNodes should be used, false * otherwise */ public boolean isUseJingleNodes() { return isUseJingleNodes; } /** * Adds the given node to the list of additional JingleNodes. * * @param node the node to add */ public void addJingleNodes(JingleNodeDescriptor node) { additionalJingleNodes.add(node); } /** * Returns the List of all additional stun servers entered by the * user. The list is guaranteed not to be null. * * @return the List of all additional stun servers entered by the * user. */ public List getAdditionalJingleNodes() { return additionalJingleNodes; } }