| | |
| | | |
| | | import org.opends.server.api.Backend; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines a Directory Server cache entry, which is simply |
| | | * used to store an entry with its associated backend and entry ID. |
| | |
| | | public final class CacheEntry |
| | | { |
| | | /** The backend with which this cache entry is associated. */ |
| | | private Backend<?> backend; |
| | | private final Backend<?> backend; |
| | | |
| | | /** The entry itself. */ |
| | | private Entry entry; |
| | | private final Entry entry; |
| | | |
| | | /** The entry ID for the entry within the backend. */ |
| | | private long entryID; |
| | | |
| | | |
| | | private final long entryID; |
| | | |
| | | /** |
| | | * Creates a new cache entry with the provided information. |
| | |
| | | this.entryID = entryID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the entry for this cache entry. |
| | | * |
| | |
| | | return entry; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Specifies the entry for this cache entry. |
| | | * |
| | | * @param entry The entry for this cache entry. |
| | | */ |
| | | public void setEntry(Entry entry) |
| | | { |
| | | this.entry = entry; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the backend for this cache entry. |
| | | * |
| | | * @return The backend for this cache entry. |
| | | */ |
| | | public Backend getBackend() |
| | | public Backend<?> getBackend() |
| | | { |
| | | return backend; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Specifies the backend for this cache entry. |
| | | * |
| | | * @param backend The backend for this cache entry. |
| | | */ |
| | | public void setBackend(Backend backend) |
| | | { |
| | | this.backend = backend; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the entry ID for this cache entry. |
| | | * |
| | |
| | | return entryID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Specifies the entry ID for this cache entry. |
| | | * |
| | | * @param entryID The entryID for this cache entry. |
| | | */ |
| | | public void setEntryID(long entryID) |
| | | { |
| | | this.entryID = entryID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the DN for this cache entry. |
| | | * |
| | |
| | | return entry.getName(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the hash code for this cache entry. It will be the |
| | | * integer representation of the entry ID. |
| | | * |
| | | * @return The hash code for this cache entry. |
| | | */ |
| | | @Override |
| | | public int hashCode() |
| | | { |
| | | return (int) entryID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether this cache entry is equal to the provided \ |
| | | * object. They will be considered equal if the provided object is |
| | |
| | | * @return <CODE>true</CODE> if the provided object is equal to |
| | | * this cache entry, or <CODE>false</CODE> if not. |
| | | */ |
| | | @Override |
| | | public boolean equals(Object o) |
| | | { |
| | | if (o == null) |