Validates the conversation state by ensuring we have a local cache of it here in this class.
971984
private void validateConversationState()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "validateConversationState");
      
      if (cConState == null)
      {
         cConState = (ClientConversationState) getConversation().getAttachment();
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Using Client Conversation State:", cConState);
      }
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "validateConversationState");
   }
319354
public void validate() {
    synchronized (mSharedMapsLock) {
      // Compute block lock reference counts based off of lock records
      ConcurrentMap<Long, AtomicInteger> blockLockReferenceCounts = new ConcurrentHashMap<>();
      for (LockRecord record : mLockIdToRecordMap.values()) {
        blockLockReferenceCounts.putIfAbsent(record.getBlockId(), new AtomicInteger(0));
        blockLockReferenceCounts.get(record.getBlockId()).incrementAndGet();
      }

      // Check that the reference count for each block lock matches the lock record counts.
      for (Entry<Long, ClientRWLock> entry : mLocks.entrySet()) {
        long blockId = entry.getKey();
        ClientRWLock lock = entry.getValue();
        Integer recordCount = blockLockReferenceCounts.get(blockId).get();
        Integer referenceCount = lock.getReferenceCount();
        if (!Objects.equal(recordCount, referenceCount)) {
          throw new IllegalStateException("There are " + recordCount + " lock records for block"
              + " id " + blockId + ", but the reference count is " + referenceCount);
        }
      }

      // Check that if a lock id is mapped to by a session id, the lock record for that lock id
      // contains that session id.
      for (Entry<Long, Set<Long>> entry : mSessionIdToLockIdsMap.entrySet()) {
        for (Long lockId : entry.getValue()) {
          LockRecord record = mLockIdToRecordMap.get(lockId);
          if (record.getSessionId() != entry.getKey()) {
            throw new IllegalStateException("The session id map contains lock id " + lockId
                + "under session id " + entry.getKey() + ", but the record for that lock id ("
                + record + ")" + " doesn't contain that session id");
          }
        }
      }
    }
  }
52273
public void validate(StateAccess validationState, ValidationMessageAcceptor messageAcceptor) {
		if (isResponsible(validationState.getState().context, validationState.getState().currentObject)) {
			try {
				for (final MethodWrapper method : getMethods(validationState.getState().currentObject)) {
					final Context ctx = new Context(validationState, this, method, messageAcceptor);
					this.currentContext.set(ctx);
					initializeContext(ctx);
					method.invoke(ctx);
				}
			} finally {
				this.currentContext.set(null);
			}
		}
	}
1131390
@Override
    public boolean isKeepMessages()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExternalContext externalContext = facesContext.getExternalContext();
        Map<String, Object> requestMap = externalContext.getRequestMap();
        Boolean keepMessages = (Boolean) requestMap.get(FLASH_KEEP_MESSAGES);
        
        return (keepMessages == null ? Boolean.FALSE : keepMessages);
    }
514815
def validate(self):
        

        errors = {}

        for name, field in self.fields:
            try:
                field.validate(self._state.get(name))
            except Exception as e:
                errors[name] = e

        if len(errors) is not 0:
            raise Exception(errors)

        return True
193956
private void processDestinationListenerCallback (CommsByteBuffer buffer, Conversation conversation) {
     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "processDestinationListenerCallback", new Object[]{buffer, conversation});

     final ClientConversationState convState = (ClientConversationState) conversation.getAttachment();
     final SICoreConnection connection = convState.getSICoreConnection();

     final short connectionObjectId                = buffer.getShort();
     final short destinationListenerId             = buffer.getShort();
     final SIDestinationAddress destinationAddress = buffer.getSIDestinationAddress(conversation.getHandshakeProperties().getFapLevel());
     final short destinationAvailabilityShort      = buffer.getShort();

     if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "connectionObjectId="+connectionObjectId);
     if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "destinationListenerId="+destinationListenerId);
     if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "destinationAddress="+destinationAddress);

     DestinationAvailability destinationAvailability = null;
     if (destinationAvailabilityShort != CommsConstants.NO_DEST_AVAIL) {
       destinationAvailability = DestinationAvailability.getDestinationAvailability(destinationAvailabilityShort);
     }
     if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "destinationAvailability="+destinationAvailability);

     // Look up the real DestinationListener in the local DestinationListenerCache

     final DestinationListenerCache destinationListenerCache = convState.getDestinationListenerCache();
     final DestinationListener destinationListener = destinationListenerCache.get(destinationListenerId);

     if (destinationListener != null) {
        //Call the listener on a seperate thread.
        ClientAsynchEventThreadPool.getInstance().dispatchDestinationListenerEvent(connection, destinationAddress, destinationAvailability, destinationListener);
     } else {
       if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "DestinationListener id="+destinationListenerId+" not found in DestinationListenerCache");
       if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, destinationListenerCache.toString());

       SIErrorException e = new SIErrorException(nls.getFormattedMessage("UNABLE_TO_FIND_DESTINATION_LISTENER_SICO8019", new Object[] {Short.valueOf(destinationListenerId)}, null));
       FFDCFilter.processException(e, CLASS_NAME + ".processDestinationListenerCallback", CommsConstants.PROXYRECEIVELISTENER_DESTLIST_CALLBACK_02, this);

       SibTr.error(tc, "UNABLE_TO_FIND_DESTINATION_LISTENER_SICO8019", e);
       throw e;
     }

     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "processDestinationListenerCallback");
   }
