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

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

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

Collection.getContent介绍

暂无

代码示例

代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.api

  1. /**
  2. * Retrieve all the governance artifact paths which associated with the given lifecycle in the given lifecycle state
  3. *
  4. * @param registry registry instance
  5. * @param lcName lifecycle name
  6. * @param lcState lifecycle state
  7. * @param mediaType mediatype of the artifacts
  8. * @return String array of all the artifact paths
  9. * @throws GovernanceException if the operation failed.
  10. */
  11. public static String[] getAllArtifactPathsByLifecycleState(
  12. Registry registry, String lcName, String lcState, String mediaType) throws GovernanceException {
  13. String sql = "SELECT R.REG_PATH_ID, R.REG_NAME FROM REG_RESOURCE R, REG_PROPERTY PP, " +
  14. "REG_RESOURCE_PROPERTY RP WHERE R.REG_VERSION=RP.REG_VERSION AND RP.REG_PROPERTY_ID=PP.REG_ID " +
  15. "AND PP.REG_NAME = ? AND PP.REG_VALUE = ? AND R.REG_MEDIA_TYPE = ?";
  16. Map<String, String> parameter = new HashMap<String, String>();
  17. parameter.put("1", "registry.lifecycle." + lcName + ".state");
  18. parameter.put("2", lcState);
  19. parameter.put("3", mediaType);
  20. parameter.put("query", sql);
  21. try {
  22. return (String[]) registry.executeQuery(null, parameter).getContent();
  23. } catch (RegistryException e) {
  24. String msg = "Error occured while executing custom query";
  25. throw new GovernanceException(msg, e);
  26. }
  27. }

代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.api

  1. /**
  2. * Retrieve all the governance artifact paths which associated with the given lifecycle
  3. *
  4. * @param registry registry instance
  5. * @param lcName lifecycle name
  6. * @param mediaType mediatype of the artifacts
  7. * @return String array of all the artifact paths
  8. * @throws GovernanceException if the operation failed.
  9. */
  10. public static String[] getAllArtifactPathsByLifecycle(Registry registry, String lcName, String mediaType) throws GovernanceException {
  11. String sql = "SELECT R.REG_PATH_ID, R.REG_NAME FROM REG_RESOURCE R, REG_PROPERTY PP, " +
  12. "REG_RESOURCE_PROPERTY RP WHERE R.REG_VERSION=RP.REG_VERSION AND RP.REG_PROPERTY_ID=PP.REG_ID " +
  13. "AND PP.REG_NAME = ? AND PP.REG_VALUE = ? AND R.REG_MEDIA_TYPE = ?";
  14. Map<String, String> parameter = new HashMap<String, String>();
  15. parameter.put("1", "registry.LC.name");
  16. parameter.put("2", lcName);
  17. parameter.put("3", mediaType);
  18. parameter.put("query", sql);
  19. try {
  20. return (String[]) registry.executeQuery(null, parameter).getContent();
  21. } catch (RegistryException e) {
  22. String msg = "Error occured while executing custom query";
  23. throw new GovernanceException(msg, e);
  24. }
  25. }

代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.eventing.impl

  1. if (registry.resourceExists(subscriptionsCollection)) {
  2. Collection subs = (Collection) registry.get(subscriptionsCollection);
  3. String[] subsPaths = (String[]) subs.getContent();
  4. for (String subsPath : subsPaths) {
  5. Resource resource = registry.get(subsPath);

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

  1. if (userRegistry.resourceExists(topicResourcePath)) {
  2. Collection subscriptions = (Collection) userRegistry.get(topicResourcePath);
  3. String[] subscriptionPaths = (String[]) subscriptions.getContent();
  4. for (String subscriptionPath : subscriptionPaths) {
  5. Resource resource = userRegistry.get(subscriptionPath);

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

  1. String [] paths;
  2. try {
  3. paths = (String [])registry.searchContent(content).getContent();
  4. } catch (Exception e) {
  5. return new ResourceData[0];

相关文章