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

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


     * Takes user and password from the CallContext and checks them.
     */
    public void authenticate(CallContext context) {
        // check user and password first
        if (!authenticate(context.getUsername(), context.getPassword())) {
            throw new CmisPermissionDeniedException();
        }
    }
View Full Code Here


     * Checks if the user in the given context is valid for this repository and
     * if the user has the required permissions.
     */
    private boolean checkUser(CallContext context, boolean writeRequired) {
        if (context == null) {
            throw new CmisPermissionDeniedException("No user context!");
        }

        Boolean readOnly = fUserMap.get(context.getUsername());
        if (readOnly == null) {
            throw new CmisPermissionDeniedException("Unknown user!");
        }

        if (readOnly.booleanValue() && writeRequired) {
            throw new CmisPermissionDeniedException("No write permission!");
        }

        return readOnly.booleanValue();
    }
View Full Code Here

                    "Object is of a versionable type but not instance of VersionedDocument or DocumentVersion.");
    }

    protected void checkHasUser(String user) {
        if (null == user || user.length() == 0)
            throw new CmisPermissionDeniedException("Object can't be checked-in, no user is given.");
    }
View Full Code Here

        case NOT_SUPPORTED:
            return new CmisNotSupportedException(msg, code);
        case OBJECT_NOT_FOUND:
            return new CmisObjectNotFoundException(msg, code);
        case PERMISSION_DENIED:
            return new CmisPermissionDeniedException(msg, code);
        case RUNTIME:
            return new CmisRuntimeException(msg, code);
        case STORAGE:
            return new CmisStorageException(msg, code);
        case STREAM_NOT_SUPPORTED:
View Full Code Here

        case 400:
            return new CmisInvalidArgumentException(message, errorContent, t);
        case 404:
            return new CmisObjectNotFoundException(message, errorContent, t);
        case 403:
            return new CmisPermissionDeniedException(message, errorContent, t);
        case 405:
            return new CmisNotSupportedException(message, errorContent, t);
        case 409:
            return new CmisConstraintException(message, errorContent, t);
        default:
View Full Code Here

        }
    }

    protected void checkHasUser(String user) {
        if (null == user || user.length() == 0) {
            throw new CmisPermissionDeniedException("Object can't be checked-in, no user is given.");
        }
    }
View Full Code Here

        try {
            return repository.login(credentials, workspaceName);
        }
        catch (LoginException e) {
            log.debug(e.getMessage(), e);
            throw new CmisPermissionDeniedException(e.getMessage(), e);
        }
        catch (NoSuchWorkspaceException e) {
            log.debug(e.getMessage(), e);
            throw new CmisObjectNotFoundException(e.getMessage(), e);
        }
View Full Code Here

     * Checks if the user in the given context is valid for this repository and
     * if the user has the required permissions.
     */
    private boolean checkUser(CallContext context, boolean writeRequired) {
        if (context == null) {
            throw new CmisPermissionDeniedException("No user context!");
        }

        Boolean readOnly = fUserMap.get(context.getUsername());
        if (readOnly == null) {
            throw new CmisPermissionDeniedException("Unknown user!");
        }

        if (readOnly.booleanValue() && writeRequired) {
            throw new CmisPermissionDeniedException("No write permission!");
        }

        return readOnly.booleanValue();
    }
View Full Code Here

     * Takes user and password from the CallContext and checks them.
     */
    public void authenticate(CallContext context) {
        // check user and password first
        if (!authenticate(context.getUsername(), context.getPassword())) {
            throw new CmisPermissionDeniedException();
        }
    }
View Full Code Here

        case NOT_SUPPORTED:
            return new CmisNotSupportedException(msg, code);
        case OBJECT_NOT_FOUND:
            return new CmisObjectNotFoundException(msg, code);
        case PERMISSION_DENIED:
            return new CmisPermissionDeniedException(msg, code);
        case RUNTIME:
            return new CmisRuntimeException(msg, code);
        case STORAGE:
            return new CmisStorageException(msg, code);
        case STREAM_NOT_SUPPORTED:
View Full Code Here

TOP

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

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.