Commits

Sebastian Sdorra committed 7ec04a0

javadoc for blob store api

Comments (0)

Files changed (4)

scm-core/src/main/java/sonia/scm/store/Blob.java

 import java.io.OutputStream;
 
 /**
+ * A blob is binary object. A blob can be used to store unstructured any data.
  *
  * @author Sebastian Sdorra
  * @since 1.23
 {
 
   /**
-   * Method description
+   * This method should be called after all data is written to the
+   * {@link OutputStream} from the {@link #getOutputStream()} method.
    *
    *
    * @throws IOException
   //~--- get methods ----------------------------------------------------------
 
   /**
-   * Method description
+   * Returns the id of blob object.
    *
    *
-   * @return
+   * @return id of the blob
    */
   public String getId();
 
   /**
-   * Method description
+   * Returns the content of the blob as {@link InputStream}.
    *
    *
-   * @return
+   * @return content of the blob
    *
    * @throws IOException
    */
   public InputStream getInputStream() throws IOException;
 
   /**
-   * Method description
+   * Returns a {@link OutputStream} to write content to the blob object.
+   * <strong>Note:</strong> after all data is written to the
+   * {@link OutputStream} the {@link #commit()} method have to be called.
    *
-   *
-   * @param content
-   *
-   *
-   * @return
+   * @return outputstream for blob write operations
    * @throws IOException
    */
   public OutputStream getOutputStream() throws IOException;

scm-core/src/main/java/sonia/scm/store/BlobStore.java

 import java.util.List;
 
 /**
+ * The blob store can be used store unstructured data in form of a {@link Blob}.
  *
  * @author Sebastian Sdorra
  * @since 1.23
 {
 
   /**
-   * Method description
+   * Create a new blob object with automatically generated id.
    *
    *
-   * @return
+   * @return new blob
    */
   public Blob create();
 
   /**
-   * Method description
+   * Create a new blob object with the given id.
    *
    *
-   * @param id
+   * @param id id of the new blob
    *
-   * @return
+   * @return new blob
    */
   public Blob create(String id);
 
   /**
-   * Method description
+   * Remove the given blob object-
    *
    *
-   * @param id
+   * @param blob blob object to remove
    */
-  public void remove(Blob id);
+  public void remove(Blob blob);
 
   //~--- get methods ----------------------------------------------------------
 
   /**
-   * Method description
+   * Return all blob object which are stored in this BlobStore.
    *
    *
-   * @return
+   * @return a list of all blob object
    */
   public List<Blob> getAll();
 }

scm-core/src/main/java/sonia/scm/store/BlobStoreFactory.java

 package sonia.scm.store;
 
 /**
+ * The BlobStoreFactory can be used to create new or get existing
+ * {@link BlobStore}s.
  *
  * @author Sebastian Sdorra
  * @since 1.23
 {
 
   /**
-   * Method description
+   * Returns a {@link BlobStore} with the given name, if the {@link BlobStore}
+   * with the given name does not exists the factory will create a new one.
    *
    *
-   * @param name
+   * @param name name of the {@link BlobStore}
    *
-   * @return
+   * @return {@link BlobStore} with the given name
    */
   public BlobStore getBlobStore(String name);
 }

scm-core/src/main/java/sonia/scm/store/StoreBase.java

 package sonia.scm.store;
 
 /**
+ * Base class for {@link BlobStore} and {@link DataStore}.
  *
  * @author Sebastian Sdorra
  * @since 1.23
  *
- * @param <T>
+ * @param <T> Type of the stored objects
  */
 public interface StoreBase<T>
 {
 
   /**
-   * Method description
+   * Remove all items from the store.
    *
    */
   public void clear();
 
   /**
-   * Method description
+   * Remove the item with the given id.
    *
    *
-   * @param id
+   * @param id id of the item to remove
    */
   public void remove(String id);
 
   //~--- get methods ----------------------------------------------------------
 
   /**
-   * Method description
+   * Returns the item with the given id from the store.
    *
    *
-   * @param id
+   * @param id id of the item to return
    *
-   * @return
+   * @return item with the given id
    */
   public T get(String id);
 }