001: /*
002: * Portions Copyright 2000-2007 Sun Microsystems, Inc. All Rights
003: * Reserved. Use is subject to license terms.
004: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License version
008: * 2 only, as published by the Free Software Foundation.
009: *
010: * This program is distributed in the hope that it will be useful, but
011: * WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * General Public License version 2 for more details (a copy is
014: * included at /legal/license.txt).
015: *
016: * You should have received a copy of the GNU General Public License
017: * version 2 along with this work; if not, write to the Free Software
018: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019: * 02110-1301 USA
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
022: * Clara, CA 95054 or visit www.sun.com if you need additional
023: * information or have any questions.
024: */
025: /*
026: * Credential.java
027: *
028: * Created on Feb 2, 2004
029: *
030: */
031: package gov.nist.siplite.stack.authentication;
032:
033: /**
034: * Authentication credentials.
035: *
036: * <a href="{@docRoot}/uncopyright.html">This code is in the public domain.</a>
037: */
038: public class Credentials {
039: /** User name. */
040: private String userName = null;
041: /** Password. */
042: private String password = null;
043: /** Realm. */
044: private String realm = null;
045:
046: /**
047: * Creates a new Credential composed of a username password and realm
048: * for later user by the API when a 401 or 407 Message will be received
049: * @param userName - the user name
050: * @param password - the password
051: * @param realm - the realm
052: */
053: public Credentials(String userName, String password, String realm) {
054: this .userName = userName;
055: this .password = password;
056: this .realm = realm;
057: }
058:
059: /**
060: * Gets the user name for this credential
061: * @return the user name for this credential
062: */
063: public String getUserName() {
064: return userName;
065: }
066:
067: /**
068: * Sets the user name for this credential
069: * @param userName - the user name for this credential
070: */
071: public void setUserName(String userName) {
072: this .userName = userName;
073: }
074:
075: /**
076: * Gets the password for this credential
077: * @return the password for this credential
078: */
079: public String getPassword() {
080: return password;
081: }
082:
083: /**
084: * Sets the password for this credential
085: * @param password - the password for this credential
086: */
087: public void setPassword(String password) {
088: this .password = password;
089: }
090:
091: /**
092: * Gets the realm for this credential
093: * @return the realm for this credential
094: */
095: public String getRealm() {
096: return realm;
097: }
098:
099: /**
100: * Sets the realm for this credential
101: * @param realm - the realm for this credential
102: */
103: public void setRealm(String realm) {
104: this.realm = realm;
105: }
106: }
|