1171370
protected void validate() {
        if(clusterId == null)
            throw new IllegalStateException("The container must have a cluster id");

        if(prototype == null)
            throw new IllegalStateException("The container for \"" + clusterId + "\" cannot be supplied a null MessageProcessor");

        if(dispatcher == null)
            throw new IllegalStateException("The container for cluster \"" + clusterId + "\" never had the dispatcher set on it.");

        if(statCollector == null)
            throw new IllegalStateException("The container must have a " + ClusterStatsCollector.class.getSimpleName() + " id");
    }
1289099
protected function validateEditCountryState()
    {
        $this->setSubmitted('state');
        $this->setSubmittedBool('status');
        $this->setSubmitted('update', $this->data_state);
        $this->setSubmitted('country', $this->data_country['code']);

        $this->validateComponent('country_state');

        return !$this->hasErrors();
    }
514269
protected void common_invalidate(Object key, boolean waitOnInvalidation, boolean checkPreInvalidationListener) {
        ValidateUtility.objectNotNull(key, "key");
        cache.invalidateById(key, waitOnInvalidation, checkPreInvalidationListener);
    }
676308
def _check_transition_validity(self, check_transition):
        
        valid, message = super(PreemptiveConcurrencyState, self)._check_transition_validity(check_transition)
        if not valid:
            return False, message

        # Only transitions to the parent state are allowed

        if check_transition.to_state != self.state_id:
            return False, "Only transitions to the parent state are allowed"

        return True, message
652522
def ensure_state(default_getter, exc_class, default_msg=None):
    """"""
    def decorator(getter=default_getter, msg=default_msg):
        def ensure_decorator(f):
            @wraps(f)
            def inner(self, *args, **kwargs):
                if not getter(self):
                    raise exc_class(msg) if msg else exc_class()
                return f(self, *args, **kwargs)
            return inner
        return ensure_decorator
    return decorator
605265
public void validate() {
    Preconditions.checkState(getMaxLogSize() <= Integer.MAX_VALUE,
        "{} has value {} but must not exceed {}", PropertyKey.MASTER_JOURNAL_LOG_SIZE_BYTES_MAX,
        getMaxLogSize(), Integer.MAX_VALUE);
    Preconditions.checkState(getHeartbeatIntervalMs() < getElectionTimeoutMs() / 2,
        "Heartbeat interval (%sms) should be less than half of the election timeout (%sms)",
        getHeartbeatIntervalMs(), getElectionTimeoutMs());
    Preconditions.checkState(getClusterAddresses().contains(getLocalAddress()),
        "The cluster addresses (%s) must contain the local master address (%s)",
        getClusterAddresses(), getLocalAddress());
  }
827325
public static void ensureCurrentState(Service.STATE state,
                                        Service.STATE expectedState) {
    if (state != expectedState) {
      throw new IllegalStateException("For this operation, the " +
                                          "current service state must be "
                                          + expectedState
                                          + " instead of " + state);
    }
  }
844994
@Override
    protected void createConversationState() {
        if (tc.isEntryEnabled())
            SibTr.entry(this, tc, "createConversationState");

        // Now create the Conversation wide ConversationState
        ConversationState cs = new ConversationState();
        getConversation().setAttachment(cs);

        // Only create one if one does not already exist
        ServerLinkLevelState lls = (ServerLinkLevelState) getConversation().getLinkLevelAttachment();
        if (lls == null) {
            getConversation().setLinkLevelAttachment(new ServerLinkLevelState());
        }

        if (tc.isEntryEnabled())
            SibTr.exit(this, tc, "createConversationState");
    }
1304746
private void validateRebalancePlanState(RebalancePlan rebalancePlan) {
        logger.info("Validating rebalance plan state.");

        Cluster currentCluster = rebalancePlan.getCurrentCluster();
        List<StoreDefinition> currentStores = rebalancePlan.getCurrentStores();
        Cluster finalCluster = rebalancePlan.getFinalCluster();
        List<StoreDefinition> finalStores = rebalancePlan.getFinalStores();

        RebalanceUtils.validateClusterStores(currentCluster, currentStores);
        RebalanceUtils.validateClusterStores(finalCluster, finalStores);
        RebalanceUtils.validateCurrentFinalCluster(currentCluster, finalCluster);
        RebalanceUtils.validateRebalanceStore(currentStores);
        RebalanceUtils.validateRebalanceStore(finalStores);
    }
639388
def verify(self):
        
        # if we are in a lock don't check anything
        if self._lock != 0:
            return

        # check the hash of our data
        id_new = self._id_function()

        # things changed
        if id_new != self.id_current:
            if len(self.cache) > 0:
                log.debug('%d items cleared from cache: %s',
                          len(self.cache),
                          str(list(self.cache.keys())))
            # hash changed, so dump the cache
            # do it manually rather than calling clear()
            # as we are internal logic and can avoid function calls
            self.cache = {}
            # set the id to the new data hash
            self.id_current = id_new
556484
def is_state(self, state):
        
        state = state.format(relation_name=self.relation_name)
        value = _get_flag_value(state)
        if not value:
            return False
        return self.key in value['conversations']