Package org.apache.airavata.persistance.registry.jpa.resources

Examples of org.apache.airavata.persistance.registry.jpa.resources.ConfigurationResource


  }

    /**---------------------------------Configuration Registry----------------------------------**/

    public Object getConfiguration(String key) {
    ConfigurationResource configuration = ResourceUtils.getConfiguration(key);
    return configuration==null? null: configuration.getConfigVal();
    }
View Full Code Here


    public void setConfiguration(String key, String value, Date expire) {
        if (configurationRegistry != null){
            configurationRegistry.setConfiguration(key, value, expire);
        }else {
            ConfigurationResource config;
            if (ResourceUtils.isConfigurationExist(key)) {
                config = ResourceUtils.getConfiguration(key);
            }else{
                config = ResourceUtils.createConfiguration(key);
            }
            config.setConfigVal(value);
            config.setExpireDate(new Timestamp(expire.getTime()));
            config.save();
        }
    }
View Full Code Here

    public void addConfiguration(String key, String value, Date expire) {
        if (configurationRegistry != null){
            configurationRegistry.addConfiguration(key, value, expire);
        } else {
            ConfigurationResource config = ResourceUtils.createConfiguration(key);
            config.setConfigVal(value);
            config.setExpireDate(new Timestamp(expire.getTime()));
            config.save();
        }


    }
View Full Code Here

    public void setUp() throws Exception {
        super.setUp();
    }

    public void testSave() throws Exception {
        ConfigurationResource configuration = ResourceUtils.createConfiguration("testConfigKey");
        configuration.setConfigVal("testConfigValue");
        Calendar calender = Calendar.getInstance();
        java.util.Date d = calender.getTime();
        Timestamp currentTime = new Timestamp(d.getTime());
        configuration.setExpireDate(currentTime);
        configuration.setCategoryID("SYSTEM");
        configuration.save();

        assertTrue("Configuration Save succuessful", ResourceUtils.isConfigurationExist("testConfigKey"));
        //remove test configuration
        ResourceUtils.removeConfiguration("testConfigKey");
    }
View Full Code Here

  }

    /**---------------------------------Configuration Registry----------------------------------**/

    public Object getConfiguration(String key) {
    ConfigurationResource configuration = ResourceUtils.getConfiguration(key);
    return configuration==null? null: configuration.getConfigVal();
    }
View Full Code Here

    public void setConfiguration(String key, String value, Date expire) {
        if (configurationRegistry != null){
            configurationRegistry.setConfiguration(key, value, expire);
        }else {
            ConfigurationResource config;
            if (ResourceUtils.isConfigurationExist(key)) {
                config = ResourceUtils.getConfiguration(key);
            }else{
                config = ResourceUtils.createConfiguration(key);
            }
            config.setConfigVal(value);
            config.setExpireDate(new Timestamp(expire.getTime()));
            config.save();
        }
    }
View Full Code Here

    public void addConfiguration(String key, String value, Date expire) {
        if (configurationRegistry != null){
            configurationRegistry.addConfiguration(key, value, expire);
        } else {
            ConfigurationResource config = ResourceUtils.createConfiguration(key);
            config.setConfigVal(value);
            config.setExpireDate(new Timestamp(expire.getTime()));
            config.save();
        }


    }
View Full Code Here

    public void setUp() throws Exception {
        super.setUp();
    }

    public void testSave() throws Exception {
        ConfigurationResource configuration = ResourceUtils.createConfiguration("testConfigKey");
        configuration.setConfigVal("testConfigValue");
        Calendar calender = Calendar.getInstance();
        java.util.Date d = calender.getTime();
        Timestamp currentTime = new Timestamp(d.getTime());
        configuration.setExpireDate(currentTime);
        configuration.save();

        assertTrue("Configuration Save succuessful", ResourceUtils.isConfigurationExist("testConfigKey"));
        //remove test configuration
        ResourceUtils.removeConfiguration("testConfigKey");
    }
View Full Code Here

  }

    /**---------------------------------Configuration Registry----------------------------------**/

    public Object getConfiguration(String key) throws RegistryException{
    ConfigurationResource configuration = ResourceUtils.getConfiguration(key);
    return configuration==null? null: configuration.getConfigVal();
    }
View Full Code Here

    public void setConfiguration(String key, String value, Date expire) throws RegistryException{
        if (configurationRegistry != null){
            configurationRegistry.setConfiguration(key, value, expire);
        }else {
            ConfigurationResource config;
            if (ResourceUtils.isConfigurationExist(key)) {
                config = ResourceUtils.getConfiguration(key);
            }else{
                config = ResourceUtils.createConfiguration(key);
            }
            config.setConfigVal(value);
            config.setExpireDate(new Timestamp(expire.getTime()));
            config.save();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.persistance.registry.jpa.resources.ConfigurationResource

Copyright © 2018 www.massapicom. 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.