Package org.apache.cloudstack.storage.datastore.provider

Examples of org.apache.cloudstack.storage.datastore.provider.DataStoreProvider


    @Override
    public PrimaryDataStore getPrimaryDataStore(long dataStoreId) {
        PrimaryDataStoreVO dataStoreVO = dataStoreDao.findById(dataStoreId);
        long providerId = dataStoreVO.getStorageProviderId();
        DataStoreProvider provider = providerManager.getDataStoreProviderById(providerId);
        /*DefaultPrimaryDataStore dataStore = DefaultPrimaryDataStore.createDataStore(dataStoreVO,
                driverMaps.get(provider.getUuid()),
                provider);*/
        DefaultPrimaryDataStore dataStore = DefaultPrimaryDataStore.createDataStore(dataStoreVO, driverMaps.get(provider.getUuid()), provider);
        return dataStore;
    }
View Full Code Here


    createTemplate();
  }
 
  @Test
  public void testCreatePrimaryStorage() {
      DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("default primary data store provider");
        Map<String, String> params = new HashMap<String, String>();
        URI uri = null;
        try {
            uri = new URI(this.getPrimaryStorageUrl());
        } catch (URISyntaxException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        params.put("url", this.getPrimaryStorageUrl());
        params.put("server", uri.getHost());
        params.put("path", uri.getPath());
        params.put("protocol", uri.getScheme());
        params.put("dcId", dcId.toString());
        params.put("clusterId", clusterId.toString());
        params.put("name", this.primaryName);
        params.put("port", "1");
        params.put("roles", DataStoreRole.Primary.toString());
        params.put("uuid", UUID.nameUUIDFromBytes(this.getPrimaryStorageUrl().getBytes()).toString());
        params.put("providerId", String.valueOf(provider.getId()));
       
        DataStoreLifeCycle lifeCycle = provider.getLifeCycle();
        this.primaryStore  = lifeCycle.initialize(params);
        ClusterScope scope = new ClusterScope(clusterId, podId, dcId);
        lifeCycle.attachCluster(this.primaryStore, scope);
  }
View Full Code Here

        ClusterScope scope = new ClusterScope(clusterId, podId, dcId);
        lifeCycle.attachCluster(this.primaryStore, scope);
  }
 
  private DataStore createImageStore() {
      DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("default image data store");
        Map<String, String> params = new HashMap<String, String>();
        String name = UUID.randomUUID().toString();
        params.put("name", name);
        params.put("uuid", name);
        params.put("protocol", "http");
        params.put("scope", ScopeType.GLOBAL.toString());
        params.put("provider", Long.toString(provider.getId()));
        DataStoreLifeCycle lifeCycle = provider.getLifeCycle();
        DataStore store = lifeCycle.initialize(params);
        return store;
  }
View Full Code Here

  }
 

  public DataStore createPrimaryDataStore() {
    try {
        DataStoreProvider provider = dataStoreProviderMgr.getDataStoreProvider("default primary data store provider");
        Map<String, String> params = new HashMap<String, String>();
        URI uri = new URI(this.getPrimaryStorageUrl());
        params.put("url", this.getPrimaryStorageUrl());
            params.put("server", uri.getHost());
            params.put("path", uri.getPath());
            params.put("protocol", uri.getScheme());
            params.put("dcId", dcId.toString());
            params.put("clusterId", clusterId.toString());
            params.put("name", this.primaryName);
            params.put("port", "1");
            params.put("roles", DataStoreRole.Primary.toString());
            params.put("uuid", UUID.nameUUIDFromBytes(this.getPrimaryStorageUrl().getBytes()).toString());
            params.put("providerId", String.valueOf(provider.getId()));
       
        DataStoreLifeCycle lifeCycle = provider.getLifeCycle();
        DataStore store = lifeCycle.initialize(params);
        ClusterScope scope = new ClusterScope(clusterId, podId, dcId);
        lifeCycle.attachCluster(store, scope);
       
        /*
 
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.storage.datastore.provider.DataStoreProvider

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.