Package com.amazonaws.services.s3.model.BucketLifecycleConfiguration

Examples of com.amazonaws.services.s3.model.BucketLifecycleConfiguration.Rule


                String qName,
                Attributes attrs) {

            if (in("LifecycleConfiguration")) {
                if (name.equals("Rule")) {
                    currentRule = new Rule();
                }
            } else if (in("LifecycleConfiguration", "Rule")) {
                if (name.equals("Transition")) {
                    currentTransition = new Transition();
                } else if (name.equals("NoncurrentVersionTransition")) {
View Full Code Here


        @Override
        public void startElement(String uri, String name, String qName, Attributes attrs) {
            if (name.equals("LifecycleConfiguration")) {
            } else if (name.equals("Rule")) {
                rule = new Rule();
            } else if (name.equals("ID")) {
            } else if (name.equals("Prefix")) {
            } else if (name.equals("Status")) {
            } else if (name.equals("Expiration")) {
                container = Container.EXPIRATION;
View Full Code Here

                String qName,
                Attributes attrs) {

            if (in("LifecycleConfiguration")) {
                if (name.equals("Rule")) {
                    currentRule = new Rule();
                }
            } else if (in("LifecycleConfiguration", "Rule")) {
                if (name.equals("Transition")) {
                    currentTransition = new Transition();
                } else if (name.equals("NoncurrentVersionTransition")) {
View Full Code Here

        }
    }

    private boolean updateLifecycleRule(List<Rule> rules, String prefix)
    {
        Rule rule = null;
        for (BucketLifecycleConfiguration.Rule lcRule : rules)
        {
            if (lcRule.getPrefix().equals(prefix))
            {
                rule = lcRule;
                break;
            }
        }
        if (rule == null && config.getBackupRetentionDays() <= 0)
            return false;
        if (rule != null && rule.getExpirationInDays() == config.getBackupRetentionDays())
        {
            logger.info("Cleanup rule already set");
            return false;
        }
        if (rule == null)
        {
            // Create a new rule
            rule = new BucketLifecycleConfiguration.Rule().withExpirationInDays(config.getBackupRetentionDays()).withPrefix(prefix);
            rule.setStatus(BucketLifecycleConfiguration.ENABLED);
            rule.setId(prefix);
            rules.add(rule);
            logger.info(String.format("Setting cleanup for %s to %d days", rule.getPrefix(), rule.getExpirationInDays()));
        }
        else if (config.getBackupRetentionDays() > 0)
        {
            logger.info(String.format("Setting cleanup for %s to %d days", rule.getPrefix(), config.getBackupRetentionDays()));
            rule.setExpirationInDays(config.getBackupRetentionDays());
        }
        else
        {
            logger.info(String.format("Removing cleanup rule for %s", rule.getPrefix()));
            rules.remove(rule);
        }
        return true;
    }
View Full Code Here

        @Override
        public void startElement(String uri, String name, String qName, Attributes attrs) {
            if ( name.equals("LifecycleConfiguration") ) {
            } else if ( name.equals("Rule") ) {
                rule = new Rule();
            } else if ( name.equals("ID") ) {
            } else if ( name.equals("Prefix") ) {
            } else if ( name.equals("Status") ) {
            } else if ( name.equals("Expiration") ) {
            } else if ( name.equals("Days") ) {
View Full Code Here

        @Override
        public void startElement(String uri, String name, String qName, Attributes attrs) {
            if (name.equals("LifecycleConfiguration")) {
            } else if (name.equals("Rule")) {
                rule = new Rule();
            } else if (name.equals("ID")) {
            } else if (name.equals("Prefix")) {
            } else if (name.equals("Status")) {
            } else if (name.equals("Transition")) {
                transition = new Transition();
View Full Code Here

        @Override
        public void startElement(String uri, String name, String qName, Attributes attrs) {
            if (name.equals("LifecycleConfiguration")) {
            } else if (name.equals("Rule")) {
                rule = new Rule();
            } else if (name.equals("ID")) {
            } else if (name.equals("Prefix")) {
            } else if (name.equals("Status")) {
            } else if (name.equals("Transition")) {
                transition = new Transition();
View Full Code Here

   
        @Override
        public void startElement(String uri, String name, String qName, Attributes attrs) {
            if ( name.equals("LifecycleConfiguration") ) {
            } else if ( name.equals("Rule") ) {
                rule = new Rule();
            } else if ( name.equals("ID") ) {
            } else if ( name.equals("Prefix") ) {
            } else if ( name.equals("Status") ) {
            } else if ( name.equals("Expiration") ) {
            } else if ( name.equals("Days") ) {
View Full Code Here

        @Override
        public void startElement(String uri, String name, String qName, Attributes attrs) {
            if (name.equals("LifecycleConfiguration")) {
            } else if (name.equals("Rule")) {
                rule = new Rule();
            } else if (name.equals("ID")) {
            } else if (name.equals("Prefix")) {
            } else if (name.equals("Status")) {
            } else if (name.equals("Transition")) {
                transition = new Transition();
View Full Code Here

        @Override
        public void startElement(String uri, String name, String qName, Attributes attrs) {
            if (name.equals("LifecycleConfiguration")) {
            } else if (name.equals("Rule")) {
                rule = new Rule();
            } else if (name.equals("ID")) {
            } else if (name.equals("Prefix")) {
            } else if (name.equals("Status")) {
            } else if (name.equals("Transition")) {
                transition = new Transition();
View Full Code Here

TOP

Related Classes of com.amazonaws.services.s3.model.BucketLifecycleConfiguration.Rule

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.