Package org.persvr.data

Examples of org.persvr.data.ObjectNotFoundException


                }
              }
            }
            if (attributes == -2) {
              // this indicates it was deleted
              throw new ObjectNotFoundException(id.source, objectId.toString());
            }
          }
          if(inRecoveryProcess){
            updateTableLastChange(tableId, objectReference, objectId instanceof Number ? ((Number)objectId).longValue() : 0);
          }
View Full Code Here


  String id;
  public String getId() {
    return id;
  }
  public void mapObject(PersistableInitializer initializer, String objectId) throws Exception {
    throw new ObjectNotFoundException(this,objectId);
  }
View Full Code Here

    traverser.minKey = noVersionObjectId;
    traverser.maxKey = noVersionObjectId;
    Persistable object;
    // this should trigger the loading of the object
    if((object = (Persistable) traverser.nextObject()) == null){
      throw new ObjectNotFoundException(this, objectId);
    }
    //FIXME: remove this
/*    if((Persistable) traverser.nextObject() != null){
      throw new IllegalStateException("shouldn't be duplicate ids");
    }*/
   
    // if a version was specified, we need to make sure we load it
    if(version > -1){
      while(((ObjectVersion) object.getVersion()).versionNumber > version){
        object = getDatabase().getVersionByReference(((ObjectVersion) object.getVersion()).previousVersionReference);
      }
      if(((ObjectVersion) object.getVersion()).versionNumber != version)
        throw new ObjectNotFoundException(this, objectId);
    }
  }
View Full Code Here

        initializeList(initializer, listRetrieval.executeQuery());
        break;
      }
      Object value = getValueFromRs(rs);
      if (":isDeleted".equals(field)){
        throw new ObjectNotFoundException(this,objectId);
      }
      if ("parent".equals(field)){
        if(value instanceof ObjectId)
          initializer.setParent((ObjectId) value);
        else
          initializer.setParent((ObjectId) DataSourceManager.getRootObject().getId());
        parentSet = true;
      }
      else if (!":exists".equals(field)){
        int type = rs.getInt("value_type");
        initializer.setProperty(field, value, (type & DONTENUM) == DONTENUM ? ScriptableObject.DONTENUM : 0);
      }
    }
    rs.close();
    if(!hasProperties){
      // if no properties were found that means the object doesn't exist
      throw new ObjectNotFoundException(this,objectId);
    }
    if(!parentSet && (id.equals("Object") || id.equals("Array"))){
      List<ObjectId> referrers = getReferrers(objectId);
      if (!referrers.isEmpty())
        initializer.setParent(referrers.get(0));
View Full Code Here

    if ("".equals(id))
      throw new RuntimeException("invalid id: " + id);
    try {
      long longId = Long.parseLong(id) + startingId;
      if (longId < (startingId) || longId >= currentId) { // the first two ids are only accessible through null and empty string
        throw new ObjectNotFoundException(this,id);
      }
      return longId;
    }
    catch (NumberFormatException e) {
      throw new ObjectNotFoundException(this,id);
    }
  }
View Full Code Here

        try {
          conn.close();
        }
        catch (SQLException yikes) {
        }
        throw new ObjectNotFoundException(DatabaseTableDataSource.this,objectId);
      }
     
      ResultSet rs = loadStatement.executeQuery();
      if (!rs.next()) {
        try {
          conn.close();
        }
        catch (SQLException yikes) {
        }
        throw new ObjectNotFoundException(DatabaseTableDataSource.this,objectId);
      }
      mapResult(initializer,rs,objectId);
      rs.close();
      if(!inTransaction){
        conn.close();
View Full Code Here

        object = ((Map) object).get(pathPart);
      else if (object instanceof List)
        try{
          object = ((List) object).get(Integer.parseInt(pathPart));
        }catch(IndexOutOfBoundsException e){
          throw new ObjectNotFoundException(this, objectId);
        }
      if (object == null) {
        if ("schema".equals(pathPart))// a little exception so we can bootstrap
          ((Map)last).put("schema",object = new HashMap());
        else
          throw new ObjectNotFoundException(this,objectId);
      }
      last = object;
    }
    rar.resolved = object;
    return rar;
View Full Code Here

          File resourceFile = new File(localPath + File.separatorChar + resourceName);
          FileInputStream fis = new FileInputStream(resourceFile);
          json = JSON.parse(getResourceAsString(fis));
          fis.close();
        } catch (FileNotFoundException e) {
          throw new ObjectNotFoundException(this,resourceName);
        }
      }
      return json;
    }
    throw new RuntimeException("Illegal character in filename");
View Full Code Here

  }
  public void mapObject(PersistableInitializer initializer, String objectId) throws Exception {
    if (!("".equals(objectId) || "schemaProperties".equals(objectId) || "root".equals(objectId))) {
      ObjectId configId = sourceToConfigObject.get(objectId);
      if(configId == null)
        throw new ObjectNotFoundException(this,objectId);
      configId.source.mapObject(initializer,configId.subObjectId);
      DataSource source = DataSourceManager.getSource(objectId);
      initializer.setProperty("instances", ObjectId.idForObject(source, ""));
      if (source instanceof DynaObjectDBSource) {
        DataSource superSource = ((DynaObjectDBSource)source).getSuperSource();
View Full Code Here

TOP

Related Classes of org.persvr.data.ObjectNotFoundException

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.