{
System.out.println(">>>>>> Write <<<<<<<<");
ScspQueryArgs rswArgs = new ScspQueryArgs();
rswArgs.setValue("replicate","immediate"); //adds the required '?replicate=immediate' query argument
ScspQueryArgs args = new ScspQueryArgs();
ScspResponse wcResponse = client.writeMutable(rcn, inputStream, testData.getBytes().length, rswArgs, new ScspHeaders()); //writes a mutable object to the local and remote clusters
String uuid = wcResponse.getResponseHeaders().getHeaderValues("Content-UUID").get(0);
System.out.println(wcResponse.toString());
//Updates the mutable object in the remote cluster
System.out.println(">>>>>> Update <<<<<<<<");
ScspResponse ucResponse = client.updateMutable("", rcn + "/" + uuid, updateStream, testUpdateData.getBytes().length, rswArgs, new ScspHeaders());
uuid = ucResponse.getResponseHeaders().getHeaderValues("Content-UUID").get(0);
System.out.println(ucResponse.toString());
//Copies metadata to the mutable object in the remote cluster
System.out.println(">>>>>> Copy (Remote) <<<<<<<<");
ScspHeaders headers = new ScspHeaders();
headers.addValue("Castor-color", "blue");
ScspResponse ccResponse = client.copyMutable("", rcn + "/" + uuid, rswArgs, headers);
uuid = ccResponse.getResponseHeaders().getHeaderValues("Content-UUID").get(0);
System.out.println(ccResponse.toString());
//Reads the mutable object directly from the remote cluster
System.out.println(">>>>>> Read Remote <<<<<<<<");
ScspResponse rcResponse = client.readMutable("", rcn + "/" + uuid, outputStream, args, new ScspHeaders());
System.out.println(rcResponse.toString());
System.out.println("Body Received");
System.out.println(outputStream.toString());
//Reads the mutable object directly from the local cluster
System.out.println(">>>>>> Read Local<<<<<<<<");
outputStream.reset();
ScspResponse lrcResponse = localClient.readMutable("", uuid, outputStream, args, new ScspHeaders());
System.out.println(lrcResponse.toString());
System.out.println("Body Received");
System.out.println(outputStream.toString());
//Reads the mutable object from the local cluster using the Proxy
System.out.println(">>>>>> Read Proxy Local<<<<<<<<");
outputStream.reset();
ScspResponse prcResponse = client.readMutable("", uuid, outputStream, args, new ScspHeaders());
System.out.println(prcResponse.toString());
System.out.println("Body Received");
System.out.println(outputStream.toString());
//Infos the mutable object in the remote cluster
System.out.println(">>>>>> Info (Remote) <<<<<<<<");
ScspResponse icResponse = client.infoMutable("", uuid, args, new ScspHeaders());
System.out.println(icResponse.toString());
//Deletes the object in the remote cluster
System.out.println(">>>>>> Delete <<<<<<<<");
ScspResponse dcResponse = client.deleteMutable("", uuid, args, new ScspHeaders());
System.out.println(dcResponse.toString());
}
catch (Exception ex)
{
ex.printStackTrace();