Package org.jboss.dna.graph.request

Examples of org.jboss.dna.graph.request.InvalidRequestException


        return workspace;
    }

    protected boolean updatesAllowed( Request request ) {
        if (!updatesAllowed) {
            request.setError(new InvalidRequestException(GraphI18n.sourceIsReadOnly.text(getSourceName())));
        }
        return !request.hasError();
    }
View Full Code Here


            Path oldPath = actualOldLocation.getPath();

            // It's not possible to move the root node
            if (oldPath.isRoot()) {
                String msg = JpaConnectorI18n.unableToMoveRootNode.text(getSourceName());
                throw new InvalidRequestException(msg);
            }

            // Find the ChildEntity of the existing 'from' node ...
            ChildEntity fromEntity = actualLocation.childEntity;
            final String oldParentUuid = fromEntity.getId().getParentUuidString();
View Full Code Here

    @Override
    public void process( CreateWorkspaceRequest request ) {
        String name = request.desiredNameOfNewWorkspace();
        if (!creatingWorkspacesAllowed) {
            String msg = JpaConnectorI18n.unableToCreateWorkspaces.text(getSourceName());
            request.setError(new InvalidRequestException(msg));
        }
        Set<String> existingNames = workspaces.getWorkspaceNames();
        int counter = 0;
        while (existingNames.contains(name)) {
            switch (request.conflictBehavior()) {
View Full Code Here

    @SuppressWarnings( "unchecked" )
    @Override
    public void process( CloneWorkspaceRequest request ) {
        if (!creatingWorkspacesAllowed) {
            String msg = JpaConnectorI18n.unableToCreateWorkspaces.text(getSourceName());
            request.setError(new InvalidRequestException(msg));
        }
        Set<String> existingNames = workspaces.getWorkspaceNames();
        String name = request.desiredNameOfTargetWorkspace();
        int counter = 0;
        while (existingNames.contains(name)) {
            switch (request.targetConflictBehavior()) {
                case CREATE_WITH_ADJUSTED_NAME:
                    name = request.desiredNameOfTargetWorkspace() + ++counter;
                    break;
                case DO_NOT_CREATE:
                default:
                    String msg = JpaConnectorI18n.workspaceAlreadyExists.text(getSourceName(), name);
                    request.setError(new InvalidWorkspaceException(msg));
                    return;
            }
        }
        String fromWorkspaceName = request.nameOfWorkspaceToBeCloned();
        WorkspaceEntity fromWorkspace = workspaces.get(fromWorkspaceName, false);
        if (fromWorkspace == null) {
            switch (request.cloneConflictBehavior()) {
                case SKIP_CLONE:
                    break;
                case DO_NOT_CLONE:
                default:
                    String msg = JpaConnectorI18n.workspaceDoesNotExist.text(getSourceName(), fromWorkspaceName);
                    request.setError(new InvalidRequestException(msg));
                    return;
            }
        }

        // Create the workspace ...
View Full Code Here

     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.CreateWorkspaceRequest)
     */
    @Override
    public void process( CreateWorkspaceRequest request ) {
        String msg = GraphI18n.federatedSourceDoesNotSupportCreatingWorkspaces.text(getSourceName());
        request.setError(new InvalidRequestException(msg));
    }
View Full Code Here

     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.CloneWorkspaceRequest)
     */
    @Override
    public void process( CloneWorkspaceRequest request ) {
        String msg = GraphI18n.federatedSourceDoesNotSupportCloningWorkspaces.text(getSourceName());
        request.setError(new InvalidRequestException(msg));
    }
View Full Code Here

     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.DestroyWorkspaceRequest)
     */
    @Override
    public void process( DestroyWorkspaceRequest request ) {
        String msg = GraphI18n.federatedSourceDoesNotSupportDestroyingWorkspaces.text(getSourceName());
        request.setError(new InvalidRequestException(msg));
    }
View Full Code Here

            }
        }
        // Record that there was an error projecting the results ...
        String whereInSource = actualSourceLocation.getString(getExecutionContext().getNamespaceRegistry());
        String msg = GraphI18n.unableToProjectSourceInformationIntoWorkspace.text(whereInSource, getSourceName(), projection);
        originalRequest.setError(new InvalidRequestException(msg));
        return null;
    }
View Full Code Here

            return actualSourceLocation.with(path);
        }
        // Record that there was an error projecting the results ...
        String whereInSource = actualSourceLocation.getString(getExecutionContext().getNamespaceRegistry());
        String msg = GraphI18n.unableToProjectSourceInformationIntoWorkspace.text(whereInSource, getSourceName(), projection);
        originalRequest.setError(new InvalidRequestException(msg));
        return null;
    }
View Full Code Here

     * request.
     *
     * @param request the unknown request
     */
    protected void processUnknownRequest( Request request ) {
        request.setError(new InvalidRequestException(GraphI18n.unsupportedRequestType.text(request.getClass().getName(), request)));
    }
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.request.InvalidRequestException

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.