123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- import java.util.HashMap;
- import java.util.Set;
- import java.util.Vector;
- import com.cognos.CAM_AAA.authentication.ICredential;
- @SuppressWarnings("rawtypes")
- public class Credential implements ICredential
- {
-
- public Credential()
- {
- super();
- credentials = null;
- }
-
- public String[] getCredentialNames()
- {
- if (credentials != null)
- {
- Set keySet = credentials.keySet();
- String[] array = new String[keySet.size()];
- return (String[]) keySet.toArray(array);
- }
- return null;
- }
-
- public void addCredentialValue(String theName, String theValue)
- {
- if (credentials == null)
- {
- credentials = new HashMap();
- }
- Vector v = (Vector) this.credentials.get(theName);
- if (v == null)
- {
- v = new Vector();
- this.credentials.put(theName, v);
- }
- v.add(theValue);
- }
-
- public String[] getCredentialValue(String theName)
- {
- if (credentials != null)
- {
- Vector v = (Vector) this.credentials.get(theName);
- if (v != null)
- {
- return (String[]) v.toArray(new String[v.size()]);
- }
- }
- return null;
- }
- private HashMap credentials;
- }
|