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

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


        File file = new File(filePath);

        if (!file.exists()) {
            String errorMessage = "Attempt to remove non-existing object with key: " + key;
            LOG.log(Level.WARNING, errorMessage);
            throw new ObjectNotFoundException(errorMessage);
        }

        file.delete();
    }
View Full Code Here


       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 {
View Full Code Here

                node.remove();
                session.save();
            } catch (PathNotFoundException e) {
                String errorMessage = "Attempt to remove non-existing object with key: " + key;
                LOG.log(Level.WARNING, errorMessage);
                throw new ObjectNotFoundException(errorMessage);
            } catch (RepositoryException e) {
                String errorMessage = "Attempt to remove object with key: " + key + " failed. "
                        + "RepositoryException. Error message is: " + e.getMessage();
                LOG.log(Level.WARNING, errorMessage);
                throw new PersistencyException(errorMessage);
View Full Code Here

    public AuxiliaryStorageException fromResponse(Response r) {

        if (Status.BAD_REQUEST.getStatusCode() == r.getStatus()) {
            return new IllegalParameterException("This is one");
        } 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 {
View Full Code Here

            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 {"
                    + key +"}");
        }

        return ctx;
    }
View Full Code Here

  }
 
  @Test
  public void deleteObjectNotExistingTest() {
    server.deleteObject(KEY);
    EasyMock.expectLastCall().andStubThrow(new ObjectNotFoundException("Object is not found"));
    replayAll();

    try{
      restService.remove(KEY);
    }catch(Exception ex){
View Full Code Here

TOP

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

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.