Examples of Parameter


Examples of org.apache.axis2.rmi.metadata.Parameter

            } catch (IllegalAccessException e) {
                throw AxisFault.makeFault(e);
            } catch (InvocationTargetException e) {
                Throwable targetException = e.getTargetException();
                if (targetException != null) {
                    Parameter parameter = this.service.getExceptionParameter(targetException.getClass());
                    if (parameter != null) {
                        AxisFault axisFault = new AxisFault(targetException.getMessage());
                        axisFault.setDetail(getParameterOMElement(targetException,
                                                                  parameter,
                                                                  this.javaObjectSerializer,
View Full Code Here

Examples of org.apache.axis2.transport.testkit.message.RESTMessage.Parameter

       
        List<Parameter> parameters = new LinkedList<Parameter>();
        for (Map.Entry<String,List<String>> entry :
                ((Map<String,List<String>>)request.getParameters()).entrySet()) {
            for (String value : entry.getValue()) {
                parameters.add(new Parameter(entry.getKey(), value));
            }
        }
        return new IncomingMessage<RESTMessage>(null, new RESTMessage(parameters.toArray(
                new Parameter[parameters.size()])));
    }
View Full Code Here

Examples of org.apache.blur.trace.Trace.Parameter

    _name = "new thread collector";
    _start = System.nanoTime();
    _ended = _start;
    _threadName = Thread.currentThread().getName();
    _id = id;
    _parameters = new Parameter[] { new Parameter("requestId", requestId) };
    _traceCollector = traceCollector;
    _scope = traceCollector.getScope();
    _traceScope = traceScope;
  }
View Full Code Here

Examples of org.apache.cloudstack.api.Parameter

        }

        List<Field> fields = ReflectUtil.getAllFieldsForClass(cmd.getClass(), BaseCmd.class);

        for (Field field : fields) {
            Parameter parameterAnnotation = field.getAnnotation(Parameter.class);
            if ((parameterAnnotation == null) || !parameterAnnotation.expose()) {
                continue;
            }

            //TODO: Annotate @Validate on API Cmd classes, FIXME how to process Validate
            Validate validateAnnotation = field.getAnnotation(Validate.class);
            Object paramObj = unpackedParams.get(parameterAnnotation.name());
            if (paramObj == null) {
                if (parameterAnnotation.required()) {
                    throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to execute API command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8) + " due to missing parameter "
                            + parameterAnnotation.name());
                }
                continue;
            }

            // marshall the parameter into the correct type and set the field value
            try {
                setFieldValue(field, cmd, paramObj, parameterAnnotation);
            } catch (IllegalArgumentException argEx) {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Unable to execute API command " + cmd.getCommandName() + " due to invalid value " + paramObj + " for parameter " + parameterAnnotation.name());
                }
                throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to execute API command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8) + " due to invalid value " + paramObj
                        + " for parameter "
                        + parameterAnnotation.name());
            } catch (ParseException parseEx) {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Invalid date parameter " + paramObj + " passed to command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8));
                }
                throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to parse date " + paramObj + " for command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8)
                        + ", please pass dates in the format mentioned in the api documentation");
            } catch (InvalidParameterValueException invEx) {
                throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to execute API command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8) + " due to invalid value. " + invEx.getMessage());
            } catch (CloudRuntimeException cloudEx) {
              s_logger.error("CloudRuntimeException", cloudEx);
                // FIXME: Better error message? This only happens if the API command is not executable, which typically
                //means
                // there was
                // and IllegalAccessException setting one of the parameters.
                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Internal error executing API command " + cmd.getCommandName().substring(0, cmd.getCommandName().length() - 8));
            }

            //check access on the resource this field points to
            try {
                ACL checkAccess = field.getAnnotation(ACL.class);
                CommandType fieldType = parameterAnnotation.type();

                if (checkAccess != null) {
                    // Verify that caller can perform actions in behalf of vm owner
                    //acumulate all Controlled Entities together.

                    //parse the array of resource types and in case of map check access on key or value or both as specified in @acl
                    //implement external dao for classes that need findByName
                    //for maps, specify access to be checkd on key or value.

                    // find the controlled entity DBid by uuid
                    if (parameterAnnotation.entityType() != null) {
                        Class<?>[] entityList = parameterAnnotation.entityType()[0].getAnnotation(EntityReference.class).value();

                        for (Class entity : entityList) {
                            // Check if the parameter type is a single
                            // Id or list of id's/name's
                            switch (fieldType) {
                            case LIST:
                                CommandType listType = parameterAnnotation.collectionType();
                                switch (listType) {
                                case LONG:
                                case UUID:
                                    List<Long> listParam = (List<Long>) field.get(cmd);
                                    for (Long entityId : listParam) {
View Full Code Here

Examples of org.apache.cocoon.portal.layout.impl.Parameter

    throws SAXException {
        if (layout instanceof CompositeLayout) {
            AttributesImpl attributes = new AttributesImpl();
            Map parameter = layout.getParameters();
            for (Iterator iter = parameter.values().iterator(); iter.hasNext();) {
                Parameter param = (Parameter) iter.next();
                attributes.addCDATAAttribute(param.getName(), param.getValue());
            }
            XMLUtils.startElement(handler, this.getTagName(context), attributes);

            PortalService portalService = null;
            try {
View Full Code Here

Examples of org.apache.cxf.jaxrs.model.Parameter

                String propertyName = m.getName().substring(3).toLowerCase();
                if (m.getReturnType() == Class.class
                    || checkIgnorable && canPropertyBeIgnored(m, propertyName)) {
                    continue;
                }
                params.put(new Parameter(type, propertyName), m.getReturnType());
            }
        }
        return params;
    }
View Full Code Here

Examples of org.apache.etch.compiler.ast.Parameter

  @Override
  public String getValidator( Named<?> named )
  {
    if (named instanceof Parameter)
    {
      Parameter param = (Parameter) named;
      TypeRef type = param.type();

      if (type.isBuiltin())
        return "Validator_" + type.type() + ".Get( " + type.dim()
          + " )";
View Full Code Here

Examples of org.apache.felix.service.command.Parameter

                Map<String, String> optionDescs = new TreeMap();
                List<String> params = new ArrayList();
                Annotation[][] anns = m.getParameterAnnotations();
                for (int paramIdx = 0; paramIdx < anns.length; paramIdx++)
                {
                    Parameter p = findAnnotation(anns[paramIdx], Parameter.class);
                    d = findAnnotation(anns[paramIdx], Descriptor.class);
                    if (p != null)
                    {
                        if (p.presentValue().equals(Parameter.UNSPECIFIED))
                        {
                            options.put(p.names()[0], p);
                            if (d != null)
                            {
                                optionDescs.put(p.names()[0], d.value());
                            }
                        }
                        else
                        {
                            flags.put(p.names()[0], p);
                            if (d != null)
                            {
                                flagDescs.put(p.names()[0], d.value());
                            }
                        }
                    }
                    else if (d != null)
                    {
View Full Code Here

Examples of org.apache.isis.viewer.scimpi.dispatcher.view.action.Parameter

        addElementProcessor(new Members());
        addElementProcessor(new Messages());
        addElementProcessor(new Methods());
        addElementProcessor(new ObjectLink());
        addElementProcessor(new PageTitle());
        addElementProcessor(new Parameter());
        addElementProcessor(new ParameterName());
        addElementProcessor(new RadioListField());
        addElementProcessor(new Redirect());
        addElementProcessor(new RemoveElement());
        addElementProcessor(new VersionNumber());
View Full Code Here

Examples of org.apache.jetspeed.om.profile.Parameter

        if (entry == null)
        {
            return dftValue;
        }
        Parameter attr = entry.getParameter(name);
        if (attr != null)
        {
            return attr.getValue();
        }
        else
        {
            return dftValue;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.