New CC
New CC
OF
CLOUD COMPUTING(CS-711)
BACJELORS OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING
2. Hello World
Program In
Salesforce Apex
3. Implementation
of SOAP web
services in
C#/JAVA
4. Implementation
of Para-
Virtualization
using Vm ware
Workstation/
Oracle’s Virtual
Box and Guest
O.S
5. Installation and
configuration of
Hadoop
6. Create an
Application (Ex:
Word-Count)
using Hadoop
Map/Reduce
7. Case Study:
PAAS (Google
App
Engine/Facebook
)
8. Case Study:
Amazon Web
Services
Experiment-1
AIM: Introduction to cloud computing
Cloud computing
Cloud Computing is a network of remote servers hosted on the internet for storing and
retrieving data. The cloud provides a number of IT services such as servers, databases,
software, virtual storage, and networking, among others.
In layman's terms, Cloud Computing is defined as a virtual platform that allows you to store
and access your data over the internet without any limitations.
Companies that offer all the services mentioned above are called cloud providers. They
provide us with the ability to store and retrieve data and run applications, managing them
through configuration portals. Two of the best cloud providers available today are Amazon
Web Services and Microsoft Azure.
Public cloud
Private cloud
Hybrid cloud
The remaining three categories are divided based on the services they offer,
including:
SOAP can be used in a variety of messaging systems and can be delivered via a variety of
transport protocols, the initial focus of SOAP is remote procedure calls transported via
HTTP.
Creating a SOAP web service or an API using JAVA that evaluates the
eligibility of loan for a customer
1. CustomerRequest.javaClass
package com.soapws.example.loaneligibility;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
"customerName",
"age",
"yearlyIncome",
"cibilScore",
"employmentMode"
})
@XmlRootElement(name = "CustomerRequest")
@XmlElement(required = true)
@XmlElement(required = true)
return customerName;
this.customerName = value;
return age;
this.age = value;
return yearlyIncome;
return cibilScore;
this.cibilScore = value;
return employmentMode;
this.employmentMode = value;
2. Acknowldgement.javaClass
package com.soapws.example.loaneligibility;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccess Type; import
javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import
javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
"isEligible",
"approved Amount",
"criteriaMismatch"
)}
@XmlRootElement(name = "Acknowledgement")
public class Acknowledgement {
protected booleanisEligible;
protected List<String>criteriaMismatch;
public booleanisIsEligible() {
return isEligible;
this.isEligible = value;
public List<String>getCriteriaMismatch() {
if (criteriaMismatchnull) {
return this.criteriaMismatch;
3. ObjectFactory.java Class
package com.soapws.example;
import javax.xml.bind.annotation.XmlRegistry;
@XmlRegistry
public ObjectFactory() {
}
public CustomerRequestcreateCustomerRequest() {
import java.util.List;
import org.springframework.stereotype.Service;
import com.javatechie.spring.soap.api.loaneligibility.Acknowledgement;
@Service
List<String>mismatchCriteriaList = acknowledgement.getCriteriaMismatch();
if (!(request.getYearlyIncome() >200000)) {
if (mismatchCriteriaList.size() > 0) {
acknowledgement.setApproved Amount(0);
acknowledgement.setIsEligible(false);
} else {
acknowledgement.setApproved Amount(500000);
acknowledgement.setIsEligible(true);
mismatchCriteriaList.clear();
return acknowledgement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import com.javatechie.spring.soap.api.loaneligibility.Acknowledgement;
import com.javatechie.spring.soap.api.loaneligibility. CustomerRequest;
import com.javatechie.spring.soap.api.service.LoanEligibilityService;
@Endpoint
public class Loan EligibilityindicatorEndpoint {
SoapWsConfig.java Class
package com.soapws.example.config;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation. Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.ws.config.annotation.EnableWs;
import org.springframework.ws.transport.http.MessageDispatcherServlet;
import org.springframework.ws.wsdl.wsdl11.Default Wsdl11 Definition;
import org.springframework.xml.xsd.SimpleXsdSchema;
import org.springframework.xml.xsd.XsdSchema;
@Configuration
@EnableWs
public class SoapWSConfig {
@Bean
public
ServletRegistrationBean<MessageDispatcherServlet messageDispatcherServlet(Application
Context context) {
“/ws/*”);
@Bean(name = "loanEligibility")
public DefaultWsdl11 Definition default Wsdl11 Definition(XsdSchema schema) {
DefaultWsd111 Definition defaultWsdl11 Definition = new
Default Wsdl11 Definition();
defaultWsdl11 Definition.setPortTypeName("LoanEligibilityindicator");
defaultWsdl11Definition.setLocationUri("/ws");
defaultWsdl11 Definition.setTargetNamespace("http://www.javatechie.com/spring/soa
p/api/loanEligibility");
defaultWsdl11 Definition.setSchema(schema);
return default Wsdl11 Definition;
}
@Bean
public XsdSchemaschema() {
return new SimpleXsdSchema(new ClassPathResource("loaneligibility.xsd"));
Now the xsd file for handing the loan requests in runtime can be illustrated
as:
Loaneligibility.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schemaxmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.com/spring/soap/api/loanEligibility"
xmlns:tns="http://www.example.com/spring/soap/api/loanEligibility"
elementFormDefault="qualified">
<xsd:element name="Acknowledgement">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="isEligible" type="xsd:boolean"/>
<xsd:element name="approved Amount" type="xsd:long" />
<xsd:element name="CriteriaMismatch" type="xsd:string"
maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
SpringApplication.run(SpringBootSopaWsApplication.class, args);}}
Experiment-4
Aim: Implementation of Para- Virtual using VM Ware Workstation/
Oracle’s Virtual Box and Guest O.s
Paravirtualization:
Paravirtualization is the category of CPU virtualization which uses
hyper calls for operations to handle instructions and compile time.
For achieving the paravirtualization, download the virtual box and set
up the virtual OS file for setup.
Implementation of paravirtualization using the Oracle Virtual box:
1. Open a virtual box and set up an OS for virtualization.For example-
Linux, Windows, etc.
2. The virtual workspace has been created successfully. Now select the OS
and click on Start to open the virtually installed OS application in virtual-
box window. This is Ubuntu’s virtual environments home screen on the
Oracle Virtual box this OS will behave like the native OS of the machine
on which it is installed.
We can perform data-driven or oriented task on this OS securely.
It provides less isolation compared to full virtualization.
It is more streamlined.
The guest operating system has to be modemed and only a
few operating systems support it.
package com.Hadoop.wordcount;
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;
public class WC_Mapper extends MapReduceBase implements Mapper LongWritable, Text, Text,
IntWritable>{
public void map(LongWritable key, Text value, OutputCollector<Text, IntWritable> output, Reporter
reporter) throws IOException { String line = value.toString();
}}}
WC reducer.java Class:
package com.Hadoop.wordcount;
import java.io.IOException;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.MapReduceBasc,
public class WC_Reducer extendsMapReduceBase implements Reducer Text, Int Writable, Text, Int
Writable> { public void reduce(Text key, Iterator<Int Writable values, OutputCollector<Text, Int
Writable> output, Reporter reporter) throws IOException { int sum=0; while (values.hasNext()) {
sum+=values.next().get();
output.collect(key,newIntWritable(sum));
WC Runner.java Class
package com.Hadoop.wordcount;
import java.io.IOException;
import org.apache.hadoop.fs.Path,
org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
conf.setJobName("WordCount");
conf.setOutput KeyClass(Text.class);
conf.setOutputValueClass(Int Writable.class);
conf.setMapperClass(WC_Mapper.class);
conf.setCombinerClass(WC_Reducer.class);
conf.setReducerClass(WC_Reducer.class);
conf.setInputFormat TextInputFormat.class);
conf.setOutputFormat(TextOutputFormat.clam);
FileInputFormat.setInputPaths(conf.new Path(args[0]));
FileOutputFormat.setOutputPath(conf.new Path(args[1]));
JobClient.runJob(conf);
}}
Create the jar file of this program and name it countworddemo.jar. and run it like below:
Step 1: Install Java using the official Oracle website and check if it is installed successfully
using the Java version on command prompt and output will be like this:
core-site.xml
This command will start all the required Hadoop services, including the NameNode,
DataNode, and JobTracker. Wait for a few minutes until all the services are started.
Fees are charged for additional storage, bandwidth, or instance hours required by the
application. It was first released as a preview version in April 2008, and came out of preview
in September 2011.
Current APIs allow storing and retrieving data from a BigTable non-
relational database; making HTTP requests; sending e-mail; manipulating
images; and caching.
Per-day and per-minute quotas restrict bandwidth and CPU use, number
of requests served, number of concurrent requests, and calls to the various
APIs, and individual requests are terminated if they take more than 60
seconds or return more than 32MB of data.
Experiment-8
AIM: Case Study Amazon Web Services
Amazon Web Services:
Amazon Web Services (AWS) is a subsidiary of Amazon providing on-demand cloud
computing platforms and APIs to individuals, companies, and governments, on a metered
pay-as-you-go basis.
Amazon Web Services (AWS) is the world's most comprehensive and broadly adopted cloud
platform, offering over 175 fully-featured services from data centers globally. Millions of
customers including the fastest-growing startups, largest enterprises, and leading government
agencies faster. are using AWS to lower costs, necome more agile, and innovate
In 2010, Netflix became the first company to announce publicly that it would run all of its
infrastructure on AWS. After that, customers began to sign up even more quickly, and AWS
developed the market share that put it far ahead of all the other competitors who began to
offer their own cloud computing services.
AWS Regions:
• Most functionality like compute, storage, and databases-to emerging technologies, such as
machine learning and artificial intelligence, data lakes and analytics, and the Internet of
Things.
➤ AWS supports 90 security standards and compliance sertifications, and all 117 AWS
services that store customer data offer the ability to encrypt that data.
• Fastest pace of innovation-With AWS, you can leverage the latest technologies to
experiment and innovate more quickly.
• Most proven operational expertise
• Agility & Elasticity
Important Points:
• Amazon Web Services (AWS) is the undisputed market leader in cloud computing,
from overall market share to most expansive cloud offering.
• It has vast resources, allowing it to design and execute new solutions at a dizzying
pace, sometimes or often faster than customers can understand or incorporate them.
• The company offers a complete range of laas and PaaS services.
• Among the best known are its Elastic Compute Cloud (EC2), Elastic Beanstalk,
Simple Storage Service (S3), Elastic Block Store (EBS), Glacier storage, Relational
Database Service (RDS), and DynamoDB NoSQL database.
• It also offers cloud services related to networking, analytics and machine learning, the
Internet of Things (IoT), mobile services, development, cloud management, cloud
security and more.