You are on page 1of 10

**** CXF web services

WS)

->

Java API for XML Web Services (JAX-

Jboss Application server used for deploying application, configured by


team mates
HornetQ It's uses teminology of FIFO. When we send a sms it goes to
HornetQ and it's Gateway listener will hold this object in que and process
the sms in ques.
SMSC is a SMS Center
************ SMSC protocols does the SMS part of the gateway
support?
CIMD 1.3, CIMD 2.0, SMPP 3.4, UCP/EMI 4.0, SEMA SMS2000 OIS
protocol for SMS centers over Radiopad and X.25 and several modems
and mobile phones through AT protocol

Project Name
Project Category
Time Taken
Technology
Database
Framework
OS

Description

Project Name
Project Category
Company Name / Client
Name
Time Taken
Technology
Database
Framework
OS
Third Party Component

UltimateSMS
Project Type
Web
Other
1 Year
Team Size
4
Core Java, HTML, Java/J2EE, Javascript, XML
PostgreSQL
Java Hibernate
UNIX / LINUX
This system is designed to send out messages from a web interface.
Unlike other SMS providers that provide the user with a HTTP API this
one is directly connected to a Open Source SMSC gateway (Kannel). We
send messages to a JMS Queue (Used as our JMS server) HornetQ. This
project also involves the use of a Messages Driven Bean which take
messages out of the HornetQ and performs necessary operations on the
object received. It also has a failsafe mechanism to buffer messages
in case Kannel is down. The system also provides detailed reports on
message delivery, it also tracks the message a teach point in the system.

SEDI PORTAL
Portals

Project Type

Web

Hollcim Cement (Ambuja)


10 Months
Team Size
Core Java, CSS, HTML, Java MVC, Java/J2EE
MySQL 5.0
Java Hibernate, Spring
UNIX / LINUX
Jasper Report, Jquery

SEDI (Skills and Entrepreneurship Development Institutes) an initiative


of Ambuja Cement Foundation wants a portal to manage trainee detail.
SEDI has 16 branches across India. SEDI work on skills development of
rural youth. Students receive training in various trades through intensive
short duration course certified by competent authorities. Post-training,
SEDI facilitate trainees to find suitable job opportunities or to establish
small scale enterprises by extending hand holding support for 2 years.
Description

We developed sedi portal on Spring framework which facilitates the


organization to manage all the activity across the nation wide spread
development centres at one place, this portal have specific role users
like Super Admin, Zonal Admin and Branch Admin, Trainee and
Employer... It facilitates the enrollment of trainee adding 'Joining
Queris' , creating and maintain batches, generate assignment, generate
results etc. Portal generates different level of reports for different level
of admins via iText and Apache POI APIs.

Project Name
Project Category
Company Name / Client
Name
Time Taken
Technology
Database
Framework
OS
Payment Gateway
Third Party Component

Description

PMPML Inventory Mangment Project Type


Inventory

Desktop + Web

PMPML(Pune Mahanagar Parivahan Mahamandal Ltd.)


1 Year 3 Months
Team Size
5
Core Java, CSS, HTML, Java MVC, Java/J2EE, Javascript
MySQL 5.0
Java Hibernate, Spring
UNIX / LINUX
PayPal
Google API, Jasper Report, Jquery
PMPML Store Inventory Managment is a application which helps the
PMPML which is Pune Mahanagar Parivahan Mahamandal Ltd. is one of
the latgest govt. operated Public Bus service, this application helps
PMPML to manage the buses while every week they go for there service
in the bus Depot, This application generates a SMS when the bus is taken
in at the service center and also when the bus is ready after servicing.
The Inventory keeps the track of Bus at every stage of the service center.
Store inventory as well as for the parts that needs to be changed.
We have provided tickete raising feature for facilitaing above
functionalities , Once a tickit has been raised it gets automaticaly added
in the concern departments pending task.

Project Name
KYC Document Management Project Type
Project Category
Document Management System
Company Name / Client
Idea & Vodafone Cellular
Name
Time Taken
1 Year 2 Months
Team Size
Technology
Java MVC, Java Swing, Java/J2EE
Database
MS SQL 2005
Framework
Spring
OS
Windows 2000/2003/2008 Server
Third Party Component Google API, Jasper Report, Jquery

Desktop + Web

KYC Document Management System was a utility for telecom


companies to, maintain and meet the KYC norms provided by the govt.
We have developed a Multitiere architecture , which has a Input
mechanism to Scan the documents provided by the customer , Process the
data in the form and store the analized information in the database.
Description

It also facilitates the Quality Check , if a image comes in an unreadable


format for application it redirects the user to a manual entry page where
operator can manually enter the details.
Beyond we implemented a comprehensive reporting functionality for
various range of users (SuperAdmin, Admin, Operator) can view the
reports in there accounts in various formats like PDF, Excell and HTML.

Linux Commands :
-> ssh user@IP -port
e.g. >ssh lalit@192.168.10.20 -22
-22 is default for ssh command
secure share
-> scp secure copy on port 22

Aspose.OCR for Java is a character recognition component


that allows developers to add OCR(Optical Character
Recognition) and OMR functionality in their Java based
applications. It provides a simple set of classes for controlling
character recognition as well as optical mark recognition.
The API is extensible, easy to use and compact. It provides
common functionality so that developers have to write less code
when performing common tasks.
Aspose.OCR is aimed at developers who need to find text in
image files from within their own applications. It allows
developers to extract text from images quickly and easily,
saving the time and effort involved in developing an OCR
solution from scratch.

*********** UltimateSMS Lalit has done only table partitioninig as


it's SMS table got loaded with Huge data.

**Cronjob in Linux:
Job scheduling in linux using crontab table which executes shell
commands given in crontab after each interval of time given in that
table.

**Table partitioning in Postgresql


1)Create a simple table call hashvalue_PT , it only include 2 columns hash and hashtime
CREATE TABLE hashvalue_PT(
hash bytea NOT NULL,
hashtime TIMESTAMP WITHOUT TIME zone NOT NULL
);
2) Create 10 tables in different months and inherantence from main hashvalue_PT table.
--Create Partition with check rule for validation
CREATE TABLE hashvalue_PT_y2008m01 (
CHECK ( hashtime >= DATE '2008-01-01' AND hashtime
) INHERITS (hashvalue_PT);
CREATE TABLE hashvalue_PT_y2008m02 (
CHECK ( hashtime >= DATE '2008-02-01' AND hashtime
) INHERITS (hashvalue_PT);
CREATE TABLE hashvalue_PT_y2008m03 (
CHECK ( hashtime >= DATE '2008-03-01' AND hashtime
) INHERITS (hashvalue_PT);
CREATE TABLE hashvalue_PT_y2008m04 (
CHECK ( hashtime >= DATE '2008-04-01' AND hashtime
) INHERITS (hashvalue_PT);
CREATE TABLE hashvalue_PT_y2008m05 (
CHECK ( hashtime >= DATE '2008-05-01' AND hashtime
) INHERITS (hashvalue_PT);
CREATE TABLE hashvalue_PT_y2008m06 (
CHECK ( hashtime >= DATE '2008-06-01' AND hashtime
) INHERITS (hashvalue_PT);
CREATE TABLE hashvalue_PT_y2008m07 (
CHECK ( hashtime >= DATE '2008-07-01' AND hashtime
) INHERITS (hashvalue_PT);
CREATE TABLE hashvalue_PT_y2008m08 (
CHECK ( hashtime >= DATE '2008-08-01' AND hashtime
) INHERITS (hashvalue_PT);
CREATE TABLE hashvalue_PT_y2008m09 (
CHECK ( hashtime >= DATE '2008-09-01' AND hashtime
) INHERITS (hashvalue_PT);
CREATE TABLE hashvalue_PT_y2008m010 (
CHECK ( hashtime >= DATE '2008-10-01' AND hashtime
) INHERITS (hashvalue_PT);

< DATE '2008-01-31' )


< DATE '2008-02-29' )
< DATE '2008-03-31' )
< DATE '2008-04-30' )
< DATE '2008-05-31' )
< DATE '2008-06-30' )
< DATE '2008-07-31' )
< DATE '2008-08-31' )
< DATE '2008-09-30' )
< DATE '2008-10-31' )

