Package com.volantis.mcs.repository.xml

Examples of com.volantis.mcs.repository.xml.XMLRepositoryFactory


            // Note that we can only handle file: urls.
            DeviceRepositoryLocation location =
                    new DeviceRepositoryLocationImpl(
                            configuration.getRepositoryUrl().getFile());

            XMLRepositoryFactory factory =
                    XMLRepositoryFactory.getDefaultInstance();
            LocalRepository repository =
                    factory.createXMLRepository(null);

            // Create the XML accessor.

            DeviceRepositoryAccessor accessor =
                REPOSITORY_ACCESSOR_FACTORY.createDeviceRepositoryAccessor(
View Full Code Here


     * @exception RepositoryException if an error occurs
     */
    private LocalRepository createXMLRepository()
        throws RepositoryException {

        XMLRepositoryFactory factory =
                XMLRepositoryFactory.getDefaultInstance();
        return factory.createXMLRepository(null);
//
//        Map properties = new HashMap();
//        String dirName = args.getValue(SOURCE_DIR);
//        if(dirName != null) {
//            File dir = new File(dirName);
View Full Code Here

                                                boolean accessExperimental)
            throws DeviceRepositoryException {
        try {
            // Create the XML repository
            // Note that we can only handle file: urls.
            XMLRepositoryFactory factory =
                    XMLRepositoryFactory.getDefaultInstance();
            LocalRepository repository = factory.createXMLRepository(null);

            DeviceRepositoryLocation location =
                    new DeviceRepositoryLocationImpl(repositoryUrl.getFile());

            // Create the XML accessor.
View Full Code Here

            // NOTE: this configuration mirrored the "old" way of configuring
            // local repositories, presumably it should be updated to
            // mirror the new way?
            if (repositoryType != null && repositoryType.equals("xml")) {

                XMLRepositoryFactory factory =
                        XMLRepositoryFactory.getDefaultInstance();
                repository = factory.createXMLRepository(null);

                location = REPOSITORY_LOCATION_FACTORY.createDeviceRepositoryLocation(
                        Environment.getParameter(config, "file"));
            } else {
                // Default to JDBC.

                JDBCRepositoryFactory factory =
                        JDBCRepositoryFactory.getDefaultInstance();

                MCSDriverConfiguration driverConfiguration =
                        factory.createMCSDriverConfiguration();

                driverConfiguration.setSource(
                        Environment.getParameter(config, "odbc-source"));
                String vendor = Environment.getParameter(config, "odbc-vendor");
                JDBCRepositoryType jdbcRepositoryType =
                        JDBCRepositoryType.getTypeForVendor(vendor);
                if (jdbcRepositoryType != null) {
                    driverConfiguration.setDriverVendor(
                            jdbcRepositoryType.getVendor());
                }

                driverConfiguration.setHost(Environment.getParameter(config,
                        "odbc-host"));
                String port = Environment.getParameter(config, "odbc-port");
                if (port != null) {
                    driverConfiguration.setPort(Integer.parseInt(port));
                }

                DataSource dataSource = factory.createMCSDriverDataSource(
                        driverConfiguration);

                JDBCRepositoryConfiguration configuration =
                        factory.createJDBCRepositoryConfiguration();
                configuration.setDataSource(dataSource);
                configuration.setUsername(Environment.getParameter(config,
                        "odbc-user"));
                configuration.setPassword(Environment.getParameter(config,
                        "odbc-password"));

                repository = factory.createJDBCRepository(configuration);

                location = REPOSITORY_LOCATION_FACTORY.createDeviceRepositoryLocation(
                        Environment.getParameter(config, "project"));
            }
View Full Code Here

     *      repository.
     */
    private LocalRepository createDestinationRepository()
            throws RepositoryException {

        XMLRepositoryFactory factory =
                XMLRepositoryFactory.getDefaultInstance();

        return factory.createXMLRepository(null);
    }
View Full Code Here

            if (marinerConfig.getLocalRepository().
                    getXmlRepository() != null ||
                    (deviceConnectionType ==
                     RepositoryConnectionType.XML_REPOSITORY_CONNECTION)) {

                XMLRepositoryFactory factory =
                        XMLRepositoryFactory.getDefaultInstance();

                // todo: later: refactor this config object using factory pattern
                XMLRepositoryConfiguration xmlRepositoryConfiguration =
                        (XMLRepositoryConfiguration)
                        factory.createXMLRepositoryConfiguration();

                xmlRepository =
                        factory.createXMLRepository(xmlRepositoryConfiguration);
            }

            // Create a JDBC repository if one has been configured.

            // todo Should we try and get the data source from the
            // todo AppServerInterfaceManager like we used to.
            DataSource dataSource = getLocalRepositoryJDBCDataSource();

            if (dataSource != null ||
                    (deviceConnectionType ==
                     RepositoryConnectionType.JDBC_REPOSITORY_CONNECTION)) {

                JDBCRepositoryFactory factory =
                        JDBCRepositoryFactory.getDefaultInstance();

                // todo: later: refactor this config object using factory pattern
                com.volantis.mcs.repository.jdbc.JDBCRepositoryConfiguration configuration =
                        factory.createJDBCRepositoryConfiguration();
                configuration.setDataSource(dataSource);
                configuration.setReleaseConnectionsImmediately(true);
                configuration.setShortNames(getJDBCRepositoryUsesShortNames());
                configuration.setAnonymous(true);

                jdbcRepository = (LocalRepository)
                        factory.createJDBCRepository(configuration);
            } else {
                // Until datasource configuration is implemented, log a warning
                // about not being able to create a JDBC repository.
                logger.warn("local-repository-type-unknown");
            }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.repository.xml.XMLRepositoryFactory

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.