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

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

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

Collection.getProperty介绍

暂无

代码示例

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

@Override
public String getGlobalPolicyAlgorithmName() {
  String algorithm = null;
  try {
    Registry registry = getGovernanceRegistry();
    if (registry.resourceExists(policyDataCollection)) {
      Collection collection = (Collection) registry.get(policyDataCollection);
      algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");
    }
  } catch (RegistryException e) {
    if (log.isDebugEnabled()) {
      log.debug(e);
    }
  } catch (EntitlementException e) {
    log.error("Error while getting Global Policy Combining Algorithm Name.", e);
  }
  // set default
  if (algorithm == null) {
    algorithm = "deny-overrides";
  }
  return algorithm;
}

代码示例来源:origin: wso2/carbon-identity-framework

@Override
public String getGlobalPolicyAlgorithmName() {
  String algorithm = null;
  try {
    Registry registry = getGovernanceRegistry();
    if (registry.resourceExists(policyDataCollection)) {
      Collection collection = (Collection) registry.get(policyDataCollection);
      algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");
    }
  } catch (RegistryException e) {
    if (log.isDebugEnabled()) {
      log.debug(e);
    }
  } catch (EntitlementException e) {
    log.error("Error while getting Global Policy Combining Algorithm Name.", e);
  }
  // set default
  if (algorithm == null) {
    algorithm = "deny-overrides";
  }
  return algorithm;
}

代码示例来源:origin: wso2/carbon-identity-framework

/**
 * This reads the policy combining algorithm from registry resource property
 *
 * @return policy combining algorithm as String
 * @throws EntitlementException throws
 */
public String readPolicyCombiningAlgorithm() throws EntitlementException {
  try {
    Collection policyCollection = null;
    if (registry.resourceExists(policyStorePath)) {
      policyCollection = (Collection) registry.get(policyStorePath);
    }
    if (policyCollection != null) {
      return policyCollection.getProperty("globalPolicyCombiningAlgorithm");
    }
    return null;
  } catch (RegistryException e) {
    log.error("Error while reading policy combining algorithm", e);
    throw new EntitlementException("Error while reading policy combining algorithm", e);
  }
}

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

/**
 * This reads the policy combining algorithm from registry resource property
 *
 * @return policy combining algorithm as String
 * @throws EntitlementException throws
 */
public String readPolicyCombiningAlgorithm() throws EntitlementException {
  try {
    Collection policyCollection = null;
    if (registry.resourceExists(policyStorePath)) {
      policyCollection = (Collection) registry.get(policyStorePath);
    }
    if (policyCollection != null) {
      return policyCollection.getProperty("globalPolicyCombiningAlgorithm");
    }
    return null;
  } catch (RegistryException e) {
    log.error("Error while reading policy combining algorithm", e);
    throw new EntitlementException("Error while reading policy combining algorithm", e);
  }
}

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

/**
 * This reads the policy combining algorithm from registry resource property
 *
 * @return policy combining algorithm as String
 * @throws EntitlementException throws
 */
public String readPolicyCombiningAlgorithm() throws EntitlementException {
  try {
    Collection policyCollection = null;
    if (registry.resourceExists(policyStorePath)) {
      policyCollection = (Collection) registry.get(policyStorePath);
    }
    if (policyCollection != null) {
      return policyCollection.getProperty("globalPolicyCombiningAlgorithm");
    }
    return null;
  } catch (RegistryException e) {
    log.error("Error while reading policy combining algorithm", e);
    throw new EntitlementException("Error while reading policy combining algorithm", e);
  }
}

代码示例来源:origin: wso2/carbon-identity-framework

