/* (non-Javadoc)
@see org.cloudfoundry.identity.uaa.oauth.ClientDetailsValidatorInterface#validate(org.springframework.security.oauth2.provider.ClientDetails, boolean)
181673
@Override
    public ClientDetails validate(ClientDetails prototype, Mode mode) {
        return validate(prototype, mode == Mode.CREATE, true);
    }
55221
@Override
    // TODO: reduce Cyclomatic complexity
    public final void validate(final Class<?> clazz)
    {

        if (classes.contains(clazz))
        {
            return;
        }

        if (log.isDebugEnabled())
            log.debug("Validating " + clazz.getName());

        // Is Entity?
//        if (clazz.isAnnotationPresent(MappedSuperclass.class))
//        {
//            throw new InvalidEntityDefinitionException("JPA operation over MappedSuperclass are not allowed" + clazz);
//        }
        
        
        // Is Entity?
        if (!clazz.isAnnotationPresent(Entity.class))
        {
            throw new InvalidEntityDefinitionException(clazz.getName() + " is not annotated with @Entity.");
        }

        
        // TODO:: add validation for MappedSuperClass.
        
//        // Must be annotated with @Table
//        if (!clazz.isAnnotationPresent(Table.class))
//        {
//            throw new InvalidEntityDefinitionException(clazz.getName() + " must be annotated with @Table.");
//        }

        // must have a default no-argument constructor
        try
        {
            clazz.getConstructor();
        }
        catch (NoSuchMethodException nsme)
        {
            throw new InvalidEntityDefinitionException(clazz.getName()
                    + " must have a default no-argument constructor.");
        }

        // Check for @Key and ensure that there is just 1 @Key field of String
        // type.
        List<Field> keys = new ArrayList<Field>();
        for (Field field : clazz.getDeclaredFields())
        {
            if (field.isAnnotationPresent(Id.class) && field.isAnnotationPresent(EmbeddedId.class))
            {
                throw new InvalidEntityDefinitionException(clazz.getName()
                        + " must have either @Id field or @EmbeddedId field");
            }

            if (field.isAnnotationPresent(Id.class))
            {
                keys.add(field);
                // validate @GeneratedValue annotation if given
                if (field.isAnnotationPresent(GeneratedValue.class))
                {
                    validateGeneratedValueAnnotation(clazz, field);
                }
            }
            else if (field.isAnnotationPresent(EmbeddedId.class))
            {
                keys.add(field);
            }
        }

        if (keys.size() < 0)
        {
            throw new InvalidEntityDefinitionException(clazz.getName() + " must have an @Id field.");
        }
        else if (keys.size() > 1)
        {
            throw new InvalidEntityDefinitionException(clazz.getName() + " can only have 1 @Id field.");
        }

        // save in cache

        classes.add(clazz);
    }
1248481
private boolean isValid(final Map<String, String> properties) {

		if (!licensePresent) {
			return false;
		}


		final SimpleDateFormat format = new SimpleDateFormat(DatePattern);
		final String src              = collectLicenseFieldsForSignature(properties);
		final String name             = properties.get(NameKey);
		final String key              = properties.get(SignatureKey);
		final String hostId           = properties.get(MachineKey);
		final String thisHostId       = createHash();
		final String edition          = properties.get(EditionKey);
		final String modules          = properties.get(ModulesKey);
		final String dateString       = properties.get(DateKey);
		final String startDateString  = properties.get(StartKey);
		final String endDateString    = properties.get(EndKey);
		final String serversString    = properties.get(ServersKey);
		final String usersString      = properties.get(UsersKey); // unused (cannot be verified here)
		final Date now                = new Date();

		if (StringUtils.isEmpty(key)) {

			logger.error("Unable to read key from license file.");
			return false;
		}

		startDate = parseDate(startDateString);
		endDate   = parseDate(endDateString);

		try {

			final byte[] data      = src.getBytes(CharSet);
			final Signature signer = Signature.getInstance(SignatureAlgorithm);
			final byte[] signature = Hex.decodeHex(key.toCharArray());

			signer.initVerify(certificate);
			signer.update(data);

			if (!signer.verify(signature)) {

				logger.error("License signature verification failed, license is not valid.");
				return false;
			}

		} catch (Throwable t) {

			logger.error("Unable to verify license.", t);
			return false;
		}

		if (StringUtils.isEmpty(name)) {

			logger.error("License file doesn't contain licensee name.");
			return false;
		}

		if (StringUtils.isEmpty(edition)) {

			logger.error("License file doesn't contain edition.");
			return false;
		}

		if (StringUtils.isEmpty(modules)) {

			logger.error("License file doesn't contain modules.");
			return false;
		}

		if (StringUtils.isEmpty(hostId)) {

			logger.error("License file doesn't contain host ID.");
			return false;
		}

		if (StringUtils.isEmpty(dateString)) {

			logger.error("License file doesn't contain license date.");
			return false;
		}

		if (StringUtils.isEmpty(startDateString)) {

			logger.error("License file doesn't contain start date.");
			return false;
		}

		if (StringUtils.isEmpty(endDateString)) {

			logger.error("License file doesn't contain end date.");
			return false;
		}

		// verify host ID
		if (!thisHostId.equals(hostId) && !"*".equals(hostId)) {

			logger.error("Host ID found in license ({}) file does not match current host ID.", hostId);
			return false;
		}

		if ("*".equals(hostId)) {

			// check volume license against server addresses
			if (StringUtils.isNotBlank(serversString)) {

				// send HostID to server
				properties.put(HostIdKey, thisHostId);

				return checkVolumeLicense(properties, serversString);
			}

			final Calendar issuedAtPlusOneMonth = GregorianCalendar.getInstance();
			final Calendar cal                  = GregorianCalendar.getInstance();

			// set issuedAt to license date plus one month
			issuedAtPlusOneMonth.setTime(parseDate(dateString));
			issuedAtPlusOneMonth.add(Calendar.MONTH, 1);

			// check that the license file was issued not more than one month ago
			if (cal.after(issuedAtPlusOneMonth)) {

				logger.error("Development license found in license file is not valid any more, license period ended {}.", format.format(issuedAtPlusOneMonth.getTime()));
				return false;
			}
		}

		// verify that the license is valid for the current date
		if (startDate != null && now.before(startDate) && !now.equals(startDate)) {

			logger.error("License found in license file is not yet valid, license period starts {}.", format.format(startDate.getTime()));
			return false;
		}

		// verify that the license is valid for the current date
		if (licenseExpired()) {

			logger.error("License found in license file is not valid any more, license period ended {}.", format.format(endDate.getTime()));
			return false;
		}

		return true;
	}
522688
public void validate(ClientState state) throws RequestValidationException
    {
        ThriftValidation.validateKeyspaceNotSystem(name);

        // keyspace name
        if (!name.matches("\\w+"))
            throw new InvalidRequestException(String.format("\"%s\" is not a valid keyspace name", name));
        if (name.length() > Schema.NAME_LENGTH)
            throw new InvalidRequestException(String.format("Keyspace names shouldn't be more than %s characters long (got \"%s\")", Schema.NAME_LENGTH, name));

        attrs.validate();

        if (attrs.getReplicationStrategyClass() == null)
            throw new ConfigurationException("Missing mandatory replication strategy class");

        // The strategy is validated through KSMetaData.validate() in announceNewKeyspace below.
        // However, for backward compatibility with thrift, this doesn't validate unexpected options yet,
        // so doing proper validation here.
        AbstractReplicationStrategy.validateReplicationStrategy(name,
                                                                AbstractReplicationStrategy.getClass(attrs.getReplicationStrategyClass()),
                                                                StorageService.instance.getTokenMetadata(),
                                                                DatabaseDescriptor.getEndpointSnitch(),
                                                                attrs.getReplicationOptions());
    }
1082446
@Override
    public void validate() throws OpsGenieClientValidationException {
        super.validate();
        if (name == null && id == null)
            throw OpsGenieClientValidationException.missingMultipleMandatoryProperty(OpsGenieClientConstants.API.NAME, OpsGenieClientConstants.API.ID);
    }
646935
private String validateAuthn(String value) {
        // for now, if we got here we're validating an authnToken
        String result = null;
        String valueLower = value.toLowerCase();
        do {
            if (valueLower.equals("saml")) {
                result = JAXRSClientConstants.SAML_HANDLER;
                break;
            }
            if (valueLower.equals("oauth")) {
                result = JAXRSClientConstants.OAUTH_HANDLER;
                break;
            }
            if (valueLower.equals("ltpa")) {
                result = JAXRSClientConstants.LTPA_HANDLER;
            }
        } while (false);
        if (result == null) {
            Tr.warning(tc, "warn.invalid.authorization.token.type", value); // CWWKW0061W
        }
        return result;
    }
631348
public void validate(final ValidationContext context) {
        if (!isValid()) {
            val messages = context.getMessageContext();
            messages.addMessage(new MessageBuilder()
                .error()
                .source("token")
                .defaultText("Unable to accept credential with an empty or unspecified token")
                .build());
        }
    }
349106
@Override
    public void validate(Class<?> clazz) {

        if (log.isDebugEnabled())
            log.debug("Validating " + clazz.getName());

        // Is Entity?
        if (!checkValidClass(clazz)) {

            throw new RuleValidationException(clazz.getName() + " is not a valid jpa entity.");
        }

        // must have a default no-argument constructor
        boolean flag = false;
        try {
            Constructor[] constructors = clazz.getDeclaredConstructors();
            for (Constructor constructor : constructors) {
                if ((Modifier.isPublic(constructor.getModifiers()) || Modifier.isProtected(constructor.getModifiers()))
                    && constructor.getParameterTypes().length == 0) {
                    flag = true;
                    break;
                }
            }
            if (!flag) {
                throw new Exception();
            }
        } catch (Exception e) {
            throw new RuleValidationException(clazz.getName()
                + " must have a default public or protected no-argument constructor.");
        }
    }
1039614
public static boolean validateToken(String authToken, UserDetails userDetails) {
        String[] parts = authToken.split(TOKEN_SEPARATOR);
        long expires = Long.parseLong(parts[1]);
        String signature = parts[2];

        return expires >= System.currentTimeMillis() && signature.equals(TokenUtils.computeSignature(userDetails, expires));
    }
404471
public boolean validate(final List<Map<String, Object>> details) {
    if (this.getMetric() == null || this.getMetric().isEmpty()) {
      if (details != null) {
        details.add(getHttpDetails("Metric name was empty"));
      }
      LOG.warn("Metric name was empty: " + this);
      return false;
    }

    //TODO add blacklisted metric validatin here too
    
    if (this.getTimestamp() <= 0) {
      if (details != null) {
        details.add(getHttpDetails("Invalid timestamp"));
      }
      LOG.warn("Invalid timestamp: " + this);
      return false;
    }

    if (this.getValue() == null || this.getValue().isEmpty()) {
      if (details != null) {
        details.add(getHttpDetails("Empty value"));
      }
      LOG.warn("Empty value: " + this);
      return false;
    }

    if (this.getTags() == null || this.getTags().size() < 1) {
      if (details != null) {
        details.add(getHttpDetails("Missing tags"));
      }
      LOG.warn("Missing tags: " + this);
      return false;
    }
    return true;
  }
1215246
@Override
    public void validate() {
        if (value == null) {
            throw new NoValueGivenException(getPath());
        }

        if (valids.size() != 0) {
            boolean ok = false;
            String valString = (value != null) ? value.toString() : "";

            for (int i = 0; i < valids.size(); i++) {
                if (valids.get(i).equals(valString)) {
                    ok = true;
                    break;
                }
            }

            if (!ok) {
                throw new NoValidValueException(getPath(), valString);
            }
        }

        setValid(true);
    }
114381
public boolean validateAccount(String token) throws DAOException {
            Query q = new QueryBuilder().select().from(Credentials.class).where("validation", OPERAND.EQ, token).build();

            TransientObject to = ObjectUtils.get1stOrNull(dao.query(q));
            if (to != null) {
                ServerCredentials creds = new ServerCredentials(to);
                creds.setValidation("1");
                dao.save(creds);
                return true;
            } else {
                return false;
            }

    }
572903
@Override
    public void validate() throws InvalidPropertyException {

        final String methodName = "validate";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName);
        }

        final List<String> failedPropsMessages = new ArrayList<String>();

        try {
            final List<PropertyDescriptor> invalidProperties = new ArrayList<PropertyDescriptor>();

            // Busname is required
            if ((null == _busName) || ("".equals(_busName))) {
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                    SibTr.debug(this, TRACE, "Invalid BusName - BusName was "
                                             + _busName);
                }
                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_BUSNAME_CWSJR1187"),
                                                                null, null));
                invalidProperties.add(new PropertyDescriptor("busName",
                                JmsJcaActivationSpec.class));
            }

            // Destination required
            if (null == _destination) {
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                    SibTr.debug(this, TRACE,
                                "Invalid Destination - Destination was null");
                }
                failedPropsMessages.add(NLS.getFormattedMessage("INVALID_PROPERTY_DESTINATION_CWSJR1188", null, null));
                invalidProperties.add(new PropertyDescriptor("destination",
                                JmsJcaActivationSpec.class));
            }

            // Check destination type valid
            if (!(QUEUE.equals(_destinationType) || TOPIC
                            .equals(_destinationType))) {
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                    SibTr.debug(this, TRACE,
                                "Invalid Destination Type - We expected a destination type of "
                                                + QUEUE + " or " + TOPIC + " but we got "
                                                + _destinationType);
                }
                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_DESTINATION_TYPE_CWSJR1189"),
                                                                new Object[] { QUEUE, TOPIC, _destinationType }, null));
                invalidProperties.add(new PropertyDescriptor("destinationType",
                                JmsJcaActivationSpec.class));
            }

            // Check acknowledge mode valid
            if (!(AUTO_ACKNOWLEDGE.equals(_acknowledgeMode) || DUPS_OK_ACKNOWLEDGE
                            .equals(_acknowledgeMode))) {
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                    SibTr.debug(this, TRACE,
                                "Invalid Acknowledge Mode - We expected an acknowledge mode of "
                                                + AUTO_ACKNOWLEDGE + " or "
                                                + DUPS_OK_ACKNOWLEDGE + " but we got "
                                                + _acknowledgeMode);
                }
                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_ACKNOWLEDGE_MODE_CWSJR1190"),
                                                                new Object[] { AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, _acknowledgeMode },
                                                                null));
                invalidProperties.add(new PropertyDescriptor("acknowledgeMode",
                                JmsJcaActivationSpec.class));
            }

            // Check read ahead valid
            if (!(ApiJmsConstants.READ_AHEAD_DEFAULT.equals(_readAhead)
                  || ApiJmsConstants.READ_AHEAD_ON.equals(_readAhead) || ApiJmsConstants.READ_AHEAD_OFF
                            .equals(_readAhead))) {

                if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                    SibTr.debug(this, TRACE,
                                "Invalid ReadAhead - We expected a read ahead of "
                                                + ApiJmsConstants.READ_AHEAD_DEFAULT + ", "
                                                + ApiJmsConstants.READ_AHEAD_ON + " or "
                                                + ApiJmsConstants.READ_AHEAD_OFF
                                                + " but we got " + _readAhead);
                }
                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_READ_AHEAD_CWSJR1191"),
                                                                new Object[] { ApiJmsConstants.READ_AHEAD_DEFAULT,
                                                                              ApiJmsConstants.READ_AHEAD_ON,
                                                                              ApiJmsConstants.READ_AHEAD_OFF,
                                                                              _acknowledgeMode },
                                                                null));
                invalidProperties.add(new PropertyDescriptor("readAhead",
                                JmsJcaActivationSpec.class));
            }

            // For queues ...
            if (QUEUE.equals(_destinationType)) {
                if (!(_destination instanceof JmsQueue)) {
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                        SibTr.debug(this, TRACE,
                                    "Invalid Destination - We expect a destination object to be a "
                                                    + JmsQueue.class.getName()
                                                    + " but we got "
                                                    + _destination == null ? "null" : _destination.getClass().getName());
                    }
                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_QUEUE_CWSJR1192"),
                                                                    new Object[] { JmsQueue.class.getName(), _destination == null ? "null" : _destination.getClass().getName() },
                                                                    null));
                    invalidProperties.add(new PropertyDescriptor("destination",
                                    JmsJcaActivationSpec.class));
                }
            }

            // For topics ...
            if (TOPIC.equals(_destinationType)) {

                if (!(_destination instanceof JmsTopic)) {
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                        SibTr.debug(this, TRACE,
                                    "Invalid Destination - We expect a destination object to be a "
                                                    + JmsTopic.class.getName()
                                                    + " but we got "
                                                    + _destination == null ? "null" : _destination.getClass().getName());
                    }
                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_TOPIC_CWSJR1193"),
                                                                    new Object[] { JmsTopic.class.getName(), _destination == null ? "null" : _destination.getClass().getName() },
                                                                    null));
                    invalidProperties.add(new PropertyDescriptor("destination",
                                    JmsJcaActivationSpec.class));
                }

                // ... check subscription durability valid
                if (!(DURABLE.equals(_subscriptionDurability) || DURABLE_SHARED.equals(_subscriptionDurability) ||
                      NON_DURABLE.equals(_subscriptionDurability) || NON_DURABLE_SHARED.equals(_subscriptionDurability))) {
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                        SibTr.debug(this, TRACE,
                                    "Invalid subscriptionDurability - We expect a value of "
                                                    + DURABLE + " or " + DURABLE_SHARED + " or " + NON_DURABLE + " or " + NON_DURABLE_SHARED
                                                    + " but we got "
                                                    + _subscriptionDurability);
                    }
                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_SUBDUR_CWSJR1194"),
                                                                    new Object[] { DURABLE, DURABLE_SHARED, NON_DURABLE, NON_DURABLE_SHARED, _subscriptionDurability },
                                                                    null));
                    invalidProperties.add(new PropertyDescriptor(
                                    "subscriptionDurability",
                                    JmsJcaActivationSpec.class));
                }

                if (DURABLE.equals(_subscriptionDurability)) {
                    // ... check client ID set
                    if ((null == _clientId) || ("".equals(_clientId))) {
                        failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_CLIENTID_CWSJR1183"),
                                                                        null, null));
                        invalidProperties.add(new PropertyDescriptor(
                                        "clientId", JmsJcaActivationSpec.class));
                    }

                }
                // For durable(and shared non durable) topic subscriptions ...
                if (DURABLE.equals(_subscriptionDurability) ||
                    DURABLE_SHARED.equals(_subscriptionDurability) ||
                    NON_DURABLE_SHARED.equals(_subscriptionDurability)) {
                    // ... check client ID set
                    if ((null == _clientId) || ("".equals(_clientId))) {
                        failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_CLIENTID_CWSJR1183"),
                                                                        null, null));
                        invalidProperties.add(new PropertyDescriptor(
                                        "clientId", JmsJcaActivationSpec.class));
                    }

                    // durableSubscriptionHome is populated at the connectionImpl 
                    // or the ConnectionProxy for liberty.Hence the check is removed

                    // ... check subscription name set
                    if ((null == _subscriptionName)
                        || ("".equals(_subscriptionName))) {

                        failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_SUBNAME_CWSJR1196"),
                                                                        null, null));
                        invalidProperties
                                        .add(new PropertyDescriptor("subscriptionName",
                                                        JmsJcaActivationSpec.class));

                    }

                }
            }

            // Check maximum concurrency greater than zero
            if ((null == _maxConcurrency) || (_maxConcurrency.intValue() < 1)) {
                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_MAXCONC_CWSJR1198"),
                                                                null, null));
                invalidProperties.add(new PropertyDescriptor("maxConcurrency",
                                JmsJcaActivationSpec.class));
            }

            // Check maximum batch size greater than zero
            if ((null == _maxBatchSize) || (_maxBatchSize.intValue() < 1)) {
                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_MAXBATCH_CWSJR1199"),
                                                                null, null));
                invalidProperties.add(new PropertyDescriptor("maxBatchSize",
                                JmsJcaActivationSpec.class));
            }

            // Check share data source with CMP is set - since this defaults to a value at
            // initialisation time this should never be encountered
            if (null == _shareDataSourceWithCMP) {
                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_SHARECMP_CWSJR1200"),
                                                                null, null));
                invalidProperties.add(new PropertyDescriptor(
                                "shareDataSourceWithCMP", JmsJcaActivationSpec.class));
            }

            /**
             * For the target set of properties, use the defaults if none specified
             */
            if ("".equals(_target)) {

                _target = JmsraConstants.DEFAULT_TARGET;

            }

            // Target type must be one of the predefined values
            if ((null == _targetType) || ("".equals(_targetType))) {

                _targetType = JmsraConstants.DEFAULT_TARGET_TYPE;

            } else {

                if (!((ApiJmsConstants.TARGET_TYPE_BUSMEMBER.equals(_targetType)) ||
                      (ApiJmsConstants.TARGET_TYPE_ME.equals(_targetType)) || (ApiJmsConstants.TARGET_TYPE_CUSTOM.equals(_targetType)))) {

                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_TARGET_TYPE_CWSJR1180"),
                                                                    new Object[] { ApiJmsConstants.TARGET_TYPE_BUSMEMBER,
                                                                                  ApiJmsConstants.TARGET_TYPE_ME,
                                                                                  ApiJmsConstants.TARGET_TYPE_CUSTOM,
                                                                                  _targetType },
                                                                    null));
                    invalidProperties.add(new PropertyDescriptor(
                                    "targetType",
                                    JmsJcaActivationSpec.class));

                }

            }

            // Target significance must be one of the predefined values
            if ((null == _targetSignificance) || ("".equals(_targetSignificance))) {

                _targetSignificance = JmsraConstants.DEFAULT_TARGET_SIGNIFICANCE;

            } else {

                if (!((ApiJmsConstants.TARGET_SIGNIFICANCE_PREFERRED.equals(_targetSignificance)) || (ApiJmsConstants.TARGET_SIGNIFICANCE_REQUIRED.equals(_targetSignificance)))) {

                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_TARGET_SIGNIFICANCE_CWSJR1179"),
                                                                    new Object[] { ApiJmsConstants.TARGET_SIGNIFICANCE_PREFERRED,
                                                                                  ApiJmsConstants.TARGET_SIGNIFICANCE_REQUIRED,
                                                                                  _targetSignificance },
                                                                    null));
                    invalidProperties.add(new PropertyDescriptor(
                                    "targetSignificance",
                                    JmsJcaActivationSpec.class));

                }

            }

            // If we have any invalid properties, throw an
            // InvalidPropertyException
            if (!invalidProperties.isEmpty()) {

                final PropertyDescriptor[] invalidPropertyArray = invalidProperties
                                .toArray(new PropertyDescriptor[invalidProperties
                                                .size()]);
                // Commented out in 284561 since we are now using failedPropsMessages instead
/*
 * final List propertyNames = new ArrayList();
 * 
 * for (int i = 0; i < invalidPropertyArray.length; i++) {
 * propertyNames.add(invalidPropertyArray[i].getDisplayName());
 * }
 */

                if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                    SibTr.debug(this, TRACE, "Invalid properties found:",
                                failedPropsMessages);
                }

                final InvalidPropertyException exc = new InvalidPropertyException(
                                NLS.getFormattedMessage(
                                                        ("INVALID_PROPERTIES_CWSJR1181"),
                                                        new Object[] { failedPropsMessages }, null));
                exc.setInvalidPropertyDescriptors(invalidPropertyArray);
                throw exc;
            }

        } catch (final IntrospectionException exception) {

            FFDCFilter.processException(exception, CLASS_NAME + "."
                                                   + methodName, FFDC_PROBE_1, this);

            SibTr.exception(this, TRACE, exception);

            throw new RuntimeException(NLS.getFormattedMessage(
                                                               ("EXCEPTION_RECEIVED_CWSJR1185"),
                                                               new Object[] { exception }, null), exception);
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
1033242
void validate(ServerResponse serverResponse) throws GeneralSecurityException {
    byte[] response = validateChallenge(authNonce, serverResponse.response);

    byte[] expected = rawResponse(challenge);
    Preconditions.checkArgument(Arrays.equals(expected, response));

    byte[] nonce = decrypt(serverResponse.nonce);
    byte[] inputIv = decrypt(serverResponse.inputIv);
    byte[] outputIv = decrypt(serverResponse.outputIv);

    SecretKeySpec sessionKey = generateKey(conf.keyFactoryAlgorithm(), conf.keyFactoryIterations(),
      nonce, conf.encryptionKeyLength());
    this.sessionCipher = new TransportCipher(cryptoConf, conf.cipherTransformation(), sessionKey,
      inputIv, outputIv);
  }
1149525
@Override
    public ValidationResult validate(@Nullable final Object value) {
        if (value instanceof ObjectId) {
            return new ValidationResult.ValidationPassed();
        } else {
            return new ValidationResult.ValidationFailed(String.valueOf(value) + " is not a valid ObjectId!");
        }
    }
723261
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString id_validator = new MPSString();
		id_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);
		id_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		id_validator.validate(operationType, id, "\"id\"");
		
		MPSInternetHost server_name_validator = new MPSInternetHost();
		server_name_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		server_name_validator.validate(operationType, server_name, "\"server_name\"");
		
		MPSInt port_validator = new MPSInt();
		port_validator.setConstraintMinValue(MPSConstants.GENERIC_CONSTRAINT, 1);
		port_validator.setConstraintMaxValue(MPSConstants.GENERIC_CONSTRAINT, 65534);
		port_validator.validate(operationType, port, "\"port\"");
		
		MPSString username_validator = new MPSString();
		username_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,"[ a-zA-Z0-9_#.:@=-]+");
		username_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		username_validator.validate(operationType, username, "\"username\"");
		
		MPSString password_validator = new MPSString();
		password_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		password_validator.validate(operationType, password, "\"password\"");
		
		MPSBoolean is_auth_validator = new MPSBoolean();
		is_auth_validator.validate(operationType, is_auth, "\"is_auth\"");
		
		MPSBoolean is_ssl_validator = new MPSBoolean();
		is_ssl_validator.validate(operationType, is_ssl, "\"is_ssl\"");
		
	}
