static final class FiddlerRegistration.ConstrainableFiddlerRegistration extends FiddlerRegistration implements RemoteMethodControl
FiddlerRegistration
.
When a client obtains an instance of this proxy class, the client
should not attempt to use the proxy until the client is assured
that the proxy can be trusted. In addition to implementing the
methods and mechanisms required by RemoteMethodControl
,
this class - in conjunction with the service's
ProxyVerifier
class, helps provide a mechanism
for verifying trust in the proxy on behalf of a client.
In order to verify that an instance of this class is trusted,
trust must be verified in all subsidiary objects (contained in that
instance) through which the client ultimately makes calls (local or
remote). With respect to this class, the server
field
(which will be referred to as 'server1' for this description) is
a proxy object through which the client makes remote calls to the
service's backend. Therefore, trust in that object must be
verified.
In addition to server1, this class also contains a field of
type Uuid
(registrationID
), and a
field of type EventRegistration
(the field
eventReg
). Therefore, as with server1, trust must
also be verified in each of these objects.
As indicated by the pattern described above, in order to verify
trust in the subsidiary objects of this class, trust must also be
verified in any subsidiary objects those objects themselves
contain; and so on, until all subsidiary objects have been
exhausted. The eventReg
field contains such subsidiary
objects that also contain subsidiary objects, each requiring
verification. Those subsidiary objects are: a field of type
ConstrainableFiddlerProxy
(named source
),
and a field of type ConstrainableFiddlerLease
(the field named lease
, referred to below as 'lease1').
As with this class, the source
field of
eventReg
is also an "outer proxy" to the service's
backend, and thus also contains an (inner) proxy object (referred
to below as 'server2') through which remote calls are made to the
service's backend; thus, server2 must be verified. And since
the lease
field of eventReg
also contains
an (inner) proxy object ('server3'), that subsidiary object must
be verified as well.
The description above is summarized in the following diagram:
FiddlerRegistration { Fiddler server1 Uuid registrationID EventRegistration eventReg { ConstrainableFiddlerProxy source { Fiddler server2 }//end source ConstrainableFiddlerLease lease { Fiddler server3 }//end lease }//end eventReg }//end FiddlerRegistration
Thus, in order to verify that an instance of this class is trusted, trust must be verified in the following objects from the diagram above:
readObject
method of this class, as well
as the readObject
method for each subsidiary object,
as the mechanism "walks" through the serialization graph. For
each object that must be verified, part of that trust verification
process is performed in the various readObject
methods,
and the remaining part is performed when the client prepares
the proxy. This class' participation in the trust verification
process can be summarized as follows:
FiddlerRegistration.ConstrainableFiddlerRegistration
Modifier and Type | Field and Description |
---|---|
private MethodConstraints |
methodConstraints
Client constraints placed on this proxy (may be
null ). |
private static Method[] |
methodMapArray |
(package private) static long |
serialVersionUID |
eventReg, registrationID, server
Modifier | Constructor and Description |
---|---|
private |
FiddlerRegistration.ConstrainableFiddlerRegistration(Fiddler server,
Uuid registrationID,
EventRegistration eventReg,
MethodConstraints methodConstraints)
Constructs a new
ConstrainableFiddlerRegistration
instance. |
Modifier and Type | Method and Description |
---|---|
private static Fiddler |
constrainServer(Fiddler server,
MethodConstraints constraints)
Returns a copy of the given server proxy having the client method
constraints that result after the specified method mapping is
applied to the given client method constraints.
|
MethodConstraints |
getConstraints()
Returns the client constraints placed on the current instance of
this proxy class (
ConstrainableFiddlerRegistration ). |
private ProxyTrustIterator |
getProxyTrustIterator()
Returns a proxy trust iterator that is used in
ProxyTrustVerifier to retrieve this object's
trust verifier. |
private void |
readObject(ObjectInputStream s)
Performs various functions related to the trust verification
process for the current instance of this proxy class, as
detailed in the description for this class.
|
RemoteMethodControl |
setConstraints(MethodConstraints constraints)
Returns a new copy of this proxy class
(
ConstrainableFiddlerRegistration ) with its client
constraints set to the specified constraints. |
addGroups, addLocators, createRegistration, discard, equals, getEventRegistration, getGroups, getLease, getLocators, getReferentUuid, getRegistrars, hashCode, removeGroups, removeLocators, setGroups, setLocators
static final long serialVersionUID
private static final Method[] methodMapArray
private MethodConstraints methodConstraints
null
).private FiddlerRegistration.ConstrainableFiddlerRegistration(Fiddler server, Uuid registrationID, EventRegistration eventReg, MethodConstraints methodConstraints)
ConstrainableFiddlerRegistration
instance.
For a description of all but the methodConstraints
argument (provided below), refer to the description for the
constructor of this class' super class.
methodConstraints
- the client method constraints to place on
this proxy (may be null
).private static Fiddler constrainServer(Fiddler server, MethodConstraints constraints)
public RemoteMethodControl setConstraints(MethodConstraints constraints)
ConstrainableFiddlerRegistration
) with its client
constraints set to the specified constraints. A null
value is interpreted as mapping all methods to empty constraints.setConstraints
in interface RemoteMethodControl
constraints
- client constraints, or null
RemoteMethodControl.getConstraints()
public MethodConstraints getConstraints()
ConstrainableFiddlerRegistration
).
The value returned by this method can be null
,
which is interpreted as mapping all methods to empty constraints.getConstraints
in interface RemoteMethodControl
null
RemoteMethodControl.setConstraints(net.jini.core.constraint.MethodConstraints)
private ProxyTrustIterator getProxyTrustIterator()
ProxyTrustVerifier
to retrieve this object's
trust verifier.private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
InvalidObjectException
- if any of the
requirements for trust verification (as detailed in the
class description) are not satisfied.IOException
ClassNotFoundException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.