Package org.apache.ambari.view.pig.persistence.utils

Examples of org.apache.ambari.view.pig.persistence.utils.ItemNotFound


   */
  public T read(String id) throws ItemNotFound {
    T object = null;
    object = getPigStorage().load(this.resourceClass, Integer.parseInt(id));
    if (!checkPermissions(object))
      throw new ItemNotFound();
    return object;
  }
View Full Code Here


   * @throws ItemNotFound
   */
  public void delete(String resourceId) throws ItemNotFound {
    int id = Integer.parseInt(resourceId);
    if (!getPigStorage().exists(this.resourceClass, id)) {
      throw new ItemNotFound();
    }
    getPigStorage().delete(this.resourceClass, id);
  }
View Full Code Here

  @Override
  public T update(T newObject, String id) throws ItemNotFound {
    T object = getPigStorage().load(this.resourceClass, Integer.parseInt(id));
    if (object.getOwner().compareTo(this.context.getUsername()) != 0) {
      throw new ItemNotFound();
    }

    newObject.setOwner(this.context.getUsername());
    return super.update(newObject, id);
  }
View Full Code Here

    if (getConfig().containsKey(modelPropName)) {
      String json = read(modelPropName);
      LOG.debug(String.format("json: %s", json));
      return deserialize(model, json);
    } else {
      throw new ItemNotFound();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.ambari.view.pig.persistence.utils.ItemNotFound

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.