Package com.cloud.bridge.persist.dao

Examples of com.cloud.bridge.persist.dao.MHostDao


   * @param overrideName
   * @return
   */
  private Tuple<SHost, String> allocBucketStorageHost(String bucketName, String overrideName)
  {
    MHostDao mhostDao = new MHostDao();
    SHostDao shostDao = new SHostDao();
   
    MHost mhost = mhostDao.get(ServiceProvider.getInstance().getManagementHostId());
    if(mhost == null)
      throw new OutOfServiceException("Temporarily out of service");
     
    if(mhost.getMounts().size() > 0) {
      Random random = new Random();
View Full Code Here


    return new TimerTask() {

      @Override
      public void run() {
        try {
          MHostDao mhostDao = new MHostDao();
          mhost.setLastHeartbeatTime(DateHelper.currentGMTTime());
          mhostDao.update(mhost);
          PersistContext.commitTransaction();
        } catch(Throwable e){
          logger.error("Unexpected exception " + e.getMessage(), e);
        } finally {
          PersistContext.closeSession();
View Full Code Here

      }
    };
  }

  private void setupHost(String hostKey, String host) {
    MHostDao mhostDao = new MHostDao();
    mhost = mhostDao.getByHostKey(hostKey);
    if(mhost == null) {
      mhost = new MHost();
      mhost.setHostKey(hostKey);
      mhost.setHost(host);
      mhost.setLastHeartbeatTime(DateHelper.currentGMTTime());
      mhostDao.save(mhost);
    } else {
      mhost.setHost(host);
      mhostDao.update(mhost);
    }
  }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.persist.dao.MHostDao

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.