Package org.jboss.dna.common.i18n

Examples of org.jboss.dna.common.i18n.I18n.text()


            return new FederatedRepository(name, connectionFactory, workspaces, defaultCachePolicy, executor);
        } catch (RepositorySourceException t) {
            throw t; // rethrow
        } catch (Throwable t) {
            I18n msg = GraphI18n.errorReadingConfigurationForFederatedRepositorySource;
            throw new RepositorySourceException(getName(), msg.text(name), t);
        }
    }

    /**
     * Add a federated workspace to this source. If a workspace with the supplied name already exists, it will be replaced with
View Full Code Here


        // Check all the properties of this source ...
        String name = getName();
        if (name == null) {
            I18n msg = GraphI18n.namePropertyIsRequiredForFederatedRepositorySource;
            throw new RepositorySourceException(getName(), msg.text("name"));
        }
        RepositoryContext context = getRepositoryContext();
        if (context == null) {
            I18n msg = GraphI18n.federatedRepositorySourceMustBeInitialized;
            throw new RepositorySourceException(getName(), msg.text("name", name));
View Full Code Here

            throw new RepositorySourceException(getName(), msg.text("name"));
        }
        RepositoryContext context = getRepositoryContext();
        if (context == null) {
            I18n msg = GraphI18n.federatedRepositorySourceMustBeInitialized;
            throw new RepositorySourceException(getName(), msg.text("name", name));
        }

        // Now set up or get the existing components needed by the workspace ...
        RepositoryConnectionFactory connectionFactory = null;
        ExecutorService executor = null;
View Full Code Here

        if (node == null && request != null) {
            if (path == null) {
                if (uuid == null) {
                    // Missing both path and UUID ...
                    I18n msg = GraphI18n.inMemoryConnectorRequestsMustHavePathOrUuid;
                    request.setError(new IllegalArgumentException(msg.text()));
                    return null;
                }
                // Missing path, and could not find by UUID ...
                request.setError(new PathNotFoundException(location, pathFactory.createRootPath(),
                                                           GraphI18n.nodeDoesNotExist.text(path)));
View Full Code Here

                    loadContributionsFromSources(pathToLoad, null, contributions); // sourceNames may be null or empty
                    FederatedNode mergedNode = createFederatedNode(null, pathToLoad, contributions, true);
                    if (mergedNode == null) {
                        // No source had a contribution ...
                        I18n msg = FederationI18n.nodeDoesNotExistAtPath;
                        fromCache.setError(new PathNotFoundException(path, ancestor, msg.text(path, ancestor)));
                        return fromCache;
                    }
                    contributions.clear();
                    // Move to the next child along the path ...
                    pathToLoad = pathToLoad.getParent();
View Full Code Here

        FederatedNode mergedNode = createFederatedNode(fromCache, path, contributions, true);
        if (mergedNode == null) {
            // No source had a contribution ...
            Path ancestor = path.getParent();
            I18n msg = FederationI18n.nodeDoesNotExistAtPath;
            fromCache.setError(new PathNotFoundException(path, ancestor, msg.text(path, ancestor)));
            return fromCache;
        }
        return mergedNode;
    }
View Full Code Here

        if (!node.isRoot() && node.isChanged(true)) {
            // Need to make sure that changes to this branch are not dependent upon changes to nodes outside of this branch...
            if (!node.containsChangesWithExternalDependencies()) {
                I18n msg = GraphI18n.unableToRefreshBranchBecauseChangesDependOnChangesToNodesOutsideOfBranch;
                String path = node.getPath().getString(context.getNamespaceRegistry());
                throw new InvalidStateException(msg.text(path, workspaceName));
            }
        }

        if (keepChanges && node.isChanged(true)) {
            // Perform the refresh while retaining changes ...
View Full Code Here

        }
        if (node.isStale()) {
            // This node was deleted in this session ...
            String readableLocation = node.getLocation().getString(context.getNamespaceRegistry());
            I18n msg = GraphI18n.nodeHasAlreadyBeenRemovedFromThisSession;
            throw new InvalidStateException(msg.text(readableLocation, workspaceName));
        }
        if (node.isNew()) {
            String path = readable(node.getPath());
            throw new RepositorySourceException(GraphI18n.unableToSaveNodeThatWasCreatedSincePreviousSave.text(path,
                                                                                                               workspaceName));
View Full Code Here

        // Need to make sure that changes to this branch are not dependent upon changes to nodes outside of this branch...
        if (!node.containsChangesWithExternalDependencies()) {
            I18n msg = GraphI18n.unableToSaveBranchBecauseChangesDependOnChangesToNodesOutsideOfBranch;
            String path = node.getPath().getString(context.getNamespaceRegistry());
            throw new ValidationException(msg.text(path, workspaceName));
        }

        // Make sure that each of the changed node is valid. This process requires that all children of
        // all changed nodes are loaded, so in this process load all unloaded children in one batch ...
        root.onChangedNodes(new LoadAllChildrenVisitor() {
View Full Code Here

     * @see org.jboss.dna.graph.connector.RepositorySource#getConnection()
     */
    public synchronized RepositoryConnection getConnection() throws RepositorySourceException {
        if (getName() == null) {
            I18n msg = InfinispanConnectorI18n.propertyIsRequired;
            throw new RepositorySourceException(getName(), msg.text("name"));
        }
        if (this.repository == null) {
            Context context = getContext();
            if (context == null) {
                try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.