new Object[] { obj, ctx });
}
if (obj == null || ctx == null) {
throw new NullPointerException("Arguments must not be null");
}
RemoteMethodControl otherServerProxy;
Uuid inputProxyID = null;
if (obj instanceof Registration.ConstrainableRegistration) {
Registration reg = (Registration) obj;
// verify sub-components
if (!isTrustedObject(reg.lease, ctx) ||
!isTrustedObject(reg.listener, ctx)) {
return false;
}
otherServerProxy = (RemoteMethodControl) reg.mailbox;
} else if (obj instanceof MailboxBackEnd &&
obj instanceof RemoteMethodControl) {
/* Inner proxy verification case. To simplify logic, below,
* just assume the same Uuid that we have in hand.
*/
otherServerProxy = (RemoteMethodControl)obj;
inputProxyID = proxyID;
} else if (obj instanceof MailboxProxy.ConstrainableMailboxProxy) {
otherServerProxy = (RemoteMethodControl) ((MailboxProxy)obj).mailbox;
inputProxyID = ((ReferentUuid)obj).getReferentUuid();
} else if (obj instanceof MailboxAdminProxy.ConstrainableMailboxAdminProxy) {
otherServerProxy = (RemoteMethodControl) ((MailboxAdminProxy)obj).server;
inputProxyID = ((ReferentUuid)obj).getReferentUuid();
} else if (obj instanceof ListenerProxy.ConstrainableListenerProxy) {
otherServerProxy = (RemoteMethodControl) ((ListenerProxy)obj).server;
} else if (obj instanceof ConstrainableLandlordLease) {
final LandlordProxyVerifier lpv =
new LandlordProxyVerifier((Landlord)serverProxy, proxyID);
return lpv.isTrustedObject(obj, ctx);
} else {
logger.log(Level.FINEST, "Object {0} is not a supported type",
obj);
return false;
}
// For top-level proxies, quickly verify proxy Uuid
if ((inputProxyID != null) &&
!(proxyID.equals(inputProxyID))) {
return false;
}
MethodConstraints mc = otherServerProxy.getConstraints();
TrustEquivalence trusted =
(TrustEquivalence) serverProxy.setConstraints(mc);
boolean result = trusted.checkTrustEquivalence(otherServerProxy);
if (logger.isLoggable(Level.FINER)) {
logger.exiting(proxyVerifierSourceClass, "isTrustedObject",