Package org.talend.esb.auxiliary.storage.common.exception

Examples of org.talend.esb.auxiliary.storage.common.exception.AuxiliaryStorageException


    */
   private void handleWebException(WebApplicationException  exception)  {

       Response response = exception.getResponse();
       if (response == null) {
           throw new AuxiliaryStorageException("Mapping exception error: response is null");
       }

       int responseStatus = response.getStatus();

       if (Status.BAD_REQUEST.getStatusCode() == responseStatus) {
           throw new IllegalParameterException("Bad request server error");
       } else if (Status.NOT_FOUND.getStatusCode() == responseStatus) {
           throw new ObjectNotFoundException("Object not found in auxiliary storage");
       } else if (Status.CONFLICT.getStatusCode() == responseStatus) {
           throw new ObjectAlreadyExistsException("Object already exists in auxiliary storage");
       } else if (Status.INTERNAL_SERVER_ERROR.getStatusCode() == responseStatus) {
           throw new AuxiliaryStorageException("Internal server error");
       } else {
           throw new AuxiliaryStorageException("Unknown server error");
       }
   }
View Full Code Here


        } else if (Status.NOT_FOUND.getStatusCode() == r.getStatus()) {
            return new ObjectNotFoundException("Object was not found in auxiliary storage");
        } else if (Status.CONFLICT.getStatusCode() == r.getStatus()) {
            return new ObjectAlreadyExistsException("Object already exists in auxiliary storage");
        } else if (Status.INTERNAL_SERVER_ERROR.getStatusCode() == r.getStatus()) {
            return new AuxiliaryStorageException("Auxiliary storage error occured");
        } else {
            return new AuxiliaryStorageException("An error occured");
        }
    }
View Full Code Here

    @Override
    public String lookup(final String key){

        if(auxiliaryStorageServer == null){
            throw new AuxiliaryStorageException("Auxiliary Storage Server is not set");
        }

        String ctx = auxiliaryStorageServer.lookupObject(key);
        if(ctx == null){
            throw new ObjectNotFoundException("Can not find object with key {"
View Full Code Here

    }

    @Override
    public void put(final String object, final String key) {
        if(auxiliaryStorageServer == null){
            throw new AuxiliaryStorageException("Auxiliary Storage Server is not set");
        }
        auxiliaryStorageServer.saveObject(object, key);
    }
View Full Code Here

  private boolean checkPersistencyManager(boolean throwExceptionIfNotExists)
    throws AuxiliaryStorageException {
    if(persistencyManager==null) {
      if(throwExceptionIfNotExists){
        throw new AuxiliaryStorageException("Persistency manager is not set");
      }
      return false;
    }
    return true;
View Full Code Here

TOP

Related Classes of org.talend.esb.auxiliary.storage.common.exception.AuxiliaryStorageException

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.