Examples of RestClient


Examples of com.chandu0101.passwordmemoryclient.rest.RestClient

           updateRecord();
        }
    }

    private void updateRecord() {
        RestClient restClient = basePresenter.getRestClient();
        selectedBluePrint.setUrl(urlTextField.getText());
        selectedBluePrint.setUsername(usernameTextField.getText());
        selectedBluePrint.setEncryptedPassword(AES.encrypt(passwordTextField.getText(), restClient.getMasterPassword()));
        HashMap<String,String> newvalues = new HashMap<>();
        newvalues.put("url",selectedBluePrint.getUrl());
        newvalues.put("username",selectedBluePrint.getUsername());
        newvalues.put("encryptedPassword",selectedBluePrint.getEncryptedPassword());
        restClient.updatePassword(selectedBluePrint.getId(),newvalues);
        basePresenter.getAddEditPopOver().hide();

    }
View Full Code Here

Examples of com.emc.vipr.client.impl.RestClient

    /**
     * Creates the RestClient. This is provided here so Testcases are able to override the base implementation.
     */
    protected RestClient newClient() {
        URI baseUri = URI.create(String.format("%s://%s:%s", protocol, host, port));
        return new RestClient(baseUri, this);
    }
View Full Code Here

Examples of com.github.jreddit.utils.restclient.RestClient

public class SubmissionsExample {

  public static void main(String[] args) {
   
    // Initialize REST Client
      RestClient restClient = new HttpRestClient();
      restClient.setUserAgent("bot/1.0 by name");

    // Connect the user
      User user = new User(restClient, Authentication.getUsername(), Authentication.getPassword());
    try {
      user.connect();
View Full Code Here

Examples of com.ibm.sbt.services.client.RestClient

    }
 
    // File functions
    @Override
    public InputStream getInputStream() throws IOException {
      RestClient c = createGitClient(getUserName(),getPassword());
      String path = URLEncoding.encodeURIString(getPath(),"utf-8",0,false);
      try {
        Map<String,Object> json = (Map<String,Object>)c.get(path,new RestClient.HandlerJson(JsonJavaFactory.instance)).getData();
        String content = (String)json.get("content");
        if(content!=null) {
          String encoding = (String)json.get("encoding");
          if(StringUtil.equals(encoding, "base64")) {
            return new Base64.InputStream(new StringInputStream(content));
View Full Code Here

Examples of com.ibm.sbt.services.client.RestClient

    // Directory functions
    @Override
    protected BaseFile[] loadChildren() throws IOException {
      try {
        ArrayList<BaseFile> files = new ArrayList<BaseFile>();
        RestClient c = createGitClient(getUserName(),getPassword());
        String path = URLEncoding.encodeURIString(getPath(),"utf-8",0,false);
        Object json = c.get(path,new RestClient.HandlerJson(JsonJavaFactory.instance)).getData();
        //System.out.println("Emit request for: "+path);       
        if(json instanceof List) {
          for(Object entry: (List)json) {
            if(entry instanceof Map) {
              Map m = (Map)entry;
View Full Code Here

Examples of com.ibm.sbt.services.client.RestClient

    if(StringUtil.isEmpty(location)) {
      location = PathUtil.concat("http://127.0.0.1",getDatabase().getFilePath(),'/');
    }
   
    RestClient client = createDominoClient(location,source.getUserName(),source.getPassword());
   
    List<DocEntry> list = loadEntries(client,source);
    if(action!=null&&action.isCancelled()) {
      return 0;
    }
View Full Code Here

Examples of com.linkedin.restli.client.RestClient

  @DataProvider(name = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "oldBuildersClientDataDataProvider")
  public Object[][] oldBuildersClientDataDataProvider()
  {
    return new Object[][]
      {
        { new RestClient(CLIENT, URI_PREFIX), "application/json", new GreetingsBuilders() }, // default client
        { new RestClient(CLIENT, URI_PREFIX), "application/json", new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS) }, // default client
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Collections.singletonList(RestClient.AcceptType.PSON)),
          "application/x-pson",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Collections.singletonList(RestClient.AcceptType.PSON)),
          "application/x-pson",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Collections.singletonList(RestClient.AcceptType.PSON)),
          "application/x-pson",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Collections.singletonList(RestClient.AcceptType.JSON)),
          "application/json",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Collections.singletonList(RestClient.AcceptType.JSON)),
          "application/json",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT, URI_PREFIX,
                         Collections.singletonList(
                           RestClient.AcceptType.ANY)),
          "application/json",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT, URI_PREFIX,
                         Collections.singletonList(
                           RestClient.AcceptType.ANY)),
          "application/json",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.PSON, RestClient.AcceptType.JSON)),
          "application/x-pson",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.PSON, RestClient.AcceptType.JSON)),
          "application/x-pson",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.JSON,RestClient.AcceptType.PSON)),
          "application/json",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.JSON,RestClient.AcceptType.PSON)),
          "application/json",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.PSON, RestClient.AcceptType.ANY)),
          "application/x-pson",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.PSON, RestClient.AcceptType.ANY)),
          "application/x-pson",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.JSON, RestClient.AcceptType.ANY)),
          "application/json",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.JSON, RestClient.AcceptType.ANY)),
          "application/json",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.ANY, RestClient.AcceptType.PSON)),
          "application/x-pson",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.ANY, RestClient.AcceptType.PSON)),
          "application/x-pson",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.ANY, RestClient.AcceptType.JSON)),
          "application/json",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         Arrays.asList(RestClient.AcceptType.ANY, RestClient.AcceptType.JSON)),
          "application/json",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        // accept types and content types
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.JSON, Collections.<RestClient.AcceptType>emptyList()),
          "application/json",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.JSON, Collections.<RestClient.AcceptType>emptyList()),
          "application/json",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.JSON, Collections.singletonList(RestClient.AcceptType.JSON)),
          "application/json",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.JSON, Collections.singletonList(RestClient.AcceptType.JSON)),
          "application/json",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.JSON, Collections.singletonList(RestClient.AcceptType.PSON)),
          "application/x-pson",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.JSON, Collections.singletonList(RestClient.AcceptType.PSON)),
          "application/x-pson",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.PSON, Collections.<RestClient.AcceptType>emptyList()),
          "application/json",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.PSON, Collections.<RestClient.AcceptType>emptyList()),
          "application/json",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.PSON, Collections.singletonList(RestClient.AcceptType.JSON)),
          "application/json",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.PSON, Collections.singletonList(RestClient.AcceptType.JSON)),
          "application/json",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.PSON, Collections.singletonList(RestClient.AcceptType.PSON)),
          "application/x-pson",
          new GreetingsBuilders()
        },
        {
          new RestClient(CLIENT,
                         URI_PREFIX,
                         RestClient.ContentType.PSON, Collections.singletonList(RestClient.AcceptType.PSON)),
          "application/x-pson",
          new GreetingsBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)
        }
