All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.clustermate.client.call.PutContentProvider Maven / Gradle / Ivy

There is a newer version: 0.10.5
Show newest version
package com.fasterxml.clustermate.client.call;

import java.io.File;

import com.fasterxml.storemate.shared.ByteContainer;

/**
 * Interface that defines how calling application needs to expose data to upload,
 * so that client can upload it to multiple stores (or for possible
 * retries) as necessary.
 *

* Methods are typically called in order of: *

    *
  1. {@link #contentAsBytes}
  2. *
  3. {@link #contentAsFile}
  4. *
  5. {@link #contentAsStream}
  6. *
* until non-null response is received; not that most implementations return null * from one or more of methods, to indicate that they are not optimal accessors. */ public interface PutContentProvider { /** * @return Length of content, if known; -1 if not known */ public long length(); public ByteContainer contentAsBytes(); public File contentAsFile() throws java.io.IOException; public java.io.InputStream contentAsStream() throws java.io.IOException; public int getContentHash(); public void setContentHash(int hash); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy