Package com.cloud.bridge.service.core.ec2

Examples of com.cloud.bridge.service.core.ec2.EC2Engine


  private Map<String,S3BucketPolicy> policyMap = new HashMap<String,S3BucketPolicy>();

  protected ServiceProvider() throws IOException {
    // register service implementation object
    engine = new S3Engine();
    EC2_engine = new EC2Engine();
    serviceMap.put(AmazonS3SkeletonInterface.class, new S3SoapServiceImpl(engine));
    serviceMap.put(AmazonEC2SkeletonInterface.class, new EC2SoapServiceImpl(EC2_engine));
  }
View Full Code Here


    if ( null != volSet && 0 < volSet.length )
       volumeId = volSet[0];
    else { response.sendError(530, "Missing VolumeId parameter" ); return; }
   
    // -> execute the request
    EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();
        CreateSnapshotResponse EC2response = EC2SoapServiceImpl.toCreateSnapshotResponse( engine.createSnapshot( volumeId ), engine);
        serializeResponse(response, EC2response);
    }
View Full Code Here

    if (keyName != null) {
      EC2request.setKeyName(keyName[0]);
    }
   
    // -> execute the request
    EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();
    RunInstancesResponse EC2response = EC2SoapServiceImpl.toRunInstancesResponse( engine.runInstances( EC2request ), engine);
    serializeResponse(response, EC2response);
    }
View Full Code Here

          String[] value = request.getParameterValues( key );
          if (null != value && 0 < value.length) EC2request.addImageSet( value[0] );
      }
    }   
    // -> execute the request
    EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();
    DescribeImagesResponse EC2response = EC2SoapServiceImpl.toDescribeImagesResponse( engine.describeImages( EC2request ));
    serializeResponse(response, EC2response);
    }
View Full Code Here

          for( int i=0; i < filterSet.length; i++ ) ifs.addFilter( filterSet[i] );
          EC2request.setFilterSet( ifs );
        }

    // -> execute the request
    EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();
    DescribeInstancesResponse EC2response = EC2SoapServiceImpl.toDescribeInstancesResponse( engine.describeInstances( EC2request ), engine);
    serializeResponse(response, EC2response);
    }
View Full Code Here

                String[] value = request.getParameterValues( key );
                if (null != value && 0 < value.length) ec2Request.addPublicIp( value[0] );
            }
        }
        // -> execute the request
        EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();
        serializeResponse(response, EC2SoapServiceImpl.toDescribeAddressesResponse( engine.describeAddresses( ec2Request)));
    }
View Full Code Here

    }

    private void allocateAddress( HttpServletRequest request, HttpServletResponse response )
        throws ADBException, XMLStreamException, IOException {
     
      EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();
     
      AllocateAddressResponse ec2Response = EC2SoapServiceImpl.toAllocateAddressResponse( engine.allocateAddress());
     
      serializeResponse(response, ec2Response);
    }
View Full Code Here

    }

    private void releaseAddress( HttpServletRequest request, HttpServletResponse response )
        throws ADBException, XMLStreamException, IOException {
     
      EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();

    String publicIp = request.getParameter( "PublicIp" );
    if (publicIp == null) {
      response.sendError(530, "Missing PublicIp parameter");
      return;
    }
     
      EC2ReleaseAddress ec2Request = new EC2ReleaseAddress();
      if (ec2Request != null) {
        ec2Request.setPublicIp(publicIp);
      }
     
      ReleaseAddressResponse EC2Response = EC2SoapServiceImpl.toReleaseAddressResponse( engine.releaseAddress( ec2Request ));

      serializeResponse(response, EC2Response);
    }
View Full Code Here

      serializeResponse(response, EC2Response);
    }

    private void associateAddress( HttpServletRequest request, HttpServletResponse response )
        throws ADBException, XMLStreamException, IOException {
        EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();

        String publicIp = request.getParameter( "PublicIp" );
        if (null == publicIp) {
            response.sendError(530, "Missing PublicIp parameter" );
            return;
        }
        String instanceId = request.getParameter( "InstanceId" );
        if (null == instanceId) {
            response.sendError(530, "Missing InstanceId parameter" );
            return;
        }
       
        EC2AssociateAddress ec2Request = new EC2AssociateAddress();
        if (ec2Request != null) {
          ec2Request.setInstanceId(instanceId);
          ec2Request.setPublicIp(publicIp);
        }

        AssociateAddressResponse ec2Response = EC2SoapServiceImpl.toAssociateAddressResponse( engine.associateAddress( ec2Request ));
       
        serializeResponse(response, ec2Response);
    }
View Full Code Here

        serializeResponse(response, ec2Response);
    }

    private void disassociateAddress( HttpServletRequest request, HttpServletResponse response )
        throws ADBException, XMLStreamException, IOException {     
        EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();

        String publicIp = request.getParameter( "PublicIp" );
        if (null == publicIp) {
            response.sendError(530, "Missing PublicIp parameter" );
            return;
        }
       
        EC2DisassociateAddress ec2Request = new EC2DisassociateAddress();
        if (ec2Request != null) {
          ec2Request.setPublicIp(publicIp);
        }
       
        DisassociateAddressResponse ec2Response = EC2SoapServiceImpl.toDisassociateAddressResponse( engine.disassociateAddress( ec2Request ) );
       
        serializeResponse(response, ec2Response);
    }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.core.ec2.EC2Engine

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.