3) Create primary key for each child tables


ALTER
ALTER
ALTER
ALTER
ALTER
ALTER
ALTER
ALTER
ALTER
ALTER

TABLE
TABLE
TABLE
TABLE
TABLE
TABLE
TABLE
TABLE
TABLE
TABLE

hashvalue_PT_y2008m01 ADD CONSTRAINT hashvalue_PT_y2008m01_pkey PRIMARY KEY (hashtime, hash);


hashvalue_PT_y2008m02 ADD CONSTRAINT hashvalue_PT_y2008m02_pkey PRIMARY KEY (hashtime, hash);
hashvalue_PT_y2008m03 ADD CONSTRAINT hashvalue_PT_y2008m03_pkey PRIMARY KEY (hashtime, hash);
hashvalue_PT_y2008m04 ADD CONSTRAINT hashvalue_PT_y2008m04_pkey PRIMARY KEY (hashtime, hash);
hashvalue_PT_y2008m05 ADD CONSTRAINT hashvalue_PT_y2008m05_pkey PRIMARY KEY (hashtime, hash);
hashvalue_PT_y2008m06 ADD CONSTRAINT hashvalue_PT_y2008m06_pkey PRIMARY KEY (hashtime, hash);
hashvalue_PT_y2008m07 ADD CONSTRAINT hashvalue_PT_y2008m07_pkey PRIMARY KEY (hashtime, hash);
hashvalue_PT_y2008m08 ADD CONSTRAINT hashvalue_PT_y2008m08_pkey PRIMARY KEY (hashtime, hash);
hashvalue_PT_y2008m09 ADD CONSTRAINT hashvalue_PT_y2008m09_pkey PRIMARY KEY (hashtime, hash);
hashvalue_PT_y2008m010 ADD CONSTRAINT hashvalue_PT_y2008m010_pkey PRIMARY KEY (hashtime, hash);

