Package com.cybozu.vmbkp.config

Examples of com.cybozu.vmbkp.config.Group


    /**
     * Get value of [generation `genId`] timestamp_ms.
     */
    public String getTimestampMs(int genId)
    {
        Group genGroup = makeGenerationGroup(genId);
        return cfg_.getVal(genGroup, "timestamp_ms");
    }
View Full Code Here


    /**
     * Get value of [generation `genid`] timestamp.
     */
    public String getTimestampStr(int genId)
    {
        Group genGroup = makeGenerationGroup(genId);
        return cfg_.getVal(genGroup, "timestamp");
    }
View Full Code Here

        }

        Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(Long.valueOf(timestampMs));
       
        Group genGroup = makeGenerationGroup(genId);
        cfg_.put(genGroup, "timestamp", cal.getTime().toString());
        cfg_.put(genGroup, "timestamp_ms", timestampMs);
        cfg_.put(grpTsGen_, timestampMs, Integer.toString(genId));
    }
View Full Code Here

    {
        assert profGen != null;

        int genId = profGen.getGenerationId();
       
        Group genGroup = makeGenerationGroup(genId);
        String timestampMs = profGen.getTimestampMs();

        this.setIsGenerationSucceeded(genId, profGen.isSucceeded());
        this.setTimestampMs(genId, timestampMs);
    }
View Full Code Here

        if (timestampMs != null) {
            cfg_.del(grpTsGen_, timestampMs);
        }

        /* Delete generation group. */
        Group genGroup = makeGenerationGroup(genId);
        cfg_.delGroup(genGroup);
    }
View Full Code Here

    /**
     * Make a group [group "`groupName`"].
     */
    private Group makeGroup(String groupName)
    {
        return new Group("group", groupName);
    }
View Full Code Here

    {
        /* We use Set class because it eliminates
           duplication automatically. */
        Set<String> sset = new TreeSet<String>();
       
        Group grp = makeGroup(groupName);
        List<Entry> entryList = cfg_.getAllEntries(grp);

        for (Entry entry : entryList) {
            String key = entry.getKey();
            String val = entry.getVal();
View Full Code Here

     * @param name name of a group.
     * @return true when the name is defined as a group, or false.
     */
    public boolean isGroupName(String name)
    {
        Group grp = makeGroup(name);
        List<Entry> entryList = cfg_.getAllEntries(grp);
        /* When the name is defined but the group is empty,
           the group name is invalid for us. */

        return entryList.isEmpty() == false;
View Full Code Here

     * Initialize group(s).
     */
    private void initializeGroups()
    {
        /* initialize group(s) */
        generation_ = new Group("generation");
    }
View Full Code Here

    /**
     * Generate Group of [disk "`diskId`"]
     */
    private Group generateDiskGroup(int diskId)
    {
        return new Group("disk", Integer.toString(diskId));
    }
View Full Code Here

TOP

Related Classes of com.cybozu.vmbkp.config.Group

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.