Create Anti-affinity policy

@param createConfig policy config
@return OperationFuture wrapper for AntiAffinityPolicy
774164
public OperationFuture<AntiAffinityPolicy> create(AntiAffinityPolicyConfig createConfig) {
        AntiAffinityPolicyMetadata policy = client.createAntiAffinityPolicy(
            new AntiAffinityPolicyRequest()
                .name(createConfig.getName())
                .location(dataCenterService.findByRef(createConfig.getDataCenter()).getId())
        );

        return new OperationFuture<>(
            AntiAffinityPolicy.refById(policy.getId()),
            new NoWaitingJobFuture()
        );
    }
835168
public FilterChain create() throws FilterConfigurationException {
        Preconditions.checkState(filters != null, "list of filters must be set");
        Preconditions.checkState(inputType != null, "inputType must be set");
        Preconditions.checkState(outputType != null, "outputType must be set");

        Preconditions.checkState(filters.size() > 0, "need at least one filter");
        validateFiltersList();

        Iterator<Object> iterator = filters.iterator();

        FilterChainElement firstInstance = getInstanceFromListElement(iterator.next());
        if (!firstInstance.getSupportedInputType().isAssignableFrom(inputType)
                || !firstInstance.getSupportedOutputType().isAssignableFrom(outputType)) {
            throw new FilterConfigurationException(String.format(
                "incompatible Filtertype (%s) should be (%s->%s) - is (%s->%s)",
                firstInstance.getClass(), inputType, outputType, firstInstance.getSupportedInputType(),
                firstInstance.getSupportedOutputType()));
        }
        FilterChainElement current = firstInstance;
        while (iterator.hasNext()) {
            Object next = iterator.next();
            FilterChainElement nextFilterElement = getInstanceFromListElement(next);
            if (nextFilterElement == null) {
                current.setNext((FilterAction) next);
                break;
            }
            current.setNext(nextFilterElement);
            current = nextFilterElement;
        }
        return new FilterChain(firstInstance);
    }
975446
public function createPolicyWithLimitation(
        ?PolicyCreateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(PolicyCreateWithLimitationType::class);

        return $this->formFactory->createNamed($name, PolicyCreateWithLimitationType::class, $data);
    }
942832
public static Set<Policy> policies(Config config) {
    CollisionSettings settings = new CollisionSettings(config);
    return settings.density()
        .map(density -> new CollisionPolicy(settings, density))
        .collect(toSet());
  }
937354
public static CuratorFramework newAppCurator(FluoConfiguration config) {
    return newCurator(config.getAppZookeepers(), config.getZookeeperTimeout(),
        config.getZookeeperSecret());
  }
921777
public AntiSamy createAntiSamy(CmsObject cms, String policyPath) {

        String rootPath = cms.addSiteRoot(policyPath);
        Policy policy = null;
        if (policyPath != null) {
            Object cacheValue = CmsVfsMemoryObjectCache.getVfsMemoryObjectCache().getCachedObject(cms, rootPath);
            if (cacheValue == null) {
                policy = readPolicy(cms, policyPath);
                if (policy != null) {
                    CmsVfsMemoryObjectCache.getVfsMemoryObjectCache().putCachedObject(cms, rootPath, policy);
                }
            } else {
                policy = (Policy)cacheValue;
            }
        }
        if (policy == null) {
            policy = defaultPolicy;
        }
        if (policy != null) {
            return new AntiSamy(policy);
        }
        return null;
    }
793764
@Override
	public <T extends Endpoint> Strategy<T> create() {
		return new XorShiftRandomStrategy<T>(broker, preferLocal);
	}
317338
public static Set<Policy> policies(Config config) {
    BasicSettings settings = new BasicSettings(config);
    return settings.admission().stream().map(admission ->
      new SegmentedLruPolicy(admission, config)
    ).collect(toSet());
  }
237679
public static Set<Policy> policies(Config config) {
    WindowTinyLfuSettings settings = new WindowTinyLfuSettings(config);
    return settings.percentMain().stream()
        .map(percentMain -> new WindowTinyLfuPolicy(percentMain, settings))
        .collect(toSet());
  }
134835
public OperationFuture<List<AlertPolicy>> modify(List<AlertPolicy> policyRefs,
        AlertPolicyConfig modifyConfig) {

        policyRefs.forEach(ref -> modify(ref, modifyConfig));

        return new OperationFuture<>(
            policyRefs,
            new NoWaitingJobFuture()
        );
    }
671329
@Override
	public <T extends Endpoint> Strategy<T> create() {
		return new SecureRandomStrategy<T>(broker, preferLocal);
	}
1195223
@SuppressWarnings("deprecation")
	OperationalConfig buildOperationalConfig() {
		return new OperationalConfigImpl(isAsync(), getProperties(), getSessionTimeout(), getThreadPoolSize(), isTransportModeLoggingOnly(), isDebugLogging(),
				getSslHostsToTrust(), isTrustAllSSLHost());
	}
923440
public static Policy createPolicy(final String resourceName) {
		if (StringUtils.isBlank(resourceName)) {
			throw new SystemException("AntiSamy Policy resourceName cannot be null ");
		}
		URL resource = HtmlSanitizerUtil.class.getClassLoader().getResource(resourceName);
		if (resource == null) {
			throw new SystemException("Could not find AntiSamy Policy XML resource.");
		}
		try {
			return Policy.getInstance(resource);
		} catch (PolicyException ex) {
			throw new SystemException("Could not create AntiSamy Policy" + ex.getMessage(), ex);
		}
	}
1006564
func (s *AffinityGroupService) CreateAffinityGroup(p *CreateAffinityGroupParams) (*CreateAffinityGroupResponse, error) {
	resp, err := s.cs.newRequest("createAffinityGroup", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r CreateAffinityGroupResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
1186294
public HFCAAffiliation createDecendent(String name) throws InvalidArgumentException, AffiliationException {
        if (this.deleted) {
            throw new AffiliationException("Affiliation has been deleted");
        }
        validateAffiliationNames(name);
        return new HFCAAffiliation(this.name + "." + name, this.client);
    }
13809
public Optional<SyntheticsAlertCondition> create(long policyId, SyntheticsAlertCondition condition)
    {
        return HTTP.POST(String.format("/v2/alerts_synthetics_conditions/policies/%d.json", policyId), condition, SYNTHETICS_ALERT_CONDITION);
    }
20576
public static function create(ConfigFactoryInterface $config) {
    // Get broker url from config.
    $settings = $config->get(IslandoraSettingsForm::CONFIG_NAME);
    $brokerUrl = $settings->get(IslandoraSettingsForm::BROKER_URL);

    // Try a sensible default if one hasn't been configured.
    if (empty($brokerUrl)) {
      $brokerUrl = "tcp://localhost:61613";
    }

    $client = new Client($brokerUrl);
    return new StatefulStomp($client);
  }