org.wso2.carbon.registry.core.Collection.setMediaType()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中org.wso2.carbon.registry.core.Collection.setMediaType()方法的一些代码示例,展示了Collection.setMediaType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collection.setMediaType()方法的具体详情如下:
包路径:org.wso2.carbon.registry.core.Collection
类名称:Collection
方法名:setMediaType

Collection.setMediaType介绍

暂无

代码示例

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

if (!registry.resourceExists(versionCollectionPath)) {
      Collection collection = registry.newCollection();
      collection.setMediaType(
          CommonConstants.PROCESS_VERSION_COLLECTION_MEDIA_TYPE);
      registry.put(versionCollectionPath, collection);
    collection.setMediaType(CommonConstants.PROCESS_MAJOR_VERSION_MEDIA_TYPE);
    registry.put(majorVersionPath, collection);
  collection.setMediaType(CommonConstants.PROCESS_MINOR_VERSION_MEDIA_TYPE);
  registry.put(minorVersionPath, collection);
collection.setMediaType(CommonConstants.PROCESS_PATCH_VERSION_MEDIA_TYPE);
registry.put(patchVersionPath, collection);

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement

@Override
public void setGlobalPolicyAlgorithm(String policyCombiningAlgorithm) throws EntitlementException {
  Registry registry = EntitlementServiceComponent.
      getGovernanceRegistry(CarbonContext.getThreadLocalCarbonContext().getTenantId());
  try {
    Collection policyCollection;
    if (registry.resourceExists(policyDataCollection)) {
      policyCollection = (Collection) registry.get(policyDataCollection);
    } else {
      policyCollection = registry.newCollection();
    }
    policyCollection.setMediaType(PDPConstants.REGISTRY_MEDIA_TYPE);
    policyCollection.setProperty("globalPolicyCombiningAlgorithm", policyCombiningAlgorithm);
    registry.put(policyDataCollection, policyCollection);
  } catch (RegistryException e) {
    log.error("Error while updating Global combing algorithm in policy store ", e);
    throw new EntitlementException("Error while updating combing algorithm in policy store");
  }
}

代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions

if (!registry.resourceExists(versionCollectionPath)) {
      Collection collection = registry.newCollection();
      collection.setMediaType(
          CommonConstants.SLA_VERSION_COLLECTION_MEDIA_TYPE);
      registry.put(versionCollectionPath, collection);
    collection.setMediaType(CommonConstants.SLA_MAJOR_VERSION_MEDIA_TYPE);
    registry.put(majorVersionPath, collection);
  collection.setMediaType(CommonConstants.SLA_MINOR_VERSION_MEDIA_TYPE);
  registry.put(minorVersionPath, collection);
collection.setMediaType(CommonConstants.SLA_PATCH_VERSION_MEDIA_TYPE);
registry.put(patchVersionPath, collection);

相关文章