Examples of Rest


Examples of ca.uhn.fhir.model.dstu.resource.Conformance.Rest

    Conformance retVal = new Conformance();
    retVal.getSoftware().setName(myRestfulServer.getServerName());
    retVal.getSoftware().setVersion(myRestfulServer.getServerVersion());

    Rest rest = retVal.addRest();
    rest.setMode(RestfulConformanceModeEnum.SERVER);

    Set<RestfulOperationSystemEnum> systemOps = new HashSet<RestfulOperationSystemEnum>();

    for (ResourceBinding next : myRestfulServer.getResourceBindings()) {

      Set<RestfulOperationTypeEnum> resourceOps = new HashSet<RestfulOperationTypeEnum>();
      RestResource resource = rest.addResource();

      String resourceName = next.getResourceName();
      RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceName);
      resource.getType().setValue(def.getName());
      resource.getProfile().setId(new IdDt(def.getResourceProfile()));

      Map<String, Conformance.RestResourceSearchParam> nameToSearchParam = new HashMap<String, Conformance.RestResourceSearchParam>();
      for (BaseMethodBinding nextMethodBinding : next.getMethodBindings()) {
        RestfulOperationTypeEnum resOp = nextMethodBinding.getResourceOperationType();
        if (resOp != null) {
          if (resourceOps.contains(resOp) == false) {
            resourceOps.add(resOp);
            resource.addOperation().setCode(resOp);
          }
        }

        RestfulOperationSystemEnum sysOp = nextMethodBinding.getSystemOperationType();
        if (sysOp != null) {
          if (systemOps.contains(sysOp) == false) {
            systemOps.add(sysOp);
            rest.addOperation().setCode(sysOp);
          }
        }

        if (nextMethodBinding instanceof SearchMethodBinding) {
          List<IParameter> params = ((SearchMethodBinding) nextMethodBinding).getParameters();
View Full Code Here

Examples of ca.uhn.fhir.model.dstu.resource.Conformance.Rest

    retVal.getSoftware().setName(myRestfulServer.getServerName());
    retVal.getSoftware().setVersion(myRestfulServer.getServerVersion());
    retVal.addFormat(Constants.CT_FHIR_XML);
    retVal.addFormat(Constants.CT_FHIR_JSON);

    Rest rest = retVal.addRest();
    rest.setMode(RestfulConformanceModeEnum.SERVER);

    Set<RestfulOperationSystemEnum> systemOps = new HashSet<RestfulOperationSystemEnum>();

    List<ResourceBinding> bindings = new ArrayList<ResourceBinding>(myRestfulServer.getResourceBindings());
    Collections.sort(bindings, new Comparator<ResourceBinding>() {
      @Override
      public int compare(ResourceBinding theArg0, ResourceBinding theArg1) {
        return theArg0.getResourceName().compareToIgnoreCase(theArg1.getResourceName());
      }
    });

    for (ResourceBinding next : bindings) {

      Set<RestfulOperationTypeEnum> resourceOps = new HashSet<RestfulOperationTypeEnum>();
      RestResource resource = rest.addResource();

      String resourceName = next.getResourceName();
      RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceName);
      resource.getType().setValue(def.getName());
      resource.getProfile().setReference(new IdDt(def.getResourceProfile()));

      TreeSet<String> includes = new TreeSet<String>();

      // Map<String, Conformance.RestResourceSearchParam> nameToSearchParam = new HashMap<String,
      // Conformance.RestResourceSearchParam>();
      for (BaseMethodBinding<?> nextMethodBinding : next.getMethodBindings()) {
        RestfulOperationTypeEnum resOp = nextMethodBinding.getResourceOperationType();
        if (resOp != null) {
          if (resourceOps.contains(resOp) == false) {
            resourceOps.add(resOp);
            resource.addOperation().setCode(resOp);
          }
        }

        RestfulOperationSystemEnum sysOp = nextMethodBinding.getSystemOperationType();
        if (sysOp != null) {
          if (systemOps.contains(sysOp) == false) {
            systemOps.add(sysOp);
            rest.addOperation().setCode(sysOp);
          }
        }

        if (nextMethodBinding instanceof SearchMethodBinding) {
          SearchMethodBinding searchMethodBinding = (SearchMethodBinding) nextMethodBinding;
          includes.addAll(searchMethodBinding.getIncludes());

          List<IParameter> params = searchMethodBinding.getParameters();
          List<SearchParameter> searchParameters = new ArrayList<SearchParameter>();
          for (IParameter nextParameter : params) {
            if ((nextParameter instanceof SearchParameter)) {
              searchParameters.add((SearchParameter) nextParameter);
            }
          }
          Collections.sort(searchParameters, new Comparator<SearchParameter>() {
            @Override
            public int compare(SearchParameter theO1, SearchParameter theO2) {
              if (theO1.isRequired() == theO2.isRequired()) {
                return theO1.getName().compareTo(theO2.getName());
              }
              if (theO1.isRequired()) {
                return -1;
              }
              return 1;
            }
          });
          if (searchParameters.isEmpty()) {
            continue;
          }
          boolean allOptional = searchParameters.get(0).isRequired() == false;

          RestQuery query = null;
          if (!allOptional) {
            query = rest.addQuery();
            query.getDocumentation().setValue(searchMethodBinding.getDescription());
            query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
            for (String nextInclude : searchMethodBinding.getIncludes()) {
              query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
            }
View Full Code Here

Examples of ca.uhn.fhir.model.dstu.resource.Conformance.Rest

    retVal.getSoftware().setName(myRestfulServer.getServerName());
    retVal.getSoftware().setVersion(myRestfulServer.getServerVersion());
    retVal.addFormat(Constants.CT_FHIR_XML);
    retVal.addFormat(Constants.CT_FHIR_JSON);

    Rest rest = retVal.addRest();
    rest.setMode(RestfulConformanceModeEnum.SERVER);

    Set<RestfulOperationSystemEnum> systemOps = new HashSet<RestfulOperationSystemEnum>();

    List<ResourceBinding> bindings = new ArrayList<ResourceBinding>(myRestfulServer.getResourceBindings());
    Collections.sort(bindings, new Comparator<ResourceBinding>() {
      @Override
      public int compare(ResourceBinding theArg0, ResourceBinding theArg1) {
        return theArg0.getResourceName().compareToIgnoreCase(theArg1.getResourceName());
      }
    });

    for (ResourceBinding next : bindings) {

      Set<RestfulOperationTypeEnum> resourceOps = new HashSet<RestfulOperationTypeEnum>();
      RestResource resource = rest.addResource();

      String resourceName = next.getResourceName();
      RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceName);
      resource.getType().setValue(def.getName());
      resource.getProfile().setReference(new IdDt(def.getResourceProfile()));

      TreeSet<String> includes = new TreeSet<String>();

      // Map<String, Conformance.RestResourceSearchParam> nameToSearchParam = new HashMap<String,
      // Conformance.RestResourceSearchParam>();
      for (BaseMethodBinding<?> nextMethodBinding : next.getMethodBindings()) {
        RestfulOperationTypeEnum resOp = nextMethodBinding.getResourceOperationType();
        if (resOp != null) {
          if (resourceOps.contains(resOp) == false) {
            resourceOps.add(resOp);
            resource.addOperation().setCode(resOp);
          }
        }

        RestfulOperationSystemEnum sysOp = nextMethodBinding.getSystemOperationType();
        if (sysOp != null) {
          if (systemOps.contains(sysOp) == false) {
            systemOps.add(sysOp);
            rest.addOperation().setCode(sysOp);
          }
        }

        if (nextMethodBinding instanceof SearchMethodBinding) {
          SearchMethodBinding searchMethodBinding = (SearchMethodBinding) nextMethodBinding;
          includes.addAll(searchMethodBinding.getIncludes());

          List<IParameter> params = searchMethodBinding.getParameters();
          List<SearchParameter> searchParameters = new ArrayList<SearchParameter>();
          for (IParameter nextParameter : params) {
            if ((nextParameter instanceof SearchParameter)) {
              searchParameters.add((SearchParameter) nextParameter);
            }
          }
          Collections.sort(searchParameters, new Comparator<SearchParameter>() {
            @Override
            public int compare(SearchParameter theO1, SearchParameter theO2) {
              if (theO1.isRequired() == theO2.isRequired()) {
                return theO1.getName().compareTo(theO2.getName());
              }
              if (theO1.isRequired()) {
                return -1;
              }
              return 1;
            }
          });
          if (searchParameters.isEmpty()) {
            continue;
          }
          boolean allOptional = searchParameters.get(0).isRequired() == false;

          RestQuery query = null;
          if (!allOptional) {
            query = rest.addQuery();
            query.getDocumentation().setValue(searchMethodBinding.getDescription());
            query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
            for (String nextInclude : searchMethodBinding.getIncludes()) {
              query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
            }
View Full Code Here

Examples of ca.uhn.fhir.model.dstu.resource.Conformance.Rest

    retVal.getSoftware().setName(myRestfulServer.getServerName());
    retVal.getSoftware().setVersion(myRestfulServer.getServerVersion());
    retVal.addFormat(Constants.CT_FHIR_XML);
    retVal.addFormat(Constants.CT_FHIR_JSON);

    Rest rest = retVal.addRest();
    rest.setMode(RestfulConformanceModeEnum.SERVER);

    Set<RestfulOperationSystemEnum> systemOps = new HashSet<RestfulOperationSystemEnum>();

    for (ResourceBinding next : myRestfulServer.getResourceBindings()) {

      Set<RestfulOperationTypeEnum> resourceOps = new HashSet<RestfulOperationTypeEnum>();
      RestResource resource = rest.addResource();

      String resourceName = next.getResourceName();
      RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceName);
      resource.getType().setValue(def.getName());
      resource.getProfile().setId(new IdDt(def.getResourceProfile()));

      Map<String, Conformance.RestResourceSearchParam> nameToSearchParam = new HashMap<String, Conformance.RestResourceSearchParam>();
      for (BaseMethodBinding nextMethodBinding : next.getMethodBindings()) {
        RestfulOperationTypeEnum resOp = nextMethodBinding.getResourceOperationType();
        if (resOp != null) {
          if (resourceOps.contains(resOp) == false) {
            resourceOps.add(resOp);
            resource.addOperation().setCode(resOp);
          }
        }

        RestfulOperationSystemEnum sysOp = nextMethodBinding.getSystemOperationType();
        if (sysOp != null) {
          if (systemOps.contains(sysOp) == false) {
            systemOps.add(sysOp);
            rest.addOperation().setCode(sysOp);
          }
        }

        if (nextMethodBinding instanceof SearchMethodBinding) {
          List<IParameter> params = ((SearchMethodBinding) nextMethodBinding).getParameters();
View Full Code Here

Examples of ca.uhn.fhir.model.dstu.resource.Conformance.Rest

    Conformance retVal = new Conformance();
    retVal.getSoftware().setName(myRestfulServer.getServerName());
    retVal.getSoftware().setVersion(myRestfulServer.getServerVersion());

    Rest rest = retVal.addRest();
    rest.setMode(RestfulConformanceModeEnum.SERVER);

    Set<RestfulOperationSystemEnum> systemOps = new HashSet<RestfulOperationSystemEnum>();

    for (ResourceBinding next : myRestfulServer.getResourceBindings()) {

      Set<RestfulOperationTypeEnum> resourceOps = new HashSet<RestfulOperationTypeEnum>();
      RestResource resource = rest.addResource();

      Class<? extends IResource> resourceType = next.getResourceProvider().getResourceType();
      RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceType);
      resource.getType().setValue(def.getName());
      resource.getProfile().setId(new IdDt(def.getResourceProfile()));

      Map<String, Conformance.RestResourceSearchParam> nameToSearchParam = new HashMap<String, Conformance.RestResourceSearchParam>();
      for (BaseMethodBinding nextMethodBinding : next.getMethodBindings()) {
        RestfulOperationTypeEnum resOp = nextMethodBinding.getResourceOperationType();
        if (resOp != null) {
          if (resourceOps.contains(resOp) == false) {
            resourceOps.add(resOp);
            resource.addOperation().setCode(resOp);
          }
        }

        RestfulOperationSystemEnum sysOp = nextMethodBinding.getSystemOperationType();
        if (sysOp != null) {
          if (systemOps.contains(sysOp) == false) {
            systemOps.add(sysOp);
            rest.addOperation().setCode(sysOp);
          }
        }

        if (nextMethodBinding instanceof SearchMethodBinding) {
          List<IParameter> params = ((SearchMethodBinding) nextMethodBinding).getParameters();
View Full Code Here

Examples of ca.uhn.fhir.model.dstu.resource.Conformance.Rest

    retVal.getSoftware().setName(myRestfulServer.getServerName());
    retVal.getSoftware().setVersion(myRestfulServer.getServerVersion());
    retVal.addFormat(Constants.CT_FHIR_XML);
    retVal.addFormat(Constants.CT_FHIR_JSON);

    Rest rest = retVal.addRest();
    rest.setMode(RestfulConformanceModeEnum.SERVER);

    Set<RestfulOperationSystemEnum> systemOps = new HashSet<RestfulOperationSystemEnum>();

    List<ResourceBinding> bindings = new ArrayList<ResourceBinding>(myRestfulServer.getResourceBindings());
    Collections.sort(bindings, new Comparator<ResourceBinding>() {
      @Override
      public int compare(ResourceBinding theArg0, ResourceBinding theArg1) {
        return theArg0.getResourceName().compareToIgnoreCase(theArg1.getResourceName());
      }
    });

    for (ResourceBinding next : bindings) {

      Set<RestfulOperationTypeEnum> resourceOps = new HashSet<RestfulOperationTypeEnum>();
      RestResource resource = rest.addResource();

      String resourceName = next.getResourceName();
      RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceName);
      resource.getType().setValue(def.getName());
      resource.getProfile().setReference(new IdDt(def.getResourceProfile()));

      TreeSet<String> includes = new TreeSet<String>();

      // Map<String, Conformance.RestResourceSearchParam> nameToSearchParam = new HashMap<String,
      // Conformance.RestResourceSearchParam>();
      for (BaseMethodBinding<?> nextMethodBinding : next.getMethodBindings()) {
        RestfulOperationTypeEnum resOp = nextMethodBinding.getResourceOperationType();
        if (resOp != null) {
          if (resourceOps.contains(resOp) == false) {
            resourceOps.add(resOp);
            resource.addOperation().setCode(resOp);
          }
        }

        RestfulOperationSystemEnum sysOp = nextMethodBinding.getSystemOperationType();
        if (sysOp != null) {
          if (systemOps.contains(sysOp) == false) {
            systemOps.add(sysOp);
            rest.addOperation().setCode(sysOp);
          }
        }

        if (nextMethodBinding instanceof SearchMethodBinding) {
          SearchMethodBinding searchMethodBinding = (SearchMethodBinding) nextMethodBinding;
          includes.addAll(searchMethodBinding.getIncludes());

          List<IParameter> params = searchMethodBinding.getParameters();
          List<SearchParameter> searchParameters = new ArrayList<SearchParameter>();
          for (IParameter nextParameter : params) {
            if ((nextParameter instanceof SearchParameter)) {
              searchParameters.add((SearchParameter) nextParameter);
            }
          }
          Collections.sort(searchParameters, new Comparator<SearchParameter>() {
            @Override
            public int compare(SearchParameter theO1, SearchParameter theO2) {
              if (theO1.isRequired() == theO2.isRequired()) {
                return theO1.getName().compareTo(theO2.getName());
              }
              if (theO1.isRequired()) {
                return -1;
              }
              return 1;
            }
          });
          if (searchParameters.isEmpty()) {
            continue;
          }
          boolean allOptional = searchParameters.get(0).isRequired() == false;

          RestQuery query = null;
          if (!allOptional) {
            query = rest.addQuery();
            query.getDocumentation().setValue(searchMethodBinding.getDescription());
            query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
            for (String nextInclude : searchMethodBinding.getIncludes()) {
              query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
            }
View Full Code Here

Examples of com.aetrion.flickr.REST

        //turn on debugging
        Flickr.debugStream = true;
        Flickr.debugRequest = true;
        Flickr flickr = new Flickr(
                key,shared,
                new REST()
        );

        /*
        //
        RequestContext context = RequestContext.getRequestContext();
View Full Code Here

Examples of com.aetrion.flickr.REST

        new Thread(new Runnable(){
            public void run() {
                try {
                    Flickr flickr = new Flickr(
                            key,shared,
                            new REST()
                    );

                    AuthInterface authInterface = flickr.getAuthInterface();
                    Auth auth = authInterface.checkToken(context.getSettings().getProperty(FLICKR_USER_TOKEN));
                    RequestContext context = RequestContext.getRequestContext();
View Full Code Here

Examples of com.aetrion.flickr.REST

        private void authenticate() throws ParserConfigurationException, IOException, SAXException {
            Flickr.debugStream = true;
            Flickr.debugRequest = true;
            Flickr flickr = new Flickr(
                    key,shared,
                    new REST()
            );
            final RequestContext context = RequestContext.getRequestContext();
            //ask user to authenticate on the web
            final AuthInterface authInterface = flickr.getAuthInterface();
            try {
View Full Code Here

Examples of com.aetrion.flickr.REST

     */
    public Uploader(String apiKey, String sharedSecret) {
        try {
            this.apiKey = apiKey;
            this.sharedSecret = sharedSecret;
            this.transport = new REST();
            this.transport.setResponseClass(UploaderResponse.class);
        } catch (ParserConfigurationException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
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.