Package com.volantis.mcs.repository

Examples of com.volantis.mcs.repository.LocalRepository


                    new DeviceRepositoryLocationImpl(
                            configuration.getRepositoryUrl().getFile());

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

            // Create the XML accessor.

            DeviceRepositoryAccessor accessor =
View Full Code Here


    public DeviceTransferAccessor(
            LocalRepositoryConnection connection,
            DeviceRepositoryLocation location) {
        super(connection);

        LocalRepository repository =
                connection.getLocalRepository();
        accessor = REPOSITORY_ACCESSOR_FACTORY.createDeviceRepositoryAccessor(
            repository, location, null);
    }
View Full Code Here

        configuration.setPassword(getPassword(properties));
        configuration.setReleaseConnectionsImmediately(
                getReleaseConnectionsImmediately(properties));
        configuration.setShortNames(getUseShortNames(properties));

        LocalRepository repository = factory.createJDBCRepository(configuration);

        // Create the project.
        return new JDBCRepository(repository);
    }
View Full Code Here

    public void setUp() throws Exception {
        super.setUp();
        connectionMock = new XMLRepositoryConnectionMock(
                "connectionMock", expectations);
        final LocalRepository localRepositoryMock =
            new LocalRepositoryMock("localRepositoryMock", expectations);
        connectionMock.expects.getLocalRepository().returns(localRepositoryMock).any();
        headers = HttpFactory.getDefaultInstance().createHTTPHeaders();
        accessor = new MockDeviceRepositoryAccessor(connectionMock.getLocalRepository()) {
            /**
 
View Full Code Here

        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

        JdbcPoliciesAttributes attrs = (JdbcPoliciesAttributes) mcsiAttributes;
        MarinerPageContext pageContext =
                ContextInternals.getMarinerPageContext(context);

        LocalRepository jdbcRepository =
                pageContext.getVolantisBean().getJDBCRepository();

        InternalProjectFactory factory =
                InternalProjectFactory.getInternalInstance();
View Full Code Here

       
        // Connect to the MCS device repository.
        try {
            String repositoryType =
                Environment.getParameter(config, "repository-type");
            LocalRepository repository;

            DeviceRepositoryLocation location;

            // 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"));
            }

            accessor =
                REPOSITORY_ACCESSOR_FACTORY.createDeviceRepositoryAccessor(
                    repository,  location, null);
            connection = repository.connect();
            // NOTE: we may need to enable caching for performance.
            // I'm not sure if we need to because the implementation of the
            // device heirarchy is just about to completely change... so
            // I'll leave this like so for now and we'll add caching if we
            // have to later.
View Full Code Here

            // Synchronize while lazily creating the device repository.
            synchronized (this) {
                if (deviceRepository == null) {
                    // Retrieve the DeviceRepository configured in the runtime.
                    LocalRepository repository =
                            volantisBean.getDeviceRepository();

                    DeviceRepositoryAccessor accessor =
                            volantisBean.getDeviceRepositoryAccessor();
View Full Code Here

  public RepositoryConnection getPageConnection() {
      if (pageConnection == null) {
          Volantis volantis = pageContext.getVolantisBean();
          InternalProject project = volantis.getDefaultProject();
          LocalPolicySource source = (LocalPolicySource) project.getPolicySource();
          LocalRepository repository = source.getRepository();
          try {
              pageConnection = repository.connect();
          } catch (RepositoryException e) {
              throw new ExtendedRuntimeException(e);
          }
      }
View Full Code Here

            String srcDirString = cmd.getOptionValue(SOURCE_DIRECTORY);
            File srcDir = createSourceDirectory(srcDirString);

            printValue(cmd, REPOSITORY);
            String repositoryString = cmd.getOptionValue(REPOSITORY);
            LocalRepository destinationRepository =
                    createDestinationRepository();

            Project project = createProject(destinationRepository,
                    repositoryString);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.repository.LocalRepository

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.