Esempio n. 1
0
  /**
   * Initialization to be done after constructor assignments, such as setting of the all-important
   * DDFManager.
   */
  protected void initialize(
      DDFManager manager,
      Object data,
      Class<?>[] typeSpecs,
      String namespace,
      String name,
      Schema schema)
      throws DDFException {
    this.validateSchema(schema);
    this.setManager(manager); // this must be done first in case later stuff needs a manager

    if (typeSpecs != null) {
      this.getRepresentationHandler().set(data, typeSpecs);
    }

    this.getSchemaHandler().setSchema(schema);
    if (schema != null && schema.getTableName() == null) {
      String tableName = this.getSchemaHandler().newTableName();
      schema.setTableName(tableName);
    }

    if (Strings.isNullOrEmpty(namespace)) namespace = this.getManager().getNamespace();
    this.setNamespace(namespace);

    manager.setDDFUUID(this, UUID.randomUUID());

    if (!Strings.isNullOrEmpty(name)) manager.setDDFName(this, name);

    // Facades
    this.ML = new MLFacade(this, this.getMLSupporter());
    this.VIEWS = new ViewsFacade(this, this.getViewHandler());
    this.Transform = new TransformFacade(this, this.getTransformationHandler());
    this.R = new RFacade(this, this.getAggregationHandler());
    this.mCreatedTime = new Date();
  }
Esempio n. 2
0
 /**
  * Save a given object in memory for later (quick server-side) retrieval
  *
  * @param obj
  * @return
  */
 public String putObject(Object obj) {
   String objectId = UUID.randomUUID().toString();
   cachedObjects.put(objectId, obj);
   return objectId;
 }