Package com.cloud.bridge.model

Examples of com.cloud.bridge.model.MHostVO


     */
    private OrderedPair<SHostVO, String> allocBucketStorageHost(String bucketName, String overrideName)
    {
        //SHostDao shostDao = new SHostDao();

        MHostVO mhost = mhostDao.findById(ServiceProvider.getInstance().getManagementHostId());
        if(mhost == null)
            throw new OutOfServiceException("Temporarily out of service");

        if(mhost.getMounts().size() > 0) {
            Random random = new Random();
            MHostMountVO[] mounts = (MHostMountVO[])mhost.getMounts().toArray();
            MHostMountVO mount = mounts[random.nextInt(mounts.length)];
            S3BucketAdapter bucketAdapter =  getStorageHostBucketAdapter(mount.getShost());
            bucketAdapter.createContainer(mount.getMountPath(), (null != overrideName ? overrideName : bucketName));
            return new OrderedPair<SHostVO, String>(mount.getShost(), mount.getMountPath());
        }

        // 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));
View Full Code Here


    private void setupHost(String hostKey, String host) {

        mhost = mhostDao.getByHostKey(hostKey);
        if(mhost == null) {
            mhost = new MHostVO();
            mhost.setHostKey(hostKey);
            mhost.setHost(host);
            mhost.setLastHeartbeatTime(DateHelper.currentGMTTime());
            mhost = mhostDao.persist(mhost);
        } else {
View Full Code Here

     * @return
     */
    private OrderedPair<SHostVO, String> allocBucketStorageHost(String bucketName, String overrideName) {
        //SHostDao shostDao = new SHostDao();

        MHostVO mhost = mhostDao.findById(ServiceProvider.getInstance().getManagementHostId());
        if (mhost == null)
            throw new OutOfServiceException("Temporarily out of service");

        if (mhost.getMounts().size() > 0) {
            Random random = new Random();
            MHostMountVO[] mounts = (MHostMountVO[])mhost.getMounts().toArray();
            MHostMountVO mount = mounts[random.nextInt(mounts.length)];
            S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(mount.getShost());
            bucketAdapter.createContainer(mount.getMountPath(), (null != overrideName ? overrideName : bucketName));
            return new OrderedPair<SHostVO, String>(mount.getShost(), mount.getMountPath());
        }

        // 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));
View Full Code Here

    private void setupHost(String hostKey, String host) {

        mhost = mhostDao.getByHostKey(hostKey);
        if (mhost == null) {
            mhost = new MHostVO();
            mhost.setHostKey(hostKey);
            mhost.setHost(host);
            mhost.setLastHeartbeatTime(DateHelper.currentGMTTime());
            mhost = mhostDao.persist(mhost);
        } else {
View Full Code Here

   */
  private OrderedPair<SHostVO, String> allocBucketStorageHost(String bucketName, String overrideName)
  {
    //SHostDao shostDao = new SHostDao();
   
    MHostVO mhost = mhostDao.findById(ServiceProvider.getInstance().getManagementHostId());
    if(mhost == null)
      throw new OutOfServiceException("Temporarily out of service");
     
    if(mhost.getMounts().size() > 0) {
      Random random = new Random();
      MHostMountVO[] mounts = (MHostMountVO[])mhost.getMounts().toArray();
      MHostMountVO mount = mounts[random.nextInt(mounts.length)];
      S3BucketAdapter bucketAdapter =  getStorageHostBucketAdapter(mount.getShost());
      bucketAdapter.createContainer(mount.getMountPath(), (null != overrideName ? overrideName : bucketName));
      return new OrderedPair<SHostVO, String>(mount.getShost(), mount.getMountPath());
    }
   
    // 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));
View Full Code Here

  private void setupHost(String hostKey, String host) {

      mhost = mhostDao.getByHostKey(hostKey);
    if(mhost == null) {
      mhost = new MHostVO();
      mhost.setHostKey(hostKey);
      mhost.setHost(host);
      mhost.setLastHeartbeatTime(DateHelper.currentGMTTime());
      mhost = mhostDao.persist(mhost);
    } else {
View Full Code Here

     */
    private OrderedPair<SHostVO, String> allocBucketStorageHost(String bucketName, String overrideName)
    {
        //SHostDao shostDao = new SHostDao();

        MHostVO mhost = mhostDao.findById(ServiceProvider.getInstance().getManagementHostId());
        if(mhost == null)
            throw new OutOfServiceException("Temporarily out of service");

        if(mhost.getMounts().size() > 0) {
            Random random = new Random();
            MHostMountVO[] mounts = (MHostMountVO[])mhost.getMounts().toArray();
            MHostMountVO mount = mounts[random.nextInt(mounts.length)];
            S3BucketAdapter bucketAdapter =  getStorageHostBucketAdapter(mount.getShost());
            bucketAdapter.createContainer(mount.getMountPath(), (null != overrideName ? overrideName : bucketName));
            return new OrderedPair<SHostVO, String>(mount.getShost(), mount.getMountPath());
        }

        // 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));
View Full Code Here

    private void setupHost(String hostKey, String host) {

        mhost = mhostDao.getByHostKey(hostKey);
        if(mhost == null) {
            mhost = new MHostVO();
            mhost.setHostKey(hostKey);
            mhost.setHost(host);
            mhost.setLastHeartbeatTime(DateHelper.currentGMTTime());
            mhost = mhostDao.persist(mhost);
        } else {
View Full Code Here

     */
    private OrderedPair<SHostVO, String> allocBucketStorageHost(String bucketName, String overrideName)
    {
        //SHostDao shostDao = new SHostDao();

        MHostVO mhost = mhostDao.findById(ServiceProvider.getInstance().getManagementHostId());
        if(mhost == null)
            throw new OutOfServiceException("Temporarily out of service");

        if(mhost.getMounts().size() > 0) {
            Random random = new Random();
            MHostMountVO[] mounts = (MHostMountVO[])mhost.getMounts().toArray();
            MHostMountVO mount = mounts[random.nextInt(mounts.length)];
            S3BucketAdapter bucketAdapter =  getStorageHostBucketAdapter(mount.getShost());
            bucketAdapter.createContainer(mount.getMountPath(), (null != overrideName ? overrideName : bucketName));
            return new OrderedPair<SHostVO, String>(mount.getShost(), mount.getMountPath());
        }

        // 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));
View Full Code Here

    private void setupHost(String hostKey, String host) {

        mhost = mhostDao.getByHostKey(hostKey);
        if(mhost == null) {
            mhost = new MHostVO();
            mhost.setHostKey(hostKey);
            mhost.setHost(host);
            mhost.setLastHeartbeatTime(DateHelper.currentGMTTime());
            mhost = mhostDao.persist(mhost);
        } else {
View Full Code Here

TOP

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

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.