ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try
{
System.out.println(">>>>>> Write <<<<<<<<");
ScspQueryArgs args = new ScspQueryArgs();
ScspResponse wcResponse = client.write(rcn, inputStream, testData.getBytes().length, args, new ScspHeaders()); //write to the remote cluster
String uuid = wcResponse.getResponseHeaders().getHeaderValues("Content-UUID").get(0);
System.out.println(wcResponse.toString());
System.out.println(">>>>>> Read <<<<<<<<");
ScspResponse rcResponse = client.read("", rcn + "/" + uuid, outputStream, args, new ScspHeaders()); //read from the remote cluster
System.out.println(rcResponse.toString());
System.out.println("Body Received");
System.out.println(outputStream.toString());
System.out.println(">>>>>> Read Local<<<<<<<<");
outputStream.reset();
ScspResponse lrcResponse = localClient.read("", uuid, outputStream, args, new ScspHeaders()); //read directly from the local cluster
System.out.println(lrcResponse.toString());
System.out.println("Body Received");
System.out.println(outputStream.toString());
System.out.println(">>>>>> Read Proxy Local<<<<<<<<");
outputStream.reset();
ScspResponse prcResponse = client.read("", uuid, outputStream, args, new ScspHeaders()); //read from the local cluster using the Proxy
System.out.println(prcResponse.toString());
System.out.println("Body Received");
System.out.println(outputStream.toString());
System.out.println(">>>>>> Info <<<<<<<<");
ScspResponse icResponse = client.info("", rcn + "/" + uuid, args, new ScspHeaders()); //info in the remote cluster
System.out.println(icResponse.toString());
System.out.println(">>>>>> Delete <<<<<<<<");
ScspResponse dcResponse = client.deleteMutable("", rcn + "/" + uuid, args, new ScspHeaders()); //delete from the remote cluster
System.out.println(dcResponse.toString());
}
catch (Exception ex)
{
ex.printStackTrace();