|
|||||||||||||||||||
| 30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| AbstractAuthentication.java | - | 0% | 0% | 0% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* ========================================================================
|
|
| 3 |
*
|
|
| 4 |
* Copyright 2001-2004 The Apache Software Foundation.
|
|
| 5 |
*
|
|
| 6 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
| 7 |
* you may not use this file except in compliance with the License.
|
|
| 8 |
* You may obtain a copy of the License at
|
|
| 9 |
*
|
|
| 10 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
| 11 |
*
|
|
| 12 |
* Unless required by applicable law or agreed to in writing, software
|
|
| 13 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
| 14 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
| 15 |
* See the License for the specific language governing permissions and
|
|
| 16 |
* limitations under the License.
|
|
| 17 |
*
|
|
| 18 |
* ========================================================================
|
|
| 19 |
*/
|
|
| 20 |
package org.apache.cactus.client.authentication;
|
|
| 21 |
|
|
| 22 |
/**
|
|
| 23 |
* This class was designed with the simple assumption that ALL authentication
|
|
| 24 |
* implementations will have a String <code>Name</code> and a String
|
|
| 25 |
* <code>Password</code>. Two abstract functions <code>validateName</code> and
|
|
| 26 |
* <code>validatePassword</code> provide for concrete implementations to
|
|
| 27 |
* perform character validation. All the work is then done in the
|
|
| 28 |
* <code>configure</code> abstract function. In the
|
|
| 29 |
* <code>BasicAuthentication</code> class, for example, the configuring is done
|
|
| 30 |
* by adding the request property "Authorization" with a value
|
|
| 31 |
* "Basic <base64encode of 'userid:password'>".
|
|
| 32 |
*
|
|
| 33 |
* @since 1.3
|
|
| 34 |
*
|
|
| 35 |
* @version $Id: AbstractAuthentication.java 238991 2004-05-22 11:34:50Z vmassol $
|
|
| 36 |
*/
|
|
| 37 |
public abstract class AbstractAuthentication implements Authentication |
|
| 38 |
{
|
|
| 39 |
/**
|
|
| 40 |
* User name part of the Credential
|
|
| 41 |
*/
|
|
| 42 |
private String name;
|
|
| 43 |
|
|
| 44 |
/**
|
|
| 45 |
* Password part of the Credential
|
|
| 46 |
*/
|
|
| 47 |
private String password;
|
|
| 48 |
|
|
| 49 |
/**
|
|
| 50 |
* @param theName user name of the Credential
|
|
| 51 |
* @param thePassword user password of the Credential
|
|
| 52 |
*/
|
|
| 53 | 0 |
public AbstractAuthentication(String theName, String thePassword)
|
| 54 |
{
|
|
| 55 | 0 |
setName(theName); |
| 56 | 0 |
setPassword(thePassword); |
| 57 |
} |
|
| 58 |
|
|
| 59 |
/**
|
|
| 60 |
* Sets the user name.
|
|
| 61 |
*
|
|
| 62 |
* @param theName user name of the Credential
|
|
| 63 |
*/
|
|
| 64 | 0 |
public final void setName(String theName) |
| 65 |
{
|
|
| 66 | 0 |
this.name = theName;
|
| 67 |
} |
|
| 68 |
|
|
| 69 |
/**
|
|
| 70 |
* @return the user name of the Credential
|
|
| 71 |
*/
|
|
| 72 | 0 |
public final String getName()
|
| 73 |
{
|
|
| 74 | 0 |
return this.name; |
| 75 |
} |
|
| 76 |
|
|
| 77 |
/**
|
|
| 78 |
* Sets the user password of the Credential.
|
|
| 79 |
*
|
|
| 80 |
* @param thePassword the user password of the Credential
|
|
| 81 |
*/
|
|
| 82 | 0 |
public final void setPassword(String thePassword) |
| 83 |
{
|
|
| 84 | 0 |
this.password = thePassword;
|
| 85 |
} |
|
| 86 |
|
|
| 87 |
/**
|
|
| 88 |
* @return the user password of the Credential
|
|
| 89 |
*/
|
|
| 90 | 0 |
public final String getPassword()
|
| 91 |
{
|
|
| 92 | 0 |
return this.password; |
| 93 |
} |
|
| 94 |
} |
|
| 95 |
|
|
||||||||||