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

x33g5p2x  于2022-01-28 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(132)

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

Registry.resourceExists介绍

暂无

代码示例

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

public boolean hasXmppSettings(String userId) {
    boolean hasSettings = false;

    try {
      hasSettings = registry.resourceExists(IdentityRegistryResources.XMPP_SETTINGS_ROOT
          + userId);
    } catch (RegistryException e) {
      log.error("Error when checking the availability of the user " + userId, e);
    }

    return hasSettings;
  }
}

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

public boolean hasXmppSettings(String userId) {
    boolean hasSettings = false;

    try {
      hasSettings = registry.resourceExists(IdentityRegistryResources.XMPP_SETTINGS_ROOT
          + userId);
    } catch (RegistryException e) {
      log.error("Error when checking the availability of the user " + userId, e);
    }

    return hasSettings;
  }
}

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

public boolean hasXmppSettings(String userId) {
    boolean hasSettings = false;

    try {
      hasSettings = registry.resourceExists(IdentityRegistryResources.XMPP_SETTINGS_ROOT
          + userId);
    } catch (RegistryException e) {
      log.error("Error when checking the availability of the user " + userId, e);
    }

    return hasSettings;
  }
}

代码示例来源:origin: org.wso2.carbon.business-process/org.wso2.carbon.bpel

private boolean isDUCollectionIsThere(BPELDeploymentContext deploymentContext)
    throws RegistryException {
  String collectionLocation =
      BPELPackageRepositoryUtils.getResourcePathForBPELPackageContent(deploymentContext);
  return configRegistry.resourceExists(collectionLocation);
}

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

public boolean isServiceProviderExists(String issuer) throws IdentityException {
  String path = IdentityRegistryResources.SAML_SSO_SERVICE_PROVIDERS + encodePath(issuer);
  try {
    return registry.resourceExists(path);
  } catch (RegistryException e) {
    throw IdentityException.error("Error occurred while checking if resource path \'" + path + "\' exists in " +
        "registry");
  }
}

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

public  boolean isServiceProviderExists(String issuer) throws IdentityException {
  String path = IdentityRegistryResources.SAML_SSO_SERVICE_PROVIDERS + encodePath(issuer);
  try {
    return registry.resourceExists(path);
  } catch (RegistryException e) {
    throw IdentityException.error("Error occurred while checking if resource path \'" + path + "\' exists in " +
                  "registry");
  }
}

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

private static Boolean resourceExists(Registry registry, LogEntry entry) {
  try {
    return registry != null && entry != null && entry.getResourcePath() != null &&
        registry.resourceExists(entry.getResourcePath());
  } catch (RegistryException ignore) {
    return false;
  }
}

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

public boolean isServiceProviderExists(String issuer) throws IdentityException {
  String path = IdentityRegistryResources.SAML_SSO_SERVICE_PROVIDERS + encodePath(issuer);
  try {
    return registry.resourceExists(path);
  } catch (RegistryException e) {
    throw IdentityException.error("Error occurred while checking if resource path \'" + path + "\' exists in " +
        "registry");
  }
}

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

public void removeOpenIDSignUp(String openID) {
  try {
    if (registry.resourceExists(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID))) {
      registry.delete(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID));
    }
  } catch (RegistryException e) {
    log.error("Error Removing the OpenID", e);
  }
}

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

public void removeOpenIDSignUp(String openID) {
  try {
    if (registry.resourceExists(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID))) {
      registry.delete(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID));
    }
  } catch (RegistryException e) {
    log.error("Error Removing the OpenID", e);
  }
}

代码示例来源:origin: org.apache.stratos/org.apache.stratos.adc.mgt

public RegistryManager() {
  try {
    if (!registry.resourceExists(CartridgeConstants.DomainMappingInfo.HOSTINFO)) {
      registry.put(CartridgeConstants.DomainMappingInfo.HOSTINFO,
                registry.newCollection());
    }
  } catch (RegistryException e) {
    String msg =
           "Error while accessing registry or initializing domain mapping registry path\n";
    log.error(msg + e.getMessage());
  }
}

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

