class Registration extends Object implements ServiceRegistration, ReferentUuid, Serializable
| Modifier and Type | Field and Description |
|---|---|
(package private) ServiceLease |
lease
The service lease
|
private static long |
serialVersionUID |
(package private) Registrar |
server
The registrar
|
| Constructor and Description |
|---|
Registration(Registrar server,
ServiceLease lease)
Constructor for use by getInstance(), ConstrainableRegistration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributes(Entry[] attrSets)
Adds the specified attribute sets (those that aren't duplicates of
existing attribute sets) to the registered service item.
|
boolean |
equals(Object obj)
Returns true if registration Uuids match, false otherwise.
|
(package private) static Registration |
getInstance(Registrar server,
ServiceLease lease)
Returns Registration or ConstrainableRegistration instance, depending on
whether given server implements RemoteMethodControl.
|
Lease |
getLease()
Returns the lease that controls the service registration, allowing
the lease to be renewed or cancelled.
|
Uuid |
getReferentUuid()
Return the
Uuid that has been assigned to the
resource this proxy represents. |
ServiceID |
getServiceID()
Returns the service ID for this service.
|
int |
hashCode()
Returns the registration Uuid's hash code.
|
void |
modifyAttributes(Entry[] attrSetTmpls,
Entry[] attrSets)
Modifies existing attribute sets.
|
private void |
readObject(ObjectInputStream in)
Verifies that member fields are non-null.
|
private void |
readObjectNoData()
Throws InvalidObjectException, since data for this class is required.
|
void |
setAttributes(Entry[] attrSets)
Deletes all of the service item's existing attributes, and replaces
them with the specified attribute sets.
|
String |
toString()
Returns a string created from the proxy class name and the result
of calling toString on the contained lease.
|
private static final long serialVersionUID
final Registrar server
final ServiceLease lease
Registration(Registrar server, ServiceLease lease)
static Registration getInstance(Registrar server, ServiceLease lease)
public ServiceID getServiceID()
ServiceRegistrationgetServiceID in interface ServiceRegistrationpublic Lease getLease()
ServiceRegistrationgetLease in interface ServiceRegistrationpublic void addAttributes(Entry[] attrSets) throws UnknownLeaseException, RemoteException
ServiceRegistrationaddAttributes in interface ServiceRegistrationattrSets - attribute sets to addUnknownLeaseException - the registration lease has expired
or been cancelled.RemoteExceptionpublic void modifyAttributes(Entry[] attrSetTmpls, Entry[] attrSets) throws UnknownLeaseException, RemoteException
ServiceRegistrationNote that it is possible to use modifyAttributes in ways that are not idempotent. The attribute schema should be designed in such a way that all intended uses of this method can be performed in an idempotent fashion. Also note that modifyAttributes does not provide a means for setting a field to null; it is assumed that the attribute schema is designed in such a way that this is not necessary.
modifyAttributes in interface ServiceRegistrationattrSetTmpls - attribute set templates to matchattrSets - modifications to make to matching attribute setsUnknownLeaseException - the registration lease has expired
or been cancelledRemoteExceptionpublic void setAttributes(Entry[] attrSets) throws UnknownLeaseException, RemoteException
ServiceRegistrationsetAttributes in interface ServiceRegistrationattrSets - attribute sets to useUnknownLeaseException - the registration lease has expired
or been cancelledRemoteExceptionpublic Uuid getReferentUuid()
ReferentUuidUuid that has been assigned to the
resource this proxy represents.getReferentUuid in interface ReferentUuidUuid associated with the
resource this proxy represents. Will not
return null.public int hashCode()
public boolean equals(Object obj)
public String toString()
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionprivate void readObjectNoData()
throws ObjectStreamException
ObjectStreamExceptionCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.