Package com.linkedin.restli.server

Examples of com.linkedin.restli.server.ResourceConfigException


                        annotations);
      return param;
    }
    catch (TemplateRuntimeException e)
    {
      throw new ResourceConfigException("DataSchema for parameter '" + paramName + "' of type " + paramType.getSimpleName() + " on "
          + buildMethodMessage(method) + "cannot be found; type is invalid or requires typeref", e);
    }
    catch (Exception e)
    {
      throw new ResourceConfigException("Typeref for parameter '" + paramName + "' on "
          + buildMethodMessage(method) + " cannot be instantiated, " + e.getMessage(), e);
    }
  }
View Full Code Here


    QueryParam queryParam = annotations.get(QueryParam.class);
    Optional optional = annotations.get(Optional.class);
    String paramName = queryParam.value();
    if (INVALID_CHAR_PATTERN.matcher(paramName).find())
    {
      throw new ResourceConfigException("Unsupported character in the parameter name :"
          + paramName);
    }
    Class<? extends TyperefInfo> typerefInfoClass = queryParam.typeref();
    try
    {
      @SuppressWarnings({"unchecked", "rawtypes"})
      Parameter<?> param =
          new Parameter(queryParam.value(),
                        paramType,
                        getDataSchema(paramType, getSchemaFromTyperefInfo(typerefInfoClass)),
                        optional != null,
                        getDefaultValueData(optional),
                        Parameter.ParamType.QUERY,
                        true,
                        annotations);
      return param;
    }
    catch (TemplateRuntimeException e)
    {
      throw new ResourceConfigException("DataSchema for parameter '" + paramName + "' of type " + paramType.getSimpleName() + " on "
            + buildMethodMessage(method) + "cannot be found; type is invalid or requires typeref", e);
    }
    catch (Exception e)
    {
      throw new ResourceConfigException("Typeref for parameter '" + paramName + "' on "
          + buildMethodMessage(method) + " cannot be instantiated, " + e.getMessage(), e);
    }
  }
View Full Code Here

    {
      Custom.initializeCustomClass(Class.forName(javaClassNameFromSchema, true, Thread.currentThread().getContextClassLoader()));
    }
    catch (ClassNotFoundException e)
    {
      throw new ResourceConfigException("Could not find class for type "
          + javaClassNameFromSchema, e);
    }
    if (coercerClassName != null)
    {
      try
      {
        Custom.initializeCoercerClass(Class.forName(coercerClassName, true, Thread.currentThread().getContextClassLoader()));
      }
      catch (ClassNotFoundException e)
      {
        throw new ResourceConfigException("Could not find coercer " + coercerClassName
            + " for type " + javaClassNameFromSchema, e);
      }
    }
  }
View Full Code Here

    {
      ResourceMethod type = descriptor.getType();

      if (!RestConstants.SIMPLE_RESOURCE_METHODS.contains(type))
      {
        throw new ResourceConfigException(
            String.format(
                "Resource '%s' is a simple resource but it contains a method of type %s" +
                " which is not supported on simple resources.",
                                                        model.getName(),
                                                        type.toString()));
View Full Code Here

      return;
    }

    if (model.getKeys().size() <= 1)
    {
      throw new ResourceConfigException(String.format("Association '%s' requires more than 1 key.",
                                                      model.getName()));
    }
  }
View Full Code Here

          continue;
        default:
          if (crudMethods.containsKey(type))
          {
            ResourceMethodDescriptor oldDescriptor = crudMethods.get(type);
            throw new ResourceConfigException(String.format("Resource '%s' contains duplicate methods of type '%s'.  Methods are '%s' and '%s'.",
                                                            model.getName(),
                                                            type.toString(),
                                                            oldDescriptor.getMethod()
                                                                         .getName(),
                                                            descriptor.getMethod()
View Full Code Here

                                                   annotationsMap);
      validateFinderMethod(finderMethodDescriptor, model);

      if (!Modifier.isPublic(method.getModifiers()))
      {
        throw new ResourceConfigException(String.format("Resource '%s' contains non-public finder method '%s'.",
                                                        model.getName(),
                                                        method.getName()));
      }

      model.addResourceMethodDescriptor(finderMethodDescriptor);
View Full Code Here

TOP

Related Classes of com.linkedin.restli.server.ResourceConfigException

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.