Examples of RegistryCacheKey


Examples of org.wso2.carbon.caching.core.registry.RegistryCacheKey

                                                   String resourcePath) {
        RegistryContext registryContext = RegistryContext.getBaseInstance();
        String absoluteLocalRepositoryPath = getAbsolutePath(registryContext,
                RegistryConstants.LOCAL_REPOSITORY_BASE_PATH);
        if (resourcePath != null && resourcePath.startsWith(absoluteLocalRepositoryPath)) {
            return new RegistryCacheKey(resourcePath, tenantId,
                    registryContext.getNodeIdentifier() + ":" + connectionId);
        } else {
            return new RegistryCacheKey(resourcePath, tenantId, connectionId);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.caching.core.registry.RegistryCacheKey

    public Resource get(String path) throws RegistryException {
        if (isCommunityFeatureRequest(path)) {
            return registry.get(path);
        }
        Resource resource;
        RegistryCacheKey registryCacheKey = getRegistryCacheKey(registry, path);

        if (!cache.containsKey(registryCacheKey)) {
            resource = registry.get(path);
            if (resource.getProperty(RegistryConstants.REGISTRY_LINK) == null) {
                cache.put(registryCacheKey, new GhostResource<Resource>(resource));
View Full Code Here

Examples of org.wso2.carbon.caching.core.registry.RegistryCacheKey

    public Collection get(String path, int start, int pageSize) throws RegistryException {
        if (isCommunityFeatureRequest(path)) {
            return registry.get(path, start, pageSize);
        }
        Collection collection;
        RegistryCacheKey registryCacheKey = getRegistryCacheKey(registry, path +
                ";start=" + start + ";pageSize=" + pageSize);

        if (!cache.containsKey(registryCacheKey)) {
            collection = registry.get(path, start, pageSize);
            if (collection.getProperty(RegistryConstants.REGISTRY_LINK) == null) {
View Full Code Here

Examples of org.wso2.carbon.caching.core.registry.RegistryCacheKey

        }
        return false;
    }

    public boolean resourceExists(String path) throws RegistryException {
        RegistryCacheKey registryCacheKey = getRegistryCacheKey(registry, path);
        if (cache.containsKey(registryCacheKey)) {
            return true;
        } else if (registry.resourceExists(path)) {
            cache.put(registryCacheKey, new GhostResource<Resource>(null));
            return true;
View Full Code Here

Examples of org.wso2.carbon.caching.core.registry.RegistryCacheKey

                registryContext.getDefaultDataBaseConfiguration();
        if (dataBaseConfiguration != null) {
            connectionId = dataBaseConfiguration.getUserName() + "@" +
                    dataBaseConfiguration.getDbUrl();
        }
        RegistryCacheKey registryCacheKey =
                RegistryUtils.buildRegistryCacheKey(connectionId, CurrentSession.getTenantId(),
                        cachePath);
        if (cache.containsKey(registryCacheKey)) {
            cache.remove(registryCacheKey);
        }
View Full Code Here

Examples of org.wso2.carbon.caching.core.registry.RegistryCacheKey

                    RegistryCacheEntry e = new RegistryCacheEntry(pathId);
                    String connectionId = null;
                    if (conn.getMetaData() != null) {
                        connectionId = RegistryUtils.getConnectionId(conn);
                    }
                    RegistryCacheKey key =
                            RegistryUtils.buildRegistryCacheKey(connectionId,
                                    CurrentSession.getTenantId(), path);
                    pathCache.put(key, e);

                } catch (SQLException e) {
View Full Code Here

Examples of org.wso2.carbon.caching.core.registry.RegistryCacheKey

    public int getPathID(Connection conn, String path) throws SQLException {
        String connectionId = null;
        if (conn != null && conn.getMetaData() != null) {
            connectionId = RegistryUtils.getConnectionId(conn);
        }
        RegistryCacheKey key =
                RegistryUtils.buildRegistryCacheKey(connectionId,
                        CurrentSession.getTenantId(), path);
        RegistryCacheEntry result = (RegistryCacheEntry) pathCache.get(key);

        // TODO: FIX: Path Cache should only be updated if the key yields a valid registry path.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.