Package com.caringo.client

Examples of com.caringo.client.ScspResponse


     
      // Empty headers object for DELETE
      ScspHeaders headers = new ScspHeaders();
     
      // Do the DELETE
      ScspResponse response = this.scspClient.delete(this.enumUuid.toString(), null, queryArgs, headers);
     
      if (response.getHttpStatusCode() != 200) {
        throw new ObjectEnumeratorException("Object Enumerator end returned an unexpected response code: " + response.getHttpStatusCode());
      }
     
      // Reset the Object Enumerator properties to their initial state
      this.enumUuid = null;
      this.channelName = null;
View Full Code Here


    }

    @Override
    public void createContainer(String mountedRoot, String bucket) {
        try {
            ScspResponse bwResponse = myClient(mountedRoot).write(bucket, new ByteArrayInputStream("".getBytes()), 0, domainQueryArg(), new ScspHeaders());
            if (bwResponse.getHttpStatusCode() != HTTP_CREATED) {
                if (bwResponse.getHttpStatusCode() == HTTP_PRECONDITION_FAILED)
                    s_logger.error("CAStor unable to create bucket " + bucket + " because domain " +
                                   (this._domain==null ? "(default)" : this._domain) + " does not exist");
                else
                    s_logger.error("CAStor unable to create bucket " + bucket + ": " + bwResponse.getHttpStatusCode());
                throw new OutOfStorageException("CAStor unable to create bucket " + bucket + ": " +
                                                bwResponse.getHttpStatusCode());
            }
        } catch (ScspExecutionException e) {
            s_logger.error("CAStor unable to create bucket " + bucket, e);
            throw new OutOfStorageException("CAStor unable to create bucket " + bucket + ": " + e.getMessage());
        }
View Full Code Here

    }

    @Override
    public void deleteContainer(String mountedRoot, String bucket) {
        try {
            ScspResponse bwResponse = myClient(mountedRoot).delete("", bucket, domainQueryArg(), new ScspHeaders());
            if (bwResponse.getHttpStatusCode() >= HTTP_UNSUCCESSFUL) {
                s_logger.error("CAStor unable to delete bucket " + bucket + ": " + bwResponse.getHttpStatusCode());
                throw new OutOfStorageException("CAStor unable to delete bucket " + bucket + ": " +
                                                bwResponse.getHttpStatusCode());
            }
        } catch (ScspExecutionException e) {
            s_logger.error("CAStor unable to delete bucket " + bucket, e);
            throw new OutOfStorageException("CAStor unable to delete bucket " + bucket + ": " + e.getMessage());
        }
View Full Code Here

                    throw new OutOfStorageException("Unable to close CAStor spool file: " + e.getMessage(), e);
                }
            }

            try {
                ScspResponse bwResponse =
                    myClient(mountedRoot).write(bucket + "/" + fileName,
                                                new ResettableFileInputStream(spoolFile), streamLen,
                                                domainQueryArg(), new ScspHeaders());
                if (bwResponse.getHttpStatusCode() >= HTTP_UNSUCCESSFUL) {
                    s_logger.error("CAStor write responded with error " + bwResponse.getHttpStatusCode());
                    throw new OutOfStorageException("Unable to write object to CAStor " +
                                                    bucket + "/" + fileName + ": " + bwResponse.getHttpStatusCode());
                }
            } catch (ScspExecutionException e) {
                s_logger.error("Unable to write object to CAStor " + bucket + "/" + fileName, e);
                throw new OutOfStorageException("Unable to write object to CAStor " + bucket + "/" + fileName + ": " +
                                                e.getMessage());
View Full Code Here

    @Override
    public void deleteObject(String mountedRoot, String bucket, String fileName) {
        String filePath = bucket + "/" + fileName;
        try {
            ScspResponse bwResponse = myClient(mountedRoot).delete("", filePath, domainQueryArg(), new ScspHeaders());
            if (bwResponse.getHttpStatusCode() != HTTP_OK) {
                s_logger.error("CAStor delete object responded with error " + bwResponse.getHttpStatusCode());
                throw new OutOfStorageException("CAStor unable to delete object " + filePath + ": " +
                                                bwResponse.getHttpStatusCode());
            }
        } catch (ScspExecutionException e) {
            s_logger.error("CAStor unable to delete object " + filePath, e);
            throw new OutOfStorageException("CAStor unable to delete object " + filePath + ": " + e.getMessage());
        }
View Full Code Here

TOP

Related Classes of com.caringo.client.ScspResponse

Copyright © 2018 www.massapicom. 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.