Package java.security

Examples of java.security.InvalidParameterException


        final ReturnValueKeyProvider returnAnnotation = targetMethod.getAnnotation(ReturnValueKeyProvider.class);
        if (returnAnnotation != null) {
            final Method beanMethod = ReturnValueKeyProvider.class.getDeclaredMethod("keyProviderBeanName", null);
            final String beanName = (String) beanMethod.invoke(returnAnnotation, null);
            if (beanName == null || beanName.length() < 1) {
                throw new InvalidParameterException(String.format(
                        "No valid keyIndexBeanName defined in annotation [%s] on method [%s]",
                        ReturnValueKeyProvider.class.getName(),
                        targetMethod.getName()
                ));
            }
            data.setKeyIndex(-1);
            data.setKeyProviderBeanName(beanName);
            return;
        }

        final Annotation[][] paramAnnotationArrays = targetMethod.getParameterAnnotations();
        int foundIndex = Integer.MIN_VALUE;
        Annotation foundAnnotation = null;

        if (paramAnnotationArrays != null && paramAnnotationArrays.length > 0) {
            for (int ix = 0; ix < paramAnnotationArrays.length; ix++) {
                final Annotation[] paramAnnotations = paramAnnotationArrays[ix];
                if (paramAnnotations != null && paramAnnotations.length > 0) {
                    for (int jx = 0; jx < paramAnnotations.length; jx++) {
                        final Annotation paramAnnotation = paramAnnotations[jx];
                        if (ParameterValueKeyProvider.class.equals(paramAnnotation.annotationType())) {
                            if (foundIndex >= 0) {
                                throw new InvalidParameterException(String.format(
                                        "Multiple annotations of type [%s] found on method [%s]",
                                        ParameterValueKeyProvider.class.getName(),
                                        targetMethod.getName()
                                ));
                            }
                            foundAnnotation = paramAnnotation;
                            foundIndex = ix;
                        }
                    }
                }
            }
        }

        if (foundIndex < 0 || foundAnnotation == null) {
            throw new InvalidParameterException(String.format(
                    "No KeyProvider annotation found method [%s]",
                    targetMethod.getName()
            ));
        }


        final Method beanMethod = ParameterValueKeyProvider.class.getDeclaredMethod("keyProviderBeanName", null);
        final String beanName = (String) beanMethod.invoke(foundAnnotation, null);
        if (beanName == null || beanName.length() < 1) {
            throw new InvalidParameterException(String.format(
                    "No valid keyIndexBeanName defined in annotation [%s] on method [%s]",
                    ParameterValueKeyProvider.class.getName(),
                    targetMethod.getName()
            ));
        }
View Full Code Here


    static void populateClassName(final AnnotationData data,
                                   final Annotation annotation,
                                   final Class expectedAnnotationClass) {
        if (annotation == null) {
            throw new InvalidParameterException(String.format(
                    "No annotation of type [%s] found.",
                    expectedAnnotationClass.getName()
            ));
        }

        final Class clazz = annotation.annotationType();
        if (!expectedAnnotationClass.equals(clazz)) {
            throw new InvalidParameterException(String.format(
                    "No annotation of type [%s] found, class was of type [%s].",
                    expectedAnnotationClass.getName(),
                    clazz.getName()
            ));
        }
View Full Code Here

   * @param oValue value to append
   * @param bBeginning true to add at the start, false to add at the end
   */
  public void append(final String sTagName, final Object oValue, final boolean bBeginning) {
    if (sTagName==null)
      throw new InvalidParameterException("Tag cannot be null"); //$NON-NLS-1$
   
    if (oValue==null || this.tp==null)
      return;

    final String sTag = StringFactory.get(sTagName);
View Full Code Here

     * @return              a chunkified list (i.e., list of sublists)
     */
    public static <T> List<List<T>> chunkifyList(List<T> list, int maxChunkSize) {
        // sanity-check input param
        if (maxChunkSize < 1)
            throw new InvalidParameterException("maxChunkSize must be greater than zero");
       
        // initialize return object
        List<List<T>> chunkedLists = new ArrayList<List<T>>();
       
        // if the given list is smaller than the maxChunksize, there's
View Full Code Here

                Series<Parameter> params = server.getContext().getParameters();
               
                if (endpoint.getProtocol().equals("https")) {
                    SSLContextParameters scp = endpoint.getSslContextParameters();
                    if (endpoint.getSslContextParameters() == null) {
                        throw new InvalidParameterException("Need to specify the SSLContextParameters option here!");
                    }
                    setupServerWithSSLContext(params, scp);
                }

                if (getControllerDaemon() != null) {
View Full Code Here

                          int numRedirects,
                          String hostAddress){
        _payload = payload;
   
    if (baseUrl == null) {
          throw new InvalidParameterException("baseUrl cannot be null");
        }
       
        if (redirectedUrl == null) {
          throw new InvalidParameterException("redirectedUrl cannot be null");
        }
       
        if (headers == null) {
          throw new InvalidParameterException("headers cannot be null");
        }
       
        if (content == null) {
          throw new InvalidParameterException("content cannot be null");
        }
       
        if (contentType == null) {
            throw new InvalidParameterException("contentType cannot be null");
        }
       
        if (hostAddress == null) {
            throw new InvalidParameterException("hostAddress cannot be null");
        }
       
        _baseUrl = baseUrl;
        _fetchedUrl = redirectedUrl;
        _fetchTime = fetchTime;
View Full Code Here

    }
   
    public void setMaxContentSize(String mimeType, int maxContentSize) {
        if  (   (_fetcherPolicy.getValidMimeTypes().size() > 0)
            &&  (!(_fetcherPolicy.getValidMimeTypes().contains(mimeType)))) {
            throw new InvalidParameterException(String.format("'%s' is not a supported MIME type", mimeType));
        }
        _maxContentSizes.put(mimeType, maxContentSize);
    }
View Full Code Here

        this(DEFAULT_MIN_RESPONSE_RATE, DEFAULT_MAX_CONTENT_SIZE, DEFAULT_CRAWL_END_TIME, DEFAULT_CRAWL_DELAY, DEFAULT_MAX_REDIRECTS);
    }

    public FetcherPolicy(int minResponseRate, int maxContentSize, long crawlEndTime, long crawlDelay, int maxRedirects) {
        if (crawlDelay < 0) {
            throw new InvalidParameterException("crawlDelay must be >= 0: " + crawlDelay);
        }
       
        // Catch common error of specifying crawl delay in seconds versus milliseconds
        if ((crawlDelay < 100) && (crawlDelay != 0))  {
            throw new InvalidParameterException("crawlDelay must be milliseconds, not seconds: " + crawlDelay);
        }
       
        _minResponseRate = minResponseRate;
        _maxContentSize = maxContentSize;
        _crawlEndTime = crawlEndTime;
View Full Code Here

        return _tupleEntry.getString(URL_FN);
    }

    public void setUrl(String baseUrl) {
        if (baseUrl == null) {
            throw new InvalidParameterException("baseUrl cannot be null");
        }

        _tupleEntry.setString(URL_FN, baseUrl);
    }
View Full Code Here

        return _tupleEntry.getString(FETCHED_URL_FN);
    }

    public void setFetchedUrl(String fetchedUrl) {
        if (fetchedUrl == null) {
            throw new InvalidParameterException("fetchedUrl cannot be null");
        }

        _tupleEntry.setString(FETCHED_URL_FN, fetchedUrl);
    }
View Full Code Here

TOP

Related Classes of java.security.InvalidParameterException

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.