Giter VIP home page Giter VIP logo

riakcs-java-client's Introduction

Lightweight Java library to interact with a CF Riak CS instance.

Pre-requisites

  • Maven
  • JDK version >= 1.6

Run the Smoketest

Executing the compiled jar will run two suites of tests for the Bucket and Object APIs. This test creates a bucket, writes and read, and deletes the bucket.

  1. Update the contents of src/examples/com/basho/riakcs/client/CSCredentials.Riak.properties with credentials from VCAP_SERVICES

     #Credentials for RiakCS Installation
     accessKey=access_key_id
     secretKey=secret_access_key
     
     #hostname:port for your RiakCS installation
     endPoint=hostname_from_uri #eg. p-riakcs.system-domain.com
     useHttps=false
    
  2. $ mvn clean install

  3. $ java -jar target/riak-cs-client-0.0.1-SNAPSHOT-jar-with-dependencies.jar

SSL

If you set useHttps=true in CSCredentials.Riak.properties and your Riak CS deployment uses a self-signed certificate, executing the jar above will fail. On OSX you can work around this by adding the self-signed cert to your Java keystore:

  1. Display the certificate

     $ openssl s_client -connect p-riakcs.system-domain.com:443 -showcerts
    
  2. Copy from "-----BEGIN CER....................." to ".....................END CERTIFICATE-----" inclusively.

  3. Paste this text into a new file eg. p-riakcs.cer

  4. Save the cert to java keystore

     $ sudo keytool -importcert -alias dev -file p-riakcs.cer -keystore /Library/Java/Home/lib/security/cacerts
    

When asked for the keystore password, try changeit. Executing the jar should succeed now.

Bucket APIs

void       createBucket(String bucketName)
JSONObject listBuckets()
boolean    isBucketAccessible(String bucketName)
JSONObject getACLForBucket(String bucketName)
void       deleteBucket(String bucketName)

Object APIs

void       createObject(String bucketName, String objectKey, InputStream dataInputStream, Map<String, String> headers, Map<String, String> metadata)
JSONObject listObjects(String bucketName)
JSONObject listObjectNames(String bucketName)
JSONObject getObject(String bucketName, String objectKey)
JSONObject getObject(String bucketName, String objectKey, OutputStream dataOutputStream)
JSONObject getObjectInfo(String bucketName, String objectKey)
JSONObject getACLForObject(String bucketName, String objectKey)
void       deleteObject(String bucketName, String objectKey)

License forthcoming.

riakcs-java-client's People

Contributors

neuhausler avatar robdimsdale avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.