public Rule newRule(String id, String prefix, Boolean enabled) { Rule rule = this.new Rule(id, prefix, enabled); this.rules.add(rule); return rule; }
public void endStatus(String text) { latestRule.setEnabled(text.equals("Enabled")); }
String storageClass = null; for(LifecycleConfig.Rule rule : status.getRules()) { if(rule.getTransition() != null) { storageClass = rule.getTransition().getStorageClass(); transition = rule.getTransition().getDays(); if(rule.getExpiration() != null) { expiration = rule.getExpiration().getDays();
@Override public void setConfiguration(final Path file, final LifecycleConfiguration configuration) throws BackgroundException { final Path container = containerService.getContainer(file); try { if(configuration.getTransition() != null || configuration.getExpiration() != null) { final LifecycleConfig config = new LifecycleConfig(); // Unique identifier for the rule. The value cannot be longer than 255 characters. When you specify an empty prefix, the rule applies to all objects in the bucket final LifecycleConfig.Rule rule = config.newRule( String.format("%s-%s", PreferencesFactory.get().getProperty("application.name"), new AlphanumericRandomStringService().random()), StringUtils.EMPTY, true); if(configuration.getTransition() != null) { rule.newTransition().setDays(configuration.getTransition()); } if(configuration.getExpiration() != null) { rule.newExpiration().setDays(configuration.getExpiration()); } session.getClient().setLifecycleConfig(container.getName(), config); } else { session.getClient().deleteLifecycleConfig(container.getName()); } } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Failure to write attributes of {0}", e, container); } }
public void endID(String text) { latestRule.setId(text); }
public void startRule() { latestRule = config.new Rule(); }
public void endID(String text) { latestRule.setId(text); }
public void startRule() { latestRule = config.new Rule(); }
public void endStatus(String text) { latestRule.setEnabled(text.equals("Enabled")); }
public void startTransition() { latestTimeEvent = config.new Transition(); latestRule.setTransition(((Transition)latestTimeEvent)); }
public void endPrefix(String text) { latestRule.setPrefix(text); }
public void endPrefix(String text) { latestRule.setPrefix(text); }
public void startExpiration() { latestTimeEvent = config.new Expiration(); latestRule.setExpiration(((Expiration)latestTimeEvent)); }
public void startTransition() { latestTimeEvent = config.new Transition(); latestRule.setTransition(((Transition)latestTimeEvent)); }
public Rule newRule(String id, String prefix, Boolean enabled) { Rule rule = this.new Rule(id, prefix, enabled); this.rules.add(rule); return rule; }
public void startExpiration() { latestTimeEvent = config.new Expiration(); latestRule.setExpiration(((Expiration)latestTimeEvent)); }