4) Create an index for each child tables


CREATE INDEX idx_hashvalue_PT_y2008m01_hashtime ON hashvalue_PT_y2008m01 (hashtime);
CREATE INDEX idx_hashvalue_PT_y2008m02_hashtime ON hashvalue_PT_y2008m02 (hashtime);

CREATE
CREATE
CREATE
CREATE
CREATE
CREATE
CREATE
CREATE

INDEX
INDEX
INDEX
INDEX
INDEX
INDEX
INDEX
INDEX

idx_hashvalue_PT_y2008m03_hashtime ON hashvalue_PT_y2008m03 (hashtime);


idx_hashvalue_PT_y2008m04_hashtime ON hashvalue_PT_y2008m04 (hashtime);
idx_hashvalue_PT_y2008m05_hashtime ON hashvalue_PT_y2008m05 (hashtime);
idx_hashvalue_PT_y2008m06_hashtime ON hashvalue_PT_y2008m06 (hashtime);
idx_hashvalue_PT_y2008m07_hashtime ON hashvalue_PT_y2008m07 (hashtime);
idx_hashvalue_PT_y2008m08_hashtime ON hashvalue_PT_y2008m08 (hashtime);
idx_hashvalue_PT_y2008m09_hashtime ON hashvalue_PT_y2008m09 (hashtime);
idx_hashvalue_PT_y2008m010_hashtime ON hashvalue_PT_y2008m010 (hashtime);

5) Create a trigger on mother table to redirect records into child tables.


