Package org.apache.chemistry.opencmis.commons.exceptions

Examples of org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException


        case STORAGE:
            return new CmisStorageException(msg, code, errorContent);
        case STREAM_NOT_SUPPORTED:
            return new CmisStreamNotSupportedException(msg, code, errorContent);
        case UPDATE_CONFLICT:
            return new CmisUpdateConflictException(msg, code, errorContent);
        case VERSIONING:
            return new CmisVersioningException(msg, code, errorContent);
        }

        return new CmisRuntimeException("Unknown exception[" + ex.getFaultInfo().getType().value() + "]: " + msg);
View Full Code Here


            if (CmisContentAlreadyExistsException.EXCEPTION_NAME.equals(exception)) {
                return new CmisContentAlreadyExistsException(message, errorContent, t);
            } else if (CmisVersioningException.EXCEPTION_NAME.equals(exception)) {
                return new CmisVersioningException(message, errorContent, t);
            } else if (CmisUpdateConflictException.EXCEPTION_NAME.equals(exception)) {
                return new CmisUpdateConflictException(message, errorContent, t);
            } else if (CmisNameConstraintViolationException.EXCEPTION_NAME.equals(exception)) {
                return new CmisNameConstraintViolationException(message, errorContent, t);
            }
            return new CmisConstraintException(message, errorContent, t);
        default:
View Full Code Here

            if (CmisContentAlreadyExistsException.EXCEPTION_NAME.equals(exception)) {
                return new CmisContentAlreadyExistsException(message, errorContent, t);
            } else if (CmisVersioningException.EXCEPTION_NAME.equals(exception)) {
                return new CmisVersioningException(message, errorContent, t);
            } else if (CmisUpdateConflictException.EXCEPTION_NAME.equals(exception)) {
                return new CmisUpdateConflictException(message, errorContent, t);
            } else if (CmisNameConstraintViolationException.EXCEPTION_NAME.equals(exception)) {
                return new CmisNameConstraintViolationException(message, errorContent, t);
            }
            return new CmisConstraintException(message, errorContent, t);
        default:
View Full Code Here

            File parent = file.getParentFile();
            File propFile = getPropertiesFile(file);
            newFile = new File(parent, newName);
            if (!file.renameTo(newFile)) {
                // if something went wrong, throw an exception
                throw new CmisUpdateConflictException("Could not rename object!");
            } else {
                // set new id
                objectId.setValue(getId(newFile));

                // if it is a file, rename properties file too
View Full Code Here

            if (CmisContentAlreadyExistsException.EXCEPTION_NAME.equals(exception)) {
                return new CmisContentAlreadyExistsException(message, errorContent, t);
            } else if (CmisVersioningException.EXCEPTION_NAME.equals(exception)) {
                return new CmisVersioningException(message, errorContent, t);
            } else if (CmisUpdateConflictException.EXCEPTION_NAME.equals(exception)) {
                return new CmisUpdateConflictException(message, errorContent, t);
            } else if (CmisNameConstraintViolationException.EXCEPTION_NAME.equals(exception)) {
                return new CmisNameConstraintViolationException(message, errorContent, t);
            }
            return new CmisConstraintException(message, errorContent, t);
        default:
View Full Code Here

                } else if (CmisStorageException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisStorageException(message, errorContent, t);
                } else if (CmisStreamNotSupportedException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisStreamNotSupportedException(message, errorContent, t);
                } else if (CmisUpdateConflictException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisUpdateConflictException(message, errorContent, t);
                } else if (CmisVersioningException.EXCEPTION_NAME.equalsIgnoreCase((String) jsonError)) {
                    return new CmisVersioningException(message, errorContent, t);
                }
            }
        }
View Full Code Here

            throw new CmisPermissionDeniedException("Object can't be checked-in, no user is given.");
    }

    protected void testCheckedOutByCurrentUser(String user, VersionedDocument verDoc) {
        if (!user.equals(verDoc.getCheckedOutBy()))
            throw new CmisUpdateConflictException("Object can't be checked-in, user " + verDoc.getCheckedOutBy()
                    + " has checked out the document.");
    }
View Full Code Here

                    + " has checked out the document.");
    }

    protected void testIsCheckedOut(VersionedDocument verDoc) {
        if (!verDoc.isCheckedOut())
            throw new CmisUpdateConflictException("Canot check-in: Document " + verDoc.getId() + " is not checked out.");
    }
View Full Code Here

        } else {
            content = ((VersionedDocument) so).getLatestVersion(false).getContent(0, -1);
        }

        if (verDoc.isCheckedOut())
            throw new CmisUpdateConflictException("Document " + objectId.getValue() + " is already checked out.");

        String user = context.getUsername();
        checkHasUser(user);

        DocumentVersion pwc = verDoc.checkOut(content, user);
View Full Code Here

        // check properties for validity
        TypeValidator.validateProperties(typeDef, properties, false);

        if (changeToken != null && changeToken.getValue() != null
                && Long.valueOf(so.getChangeToken()) > Long.valueOf(changeToken.getValue()))
            throw new CmisUpdateConflictException(" updateProperties failed: outdated changeToken");

        // update properties
        boolean hasUpdatedName = false;
        boolean hasUpdatedOtherProps = false;
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException

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.