if (registry.resourceExists(policyDataCollection)) {
  Collection collection = (Collection) registry.get(policyDataCollection);
  algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");

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

if (registry.resourceExists(policyDataCollection)) {
  Collection collection = (Collection) registry.get(policyDataCollection);
  algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");

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

algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");

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

@Override
public String getGlobalPolicyAlgorithmName() {
  Registry registry = EntitlementServiceComponent.
      getGovernanceRegistry(CarbonContext.getThreadLocalCarbonContext().getTenantId());
  String algorithm = null;
  try {
    if (registry.resourceExists(policyDataCollection)) {
      Collection collection = (Collection) registry.get(policyDataCollection);
      algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");
    }
  } catch (RegistryException e) {
    if (log.isDebugEnabled()) {
      log.debug(e);
    }
  }
  // set default
  if (algorithm == null) {
    algorithm = "deny-overrides";
  }
  return algorithm;
}

代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core

public TimeRange getDataRetentionPeriod() throws BAMException {
  try {
    if (registry.resourceExists(BAMRegistryResources.GLOBAL_CONFIG_PATH)) {
      Collection configCollection = (Collection)registry.get(BAMRegistryResources.GLOBAL_CONFIG_PATH);
      String period = configCollection.getProperty(BAMRegistryResources.DATA_RETENTION_PROPERTY);
      return TimeRange.parseTimeRange(period);
    }
  } catch (RegistryException e) {
    String msg = "Could not retrieve the data retention policy in registry";
    //log.error(msg);
    throw new BAMException(msg, e);
  }
  return null;
}

代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core

public TimeRange getDataArchivalPeriod() throws BAMException {
  try {
    if (registry.resourceExists(BAMRegistryResources.GLOBAL_CONFIG_PATH)) {
      Collection configCollection = (Collection) registry
          .get(BAMRegistryResources.GLOBAL_CONFIG_PATH);
      String period = configCollection
          .getProperty(BAMRegistryResources.DATA_ARCHIVAL_PROPERTY);
      return TimeRange.parseTimeRange(period);
    }
  } catch (RegistryException e) {
    String msg = "Could not retrieve the data archival policy in registry";
    //log.error(msg);
    throw new BAMException(msg, e);
  }
  return null;
}

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

/**
 * @param rememberMe
 * @return
 * @throws IdentityException
 */
public String getToken(OpenIDRememberMeDO rememberMe) throws IdentityException {
  Collection userResource = null;
  String value = null;
  try {
    if (!registry.resourceExists(RegistryConstants.PROFILES_PATH + rememberMe.getUserName())) {
      return null;
    } else {
      userResource =
          (Collection) registry.get(RegistryConstants.PROFILES_PATH +
              rememberMe.getUserName());
    }
    value = userResource.getProperty("OpenIDRememberMeToken");
  } catch (Exception e) {
    log.error("Error occured while updating OpenID remember me token", e);
    throw IdentityException.error("Error occured while updating OpenID remember me token", e);
  }
  return value;
}

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

/**
 * @param rememberMe
 * @return
 * @throws IdentityException
 */
public String getToken(OpenIDRememberMeDO rememberMe) throws IdentityException {
  Collection userResource = null;
  String value = null;
  try {
    if (!registry.resourceExists(RegistryConstants.PROFILES_PATH + rememberMe.getUserName())) {
      return null;
    } else {
      userResource =
          (Collection) registry.get(RegistryConstants.PROFILES_PATH +
              rememberMe.getUserName());
    }
    value = userResource.getProperty("OpenIDRememberMeToken");
  } catch (Exception e) {
    log.error("Error occured while updating OpenID remember me token", e);
    throw IdentityException.error("Error occured while updating OpenID remember me token", e);
  }
  return value;
}

代码示例来源:origin: wso2/carbon-identity-framework

/**
 * @param rememberMe
 * @return
 * @throws IdentityException
 */
public String getToken(OpenIDRememberMeDO rememberMe) throws IdentityException {
  Collection userResource = null;
  String value = null;
  try {
    if (!registry.resourceExists(RegistryConstants.PROFILES_PATH + rememberMe.getUserName())) {
      return null;
    } else {
      userResource =
          (Collection) registry.get(RegistryConstants.PROFILES_PATH +
              rememberMe.getUserName());
    }
    value = userResource.getProperty("OpenIDRememberMeToken");
  } catch (Exception e) {
    log.error("Error occured while updating OpenID remember me token", e);
    throw IdentityException.error("Error occured while updating OpenID remember me token", e);
  }
  return value;
}

代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.event.core

subscriptionDetails.setId(subscription.getProperty("Name"));
subscriptionDetails.setOwner(subscription.getProperty("Owner"));
subscriptionDetails.setCreatedTime(ConverterUtil.convertToDate(subscription.getProperty("createdTime")));

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

String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
  nodeRoot = new UIPermissionNode(UserMgtConstants.UI_PERMISSION_ROOT, displayName);
} else {
    displayName = parent.getProperty(UserMgtConstants.DISPLAY_NAME);
  } else {
    displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);

代码示例来源:origin: wso2/carbon-identity-framework

String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
  nodeRoot = new UIPermissionNode(UserMgtConstants.UI_PERMISSION_ROOT, displayName);
} else {
    displayName = parent.getProperty(UserMgtConstants.DISPLAY_NAME);
  } else {
    displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);

代码示例来源:origin: wso2/carbon-identity-framework

if (tenantId == MultitenantConstants.SUPER_TENANT_ID) {
  regRoot = (Collection) registry.get(UserMgtConstants.UI_PERMISSION_ROOT);
  String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
  nodeRoot = new UIPermissionNode(UserMgtConstants.UI_PERMISSION_ROOT, displayName);
} else {
    displayName = parent.getProperty(UserMgtConstants.DISPLAY_NAME);
  } else {
    displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);

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

if (tenantId == MultitenantConstants.SUPER_TENANT_ID) {
  regRoot = (Collection) registry.get(UserMgtConstants.UI_PERMISSION_ROOT);
  String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
  nodeRoot = new UIPermissionNode(UserMgtConstants.UI_PERMISSION_ROOT, displayName);
} else {
    displayName = parent.getProperty(UserMgtConstants.DISPLAY_NAME);
  } else {
    displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);

代码示例来源:origin: wso2/carbon-identity-framework

String noOfPolicies = policyCollection.getProperty(PDPConstants.MAX_POLICY_ORDER);
if (noOfPolicies != null && Integer.parseInt(noOfPolicies) < policy.getPolicyOrder()) {
  policyCollection.setProperty(PDPConstants.MAX_POLICY_ORDER,
  if (policyCollection != null) {
    int policyOrder = 1;
    String noOfPolicies = policyCollection.getProperty(PDPConstants.MAX_POLICY_ORDER);
    if (noOfPolicies != null) {
      policyOrder = policyOrder + Integer.parseInt(noOfPolicies);

相关文章