--create a trigger to redirect records to child table
CREATE OR REPLACE FUNCTION hashvalue_PT_func_insert_trigger()
RETURNS TRIGGER AS $$
BEGIN
IF ( NEW.hashtime >= DATE '2008-01-01' AND NEW.hashtime < DATE '2008-01-31' ) THEN
INSERT INTO hashvalue_PT_y2008m01 VALUES (NEW.*);
ELSIF ( NEW.hashtime >= DATE '2008-02-01' AND NEW.hashtime < DATE '2008-02-29' ) THEN
INSERT INTO hashvalue_PT_y2008m02 VALUES (NEW.*);
ELSIF ( NEW.hashtime >= DATE '2008-03-01' AND NEW.hashtime < DATE '2008-03-31' ) THEN
INSERT INTO hashvalue_PT_y2008m03 VALUES (NEW.*);
ELSIF ( NEW.hashtime >= DATE '2008-04-01' AND NEW.hashtime < DATE '2008-04-30' ) THEN
INSERT INTO hashvalue_PT_y2008m04 VALUES (NEW.*);
ELSIF ( NEW.hashtime >= DATE '2008-05-01' AND NEW.hashtime < DATE '2008-05-31' ) THEN
INSERT INTO hashvalue_PT_y2008m05 VALUES (NEW.*);
ELSIF ( NEW.hashtime >= DATE '2008-06-01' AND NEW.hashtime < DATE '2008-06-30' ) THEN
INSERT INTO hashvalue_PT_y2008m06 VALUES (NEW.*);
ELSIF ( NEW.hashtime >= DATE '2008-07-01' AND NEW.hashtime < DATE '2008-07-31' ) THEN
INSERT INTO hashvalue_PT_y2008m07 VALUES (NEW.*);
ELSIF ( NEW.hashtime >= DATE '2008-08-01' AND NEW.hashtime < DATE '2008-08-31' ) THEN
INSERT INTO hashvalue_PT_y2008m08 VALUES (NEW.*);
ELSIF ( NEW.hashtime >= DATE '2008-09-01' AND NEW.hashtime < DATE '2008-09-30' ) THEN
INSERT INTO hashvalue_PT_y2008m09 VALUES (NEW.*);
ELSIF ( NEW.hashtime >= DATE '2008-10-01' AND NEW.hashtime < DATE '2008-10-31' ) THEN
INSERT INTO hashvalue_PT_y2008m010 VALUES (NEW.*);
ELSE
RAISE EXCEPTION 'Date out of range. Fix the measurement_insert_trigger() function!';
END IF;
RETURN NULL;
END;
$$
LANGUAGE plpgsql;
CREATE TRIGGER trigger_hashvalue_PT_insert
BEFORE INSERT ON hashvalue_PT
FOR EACH ROW EXECUTE PROCEDURE hashvalue_PT_func_insert_trigger();

In hibernate if we insert data in regular table and got


successfully inserted then it returns 0 status
otherwise if it's a partitioned table then it will return
status as 1 applciation and spring

************KANNEL

WORKING

* Short Message Service (SMS)


* One SMS message can contain at most 140 bytes (1120 bits) of data
* 160 characters if 7-bit character encoding is used.
(7-bit character encoding is suitable for encoding Latin characters
like English alphabets.)
* 70 characters if 16-bit Unicode UCS2 character encoding is used.
(SMS text messages containing non-Latin characters like Chinese
characters should use 16-bit character encoding.)

8 = Delivered to mobile networks ,


4 = Message queued ,
16=Message rejected ,
2=Error delivering message ,
1=Received by recipient.
http://www.kannel.org/download/kannel-userguide-snapshot/userguide.html#AEN5058
dlrmask=31
String strURL = "http://" + host + ":" + port + "/cgi-bin/sendsms";
// Prepare HTTP post
PostMethod post = new PostMethod(strURL);
post.setRequestHeader("Content-Type", "text/plain; iso-8859-1");
post.setRequestHeader("X-Kannel-Username", username);
post.setRequestHeader("X-Kannel-Password", password);
post.setRequestHeader("X-Kannel-To", to);
post.setRequestHeader("X-Kannel-From", from);
post.setRequestHeader("X-Kannel-DLR-Mask", dlrmask);
post.setRequestHeader("X-Kannel-DLR-Url", dlrurl);
post.setRequestHeader("X-Kannel-Coding", "0");
post.setRequestHeader("X-Kannel-SMSC", smsc);
post.setRequestBody(text);
dlrurl-> feedback url to tell smsDelivery status
X-Kannel-SMSC
string Name of smsc used to deliver this push. Smsc configuration
must contain some of corresponding variables, see
X-Kannel-DLR-URL url
Url smsbox would call this url when doing the delivery report. Note
that it can contain all Kannel escapes.
X-Kannel-DLR-Mask number
Mask telling smsbox when it should do the delivery reports.
Values are same as used by smsbox