983763
protected void validate(String operationType) throws Exception
	{
		super.validate(operationType);

		MPSString id_validator = new MPSString();
		id_validator.setConstraintIsReq(MPSConstants.DELETE_CONSTRAINT, true);
		id_validator.setConstraintIsReq(MPSConstants.MODIFY_CONSTRAINT, true);
		id_validator.validate(operationType, id, "\"id\"");
		
		MPSString server_name_validator = new MPSString();
		server_name_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		server_name_validator.setConstraintMinStrLen(MPSConstants.GENERIC_CONSTRAINT, 1);
		server_name_validator.setConstraintIsReq(MPSConstants.ADD_CONSTRAINT, true);
		server_name_validator.validate(operationType, server_name, "\"server_name\"");
		
		MPSString username_key_validator = new MPSString();
		username_key_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		username_key_validator.validate(operationType, username_key, "\"username_key\"");
		
		MPSString username_val_validator = new MPSString();
		username_val_validator.setConstraintCharSetRegEx(MPSConstants.GENERIC_CONSTRAINT,"[ a-zA-Z0-9_#.:@=-]+");
		username_val_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		username_val_validator.validate(operationType, username_val, "\"username_val\"");
		
		MPSString password_key_validator = new MPSString();
		password_key_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		password_key_validator.validate(operationType, password_key, "\"password_key\"");
		
		MPSString password_val_validator = new MPSString();
		password_val_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		password_val_validator.validate(operationType, password_val, "\"password_val\"");
		
		MPSString optional1_key_validator = new MPSString();
		optional1_key_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		optional1_key_validator.validate(operationType, optional1_key, "\"optional1_key\"");
		
		MPSString optional1_val_validator = new MPSString();
		optional1_val_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		optional1_val_validator.validate(operationType, optional1_val, "\"optional1_val\"");
		
		MPSString optional2_key_validator = new MPSString();
		optional2_key_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		optional2_key_validator.validate(operationType, optional2_key, "\"optional2_key\"");
		
		MPSString optional2_val1_validator = new MPSString();
		optional2_val1_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		optional2_val1_validator.validate(operationType, optional2_val1, "\"optional2_val1\"");
		
		MPSString optional3_key_validator = new MPSString();
		optional3_key_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		optional3_key_validator.validate(operationType, optional3_key, "\"optional3_key\"");
		
		MPSString optional3_val_validator = new MPSString();
		optional3_val_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		optional3_val_validator.validate(operationType, optional3_val, "\"optional3_val\"");
		
		MPSString base_url_validator = new MPSString();
		base_url_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 2000);
		base_url_validator.validate(operationType, base_url, "\"base_url\"");
		
		MPSString to_key_validator = new MPSString();
		to_key_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		to_key_validator.validate(operationType, to_key, "\"to_key\"");
		
		MPSString to_seperater_validator = new MPSString();
		to_seperater_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		to_seperater_validator.validate(operationType, to_seperater, "\"to_seperater\"");
		
		MPSString message_key_validator = new MPSString();
		message_key_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		message_key_validator.validate(operationType, message_key, "\"message_key\"");
		
		MPSString message_word_sperater_validator = new MPSString();
		message_word_sperater_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		message_word_sperater_validator.validate(operationType, message_word_sperater, "\"message_word_sperater\"");
		
		MPSString type_validator = new MPSString();
		type_validator.setConstraintMaxStrLen(MPSConstants.GENERIC_CONSTRAINT, 128);
		type_validator.validate(operationType, type, "\"type\"");
		
		MPSBoolean is_ssl_validator = new MPSBoolean();
		is_ssl_validator.validate(operationType, is_ssl, "\"is_ssl\"");
		
	}