Aggregate of policies that all must pass for this policy to pass.

@param       definitions       Array of policy definitions
@param       failureCode       Failure code
@param       failureMessage    Failure message
@param       resources
421703
function all (definitions, failureCode = 'policy_failed', failureMessage = 'All of the policies failed.') {
  return Policy.extend ({
    failureCode,

    failureMessage,

    /// Collection of policies to check.
    policies: null,

    init () {
      this._super.call (this, ...arguments);

      this.policies = compact (definitions.map (policy => policyMaker (policy, this.app)));
    },

    runCheck (req) {
      return Promise.all (this.policies.map (policy => policy.runCheck (req)))
        .then (results => {
          // Locate the first policy that failed. If we cannot find a failed policy, then
          // all policies passed.

          let index = findIndex (results, result => result !== true);

          if (index === -1)
            return true;

          const {failureCode, failureMessage} = this.policies[index];

          return {failureCode, failureMessage};
        });
    }
  });
}
1356677
public void setErrorCode(String errorCode) {
		if (errorCode != null) {
			NullArgumentException.validateNotEmpty(errorCode, "Error code");
		}
		this.errorCode = errorCode;
	}
234186
@SuppressWarnings("FutureReturnValueIgnored")
  private void failWrites(Throwable cause) {
    if (failCause == null) {
      failCause = cause;
    } else {
      logger.log(Level.FINE, "Ignoring duplicate failure", cause);
    }
    while (!bufferedWrites.isEmpty()) {
      ChannelWrite write = bufferedWrites.poll();
      write.promise.setFailure(cause);
      ReferenceCountUtil.release(write.msg);
    }
  }
1298773
public static void initializeMessages(List<DajlabControllerExtensionInterface<DajlabModelInterface>> controllers) {

		// Global daJLab resource
		ResourceBundle resourceD = ResourceBundle.getBundle(MESSAGES_PATH + "dajlab" + MESSAGES_EXT);
		getInstance().resources.put("dajlab", resourceD);
		if (controllers != null) {
			// Resource for each plugin
			for (DajlabControllerExtensionInterface<DajlabModelInterface> controller : controllers) {
				String resourceName = controller.getLocalization();
				if (resourceName != null) {
					String path = MESSAGES_PATH + resourceName + MESSAGES_EXT;
					try {
						ResourceBundle resource = ResourceBundle.getBundle(path);
						getInstance().resources.put(resourceName, resource);
					} catch (MissingResourceException e) {
						logger.error("Unable to find the resource file [{}]", path + ".properties");
					}
				}
			}
		}

	}
763128
public void releaseResources(List<ResourceRequest> released)
    throws IOException {
    if (failException != null) {
      throw failException;
    }

    List<Integer> releasedIds = new ArrayList<Integer>();
    for (ResourceRequest req : released) {
      releasedIds.add(req.getId());
    }
    cmNotifier.addCall(
        new ClusterManagerService.releaseResource_args(sessionId, releasedIds));
  }
957821
private void failWithMessage(String errorMessage) {
      AssertionError assertionError = Failures.instance().failureIfErrorMessageIsOverridden(info);
      if (assertionError == null) {
        // error message was not overridden, build it.
        String description = MessageFormatter.instance().format(info.description(), info.representation(), "");
        assertionError = new AssertionError(description + errorMessage);
      }
      Failures.instance().removeAssertJRelatedElementsFromStackTraceIfNeeded(assertionError);
      throw assertionError;
    }
425695
public static Result failure(String message, String description) {
        return new Result(message, description, null);
    }
924679
protected void setErrorMessageVariableOnErrorEventDefinition(Element errorEventDefinition, ErrorEventDefinition definition) {
    String errorMessageVariable = errorEventDefinition.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "errorMessageVariable");
    if (errorMessageVariable != null) {
      definition.setErrorMessageVariable(errorMessageVariable);
    }
  }
