package edu.washington.escience.myriad.api.encoding;

import edu.washington.escience.myriad.RelationKey;
import edu.washington.escience.myriad.Schema;

/**
 * A JSON-able wrapper for the expected wire message for a new dataset.
 * 
 */
public class DatasetEncoding {
  /** The name of the dataset. */
  public RelationKey relationKey;
  /** The Schema of its tuples. */
  public Schema schema;
  /** The data it contains. */
  public byte[] data;
}
@@ -47,16 +47,104 @@
 oding;%0A%0A
+import javax.ws.rs.core.Response.Status;%0A%0Aimport com.google.common.base.Preconditions;%0A%0A
 import e
@@ -231,16 +231,77 @@
 .Schema;
+%0Aimport edu.washington.escience.myriad.api.MyriaApiException;
 %0A%0A/**%0A *
@@ -407,16 +407,44 @@
 ncoding 
+implements MyriaApiEncoding 
 %7B%0A  /** 
@@ -616,10 +616,354 @@
 %5B%5D data;
+%0A%0A  @Override%0A  public void validate() throws MyriaApiException %7B%0A    try %7B%0A      Preconditions.checkNotNull(relationKey);%0A      Preconditions.checkNotNull(schema);%0A      Preconditions.checkNotNull(data);%0A    %7D catch (Exception e) %7B%0A      throw new MyriaApiException(Status.BAD_REQUEST, %22required fields: relation_key, schema, data%22);%0A    %7D%0A  %7D
 %0A%7D

implement MyriaApiEncoding interface