Examples of RegistryEntryDO


Examples of org.wso2.carbon.mediation.registry.persistence.dataobject.RegistryEntryDO

        super(registry);
    }

    public void populateResource(Resource resource, BaseDO baseDO) {
        if (baseDO instanceof RegistryEntryDO) {
            RegistryEntryDO registryEntryDO = (RegistryEntryDO) baseDO;
            resource.setProperty(RegistryEntryDO.REGISTRY_KEY, registryEntryDO.getRegistryKey());
            resource.setProperty(RegistryEntryDO.EXPIRY_TIME, String.valueOf(registryEntryDO.getExpiryTime()));
        }
    }
View Full Code Here

Examples of org.wso2.carbon.mediation.registry.persistence.dataobject.RegistryEntryDO

            resource.setProperty(RegistryEntryDO.EXPIRY_TIME, String.valueOf(registryEntryDO.getExpiryTime()));
        }
    }

    public BaseDO populateDataObject(Resource resource) {
        RegistryEntryDO registryEntryDO = new RegistryEntryDO();
        registryEntryDO.setExpiryTime(Long.parseLong(resource.getProperty(RegistryEntryDO.EXPIRY_TIME)));
        registryEntryDO.setRegistryKey(resource.getProperty(RegistryEntryDO.REGISTRY_KEY));
        return registryEntryDO;
    }
View Full Code Here

Examples of org.wso2.carbon.mediation.registry.persistence.dataobject.RegistryEntryDO

        }
    }

    public void updateRegistryEntry(RegistryEntryDO registryEntryDO) {
        if (registryEntryDO != null && registryEntryDO.getRegistryKey() != null) {
            RegistryEntryDO storedEntry = getRegistryEntry(registryEntryDO.getRegistryKey());
            if (storedEntry != null) {
                storedEntry.setExpiryTime(registryEntryDO.getExpiryTime());
                super.update(registryEntryDO.getRegistryKey(), storedEntry);
            }
        } else {
            handleException("Invalid registry entry for update " + registryEntryDO);
        }
View Full Code Here

Examples of org.wso2.carbon.mediation.registry.persistence.dataobject.RegistryEntryDO

        }
    }

    public void saveOrUpdateRegistryEntry(RegistryEntryDO registryEntryDO) {
        if (registryEntryDO != null && registryEntryDO.getRegistryKey() != null) {
            RegistryEntryDO storedEntry = getRegistryEntry(registryEntryDO.getRegistryKey());
            if (storedEntry != null) {
                storedEntry.setExpiryTime(registryEntryDO.getExpiryTime());
                super.update(registryEntryDO.getRegistryKey(), storedEntry);
            } else {
                super.create(registryEntryDO.getRegistryKey(), registryEntryDO);
            }
        } else {
View Full Code Here

Examples of org.wso2.carbon.mediation.registry.persistence.dataobject.RegistryEntryDO

            handleException("IO Error reading from URL " + getRoot() + key, e);
        }

        // get information from the database
        PersistenceManager persistenceManager = PersistenceManager.getInstance();
        RegistryEntryDO registryEntryDO = persistenceManager.getRegistryEntry(key);

        if (registryEntryDO != null) {

            if (registryEntryDO.getExpiryTime() != null) {
                entryEmbedded.setCachableDuration(registryEntryDO.getExpiryTime());
            } else {
                entryEmbedded.setCachableDuration(0);
            }
        }
View Full Code Here

Examples of org.wso2.carbon.mediation.registry.persistence.dataobject.RegistryEntryDO

     *
     * @param entry RegistryEntry containing the new metadata
     */
    public void updateRegistryEntry(RegistryEntry entry) {

        RegistryEntryDO registryEntryDO = new RegistryEntryDO();
        registryEntryDO.setRegistryKey(entry.getKey());
        registryEntryDO.setExpiryTime(entry.getCachableDuration());

        PersistenceManager persistenceManager = PersistenceManager.getInstance();
        persistenceManager.saveOrUpdateRegistryEntry(registryEntryDO);
    }
View Full Code Here

Examples of org.wso2.carbon.mediation.registry.persistence.dataobject.RegistryEntryDO

                // note that we are using the registry key part (path without the local registry
                // root as the key in db
                // if the new FOLDER has a parent FOLDER, use its values for defaults for all
                // possible properties

                RegistryEntryDO registryEntryDO = new RegistryEntryDO();
                registryEntryDO.setRegistryKey(parentName + URL_SEPARATOR + newFolderName);

                PersistenceManager persistenceManager = PersistenceManager.getInstance();
                RegistryEntryDO parentEntryDO =
                        persistenceManager.getRegistryEntry(getURLPath(parentName));
                if (parentEntryDO != null) {
                    registryEntryDO.setExpiryTime(parentEntryDO.getExpiryTime());
                } else {
                    registryEntryDO.setExpiryTime(getCachableDuration());
                }

                persistenceManager.addRegistryEntry(registryEntryDO);
View Full Code Here

Examples of org.wso2.carbon.mediation.registry.persistence.dataobject.RegistryEntryDO

                // update meta data to the database
                // note that we are using the registry key part (path without the local registry
                // root as the key in db
                // update the db only if we have some thing else to write other than the key

                RegistryEntryDO registryEntryDO = new RegistryEntryDO();
                registryEntryDO.setRegistryKey(parentName + URL_SEPARATOR + newFileName);

                PersistenceManager persistenceManager = PersistenceManager.getInstance();
                RegistryEntryDO parentEntryDO =
                        persistenceManager.getRegistryEntry(getURLPath(parentName));
                if (parentEntryDO != null) {
                    registryEntryDO.setExpiryTime(parentEntryDO.getExpiryTime());
                } else {
                    registryEntryDO.setExpiryTime(getCachableDuration());
                }

                persistenceManager.addRegistryEntry(registryEntryDO);
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.