View Full Code Here

Examples of com.netflix.niws.client.http.RestClient

  @Override
  protected String run() {
    try {
      // The named client param must match the prefix for the ribbon
      // configuration specified in the edge.properties file
      RestClient client = (RestClient) ClientFactory
          .getNamedClient("middletier-client");

      MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
      queryParams.putSingle("log", URLEncoder.encode(log, Charsets.UTF_8.name()));

      // Note: If running locally on MacOS, you'll need to make sure your
      // /etc/hosts file contains the following entry:
      // 127.0.0.1 <hostname>.local
      // or else this will likely fail.
      HttpClientRequest request = HttpClientRequest
          .newBuilder()
          .setVerb(Verb.POST)
          .setUri(new URI("/service/"
              + FluxConstants.MIDDLETIER_WEB_RESOURCE_ROOT_PATH
              + "/"
              + FluxConstants.MIDDLETIER_WEB_RESOURCE_VERSION
              + "/"
              + FluxConstants.MIDDLETIER_WEB_RESOURCE_ADD_PATH
              + "/"
              + key)
          )
          .setQueryParams(queryParams)
          .build();
     
      HttpClientResponse response = client
          .executeWithLoadBalancer(request);
     
      if (response.getStatus() != 200) { 
        logger.error("error status: {}", response.getStatus());
        throw new Exception("error status: " + response.getStatus());
View Full Code Here

Examples of com.vmware.vim.rest.RestClient

public class RestAppDemo
{
  public static void main(String[] args) throws Exception
  {
    RestClient rc = new RestClient("https://8.8.8.8", "root", "pass");
    runRestLevel(rc);
    runMOLevel(rc);
  }
View Full Code Here

Examples of design_patterns.facade.RestClient

    }
   
    @Override
    public Reservation startReservationManagement(int nextID,Product product, User u) {
        System.out.println("next id: " + nextID);
        RestClient add_reservationto_server = new RestClient();
       
        if (product instanceof Video){
            Reservation reservation = new Reservation(nextID,u,product,new Date(),new Date(),false);
            //System.out.println("json: " + encodeJsonObject(reservation).toJSONString());
            //System.out.println("json: " + encodeJsonObjectProductstats(reservation).toJSONString());           
            add_reservationto_server.apacheHttpClientPost(Login.url+"api/reservation/reservation/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObject(reservation));
            add_reservationto_server.apacheHttpClientPatch(Login.url+"api/reservation/product/"+reservation.getProduct().getId()+"/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObjectProductstats(reservation));
            return reservation;
        }
        else if (product instanceof Book ){
            Reservation reservation = new Reservation(nextID,u,product,new Date(),new Date(),false);
            //System.out.println(encodeJsonObject(reservation).toJSONString());
            add_reservationto_server.apacheHttpClientPost(Login.url+"api/reservation/reservation/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObject(reservation));
            add_reservationto_server.apacheHttpClientPatch(Login.url+"api/reservation/product/"+reservation.getProduct().getId()+"/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObjectProductstats(reservation));
            return reservation;
        }
        return null;
    }
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.