com.bea.p13n.security.management.credentials
Class MemoryCredentialEntry

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<String,String>
          extended by com.bea.p13n.security.management.credentials.MemoryCredentialEntry
All Implemented Interfaces
CredentialEntry, Serializable, Cloneable, Map<String,String>

public class MemoryCredentialEntry
extends Hashtable<String,String>
implements CredentialEntry

This class is an in-memory-persistence of a credential entry. It should be served as base class of other persistence implementation

See Also
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.bea.p13n.security.management.credentials.CredentialEntry
CredentialEntry.EntryType
 
Constructor Summary
protected MemoryCredentialEntry(String entryName, CredentialEntry.EntryType type, Scope scope, String description, String bindingResourceId, String owner)
          Construct a credential entry to be persisted to storage
 
Method Summary
 boolean equals(Object o)
           
 String getAttribute(String name)
          Get named credential metadata value
 Map<String,String> getAttributes()
          Get a copy of all credential metadata
 Credential getCredential()
          Get credential
 String getDescription()
          Get optional description
 String getName()
          Get entry name
 String getOwnerName()
           
 Scope getScope()
          Get visibility scope of the credential entry
 CredentialEntry.EntryType getType()
          Get binding type of this entry
 int hashCode()
           
 void removeAttribute(String name)
          Remove named credential metadata
 void setAttribute(String name, String value)
          Set a credential metadata If value is null, it equals to removeAttribute(String)
 void setCredential(Credential c)
          Set credential into this entry
 void setDescription(String newDescription)
          Set a new description
 String toString()
           
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, get, isEmpty, keys, keySet, put, putAll, rehash, remove, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MemoryCredentialEntry

protected MemoryCredentialEntry(String entryName,
                                CredentialEntry.EntryType type,
                                Scope scope,
                                String description,
                                String bindingResourceId,
                                String owner)
Construct a credential entry to be persisted to storage

Parameters
entryName - the name of the entry
type - a predeinfed EntryType
scope - visibility of the entry to create
description - optional description of the entry
bindingResourceId - resource name bind to the entry
owner - the name of the user who created the entry
Method Detail

getName

public String getName()
Get entry name

Specified by:
getName in interface CredentialEntry
Returns
entry name

getType

public CredentialEntry.EntryType getType()
Get binding type of this entry

Specified by:
getType in interface CredentialEntry
Returns
a predefined binding type

getScope

public Scope getScope()
Get visibility scope of the credential entry

Specified by:
getScope in interface CredentialEntry
Returns
visibility scope of the entry

getDescription

public String getDescription()
Get optional description

Specified by:
getDescription in interface CredentialEntry
Returns
description of the entry or null if not set

setDescription

public void setDescription(String newDescription)
Set a new description

Specified by:
setDescription in interface CredentialEntry
Parameters
newDescription - a new description

getCredential

public Credential getCredential()
Get credential

Specified by:
getCredential in interface CredentialEntry
Returns
the credential in this entry, null if not set.

setCredential

public void setCredential(Credential c)
Set credential into this entry

Specified by:
setCredential in interface CredentialEntry
Parameters
c - credential to be set

getAttribute

public String getAttribute(String name)
Get named credential metadata value

Specified by:
getAttribute in interface CredentialEntry
Parameters
name - the name of credential metadata
Returns
the value of named credential metadata. If named medata is not been set, null is return.

setAttribute

public void setAttribute(String name,
                         String value)
Set a credential metadata If value is null, it equals to removeAttribute(String)

Specified by:
setAttribute in interface CredentialEntry
Parameters
name - the name of credential metadata
value - the value of credential metadata

removeAttribute

public void removeAttribute(String name)
Remove named credential metadata

Specified by:
removeAttribute in interface CredentialEntry
Parameters
name - the name of credential metadata to be remove

getAttributes

public Map<String,String> getAttributes()
Get a copy of all credential metadata

NOTE: The returned map is a shallow copy of all metadata. Using Map.put() on returned object only change value locally. It has no effect as setAttribute(String, String) does.

Specified by:
getAttributes in interface CredentialEntry
Returns
a Properties object contains all copies of credential metadata

getOwnerName

public String getOwnerName()

equals

public boolean equals(Object o)
Specified by:
equals in interface Map<String,String>
Overrides:
equals in class Hashtable<String,String>

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<String,String>
Overrides:
hashCode in class Hashtable<String,String>

toString

public String toString()
Overrides:
toString in class Hashtable<String,String>


Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.