892349
protected void doProcessFailure(PolicyFailure failure, IPolicyContext context, C config, IPolicyFailureChain chain) {
        chain.doFailure(failure);
    }
868893
void rollbackResources()
    {
        final boolean traceOn = TraceComponent.isAnyTracingEnabled();

        if (traceOn && tc.isEntryEnabled())
            Tr.entry(tc, "rollbackResources", this);

        distributeEnd(XAResource.TMFAIL);
        _outcome = false;
        _retryRequired = distributeOutcome();

        if (traceOn && tc.isEntryEnabled())
            Tr.exit(tc, "rollbackResources", _retryRequired);
    }
1200577
public void setFailedScheduledActions(java.util.Collection<FailedScheduledUpdateGroupActionRequest> failedScheduledActions) {
        if (failedScheduledActions == null) {
            this.failedScheduledActions = null;
            return;
        }

        this.failedScheduledActions = new com.amazonaws.internal.SdkInternalList<FailedScheduledUpdateGroupActionRequest>(failedScheduledActions);
    }
1234273
public static DMNKnowledgeBuilderError from(Resource resource, String namespace, DMNMessage m) {
        ResultSeverity rs = ResultSeverity.ERROR;
        switch (m.getLevel()) {
            case ERROR:
                rs = ResultSeverity.ERROR;
                break;
            case INFO:
                rs = ResultSeverity.INFO;
                break;
            case WARNING:
                rs = ResultSeverity.WARNING;
                break;
            default:
                rs = ResultSeverity.ERROR;
                break;
        }
        DMNKnowledgeBuilderError res = new DMNKnowledgeBuilderError(rs, resource, namespace, m.getMessage());
        res.dmnMessage = m;
        return res;
    }
706763
public java.util.List<ResourceKey> getFailedItems() {
        if (failedItems == null) {
            failedItems = new com.amazonaws.internal.SdkInternalList<ResourceKey>();
        }
        return failedItems;
    }
560302
protected void doQuotaExceededFailure(final IPolicyContext context, final TransferQuotaConfig config,
            final IPolicyChain<?> chain, RateLimitResponse rtr) {
        Map<String, String> responseHeaders = RateLimitingPolicy.responseHeaders(config, rtr,
                defaultLimitHeader(), defaultRemainingHeader(), defaultResetHeader());

        IPolicyFailureFactoryComponent failureFactory = context.getComponent(IPolicyFailureFactoryComponent.class);
        PolicyFailure failure = limitExceededFailure(failureFactory);
        failure.getHeaders().putAll(responseHeaders);
        chain.doFailure(failure);
    }
230075
function any (definitions, failureCode = 'policy_failed', failureMessage = 'The request did not satisfy any required policy.') {
  function isTrue (value) {
    return value === true;
  }

  return Policy.extend ({
    failureCode,

    failureMessage,

    /// Collection of policies to check.
    policies: null,

    init () {
      this._super.call (this, ...arguments);
      this.policies = compact (definitions.map (policy => policyMaker (policy, this.app)));
    },

    runCheck (req) {
      return Promise.all (this.policies.map (policy => policy.runCheck (req)))
        .then (results => some (results, isTrue));
    }
  });
}
225340
@Override
    public void registerChildren(ManagementResourceRegistration resourceRegistration) {
        // Register wildcard children last to prevent duplicate registration errors when override definitions exist
        for (ResourceDefinition rd : singletonChildren) {
            resourceRegistration.registerSubModel(rd);
        }
        for (ResourceDefinition rd : wildcardChildren) {
            resourceRegistration.registerSubModel(rd);
        }
    }
1316112
public void setResourceRegion(java.util.Collection<StringFilter> resourceRegion) {
        if (resourceRegion == null) {
            this.resourceRegion = null;
            return;
        }

        this.resourceRegion = new java.util.ArrayList<StringFilter>(resourceRegion);
    }