Package com.sun.jersey.api

Examples of com.sun.jersey.api.ConflictException


            byte[] in) {
        ItemData id = ItemData.ITEM;
        synchronized (id) {
            int currentVersion = id.getVersion();
            if (currentVersion > version) {
                throw new ConflictException("Conflict");
            }
            id.update(headers.getMediaType(), in);
        }
       
    }   
View Full Code Here


       
        // Compare against the requested link
        String editUri = uriInfo.getAbsolutePath().toString();
        if (!editUri.startsWith(editLink)) {
            // Response with 409 Conflict
            throw new ConflictException();
        }

        // Increment the version and update the edit URI
        int newVersion = version + 1;
        editUri = editUri.replaceFirst("/" + version + "/",
View Full Code Here

    DecomissionResult result = manager.decomission(objectId, user);

    if (result == DecomissionResult.FAILURE_NOT_FOUND || result == DecomissionResult.FAILURE_DEAD) {
      throw new NotFoundException(String.format("Couldn't find an active %s with id %s (result: %s)", getObjectTypeString(), objectId, result.name()));
    } else if (result == DecomissionResult.FAILURE_ALREADY_DECOMISSIONING) {
      throw new ConflictException(String.format("%s %s is already in decomissioning state", getObjectTypeString(), objectId));
    }
  }
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.ConflictException

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.