delivery report
#kannel
1=Received by recipient
#kannel with message id
m8=Delivered to mobile networks
#kannel
4=Message queued
#kannel
2=Error delivering message
#kannel
16=Message rejected
#kannel with message id
m16=Message rejected
#kannel
8=Unconfirmed delivery to mobile networks
Working of kannel message sending
1. you send a message using dlr-mask=7 and dlr-url=http://www.xyz.com/cgi/dlr.php?
myId=123456&type=%d
2. Kannel forwards the message to the SMSC and keeps track of the message
3. The SMSC can not reach the phone and thus returns a buffered message
4. Kannel calls http://www.xyz.com/cgi/dlr.php?myId=123456&type=4 to indicate the message
being buffered
5. The phone is switched on and the SMS gets delivered from the SMSC. The SMSC reports this
to Kannel
6. Kannel calls http://www.xyz.com/cgi/dlr.php?myId=123456&type=1 to indicate the final success

-> kannel sends a reply by calling servlet (metioned in DLR-Url ) for every request with
different -> sms status like (8 ,4,1,2 ,16).
-> 5 Issues Faced :
If we send 1 million sms to kannel (via http ) , kannel sends us a reply by calling servlet
once for every request as each servlet runs as a separate thread (also the thread would need to
execute its own logic, which takes time as it contains database connection)
Exception
OutOfMemoryError: unable to create new native thread
Error Description :
This Error thrown when the HotSpot JVM is unable to further create a new Java
thread.
Solution :
1) Integrated JMS queue.
2) Transfered all database logic in database level ( i.e stored procedure ).
Servlet create bean from requested parameter from kannel and add it jms queue
(HornetQueue). (Which minimize thread execution time)MDB(Message Driven Bean)
process messages asynchronously from queue. MDB execute database logic by using
stored procedure.

************ JMS Working


http://www.pretechsol.com/2012/10/how-to-create-message-driven-bean-in.html#.U6e3lJSSwVk
To register JMS we need to add following entry in Jboss's standalone-full.xml
<jms-destinations>
<jms-queue name="testQueue">
<entry name="queue/test"/>
</jms-queue>
</jms-destinations>
At time of server startup in full.xml mode
it registers above JMS
there is one to one relation in MDB and JMS
MDB always listens for object addition in JMS.
As soon as object is added , Mdb's onmessage method gets called.

status, SMSC , timeDate, destination, deliveryInfo, source, messageSendingID,


messageDeliveryID, accountInfo, charge, smsID, message
//Create InitialContext
ic = new InitialContext();
//Create Connection factory
cf = (QueueConnectionFactory) ic.lookup("java:/JmsXA")
//Lookup for queue
Queue queue = (Queue) ic.lookup(destinationName);
//Create the JMS objects to connect to the server and manage a session
// AUTO_ACKNOWLEDGE mode follows the policy of delivering the
// message once-and-only once but this incurs an overhead on the
// server to maintain this policy .
connection = cf.createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
//Create a JMS Message Producer to send a message on the queue
MessageProducer publisher = session.createProducer(queue);
//Start connection
connection.start();
//create Serializable feedback message
FeedbackMessageBean mymesage = new FeedbackMessageBean();
//Message sent to Queue
publisher.send(msg);
//Once message is sent to queue it is added in JMS

and then it goes to MDB registered with that queue


and calls Onmessage method of that MDB
//MDB to listen JMS
@MessageDriven(
activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue =
"javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/test"),
@ActivationConfigProperty(propertyName = "acknowledgeMode",propertyValue = "Autoacknowledge")
})
public class MessageDrivenBean implements MessageListener {
public MessageDrivenBean() {
// TODO Auto-generated constructor stub
}
public void onMessage(Message message) {
Logger log=LoggerFactory.getLogger(MessageDrivenBean.class);
log.info("====================== onMessage ====================");
Serializable seObj = null;
FeedbackMessageBean tmsg = null;
try {
seObj = ((ObjectMessage) message).getObject();
} catch (JMSException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
tmsg = (FeedbackMessageBean) seObj;
.
.
.
} catch (Exception e) {
e.printStackTrace();
}
}

You might also like