org.eclipse.ecf.storage
Interface IIDEntry


public interface IIDEntry

Representation of an ID instance inside of an IIDStore.


Method Summary
 ID createID()
          Create an ID from this IDEntry.
 void delete()
          Delete this IIDEntry from the IIDStore.
 IIDEntry[] getAssociates(java.lang.String key)
          Get any IIDEntrys that have previously been associated with this IIDEntry via putAssociate(java.lang.String,IIDEntry,boolean).
 org.eclipse.equinox.security.storage.ISecurePreferences getPreferences()
          Get the underlying ISecurePreferences node that represents this IDEntry in the storage.
 void putAssociate(java.lang.String key, IIDEntry entry, boolean encrypt)
          Associate an IIDEntry instance with a String key in this IIDEntry.
 

Method Detail

getPreferences

org.eclipse.equinox.security.storage.ISecurePreferences getPreferences()
Get the underlying ISecurePreferences node that represents this IDEntry in the storage.

Returns:
ISecurePreferences that represents this IIDEntry in the underlying storage. Will not return null.

createID

ID createID()
            throws IDCreateException
Create an ID from this IDEntry. This method may be used to create new ID instance from this IIDEntry. The created ID will be equivalent (via ID.equals(other)) to the ID previously stored via IIDStore.store(ID).

Returns:
ID that corresponds to this previously stored IIDEntry.
Throws:
IDCreateException - if the ID cannot be created in this environment...e.g. due to missing Namespace.

getAssociates

IIDEntry[] getAssociates(java.lang.String key)
Get any IIDEntrys that have previously been associated with this IIDEntry via putAssociate(java.lang.String,IIDEntry,boolean).

Parameters:
key - the String key for retrieving associates. Must not be null.
Returns:
IIDEntry[] of associated IIDEntry instances that have previously been successfully stored via putAssociate(java.lang.String,IIDEntry,boolean). If no IIDEntries have been previously stored with the given key, an empty array will be returned. Will not return null. Note that the order of the returned IIDEntrys will not necessarily correspond to the order added via putAssociate(String, IIDEntry, boolean).

putAssociate

void putAssociate(java.lang.String key,
                  IIDEntry entry,
                  boolean encrypt)
                  throws IDStoreException
Associate an IIDEntry instance with a String key in this IIDEntry. The association is one-way (i.e. if successful, future calls to this getAssociates(java.lang.String) with the same key will include the new entry.

Parameters:
key - the String key for storing associates. Must not be null..
entry - the IIDEntry to associated with this IIDEntry. Must not be null.
encrypt - if true associate IIDEntry will be encrypted, false and it will not be encrypted.
Throws:
IDStoreException - thrown if the given IIDEntry cannot be stored.

delete

void delete()
Delete this IIDEntry from the IIDStore. This will not delete any associated IIDEntrys. It is up to the client to explicitly remove any such associated entries.