Package com.cloud.bridge.model

Examples of com.cloud.bridge.model.SHostVO


      mhostDao.update(mhost.getId(), mhost);
    }
  }

  private void setupLocalStorage(String storageRoot) {
    SHostVO shost = shostDao.getLocalStorageHost(mhost.getId(), storageRoot);
    if(shost == null) {
      shost = new SHostVO();
      shost.setMhost(mhost);
      shost.setMhostid(mhost.getId());
      shost.setHostType(SHost.STORAGE_HOST_TYPE_LOCAL);
      shost.setHost(NetHelper.getHostName());
      shost.setExportRoot(storageRoot);
      shostDao.persist(shost);
    }
  }
View Full Code Here


      shostDao.persist(shost);
    }
  }

    private void setupCAStorStorage(String storageRoot) {
    SHostVO shost = shostDao.getLocalStorageHost(mhost.getId(), storageRoot);
    if(shost == null) {
      shost = new SHostVO();
      shost.setMhost(mhost);
      shost.setMhostid(mhost.getId());
      shost.setHostType(SHost.STORAGE_HOST_TYPE_CASTOR);
      shost.setHost(NetHelper.getHostName());
      shost.setExportRoot(storageRoot);
      shostDao.persist(shost);
    }
    }
View Full Code Here

            shostDao.persist(shost);
        }
    }

    private void setupCAStorStorage(String storageRoot) {
        SHostVO shost = shostDao.getLocalStorageHost(mhost.getId(), storageRoot);
        if(shost == null) {
            shost = new SHostVO();
            shost.setMhost(mhost);
            shost.setMhostid(mhost.getId());
            shost.setHostType(SHost.STORAGE_HOST_TYPE_CASTOR);
            shost.setHost(NetHelper.getHostName());
            shost.setExportRoot(storageRoot);
            shostDao.persist(shost);
        }
    }
View Full Code Here

    }

    private OrderedPair<SHostVO, String> getBucketStorageHost(SBucketVO bucket)
    {

        SHostVO shost = shostDao.findById(bucket.getShostID());
        if(shost.getHostType() == SHost.STORAGE_HOST_TYPE_LOCAL) {
            return new OrderedPair<SHostVO, String>(shost, shost.getExportRoot());
        }

        if(shost.getHostType() == SHost.STORAGE_HOST_TYPE_CASTOR ) {
            return new OrderedPair<SHostVO, String>(shost, shost.getExportRoot());
        }

        MHostMountVO mount = mountDao.getHostMount(ServiceProvider.getInstance().getManagementHostId(), shost.getId());
        if(mount != null) {
            return new OrderedPair<SHostVO, String>(shost, mount.getMountPath());
        }
        //return null;
        // need to redirect request to other node
View Full Code Here

        }

        // To make things simple, only allow one local mounted storage root TODO - Change in the future
        String localStorageRoot = ServiceProvider.getInstance().getStartupProperties().getProperty("storage.root");
        if(localStorageRoot != null) {
            SHostVO localSHost = shostDao.getLocalStorageHost(mhost.getId(), localStorageRoot);
            if(localSHost == null)
                throw new InternalErrorException("storage.root is configured but not initialized");

            S3BucketAdapter bucketAdapter =  getStorageHostBucketAdapter(localSHost);
            bucketAdapter.createContainer(localSHost.getExportRoot(),(null != overrideName ? overrideName : bucketName));
            return new OrderedPair<SHostVO, String>(localSHost, localStorageRoot);
        }

        throw new OutOfStorageException("No storage host is available");
    }
View Full Code Here

            mhostDao.update(mhost.getId(), mhost);
        }
    }

    private void setupLocalStorage(String storageRoot) {
        SHostVO shost = shostDao.getLocalStorageHost(mhost.getId(), storageRoot);
        if(shost == null) {
            shost = new SHostVO();
            shost.setMhost(mhost);
            shost.setMhostid(mhost.getId());
            shost.setHostType(SHost.STORAGE_HOST_TYPE_LOCAL);
            shost.setHost(NetHelper.getHostName());
            shost.setExportRoot(storageRoot);
            shostDao.persist(shost);
        }
    }
View Full Code Here

            mhostDao.update(mhost.getId(), mhost);
        }
    }

    private void setupLocalStorage(String storageRoot) {
        SHostVO shost = shostDao.getLocalStorageHost(mhost.getId(), storageRoot);
        if(shost == null) {
            shost = new SHostVO();
            shost.setMhost(mhost);
            shost.setMhostid(mhost.getId());
            shost.setHostType(SHost.STORAGE_HOST_TYPE_LOCAL);
            shost.setHost(NetHelper.getHostName());
            shost.setExportRoot(storageRoot);
            shostDao.persist(shost);
        }
    }
View Full Code Here

            shostDao.persist(shost);
        }
    }

    private void setupCAStorStorage(String storageRoot) {
        SHostVO shost = shostDao.getLocalStorageHost(mhost.getId(), storageRoot);
        if(shost == null) {
            shost = new SHostVO();
            shost.setMhost(mhost);
            shost.setMhostid(mhost.getId());
            shost.setHostType(SHost.STORAGE_HOST_TYPE_CASTOR);
            shost.setHost(NetHelper.getHostName());
            shost.setExportRoot(storageRoot);
            shostDao.persist(shost);
        }
    }
View Full Code Here

    }

    private OrderedPair<SHostVO, String> getBucketStorageHost(SBucketVO bucket)
    {

        SHostVO shost = shostDao.findById(bucket.getShostID());
        if(shost.getHostType() == SHost.STORAGE_HOST_TYPE_LOCAL) {
            return new OrderedPair<SHostVO, String>(shost, shost.getExportRoot());
        }

        if(shost.getHostType() == SHost.STORAGE_HOST_TYPE_CASTOR ) {
            return new OrderedPair<SHostVO, String>(shost, shost.getExportRoot());
        }

        MHostMountVO mount = mountDao.getHostMount(ServiceProvider.getInstance().getManagementHostId(), shost.getId());
        if(mount != null) {
            return new OrderedPair<SHostVO, String>(shost, mount.getMountPath());
        }
        //return null;
        // need to redirect request to other node
View Full Code Here

        }

        // To make things simple, only allow one local mounted storage root TODO - Change in the future
        String localStorageRoot = ServiceProvider.getInstance().getStartupProperties().getProperty("storage.root");
        if(localStorageRoot != null) {
            SHostVO localSHost = shostDao.getLocalStorageHost(mhost.getId(), localStorageRoot);
            if(localSHost == null)
                throw new InternalErrorException("storage.root is configured but not initialized");

            S3BucketAdapter bucketAdapter =  getStorageHostBucketAdapter(localSHost);
            bucketAdapter.createContainer(localSHost.getExportRoot(),(null != overrideName ? overrideName : bucketName));
            return new OrderedPair<SHostVO, String>(localSHost, localStorageRoot);
        }

        throw new OutOfStorageException("No storage host is available");
    }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.model.SHostVO

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.