public MissingParameterException(Collection<String> missingParameters) { super( new LensErrorInfo(MISSING_PARAMETERS.getValue(), 0, MISSING_PARAMETERS.toString()) , Joiner.on(",").join(missingParameters)); this.missingParameters = ImmutableList.copyOf(missingParameters); } }
public MissingParameterException(Collection<String> missingParameters) { super( new LensErrorInfo(MISSING_PARAMETERS.getValue(), 0, MISSING_PARAMETERS.toString()) , Joiner.on(",").join(missingParameters)); this.missingParameters = ImmutableList.copyOf(missingParameters); } }
public SavedQueryNotFound(long id) { super( new LensErrorInfo(RESOURCE_NOT_FOUND.getValue(), 0, RESOURCE_NOT_FOUND.toString()) , SavedQuery.class.getSimpleName() , String.valueOf(id)); this.id = id; } }
public ParameterValueException(String paramName, List<String> values, Throwable cause) { super( new LensErrorInfo(INVALID_PARAMETER_VALUE.getValue(), 0, INVALID_PARAMETER_VALUE.toString()) , values , paramName , cause.getMessage()); this.paramName = paramName; this.values = ImmutableList.copyOf(values); }
public ParameterValueException(String paramName, List<String> values, Throwable cause) { super( new LensErrorInfo(INVALID_PARAMETER_VALUE.getValue(), 0, INVALID_PARAMETER_VALUE.toString()) , values , paramName , cause.getMessage()); this.paramName = paramName; this.values = ImmutableList.copyOf(values); }
public SavedQueryNotFound(long id) { super( new LensErrorInfo(RESOURCE_NOT_FOUND.getValue(), 0, RESOURCE_NOT_FOUND.toString()) , SavedQuery.class.getSimpleName() , String.valueOf(id)); this.id = id; } }
public PrivilegeException(String resourceType, String resourceIdentifier, String privilege) { super( new LensErrorInfo(NOT_AUTHORIZED.getValue(), 0, NOT_AUTHORIZED.toString()) , privilege , resourceType , resourceIdentifier); this.resourceType = resourceType; this.resourceIdentifier = resourceIdentifier; this.privilege = privilege; } }
public PrivilegeException(String resourceType, String resourceIdentifier, String privilege) { super( new LensErrorInfo(NOT_AUTHORIZED.getValue(), 0, NOT_AUTHORIZED.toString()) , privilege , resourceType , resourceIdentifier); this.resourceType = resourceType; this.resourceIdentifier = resourceIdentifier; this.privilege = privilege; } }
/** * Validates the saved query and throws LensException with. * BAD_SYNTAX code if wrong * * @param savedQuery Saved query object * @throws LensException if invalid */ private void validateSampleResolved(@NonNull SavedQuery savedQuery) throws LensException { final String sampleResolved = SavedQueryHelper.getSampleResolvedQuery(savedQuery); try { HQLParser.parseHQL(sampleResolved, new HiveConf()); } catch (Exception e) { throw new LensException( new LensErrorInfo(INVALID_XML_ERROR.getValue(), 0, INVALID_XML_ERROR.toString()) , e , "Encountered while resolving with sample values { " + sampleResolved + " }"); } }