public void removeOpenIDSignUp(String openID) {
  try {
    if (registry.resourceExists(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID))) {
      registry.delete(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID));
    }
  } catch (RegistryException e) {
    log.error("Error Removing the OpenID", e);
  }
}

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

public void move(String s, String s1) throws ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException {
//         A read only session must not be allowed to move a node
    RegistryJCRItemOperationUtil.validateReadOnlyItemOpr(registrySession);
    try {
      if (userRegistry.resourceExists(s)) {

        userRegistry.move(s, s1);
      }
    } catch (RegistryException e) {
      throw new RepositoryException("RegistryException occurred at Registry level");
    }

  }

代码示例来源:origin: org.wso2.greg/org.wso2.carbon.governance.samples.shutterbug

public void init() {
  try {
    Registry registry =  Utils.getRegistryService().getSystemRegistry();
    if (!registry.resourceExists(shutterbugHome)) {
      Collection col = registry.newCollection();
      registry.put(shutterbugHome, col);
    }
  } catch (Exception e) {
    log.error("An error occured while initializing the Shutterbug Collection Handler", e);
  }
}

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

/**
 * Creates a collection in the given common location.
 *
 * @param commonLocation        location to create the collection.
 * @throws RegistryException    If fails to create a collection at given location.
 */
private void createCollection(String commonLocation) throws RegistryException {
  Registry systemRegistry = CommonUtil.getUnchrootedSystemRegistry(requestContext);
  //Creating a collection if not exists.
  if (!systemRegistry.resourceExists(commonLocation)) {
    systemRegistry.put(commonLocation, systemRegistry.newCollection());
  }
}

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

public boolean isAPIAvailable(APIIdentifier identifier) throws AppManagementException {
  String path = AppMConstants.API_ROOT_LOCATION + RegistryConstants.PATH_SEPARATOR +
         identifier.getProviderName() + RegistryConstants.PATH_SEPARATOR +
         identifier.getApiName() + RegistryConstants.PATH_SEPARATOR + identifier.getVersion();
  try {
    return registry.resourceExists(path);
  } catch (RegistryException e) {
    handleException("Failed to check availability of api :" + path, e);
    return false;
  }
}

代码示例来源:origin: org.wso2.carbon.devicemgt-plugins/org.wso2.carbon.device.mgt.mobile.impl

public static Resource getRegistryResource(String path) throws MobileDeviceMgtPluginException {
  try {
    if(MobileDeviceManagementUtil.getConfigurationRegistry().resourceExists(path)){
      return MobileDeviceManagementUtil.getConfigurationRegistry().get(path);
    }
    return null;
  } catch (RegistryException e) {
    throw new MobileDeviceMgtPluginException("Error in retrieving registry resource : " +
                         e.getMessage(), e);
  }
}

代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.analytics.dashboard

public static void removeRegistryResource(String resourcePath) throws RegistryException {
  int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
  Registry registry = ServiceHolder.getRegistryService().getConfigSystemRegistry(tenantId);
  if (registry.resourceExists(resourcePath)) {
    Resource resource = registry.get(resourcePath);
    registry.delete(resourcePath);
  }
}

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

private void deleteOldResource(RequestContext context, Resource metaDataResource, WSDLInfo wsdlInfo, String wsdlPath, Resource wsdlResource) throws RegistryException {
  if(wsdlInfo.isMasterWSDL()){
    if (metaDataResource != null) {
      wsdlResource.setUUID(metaDataResource.getUUID());
    }
    if(!wsdlPath.equals(context.getResourcePath().getPath())
        && registry.resourceExists(context.getResourcePath().getPath())){
      registry.delete(context.getResourcePath().getPath());
    }
  }
}

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

@Override
public void createLink(RequestContext requestContext) throws RegistryException {
  String symlinkPath = requestContext.getResourcePath().getPath();
  String targetResourcePath = requestContext.getTargetPath();
  if (requestContext.getRegistry().resourceExists(targetResourcePath)) {
    Resource r = requestContext.getRegistry().get(targetResourcePath);
    r.addProperty("registry.resource.symlink.path", symlinkPath);
    requestContext.getRegistry().put(targetResourcePath, r);
  }
}

相关文章