Package org.jboss.dna.graph.connector

Examples of org.jboss.dna.graph.connector.RepositorySourceException


    protected final void checkRequestForErrors( Request request ) throws RepositorySourceException, RuntimeException {
        if (request.hasError()) {
            Throwable t = request.getError();
            if (t instanceof RuntimeException) throw (RuntimeException)t;
            throw new RepositorySourceException(sourceName, t);
        }
    }
View Full Code Here


        SVNURL theUrl;
        try {
            theUrl = SVNURL.parseURIDecoded(url);
        } catch (SVNException e) {
            // protocol not supported by this connector
            throw new RepositorySourceException(sourceName,
                                                "Protocol is not supported by this connector or there is problem in the svn url");
        }
        return theUrl;
    }
View Full Code Here

                                                    boolean forceReconnect,
                                                    String sourceName ) {
        try {
            oldRespository.setLocation(createSVNURL(url, sourceName), forceReconnect);
        } catch (SVNException e) {
            throw new RepositorySourceException(sourceName, "the old url and a new one has got different protocols");
        }
    }
View Full Code Here

        SVNNodeKind kind;
        try {
            kind = repository.checkPath(path, revisionNumber);

        } catch (SVNException e) {
            throw new RepositorySourceException(sourceName, e.getMessage());
        }
        return kind;
    }
View Full Code Here

    public synchronized RepositoryConnection getConnection() throws RepositorySourceException {

        String sourceName = getName();
        if (sourceName == null || sourceName.trim().length() == 0) {
            I18n msg = SVNRepositoryConnectorI18n.propertyIsRequired;
            throw new RepositorySourceException(getName(), msg.text("name"));
        }

        String sourceUsername = getUsername();
        if (sourceUsername == null || sourceUsername.trim().length() == 0) {
            I18n msg = SVNRepositoryConnectorI18n.propertyIsRequired;
            throw new RepositorySourceException(getUsername(), msg.text("username"));
        }

        String sourcePassword = getPassword();
        if (sourcePassword == null) {
            I18n msg = SVNRepositoryConnectorI18n.propertyIsRequired;
            throw new RepositorySourceException(getPassword(), msg.text("password"));
        }

        String repositoryRootURL = getRepositoryRootURL();
        if (repositoryRootURL == null || repositoryRootURL.trim().length() == 0) {
            I18n msg = SVNRepositoryConnectorI18n.propertyIsRequired;
            throw new RepositorySourceException(getRepositoryRootURL(), msg.text("repositoryRootURL"));
        }

        SVNRepository repos = null;
        // Report the warnings for non-existant predefined workspaces
        boolean reportWarnings = false;
View Full Code Here

    protected Path getPathFor( Location location,
                               Request request ) {
        Path path = location.getPath();
        if (path == null) {
            I18n msg = SVNRepositoryConnectorI18n.locationInRequestMustHavePath;
            throw new RepositorySourceException(getSourceName(), msg.text(getSourceName(), request));
        }
        return path;
    }
View Full Code Here

                // node is unknown
                throw new PathNotFoundException(Location.create(requestedPath), null,
                                                SVNRepositoryConnectorI18n.nodeIsActuallyUnknow.text(myPath));
            }
        } catch (SVNException e) {
            throw new RepositorySourceException(
                                                getSourceName(),
                                                SVNRepositoryConnectorI18n.connectingFailureOrUserAuthenticationProblem.text(getSourceName()));
        }

        return kind;
View Full Code Here

        assert path != null;
        SVNDirEntry entry = null;
        try {
            entry = repos.info(path, -1);
        } catch (SVNException e) {
            throw new RepositorySourceException(
                                                getSourceName(),
                                                SVNRepositoryConnectorI18n.connectingFailureOrUserAuthenticationProblem.text(getSourceName()));
        }
        return entry;
    }
View Full Code Here

                               Request request ) {
        for (Path.Segment segment : path) {
            // Verify the segment is valid ...
            if (segment.getIndex() > 1) {
                I18n msg = SVNRepositoryConnectorI18n.sameNameSiblingsAreNotAllowed;
                throw new RepositorySourceException(getSourceName(), msg.text(getSourceName(), request));
            }
            // TODO
            // if (!segment.getName().getNamespaceUri().equals(defaultNamespaceUri)) {
            // I18n msg = SVNRepositoryConnectorI18n.onlyTheDefaultNamespaceIsAllowed;
            // throw new RepositorySourceException(getSourceName(), msg.text(getSourceName(), request));
View Full Code Here

    public RepositoryConnection getConnection() throws RepositorySourceException {
        String errMsg = null;
        // check name
        if (getName() == null) {
            errMsg = JdbcMetadataI18n.propertyIsRequired.text("name");
            throw new RepositorySourceException(errMsg);
        }
       
        // create Jdbc connection using data source first
        try {
            if (dataSourceProvider != null) {
                // create wrapper for Jdbc connection
                return new JdbcConnection(getName(),
                                          getDefaultCachePolicy(),
                                          dataSourceProvider.getConnection(),
                                          rootUuid);
            }
        } catch (Exception e) {
            errMsg = JdbcMetadataI18n.unableToGetConnectionUsingDriver.text(getName(), getDriverClassName(), getDatabaseUrl());
            throw new RepositorySourceException(errMsg, e);
        }

        // create Jdbc connection using driver and database URL
        try {
            if (driverProvider != null) {
                // create wrapper for Jdbc connection
                return new JdbcConnection(getName(),
                                          getDefaultCachePolicy(),
                                          driverProvider.getConnection(),
                                          rootUuid);
            }
        } catch (Exception e) {
            errMsg = JdbcMetadataI18n.unableToGetConnectionUsingDataSource.text(getName(), getDataSourceName());
            throw new RepositorySourceException(errMsg, e);
        }
       
        // Either data source name or JDBC driver connection properties must be defined
        errMsg = JdbcMetadataI18n.oneOfPropertiesIsRequired.text(getName());
        throw new RepositorySourceException(errMsg);
    }
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.connector.RepositorySourceException

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.