Java 类com.amazonaws.services.s3.model.lifecycle.LifecycleFilterPredicate 实例源码

项目:nexus-blobstore-s3    文件:S3BlobStore.java   
boolean isExpirationLifecycleConfigurationPresent(BucketLifecycleConfiguration lifecycleConfiguration) {
  return lifecycleConfiguration != null &&
      lifecycleConfiguration.getRules() != null &&
      lifecycleConfiguration.getRules().stream()
      .filter(r -> r.getExpirationInDays() == getConfiguredExpirationInDays())
      .filter(r -> {
        LifecycleFilterPredicate predicate = r.getFilter().getPredicate();
        if (predicate instanceof LifecycleTagPredicate) {
          LifecycleTagPredicate tagPredicate = (LifecycleTagPredicate) predicate;
          return DELETED_TAG.equals(tagPredicate.getTag());
        }
        return false;
      })
      .findAny().isPresent();
}
项目:ibm-cos-sdk-java    文件:BucketConfigurationXmlFactory.java   
@Override
public void visit(LifecycleAndOperator lifecycleAndOperator) {
    xml.start("And");
    for (LifecycleFilterPredicate predicate : lifecycleAndOperator.getOperands()) {
        predicate.accept(this);
    }
    xml.end(); // </And>
}
项目:ibm-cos-sdk-java    文件:XmlResponsesSaxParser.java   
@Override
protected void doStartElement(
        String uri,
        String name,
        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")) {
            currentNcvTransition = new NoncurrentVersionTransition();
        } else if (name.equals("AbortIncompleteMultipartUpload")) {
            abortIncompleteMultipartUpload = new
                    AbortIncompleteMultipartUpload();
        } else if (name.equals("Filter")) {
            currentFilter = new LifecycleFilter();
        }
    } else if (in("LifecycleConfiguration", "Rule", "Filter")) {
        if (name.equals("And")) {
            andOperandsList = new ArrayList<LifecycleFilterPredicate>();
        }
    }
}
项目:nexus-public    文件:S3BlobStore.java   
boolean isExpirationLifecycleConfigurationPresent(BucketLifecycleConfiguration lifecycleConfiguration) {
  return lifecycleConfiguration != null &&
      lifecycleConfiguration.getRules() != null &&
      lifecycleConfiguration.getRules().stream()
      .filter(r -> r.getExpirationInDays() == getConfiguredExpirationInDays())
      .anyMatch(r -> {
        LifecycleFilterPredicate predicate = r.getFilter().getPredicate();
        if (predicate instanceof LifecycleTagPredicate) {
          LifecycleTagPredicate tagPredicate = (LifecycleTagPredicate) predicate;
          return DELETED_TAG.equals(tagPredicate.getTag());
        }
        return false;
      });
}
项目:ibm-cos-sdk-java    文件:BucketConfigurationXmlFactory.java   
private void writeLifecycleFilterPredicate(XmlWriter xml, LifecycleFilterPredicate predicate) {
    if (predicate == null) {
        return;
    }
    predicate.accept(new LifecyclePredicateVisitorImpl(xml));
}