Examples of API


Examples of com.alu.e3.data.model.Api

    this.apiId = apiId;
  }
 
  @Override
  public void process(Exchange exchange) throws Exception {
    Api api = this.dataManager.getApiById(apiId, false);
    HttpServletRequest request = (HttpServletRequest) exchange.getIn().getHeader(Exchange.HTTP_SERVLET_REQUEST);
    //retrieve the real IP adress from the request
    String remoteAddr = CommonTools.remoteAddr(request);
    CanonicalizedIpAddress ip = new CanonicalizedIpAddress(remoteAddr);
    if(this.dataManager.isIpAllowed(api, ip.getIp())) {
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.Api

    Action action = new Action() {

      protected Object doAction(Object... params) {
        try {
          Api api = apiService.get(apiId);
          return new ApiResponse(ApiResponse.SUCCESS, api);

        } catch (ProvisionException e) {
          throw new WebApplicationException(e);
        }
View Full Code Here

Examples of com.antonytrupe.server.tend.API

  }

  @Test
  @Ignore
  public void createSaveBoard() throws GameEngineException {
    API api = new API();
    ScriptableObject board = api.createBoard();

    String json = (String) ge.invoke(board, "stringify");

    Long id = api.getId(board);
    Entity result;
    if (id != null) {
      result = ge.persistence.save("Board", id, "json", json);
    } else {
      result = ge.persistence.save("Board");
      id = result.getKey().getId();
    }
    api.setId(board, result.getKey().getId());

    json = (String) ge.invoke(board, "stringify");

    result = ge.persistence.save("Board", id, "json", json);

    api.update(board, json);

    json = (String) ge.invoke(board, "stringify");

    assertEquals(1, board.get("id"));
  }
View Full Code Here

Examples of com.carma.swagger.doclet.model.Api

      declaration.setDescription(description);
    }
  }

  private void addMethod(Method parsedMethod, ApiDeclaration declaration) {
    Api methodApi = null;
    for (Api api : declaration.getApis()) {
      if (parsedMethod.getPath().equals(api.getPath())) {
        methodApi = api;
        break;
      }
    }
    if (methodApi == null) {
      methodApi = new Api(parsedMethod.getPath(), "", new ArrayList<Operation>());
      declaration.getApis().add(methodApi);
    }

    methodApi.getOperations().add(new Operation(parsedMethod));
  }
View Full Code Here

Examples of com.cloudinary.Api

        Cloudinary cloudinary = new Cloudinary();
        if (cloudinary.getStringConfig("api_secret") == null) {
            System.err.println("Please setup environment for Upload test to run");
            return;
        }
        Api api = cloudinary.api();
        try {
            api.deleteResources(Arrays.asList("api_test", "api_test1", "api_test2", "api_test3", "api_test5"), Cloudinary.emptyMap());
        } catch (Exception e) {
        }
        try {
            api.deleteTransformation("api_test_transformation", Cloudinary.emptyMap());
        } catch (Exception e) {
        }
        try {
            api.deleteTransformation("api_test_transformation2", Cloudinary.emptyMap());
        } catch (Exception e) {
        }
        try {
            api.deleteTransformation("api_test_transformation3", Cloudinary.emptyMap());
        } catch (Exception e) {
        }
        try{api.deleteUploadPreset("api_test_upload_preset", Cloudinary.emptyMap());}catch (Exception e) {}
        try{api.deleteUploadPreset("api_test_upload_preset2", Cloudinary.emptyMap());}catch (Exception e) {}
        try{api.deleteUploadPreset("api_test_upload_preset3", Cloudinary.emptyMap());}catch (Exception e) {}
        try{api.deleteUploadPreset("api_test_upload_preset4", Cloudinary.emptyMap());}catch (Exception e) {}
        Map options = Cloudinary.asMap(
                "public_id", "api_test",
                "tags", new String[]{"api_test_tag", uniqueTag},
                "context", "key=value",
                "eager", Collections.singletonList(new Transformation().width(100).crop("scale")));
View Full Code Here

Examples of com.hypnoticocelot.jaxrs.doclet.model.Api

                        public Operation apply(Method method) {
                            return new Operation(method);
                        }
                    })
            );
            apis.add(new Api(apiEntries.getKey(), "", operations));
        }
        Collections.sort(apis, new Comparator<Api>() {
            @Override
            public int compare(Api o1, Api o2) {
                return o1.getPath().compareTo(o2.getPath());
View Full Code Here

Examples of com.mobcom.amazon.API

  /**
   * @param args
   */
  public static void main(String[] args) {
    API caller = new API();
    //System.out.println(caller.getProductById("B00008OE6I"));
    MobcomAdapter adapter = MobcomAdapter.newInstance();
    adapter.parseAsProducts(caller.getProducts(10));
    DBStore dbStore = DBStore.newInstance();
    System.out.println("No of products = " + dbStore.getNumberOfProducts());
    //parser.parse(caller.getProductById("B00008OE6I"));
  }
View Full Code Here

Examples of com.redhat.gss.redhat_support_lib.api.API

                if (splitCredentials[1] != null) {
                    password = splitCredentials[1];
                }
            }
            Config config = new Config();
            API api = new API(username, password, config.getURL(), config.getProxyUser(), config.getProxyPassword(),
                config.getProxyURL(), config.getProxyPort(), config.getUserAgent(), config.isDevel());
            // check if we are authorized
            api.getProblems().diagnoseStr("test");
            if (SERVER_REPORT.equalsIgnoreCase(attachment)) {
                String report = new JdrReportRunner().getReport();
                api.getAttachments().add(caseNum, true, report, attachment);
                log.info("File attached to URL " + api.getConfigHelper().getUrl());
                try {
                    new File(report).delete();
                    log.debug("Report " + report + " deleted");
                } catch (Exception e) {
                    log.error("Failed to delete JDR Report File", e);
                }
            }
            if (attachment.startsWith(RESOURCE_REPORT)) {
                String resourceId = attachment.replaceAll(".*/", "").replaceAll("\\:.*", "").trim();
                log.info("About to attach report for resourceId=" + resourceId);
                int resId = Integer.parseInt(resourceId);
                String report = new ResourceJdrReportRunner(resId).getReport();
                if (report != null) {
                    api.getAttachments().add(caseNum, true, report, attachment);
                    try {
                        new File(report).delete();
                        log.debug("Report " + report + " deleted");
                    } catch (Exception e) {
                        log.error("Failed to delete JDR Report File", e);
View Full Code Here

Examples of com.wordnik.swagger.annotations.Api

                return overviewResult;
            }

            List<Map<String, Object>> apis = Lists.newArrayList();
            for (Class<?> clazz : getAnnotatedClasses()) {
                Api info = clazz.getAnnotation(Api.class);
                Path path = clazz.getAnnotation(Path.class);

                if (info == null || path == null) {
                    LOG.debug("Skipping REST resource with no Api or Path annotation: <{}>", clazz.getCanonicalName());
                    continue;
                }

                Map<String, Object> apiDescription = Maps.newHashMap();
                apiDescription.put("name", info.value());
                apiDescription.put("path", path.value());
                apiDescription.put("description", info.description());

                apis.add(apiDescription);
            }
            Collections.sort(apis, new Comparator<Map<String, Object>>() {
                @Override
                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                    return ComparisonChain.start().compare(o1.get("name").toString(), o2.get("name").toString()).result();
                }
            });
            Map<String, String> info = Maps.newHashMap();
            info.put("title", "Graylog2 REST API");

            overviewResult.put("apiVersion", ServerVersion.VERSION.toString());
            overviewResult.put("swaggerVersion", EMULATED_SWAGGER_VERSION);
            overviewResult.put("apis", apis);
View Full Code Here

Examples of com.wordnik.swagger.annotations.Api

        String className = classElementIn.toString();
        classElement.setAttribute("name",className);
        String value = basePath.value();
        value = cleanOutPath(value);
        classElement.setAttribute("path", value);
        Api api = classElementIn.getAnnotation(Api.class);
        if (api!=null) {
            String shortDescription = api.value();
            setOptionalAttribute(classElement, "shortDesc", shortDescription);
            String longDescription = api.description();
            setOptionalAttribute(classElement, "description", longDescription);
            String basePathAttr = api.basePath();
            setOptionalAttribute(classElement, "basePath",basePathAttr);
        }
        Produces produces = classElementIn.getAnnotation(Produces.class);
        if (produces!=null) {
            String[] types = produces.value();
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.