Package java.security

Examples of java.security.InvalidParameterException


    */
   public void setSchedulePeriod(long pPeriod)
   {
      if (pPeriod <= 0)
      {
         throw new InvalidParameterException("Schedulable Period may be not less or equals than 0");
      }
      mSchedulePeriod = pPeriod;
      mIsRestartPending = true;
   }
View Full Code Here


               mStartDateIsNow = false;
            }
            catch (Exception e2)
            {
               log.error("Could not parse given date string: " + mStartDateString, e2);
               throw new InvalidParameterException("Schedulable Date is not of correct format: " + mStartDateString);
            }
         }
      }
      log.debug("Initial Start Date is set to: " + mStartDate);
   }
View Full Code Here

        this.methodStore = methodStore;
    }

    public String generateKey(final Object keyObject) {
        if (keyObject == null) {
            throw new InvalidParameterException("keyObject must be defined");
        }
        try {
            final Method keyMethod = getKeyMethod(keyObject);
            return generateObjectId(keyMethod, keyObject);
        } catch (Exception ex) {
View Full Code Here

        }
    }

    public List<String> generateKeys(final List<Object> keyObjects) {
        if (keyObjects == null || keyObjects.size() < 1) {
            throw new InvalidParameterException("The key objects must be defined.");
        }
        final List<String> results = new ArrayList<String>(keyObjects.size());
        for (final Object keyObject : keyObjects) {
            results.add(generateKey(keyObject));
        }
View Full Code Here

                            InvalidateAssignCache.class,
                            methodToCache);
           
            final String cacheKey = buildCacheKey(annotationData.getAssignedKey(), annotationData);
            if (cacheKey == null || cacheKey.trim().length() == 0) {
                throw new InvalidParameterException("Unable to find a cache key");
            }
            cache.delete(cacheKey);
        } catch (Throwable ex) {
            LOG.warn("Caching on " + pjp.toShortString() + " aborted due to an error.", ex);
        }
View Full Code Here

                final Method keyMethod = getKeyMethod(result);
                final String objectId = generateObjectId(keyMethod, result);
                cacheKey = buildCacheKey(objectId, annotationData);
            }
            if (cacheKey == null || cacheKey.trim().length() == 0) {
                throw new InvalidParameterException("Unable to find a cache key");
            }
            cache.delete(cacheKey);
        } catch (Throwable ex) {
            LOG.warn("Caching on " + pjp.toShortString() + " aborted due to an error.", ex);
        }
View Full Code Here

            final Method assignKeyMethod = expectedAnnotationClass.getDeclaredMethod("assignedKey", null);
            final String assignKey = (String) assignKeyMethod.invoke(annotation, null);
            if (AnnotationConstants.DEFAULT_STRING.equals(assignKey)
                    || assignKey == null
                    || assignKey.length() < 1) {
                throw new InvalidParameterException(String.format(
                        "AssignedKey for annotation [%s] must be defined on [%s]",
                        expectedAnnotationClass.getName(),
                        targetMethodName
                ));
            }
View Full Code Here

        final Method namespaceMethod = expectedAnnotationClass.getDeclaredMethod("namespace", null);
        final String namespace = (String) namespaceMethod.invoke(annotation, null);
        if (AnnotationConstants.DEFAULT_STRING.equals(namespace)
                || namespace == null
                || namespace.length() < 1) {
            throw new InvalidParameterException(String.format(
                    "Namespace for annotation [%s] must be defined on [%s]",
                    expectedAnnotationClass.getName(),
                    targetMethodName
            ));
        }
View Full Code Here

            throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
        if (!INVALIDATES.contains(expectedAnnotationClass)) {
            final Method expirationMethod = expectedAnnotationClass.getDeclaredMethod("expiration", null);
            final int expiration = (Integer) expirationMethod.invoke(annotation, null);
            if (expiration < 0) {
                throw new InvalidParameterException(String.format(
                        "Expiration for annotation [%s] must be 0 or greater on [%s]",
                        expectedAnnotationClass.getName(),
                        targetMethodName
                ));
            }
View Full Code Here

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

        if (foundIndex < 0) {
            throw new InvalidParameterException(String.format(
                    "No KeyProvider annotation found method [%s]",
                    targetMethod.getName()
            ));
        }
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.