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

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

本文整理了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

  1. @Override
  2. public String getGlobalPolicyAlgorithmName() {
  3. String algorithm = null;
  4. try {
  5. Registry registry = getGovernanceRegistry();
  6. if (registry.resourceExists(policyDataCollection)) {
  7. Collection collection = (Collection) registry.get(policyDataCollection);
  8. algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");
  9. }
  10. } catch (RegistryException e) {
  11. if (log.isDebugEnabled()) {
  12. log.debug(e);
  13. }
  14. } catch (EntitlementException e) {
  15. log.error("Error while getting Global Policy Combining Algorithm Name.", e);
  16. }
  17. // set default
  18. if (algorithm == null) {
  19. algorithm = "deny-overrides";
  20. }
  21. return algorithm;
  22. }

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

  1. @Override
  2. public String getGlobalPolicyAlgorithmName() {
  3. String algorithm = null;
  4. try {
  5. Registry registry = getGovernanceRegistry();
  6. if (registry.resourceExists(policyDataCollection)) {
  7. Collection collection = (Collection) registry.get(policyDataCollection);
  8. algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");
  9. }
  10. } catch (RegistryException e) {
  11. if (log.isDebugEnabled()) {
  12. log.debug(e);
  13. }
  14. } catch (EntitlementException e) {
  15. log.error("Error while getting Global Policy Combining Algorithm Name.", e);
  16. }
  17. // set default
  18. if (algorithm == null) {
  19. algorithm = "deny-overrides";
  20. }
  21. return algorithm;
  22. }

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

  1. /**
  2. * This reads the policy combining algorithm from registry resource property
  3. *
  4. * @return policy combining algorithm as String
  5. * @throws EntitlementException throws
  6. */
  7. public String readPolicyCombiningAlgorithm() throws EntitlementException {
  8. try {
  9. Collection policyCollection = null;
  10. if (registry.resourceExists(policyStorePath)) {
  11. policyCollection = (Collection) registry.get(policyStorePath);
  12. }
  13. if (policyCollection != null) {
  14. return policyCollection.getProperty("globalPolicyCombiningAlgorithm");
  15. }
  16. return null;
  17. } catch (RegistryException e) {
  18. log.error("Error while reading policy combining algorithm", e);
  19. throw new EntitlementException("Error while reading policy combining algorithm", e);
  20. }
  21. }

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

  1. /**
  2. * This reads the policy combining algorithm from registry resource property
  3. *
  4. * @return policy combining algorithm as String
  5. * @throws EntitlementException throws
  6. */
  7. public String readPolicyCombiningAlgorithm() throws EntitlementException {
  8. try {
  9. Collection policyCollection = null;
  10. if (registry.resourceExists(policyStorePath)) {
  11. policyCollection = (Collection) registry.get(policyStorePath);
  12. }
  13. if (policyCollection != null) {
  14. return policyCollection.getProperty("globalPolicyCombiningAlgorithm");
  15. }
  16. return null;
  17. } catch (RegistryException e) {
  18. log.error("Error while reading policy combining algorithm", e);
  19. throw new EntitlementException("Error while reading policy combining algorithm", e);
  20. }
  21. }

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

  1. /**
  2. * This reads the policy combining algorithm from registry resource property
  3. *
  4. * @return policy combining algorithm as String
  5. * @throws EntitlementException throws
  6. */
  7. public String readPolicyCombiningAlgorithm() throws EntitlementException {
  8. try {
  9. Collection policyCollection = null;
  10. if (registry.resourceExists(policyStorePath)) {
  11. policyCollection = (Collection) registry.get(policyStorePath);
  12. }
  13. if (policyCollection != null) {
  14. return policyCollection.getProperty("globalPolicyCombiningAlgorithm");
  15. }
  16. return null;
  17. } catch (RegistryException e) {
  18. log.error("Error while reading policy combining algorithm", e);
  19. throw new EntitlementException("Error while reading policy combining algorithm", e);
  20. }
  21. }

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

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

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

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

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

  1. algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");

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

  1. @Override
  2. public String getGlobalPolicyAlgorithmName() {
  3. Registry registry = EntitlementServiceComponent.
  4. getGovernanceRegistry(CarbonContext.getThreadLocalCarbonContext().getTenantId());
  5. String algorithm = null;
  6. try {
  7. if (registry.resourceExists(policyDataCollection)) {
  8. Collection collection = (Collection) registry.get(policyDataCollection);
  9. algorithm = collection.getProperty("globalPolicyCombiningAlgorithm");
  10. }
  11. } catch (RegistryException e) {
  12. if (log.isDebugEnabled()) {
  13. log.debug(e);
  14. }
  15. }
  16. // set default
  17. if (algorithm == null) {
  18. algorithm = "deny-overrides";
  19. }
  20. return algorithm;
  21. }

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

  1. public TimeRange getDataRetentionPeriod() throws BAMException {
  2. try {
  3. if (registry.resourceExists(BAMRegistryResources.GLOBAL_CONFIG_PATH)) {
  4. Collection configCollection = (Collection)registry.get(BAMRegistryResources.GLOBAL_CONFIG_PATH);
  5. String period = configCollection.getProperty(BAMRegistryResources.DATA_RETENTION_PROPERTY);
  6. return TimeRange.parseTimeRange(period);
  7. }
  8. } catch (RegistryException e) {
  9. String msg = "Could not retrieve the data retention policy in registry";
  10. //log.error(msg);
  11. throw new BAMException(msg, e);
  12. }
  13. return null;
  14. }

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

  1. public TimeRange getDataArchivalPeriod() throws BAMException {
  2. try {
  3. if (registry.resourceExists(BAMRegistryResources.GLOBAL_CONFIG_PATH)) {
  4. Collection configCollection = (Collection) registry
  5. .get(BAMRegistryResources.GLOBAL_CONFIG_PATH);
  6. String period = configCollection
  7. .getProperty(BAMRegistryResources.DATA_ARCHIVAL_PROPERTY);
  8. return TimeRange.parseTimeRange(period);
  9. }
  10. } catch (RegistryException e) {
  11. String msg = "Could not retrieve the data archival policy in registry";
  12. //log.error(msg);
  13. throw new BAMException(msg, e);
  14. }
  15. return null;
  16. }

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

  1. /**
  2. * @param rememberMe
  3. * @return
  4. * @throws IdentityException
  5. */
  6. public String getToken(OpenIDRememberMeDO rememberMe) throws IdentityException {
  7. Collection userResource = null;
  8. String value = null;
  9. try {
  10. if (!registry.resourceExists(RegistryConstants.PROFILES_PATH + rememberMe.getUserName())) {
  11. return null;
  12. } else {
  13. userResource =
  14. (Collection) registry.get(RegistryConstants.PROFILES_PATH +
  15. rememberMe.getUserName());
  16. }
  17. value = userResource.getProperty("OpenIDRememberMeToken");
  18. } catch (Exception e) {
  19. log.error("Error occured while updating OpenID remember me token", e);
  20. throw IdentityException.error("Error occured while updating OpenID remember me token", e);
  21. }
  22. return value;
  23. }

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

  1. /**
  2. * @param rememberMe
  3. * @return
  4. * @throws IdentityException
  5. */
  6. public String getToken(OpenIDRememberMeDO rememberMe) throws IdentityException {
  7. Collection userResource = null;
  8. String value = null;
  9. try {
  10. if (!registry.resourceExists(RegistryConstants.PROFILES_PATH + rememberMe.getUserName())) {
  11. return null;
  12. } else {
  13. userResource =
  14. (Collection) registry.get(RegistryConstants.PROFILES_PATH +
  15. rememberMe.getUserName());
  16. }
  17. value = userResource.getProperty("OpenIDRememberMeToken");
  18. } catch (Exception e) {
  19. log.error("Error occured while updating OpenID remember me token", e);
  20. throw IdentityException.error("Error occured while updating OpenID remember me token", e);
  21. }
  22. return value;
  23. }

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

  1. /**
  2. * @param rememberMe
  3. * @return
  4. * @throws IdentityException
  5. */
  6. public String getToken(OpenIDRememberMeDO rememberMe) throws IdentityException {
  7. Collection userResource = null;
  8. String value = null;
  9. try {
  10. if (!registry.resourceExists(RegistryConstants.PROFILES_PATH + rememberMe.getUserName())) {
  11. return null;
  12. } else {
  13. userResource =
  14. (Collection) registry.get(RegistryConstants.PROFILES_PATH +
  15. rememberMe.getUserName());
  16. }
  17. value = userResource.getProperty("OpenIDRememberMeToken");
  18. } catch (Exception e) {
  19. log.error("Error occured while updating OpenID remember me token", e);
  20. throw IdentityException.error("Error occured while updating OpenID remember me token", e);
  21. }
  22. return value;
  23. }

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

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

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

  1. String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
  2. nodeRoot = new UIPermissionNode(UserMgtConstants.UI_PERMISSION_ROOT, displayName);
  3. } else {
  4. displayName = parent.getProperty(UserMgtConstants.DISPLAY_NAME);
  5. } else {
  6. displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);

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

  1. String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
  2. nodeRoot = new UIPermissionNode(UserMgtConstants.UI_PERMISSION_ROOT, displayName);
  3. } else {
  4. displayName = parent.getProperty(UserMgtConstants.DISPLAY_NAME);
  5. } else {
  6. displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);

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

  1. if (tenantId == MultitenantConstants.SUPER_TENANT_ID) {
  2. regRoot = (Collection) registry.get(UserMgtConstants.UI_PERMISSION_ROOT);
  3. String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
  4. nodeRoot = new UIPermissionNode(UserMgtConstants.UI_PERMISSION_ROOT, displayName);
  5. } else {
  6. displayName = parent.getProperty(UserMgtConstants.DISPLAY_NAME);
  7. } else {
  8. displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);

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

  1. if (tenantId == MultitenantConstants.SUPER_TENANT_ID) {
  2. regRoot = (Collection) registry.get(UserMgtConstants.UI_PERMISSION_ROOT);
  3. String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
  4. nodeRoot = new UIPermissionNode(UserMgtConstants.UI_PERMISSION_ROOT, displayName);
  5. } else {
  6. displayName = parent.getProperty(UserMgtConstants.DISPLAY_NAME);
  7. } else {
  8. displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);

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

  1. String noOfPolicies = policyCollection.getProperty(PDPConstants.MAX_POLICY_ORDER);
  2. if (noOfPolicies != null && Integer.parseInt(noOfPolicies) < policy.getPolicyOrder()) {
  3. policyCollection.setProperty(PDPConstants.MAX_POLICY_ORDER,
  4. if (policyCollection != null) {
  5. int policyOrder = 1;
  6. String noOfPolicies = policyCollection.getProperty(PDPConstants.MAX_POLICY_ORDER);
  7. if (noOfPolicies != null) {
  8. policyOrder = policyOrder + Integer.parseInt(noOfPolicies);

相关文章