Package net.jini.io

Examples of net.jini.io.UnsupportedConstraintException


      {
    InvocationConstraint c = (InvocationConstraint) i.next();
    if (!(c instanceof Integrity) ||
        (!integrity && c == Integrity.YES))
    {
        throw new UnsupportedConstraintException(
            "cannot satisfy unfulfilled constraint: " + c);
    }
    // REMIND: support ConstraintAlternatives containing Integrity?
      }
     
View Full Code Here


    if (support == NO_SUPPORT ||
        (!relativeOK &&
         constraint instanceof RelativeTimeConstraint))
    {
        if (isRequirement) {
      throw new UnsupportedConstraintException(
          "cannot satisfy constraint: " + constraint);
        } else {
      return;
        }
    }
View Full Code Here

        maxConnectDeadline = Long.MAX_VALUE;
    }
      }
      if (!supported) {
    if (isRequirement) {
        throw new UnsupportedConstraintException(
      "cannot satisfy constraint: " + constraint);
    } else {
        return; // maxConnectDeadline is bogus in this case
    }
      }
View Full Code Here

            try {
                impl.fakeMethod();
                assertion(false);
            } catch (Throwable t) {
                check(false,false,false,false,
                    new UnsupportedConstraintException(""),t);
            }
            requestStream = request.getRequestStream();
            assertion(requestStream.read() == -1);
        }
    }
View Full Code Here

        // call dispatch and verify the proper result
        dispatcher.dispatch(impl,request,context);
        response = request.getResponseStream();
        assertion(response.read() == 0x02);
        checkUnmarshallingException(
            new UnsupportedConstraintException(""), response);

        checkConstraintsReturn =
            new InvocationConstraints(new InvocationConstraint[]
                {Integrity.NO, Confidentiality.YES}, null);
        logger.log(Level.FINE,"=================================");
        logger.log(Level.FINE,"test case " + (counter++)
            + ": integrity"
            + ",checkConstraints return: " + checkConstraintsReturn);
        logger.log(Level.FINE,"");

        // initialize FakeInboundRequest
        request = new FakeInboundRequest(methodHash,nullArgs,0x00,0x01);
        request.setCheckConstraintsReturn(checkConstraintsReturn);

        // call dispatch and verify the proper result
        dispatcher.dispatch(impl,request,context);
        response = request.getResponseStream();
        assertion(response.read() == 0x02);
        checkUnmarshallingException(
            new UnsupportedConstraintException(""), response);
    }
View Full Code Here

  }
  for (Iterator i = constraints.requirements().iterator(); i.hasNext(); )
  {
      InvocationConstraint c = (InvocationConstraint) i.next();
      if (!supported(c)) {
    throw new UnsupportedConstraintException(
            "unsupported constraint: " + c);
      }
  }
    }
View Full Code Here

      return unfulfilledConstraints;
        }
    } while (client != null);
      } while (server != null);
  }
  UnsupportedConstraintException uce =
      new UnsupportedConstraintException(
      "Constraints are not supported: " + constraints);
  if (logger.isLoggable(Levels.FAILED)) {
      logThrow(
    logger, Levels.FAILED,
    SslServerEndpoint.class, "checkConstraints",
View Full Code Here

      /* Keep track of progress; remove entry when check is done */
      Map progress = new HashMap(serverPrincipals.size());
      for (Iterator i = serverPrincipals.iterator(); i.hasNext(); ) {
    X500Principal p = (X500Principal) i.next();
    if (!principals.contains(p)) {
        throw new UnsupportedConstraintException(
      "Missing principal: " + p);
    }
    progress.put(p, X500Principal.class);
      }
      X500PrivateCredential[] privateCredentials =
    (X500PrivateCredential[]) AccessController.doPrivileged(
        new SubjectCredentials.GetAllPrivateCredentialsAction(
      serverSubject));
      List certPaths =
    SubjectCredentials.getCertificateChains(serverSubject);
      if (certPaths != null) {
    for (int i = certPaths.size(); --i >= 0; ) {
        CertPath chain = (CertPath) certPaths.get(i);
        X509Certificate firstCert = firstX509Cert(chain);
        X500Principal p = firstCert.getSubjectX500Principal();
        if (progress.containsKey(p)) {
      try {
          checkValidity(chain, null);
      } catch (CertificateException e) {
          progress.put(p, e);
          continue;
      }
      progress.put(p, CertPath.class);
      for (int j = privateCredentials.length; --j >= 0; ) {
          X509Certificate cert =
        privateCredentials[j].getCertificate();
          if (firstCert.equals(cert)) {
        progress.remove(p);
        break;
          }
      }
        }
    }
      }
      if (!progress.isEmpty()) {
    X500Principal p =
        (X500Principal) progress.keySet().iterator().next();
    Object result = progress.get(p);
    if (result == X500Principal.class) {
        throw new UnsupportedConstraintException(
      "Missing public credentials: " + p);
    } else if (result == CertPath.class) {
        throw new UnsupportedConstraintException(
      "Missing private credentials: " + p);
    } else {
        throw new UnsupportedConstraintException(
      "Problem with certificates: " + p + "\n" + result,
      (CertificateException) result);
    }
      }
  }
View Full Code Here

    throw new NullPointerException("Constraints cannot be null");
      }
      InvocationConstraints result = getUnfulfilledConstraints(
    cipherSuite, clientPrincipal, serverPrincipal, constraints);
      if (result == null) {
    UnsupportedConstraintException uce =
        new UnsupportedConstraintException(
      "Constraints are not supported: " + constraints);
    if (logger.isLoggable(Levels.FAILED)) {
        logThrow(logger, Levels.FAILED,
           SslServerConnection.class, "checkConstraints",
           "check constraints for {0}\nwith {1}\n" +
View Full Code Here

    }

    public InvocationConstraints checkConstraints(InvocationConstraints ics)
        throws UnsupportedConstraintException {
        if (!ics.isEmpty()){
            throw new UnsupportedConstraintException("This endpoint does not"
                + " support setting constraints on a remote call");
        }
        return InvocationConstraints.EMPTY;
    }
View Full Code Here

TOP

Related Classes of net.jini.io.UnsupportedConstraintException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.