Package com.cloud.bridge.persist.dao

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


        logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e);
      }
      managementServer = EC2Prop.getProperty( "managementServer" );
      cloudAPIPort = EC2Prop.getProperty( "cloudAPIPort", null );
     
      OfferingDao ofDao = new OfferingDao();
      try {
        if(ofDao.getOfferingCount() == 0) {
          String strValue = EC2Prop.getProperty("m1.small.serviceId");
          if(strValue != null) ofDao.setOfferMapping("m1.small", strValue);

          strValue = EC2Prop.getProperty("m1.large.serviceId");
          if(strValue != null) ofDao.setOfferMapping("m1.large", strValue);

          strValue = EC2Prop.getProperty("m1.xlarge.serviceId");
          if(strValue != null) ofDao.setOfferMapping("m1.xlarge", strValue);

          strValue = EC2Prop.getProperty("c1.medium.serviceId");
          if(strValue != null) ofDao.setOfferMapping("c1.medium", strValue);

          strValue = EC2Prop.getProperty("c1.xlarge.serviceId");
          if(strValue != null) ofDao.setOfferMapping("c1.xlarge", strValue);

          strValue = EC2Prop.getProperty("m2.xlarge.serviceId");
          if(strValue != null) ofDao.setOfferMapping("m2.xlarge", strValue);

          strValue = EC2Prop.getProperty("m2.2xlarge.serviceId");
          if(strValue != null) ofDao.setOfferMapping("m2.2xlarge", strValue);

          strValue = EC2Prop.getProperty("m2.4xlarge.serviceId");
          if(strValue != null) ofDao.setOfferMapping("m2.4xlarge", strValue);

          strValue = EC2Prop.getProperty("cc1.4xlarge.serviceId");
          if(strValue != null) ofDao.setOfferMapping("cc1.4xlarge", strValue);
        }
      } catch(Exception e) {
        logger.error("Unexpected exception ", e);
      }
    } else logger.error( "ec2-service.properties not found" );
View Full Code Here


   */
  private OfferingBundle instanceTypeToOfferBundle( String instanceType )
      throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
     
    OfferingBundle found = null;
    OfferingDao ofDao = new OfferingDao();

    if (null == instanceType) instanceType = "m1.small";                     
    String cloudOffering = ofDao.getCloudOffering( instanceType );

    if ( null != cloudOffering ) {
      found = new OfferingBundle();
      found.setServiceOfferingId(cloudOffering);
    } else
View Full Code Here

   * @return A valid value for the Amazon defined instanceType
   * @throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException
   */
  private String serviceOfferingIdToInstanceType( String serviceOfferingId )
      throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException 
    OfferingDao ofDao = new OfferingDao();
    String amazonOffering = ofDao.getAmazonOffering( serviceOfferingId.trim());

    if ( null == amazonOffering ) {
      logger.warn( "No instanceType match for serverOfferingId: [" + serviceOfferingId + "]" );
      return "m1.small";
    }
View Full Code Here

          endResponse(response, e.toString());
          return;
      }

        try {
          OfferingDao ofDao = new OfferingDao();
          ofDao.setOfferMapping( amazonOffer, cloudOffer );
         
        } catch( Exception e ) {
           logger.error("SetOfferMapping " + e.getMessage(), e);
        response.setStatus(401);
          endResponse(response, e.toString());
View Full Code Here

            endResponse(response, e.toString());
            return;
        }

        try {
          OfferingDao ofDao = new OfferingDao();
          ofDao.deleteOfferMapping( amazonOffer );
         
        } catch( Exception e ) {
           logger.error("DeleteOfferMapping " + e.getMessage(), e);
        response.setStatus(401);
          endResponse(response, e.toString());
View Full Code Here

TOP

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

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.