Package org.structr.common.error

Examples of org.structr.common.error.FrameworkException


    final SecurityContext superUserContext = SecurityContext.getSuperUserInstance();
    final NodeFactory nodeFactory          = new NodeFactory(superUserContext);

    final String type = (String)properties.get("type");
    if (StringUtils.isBlank(type)) {
      throw new FrameworkException(422, "Type must not be empty");
    }

    final Class cls = SchemaHelper.getEntityClassForRawType(type);
    if (cls == null) {

      throw new FrameworkException(422, "Invalid type " + type);
    }

    if (graphDb != null) {

      Result<AbstractNode> nodes = null;
View Full Code Here


            } catch(ClassCastException cce) {

              cce.printStackTrace();

              throw new FrameworkException(entityType.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
            }

          } else {

            resultMap.put(propertyKey, value);
View Full Code Here

            } catch(ClassCastException cce) {

              cce.printStackTrace();

              throw new FrameworkException(entityType.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
            }

          } else {

            resultMap.put(propertyKey, value);
View Full Code Here

            } catch(ClassCastException cce) {

              cce.printStackTrace();

              throw new FrameworkException(entityType.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
            }

          } else {

            resultMap.put(propertyKey, value);
View Full Code Here

            } catch(ClassCastException cce) {

              cce.printStackTrace();

              throw new FrameworkException(entity.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
            }

          } else {

            resultMap.put(propertyKey, value);
View Full Code Here

        } catch(ClassCastException cce) {

          cce.printStackTrace();

          throw new FrameworkException(entity.getSimpleName(), new TypeToken(propertyKey, propertyKey.typeName()));
        }

      } else {

        inputTypedProperties.put(propertyKey.jsonName(), entry.getValue());
View Full Code Here

          return (T) app.get(map.get(GraphObject.id));

         
        } else {
         
          throw new FrameworkException(type.getSimpleName(), new IdNotFoundToken(source));
         
        }

      } else if (source instanceof GraphObject) {
       
        GraphObject obj = (GraphObject)source;
        if (propertyKey != null) {
         
          results = (Result<T>) app.nodeQuery(NodeInterface.class).and(propertyKey, obj.getProperty(propertyKey)).getResult();
         
         
        } else {
         
          // fetch property key for "id", may be different for AbstractNode and AbstractRelationship!
          PropertyKey<String> idProperty = StructrApp.getConfiguration().getPropertyKeyForDatabaseName(obj.getClass(), GraphObject.id.dbName());
         
          return (T) app.get(obj.getProperty(idProperty));
         
        }
       
       
      } else {

        return (T) app.get(source.toString());

      }

      int size       = results.size();

      switch (size) {

        case 0 :
          throw new FrameworkException(type.getSimpleName(), new IdNotFoundToken(source));

        case 1 :
          return results.get(0);

        default :
View Full Code Here

        PropertyKey errorKey = validationInfo.getErrorKey();
        int minLength        = validationInfo.getMinLength();

        if (minLength > 0 && clearTextPassword.length() < minLength) {

          throw new FrameworkException(errorType, new TooShortToken(errorKey, minLength));
        }
      }
     
      String salt = RandomStringUtils.randomAlphanumeric(16);
     
View Full Code Here

            + "This is often due to wrong modeling, or you should consider creating a uniquness constraint for " + type.getName(), size);

          break;
      }

      throw new FrameworkException(type.getSimpleName(), new PropertiesNotFoundToken(AbstractNode.base, attributes));
    }
   
    return null;
  }
View Full Code Here

        } catch (Throwable t) {

          logger.log(Level.WARNING, "Unable to convert {0} to Double.", source);

          throw new FrameworkException(declaringClass.getSimpleName(), new NumberToken(DoubleProperty.this));
        }
      }

      return null;
    }
View Full Code Here

TOP

Related Classes of org.structr.common.error.FrameworkException

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.