view src/org/dancres/blitz/notify/SpaceNotifyUID.java @ 23:b7e52953b7a6

Add some cache/memory statistics to help spot potential exhaustion and other tuning issues.
author Dan Creswell <dan.creswell@gmail.com>
date Fri, 28 Aug 2009 17:23:33 +0100
parents 3dc0c5604566
children
line wrap: on
line source

package org.dancres.blitz.notify;

import org.dancres.blitz.oid.OID;

import org.dancres.blitz.lease.SpaceUID;

/**
   Opaque space-level unique identifier for an Notify. <P>

   This will be the cookie we place inside a lease.  We should make this
   cookie responsible for doing a renew.  i.e. put the renew code in here. <P>
 */
final class SpaceNotifyUID implements SpaceUID {
    private OID theOID;

    SpaceNotifyUID(OID aOID) {
        theOID = aOID;
    }

    public boolean equals(Object anObject) {
        if (anObject instanceof SpaceNotifyUID) {
            SpaceNotifyUID myUID = (SpaceNotifyUID) anObject;

            return (theOID.equals(myUID.theOID));
        }

        return false;
    }

    OID getOID() {
        return theOID;
    }

    public int hashCode() {
        return theOID.hashCode();
    }

    public String toString() {
        return "N" + theOID;
    }
}