Professional Documents
Culture Documents
PROJECT REPORT
ON
CHET SERVER
2015 2016
SUBMITTED TO
SUBMITTED BY
Mr. Ajay Raghav Dhiraj
Kumar
(FACULTY) BCA-VI
th Sem.
ROLL NO- 7217014
CANDIDATES DECLARATION
(Dhiraj Kumar)
ACKNOWLEDGEMENT
(Dhiraj Kumar)
Index
Part 1:
Introduction
Hardware and Software used
Part 2:
Part 3:
History of JAVA
Remote Method Invocation (RMI)
Part 4:
Database Used
Part 5:
Screen Shots
Part 6:
Coding
Part 7:
Progress Table
Conclusion
Bibliography
Part 1
Introduction
INTRODUCTIN
The SDLC includes ten phases during which defined IT work products are
created or modified. The tenth phase occurs when the system is disposed
of and the task performed is either eliminated or transferred to other
system. The tasks and work products for each phase are described in
subsequent chapters. Not every project will require that phases be sequentially
executed. However, the phases are interdependent. Depending upon the size
and complexity of the project, phases may be combined or may overlap.
Identify and assign the roles and responsibilities of all involved parties,
including functional and technical managers, throughout the system
development life cycle.
Initiationphae
Planning
Phase
The concept is further developed to describe how the business will operate once
the approved system is implemented, and to assess how the system will impact
employee and customer privacy. To ensure the products and / or services
provide the required capability on-time and within budget, projects resources,
activities, schedules, tools and reviews are defined. Additionally, security
certification and accreditation activities begin with the identification of system
security requirements and the completion of a high level vulnerability
assessment.
Requirements Analysis
Phase
DesignPhae
The physical characteristics of the system are designed during this phase.
The operating environment is established, major subsystems and their inputs
and outputs are defined, and processes are allocated to resources. Everything
requiring user input or approval must be documented and reviewed by the user.
The physical characteristics of the system are specified and a detailed design is
prepared. Subsystems identified during design are used to create a detailed
structure of the system. Each subsystem is partitioned into one or more design
units or modules. Detailed logic specification is prepared for each software
module.
Development
phase
The detailed specifications produced during the design phase are translated into
hardware, communications, and executable software. Software shall be unit
tested, integrated, and retested in a systematic manner. Hardware is assembled
and tested.
Integration and Test
Phase
The various components of the system are integrated and systematically tested.
The user tests the system to ensure that the functional requirements, as defined
in the functional requirements documents, are satisfied by the developed or
modified system. Prior to installing and operating the system in a production
environment, the system must undergo certification and accreditation activities.
Implementation
Phase
Disposition
Phase
The disposition activities ensure the orderly termination of the system and
preserve the vital information about the system so that some or all of the
information may be reactivated in the future if necessary. Particular
emphasis is given to proper preservation of the data processed by the
system, so that the data is effectively migrated to another system or archived
in accordance with applicable records management regulations and policies, for
potential future access.
INITIATION PHASE:
OBJECTIE
TASK AND
ACTIVITIE
The following activities are performed a part of the Initiation Phase. The results
of these activities are captured in the Concept Proposal. For every IT project, the
agency, the agency should designate a responsible organization and assign
those organization sufficient resources to execute the project.
CONCEPTUAL PROPOSAL
OBJECTIVE
System Concept Development begins when the Conceptual Proposal has been
formally approved and requires study and analysis that may lead to System
development activities.
The review and approval of the Concept Proposal begins the formal studies
and analysis of the need in the System Concept Development Phase and
begins the life cycle of an identifiable project.
PLANNING PHASE:
OBJECTIVE
Many of the plans essential to the success of the entire project are create in this
phase; the created plans are then reviewed and update throughout the
remaining SDLC phases.
In the planning phase, the concept is further developed to describe how the
business will
Operate once the approved system is implemented and to assess how the
system will impact employee and customer privacy. To ensure the products
and/or services
provides the required capability on-time and within budget, project resources,
activities, schedules,
Tools, and reviews are defined. Additionally, security certification and
accreditation activities begin with identification of system security requirements
and the completion of
a high-level vulnerability assessment.
TASK AND
ACTIVITIES
The following tasks are performed as part of the planning phase. The results of
these activities are captured in various project plans and solicitation documents.
OBJECTIE
The Requirement Analysis Phase will begin when the previous phase
documentation has been approved or by management direction. Documentation
related to user requirement from the planning phase shell be used as the basis
for further user needs analysis and the
Development of detailed user requirements. The analysis may reveal new
insights into the Overall information system requirements, and, in such
instances, all deliverables should be revised to reflect this analysis. During the
Requirement Analysis phase, the system shall be defined in ore detail with
regard to system inputs, processes, outputs, and interfaces. This definition
process occurs At the function level .The system shall be described in terms of
the function to be performed, not in terms of computer programs, files, and data
streams. The emphasis in this phase is on determining what function must be
performed rather than how to perform those functions.
TASK AND
ACTIVITIES
The following tasks are performed during the Requirements Analysis Phase. The
tasks and activities actually performed depend on the nature of the project ,
Inclusion of tasks for the ,Alternative SDLC work patterns.
First consolidate and affirm the business needs. Analyze the intended use of the
system And specify the functional and data requirements. Connect the
functional requirements to the data requirements. Defines functional and system
requirements that are not easily Expressed in data and process models Refine
the high level architecture and logical design to support the system and
functional requirement.
A logical model is constructed that describes the fundamental processes and
data needed to support the desired business functionality. This logical model
will show how
processes interact and how processes created and use data. These processes
will be
derived from the activity descriptions provided in the System Boundary
Document. Functions and entity types contained in the logical model are
extended and refine from those provided in the Concept Development
Phase. End-user and business areas experts will evaluate all identified
processes and data structures to ensure accuracy, logical consistency, and
completeness. An analysis of business activities and data structure perform
to produce entity-relationship diagrams, process hierarchy diagrams, process
dependency diagrams, and associated documentation. An interaction analysis
produce Process logic and action diagrams, definitions of the business
algorithms, entity life-cycle diagrams, and entity state change matrices .A
detailed analysis of the current technical architecture, application software,
and data is conducted to ensure that limitation or
Unique requirements have not been overlooked.
Include all possible requirements including
those for:
Functional and capability specifications, including performance, physical
characteristics, and environmental conditions under which the software item is to
perform;
Interfaces external to the software item;
Safety specification, including those related to methods of operation and
maintenance, environment influences, and personnel injury;
Security specification, including those related to compromise of sensitive
information;
Human-factors engineering, including those related to manual
operations, human- equipment interactions, constraints on personnel, and areas
needed concentrated human attention, that are sensitive to human errors and
training;
DESIGN PHASE:
OBJECTIE
TASKS AND
ACTIVITIES
The following tasks are performed during the Design Phase. The tasks and
activities actually performed depend on the nature of the project. Guidelines for
selection and inclusion of tasks for the Design Phase may be found, Alternate
SDLC Work Patterns.
Documentation DEVELOPMENT
PHASE: OBJECTIVE
The objective of the development phase will be to convert the deliverables of the
design phase into a complete information system. Although much of the
activity in the
development phase addresses the computer programs that make up the system,
this phase also puts in place the hardware, software, and communications
environment for the system and other important elements of the overall systems.
The activities of this phase translate the system design produced in the
design phase into a working information system capable of addressing
the information system
requirements. The development phase contains activities for building the
system, testing
the system, and conducting functional qualification testing, to ensure the system
functional processes satisfy the functional process requirements in the
Functional Requirement Document (FRD)
At the end of this phase, the system will be ready for the activities of the
Integration and
Testing
Phase.
TASKS AND
ACTIVITIES
The results of the audits shall be documented. If both hardware and software are
under development of integration, the audits may be postponed until the System
Qualification Testing. Upon successful completion of the audits, if conducted,
update and prepare the deliverable software product for System Integration,
System Qualification Testing, Hardware Installation, or Software Acceptance
Supports as applicable. Also, establish a baseline for the design and code of the
software item.
Integrate System
Integrate the software configuration items with hardware configuration items,
manual operations, and other systems as necessary, into the system. The
aggregates shall be tested, as they are developed, against their requirements.
The integration and the test results shall be documented. For each qualification
requirement of the system, a set of tests, test cases (inputs, outputs, test
criteria), and test procedure for conducting System Qualification Testing
shall be developed and documented. Ensure that the integration system is
ready for System Qualification Testing.
Install Software
Acceptable review and testing shall consider the results of the Joint Reviews,
Audits, Software Qualification Testing, and System Qualification Testing (if
performed). The results of the acceptance review and testing shall be
documented.
The developer shall complete and deliver the software product as specified. The
developer
Shall provide initial and continuing training and support to the acquirer as
specified.
OBJECTIE
The objective of this phase is to prove the developed system that the developed
system satisfies the requirements defined in the FRD. Several types of tests
will be conducted in the phase. First, Subsystem integration tests shall be
executed and evaluate by the development team to prove that the program
components integrate properly into the subsystems and that the subsystems
integrate properly into a application. Next, the testing team conducts and
evaluates system tests to ensure the developed system
meets all technical requirements, including performance requirement. Next, the
testing team and the security program manager conduct security tests to
validate that the access and data security requirements are met. Finally, users
participate in acceptance testing to confirm that the developed system meets
all user requirements as stated in the FRD. Acceptance testing shall be done in
a simulated real user environment with the users using simulating or real target
platforms and infrastructures .
TASKS AND
ACTIVITIS
The tasks and activities actually performed depend on the nature of the project.
The following tasks should be completed during the integration and test phase .
Establish the various test teams and ensure the test system(s) are
ready.
The test and evaluation team is responsible for creating/loading the test
database(s) and executing the integration test(s). This is to ensure that program
components integrate properly into the subsystems and the subsystem
integrates properly into an application.
The test and evaluation team is responsible for creating/loading the test
database(s) and executing the system tests. All results should be documented
on the test analysis report, test problem report and on the test analysis approval
determination. Any field components should be migrated back to the
development phase for rework, and the passed components should be migrated
ahead for security testing.
The test and evaluation team will again create or load the test databases and
execute security (penetration) tests. All tests will be documented, similar to those
above. Failed components will be migrated back to the development phase for
rework, and passed components will migrate ahead for implementation.
Revise Previous Documentation
During this phase, the systems technical lead or the developers will finalize the
software development document from the development phase. He/They will also
finalize the operations or systems administration manual, user manual, training
plan maintenance manual, conversion plan, implementation plan , contingency
plan and update the interface control document from the design phase. The
project manager should finalize the system security plan and the security
risks assessment form the requirement analysis phase and the project
management plan from the planning phase. The configuration manager should
finalize the configuration management plan from the planning phase. The
quality assurance office/person should finalize the quality
assurance plan from the planning phase. And finally, the project manager should
finalize the cost benefit analysis and the risk management plan from the system
concept development phase.
IMPLEMENTATION PHASE
OBJECTIE
In the phase, the system or system modification are installed and made
operational in a production environment. The phase is initiated after the system
has been tested and accepted by the user and project manager. Activities in the
phase include notification of implementation to end users, execution of the
previously defined training plan, Data Entry of Conversion, and post
implementation review. This phase continues until the system is operating in
production in accordance with the defined user requirements.
The new system can fall into three categories, replacement of a manual process,
replacement of a legacy system, or upgrade to an existing system
regardless of the
type of system, all expects of the implementation phase should be followed.
This will
ensure the smoothest possible transition to the organizations
desired goal.
TASKS AND
ACTIVITIES
Task and activities in the implementation phase are associated with certain
deliverables described in section 10.3. The task and activities actually performed
depend on the nature of the project. A description of these tasks and activities is
provided below.
The implementation notice should be sent to all users and organizations affected
by the implementation. Additionally, it is good policy to make internal
organizations not directly affected by the implementation aware of the schedule
so that allowances can be made for a disruption in the normal activities of the
section. Some notification methods are E- Mail,
Internal Memo to heads of department, Voice Tree Messages. The notice
include:
o The schedule of the
implementation;
o A brief synopsis of the benefits of the new
systems;
o The difference between the new and old
system;
o Responsibilities of end user affected by the
implementation during this phase; and
o The process to obtain system support, including contact
names
and phone
numbers
More then half of the life cycle costs are attributed to the operations and
maintenance of systems .In this phase, it is essential that all facets of operations
and maintenance are performed. The system is being used and scrutinized to
ensure that it meets the needs initially stated in the planning phase. Problems
are detected and new needs arise. This may require modification to existing
code, new code to be developed and/or hardware configuration changes.
Providing user support is an ongoing activity. New users will require training and
other will require training as well. The emphasis of this phase will be to ensure
that the users needs are met and the system continues to perform as
specified in the operational environment. Additionally, as operations and
maintenance personal monitor the current system they may become aware of
better ways to improve the system
And therefore make recommendations. Changes will be required to fix
problems, possibly add features and make improvements to the system. This
phase will continue as long as the system is in use.
TASKS AND
ACTIVITIES
Hardware/Software Requirements
As this project is developed in JAVA, which is platform independent, so this
software can run within any operating system. This Software needs at least 400 Mhz or
hire Processor . RAM required more then 32 MB for best performance, at least 2.1 Hard
Disk is required for installing this Software but it will refer on the amount of the Database
used for this Software, SVGA, display of 1 MB video memory and color monitor but with
this lot of processor power consumed and speed of the system will be very slow.
Therefore a realistic hardware and software configuration for this Software is:
RAM : 256 MB
Hard Disk : 40 GB
Printer : Laser
Part-2
Data flow Diagram
These are the people, places, things, events and concepts of interest to an
organization. In short, anything which an organization needs to store data about.
Entity relationship diagrams are the abstractions of the real word, which
simplify the problem to be solved while retaining its essential features.
There are three type of relationship, which can exist between two different
The basic things that relates to the tables is by the help of Primary key and
Foreign key concepts.
Primary Key is defined as that unique key that is unique in the whole table
and that cannot be null and duplicate in any circumstances.
Foreign Key is defined as the key that is particularly primary key in other
table and represent as a field in this current table.
Attributes
Attribute Attributes are the properties or characteristics of an
Entity.
Key Attributes
Attribute A key attribute is the unique, distinguishing
Characteristic of the entity. For example, Students
Roll No. might be the Students key attribute.
Derived attribute
Attribute A derived attribute is based on another attribute. For
example, an employees monthly salary is based on
the employees annual salary.
Relationship Relationships
Relationships illustrate how to entities share
information in the database structure.
Send id sid
id sid rid &
Reciv
Chat_Persona
e
Typ Chat_mMsegssa
e Flag rid l flag
ge
Part 3
History of JAVA
JAVA
History Of Java
Java was conceived by James Gostling,Patric Naughton,Chris Warth,Ed Frank ,and Mike
Sheridan at Sun Microsystems,Inc. in 1991.It took 18 months to develop the first working
version. This language was initially called Oak but was renamed Java in 1995.
Forces Behind Java
The original impetus of Java as not Internet! Instead, the primary motivation was the
need for a platform-independent (that is architectural neutral)language that could be used to
create software to be embedded in various electronic devices ,such as microwave ovens nd
remote controls.
The second force was the World Wide Web. With the emergence of WWW,Java was
propelled to the forefront of computer language design, because the Web ,too demanded
portable programs.
The Internet helped catapult Java to the forefront of programming, and Java, in, turn has
had profound effect on the Internet. The reason for this is: Java expands the universe of objects
that can move about freely in cyberspace.
Java can be used to create two types of programs: Application and Applet.
An Application is a program that runs on your computer; understand the operating system of that
computer.
An Applet is a Application designed to be transmitted over the Internet and executed by a Java-
compatible Web browser.
Security
When we have a java compatible web browser, we can safely download the Java applets by
confining a Java program to the Java execution and not allowing it access to other part of
computer.
Portability
Many types of computer and operating systems are in use and many are connected through the
Internet. For programs to be dynamically downloaded to all various types of platforms connected
to the Internet, some means of generating portable code is needed.
ByteCode
The Key that allow java to solve the security and portability problems is that output of a Java
compiler is not executable code, rather it is Bytecode.Bytecode is highly optimized set of
instruction designed to be executed by Java run-time System,which is called the JVM(Java
Virtual Machine).JVM is an interpreter for bytecode.
Translating a java program into bytecode helps makes it much easier to run a java program in a
wide variety of platforms. The reason is straightforward:Only the JVM needs to be implemented
for each platform.
RMI allow a Java object that executes on one machine to invoke a method that executes on other
machine. This is an important feature because it allows you to build distributed applications.
RMI Concept
A java object runs within a Java Virtual Machine (JVM).However ,object used by a J2EE
application do not need to run on the same JVM as the J2EE application.This is because a J2EE
application and its components can invoke objects located on a different JVM by using the RMI
system.
RMI is used to connect together a Client and Server.A Client is an application or component that
requires the service of an object to fulfill a request .A Sever creates an object and makes the
object available to clients.A client contacts the server to reference and invoke the object by using
RMI.
A Client locates a remote object by either using RMI naming registry or by passing a string that
references the remote object .In either case, RMI returns a reference to the remote object ,which
is then invoked by the client as if the object was on the local JVM.
Remote Interface
Server-side object that are invoked by remote clients must implements a remote interface and
associated method definitions. The Remote interface is used by clients to interact with the object
using RMI communications. A remote interface extends java.rmi.Remote and each method must
throw a RemoteException.
RMI Process
javac sourcefilename_client
javac sourcefilename_server
javac sourcefilename_interface
javac sourcefilename_implementation
rmic sourcefilename_impl
start rmiregistry
java sourcefilename_client
Stub and Skelton
A stub is a java object that reside on the client machine .Its function is to present the same
interface as the remote server. Remote methods calls initiated by the client are actually directed
to the remote server. The stub works with the other parts of the RMI system to formulate a
request that is sent to the remote machine.
A Skeleton is a java object that reside on the server machine.It works with the other parts of the
RMI system to receive request and perform deserialization and invoke the appropriate code on
the server.
Part 4
Data Base Used
Database Used:
Part 5
Screen Shots
Login Window
Once the user login by giving his/her name the following main window will display:
Main Window
Chatting Between two users
Group Chatting
Chatting Between two users
Private Chatting ( User 1 )
Private Chatting ( User 2 )
Part 6
Coding
Coding
ChatMain.java
import java.rmi.*;
public interface ChatMain extends Remote
{
public String getValue(String sid)throws RemoteException;
public String getValue(String sid,String rid)throws RemoteException;
public String setValue(String val,String sid)throws RemoteException;
public String setValue(String val, String sid, String rid)throws RemoteException;
public int setName(String nam)throws RemoteException;
public String getName()throws RemoteException;
public void removeName(String nam) throws RemoteException;
public void setPersonal(String sid,String rid)throws RemoteException;
public String getPersonal(String rid)throws RemoteException;
}
ChatImp.java
import java.rmi.*;
import java.rmi.server.*;
import java.sql.*;
//-------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------//
public void run()
{
while(true)
{
try{ // st.executeUpdate("delete from chat_message where flag=1");
st.executeUpdate("delete from chat_personal
where flag=1"); Thread.sleep(100000);
}catch(Exception es){System.out.println("Error : " + es);}
}
}
//-------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------//
public String getValue(String sid)
{
int
id=0;
str="";
try{
ResultSet rs=st.executeQuery("select * from chat_message where
type='G' and flag=0 and rid like '"+sid+"'");
while(rs.next
())
{
id=Integer.parseInt(rs.getString(1));
str=rs.getString(
5);
st.executeUpdate("update chat_message set flag=1
where id=" + id ); System.out.println(str);
return(str);
}
}catch(Exception e){}
return(str);
}
//-------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------//
public String getValue(String sid,String rid)
{
int
id=0;
str1=""
; try{
ResultSet rs=st.executeQuery("select id,msg from chat_message
where type='P' and flag=0 and sid='" + sid + "' and rid='"+rid+"'");
while(rs.next())
{
id=Integer.parseInt(rs.getString(1));
str1=rs.getString(2);
}
st.executeUpdate("update chat_message set flag=1 where id=" + id );
}catch(Exception e){}
return(str1);
}
//-------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------//
public String setValue(String val,String sid)
{
String mk1;
try{
ResultSet rs=st.executeQuery("select * from chat_users where id
'"+sid+"'" not like
);
Statement mst=cn.createStatement();
while(rs.next())
{
count++;
mst.executeUpdate("insert into chat_message
values("+count + ",'"+sid+"','"+rs.getString(1)+"','G','"+val+"',0)");
}
}catch(Exception e){System.out.println("Error during writing Data
setValue() : " + e);}
return(val);
}
//-------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------//
public String setValue(String val,String sid,String rid)
{
count++;
try{ st.executeUpdate("insert into chat_message values("+count +
",'"+sid+"','"+rid+"','P','"+val+"',0)");
}catch(Exception e){}
return(val);
}
//-------------------------------------------------------------------//
////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------//
public int setName(String nam)
{
int flag=0;
try{
ResultSet rs=st.executeQuery("select * from chat_users where id
"'") like'" + nam +
;
while(rs.next())
{
flag=1;
}
if(flag==0)
{
st.executeUpdate("insert into chat_users
values('"+nam+"')");
str=nam + " is Login " + "\n";
if(name==null)
name=nam+"
:";
else name=name+nam+":";
}
}catch(Exception e){}
}
ChatServer.java
import java.rmi.*;
class ChatServer
{
public static void main(String [] args)
{
try
{ ChatImp ct=new ChatImp();
Naming.rebind("bansal",ct);
System.out.println("Server Started
} Successfully ...");
catch(Exception e)
{
System.out.println("Error: to start Server \n " + e );
}
}
}
ChatClient.java
import java.rmi.*;
import java.awt.*;
import
java.awt.event.*;
import
java.applet.*;
import
javax.swing.*;
/*
<APPLET code=ChatClient.class width=500 height=280></APPLET>*/
this.setVisible(false);
Chat c1=new
Chat(str);
c1.setTitle("Chit-Chat : "
+ str);
c1.setResizable(fal
se);
c1.setSize(1000,420);
c1.setVisible(tru
e);
c1.addWindowListener(new WindowAdapter(){public void
windowClosing(WindowEvent e1){try{ct1.removeName(str);}catch(Exception abc)
{}System.exit(0);}});
System.out.println("ChatClient: ready ...");
}
}
jSP.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLL
BAR_ALWAYS);
jSP.setViewportView(mainText);
lstName=new JList();
jSPl=new JScrollPane();
jSPl.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROL
LBAR_ALWAYS);
jSPl.setViewportView(lstName);
msgText=new JTextField("");
sendBut=new JButton("Send");
nou=1;
////////////////////////////////////
jSP.setBounds(225,5,620,3
35);
l2.setBounds(1,1,220,3
90);
l3.setBounds(850,5,10
0,20);
jSPl.setBounds(850,25,140,31
5);
msgText.setBounds(225,345,6
80,40);
sendBut.setBounds(910,345,8
0,40);
cp.add(l2);cp.add(l3);
cp.add(jSP);
cp.add(msgText);
cp.add(sendBut);cp.add(jS
Pl);
sendBut.addActionListener
(this);
msgText.addActionListener
(this);
lstName.addMouseListener(this);
///////////////////////////////
try{
ct=(ChatMain)Naming.lookup("rmi://localhost/bansal");
}catch(Exception e){mainText.setText(mainText.getText()+"Error :Can't connect to
Server");}
th=new Thread(this,"mk");
th.start();
}
public void
run()
{
String
nam,nam1[];
nam1=new
String[50];
while(true)
{
try{ st=ct.getValue(sName);
if(st.length()>0 && st.compareTo(st1)!=0)
{
st1=st;
st=mainText.getText()
+"\n"+st;
mainText.insert(st,0);
mainText.setText("");
}
try{
nam=ct.getName();
lstName.removeAll();
int k=0;
for(int i=0;i<nam.length();i++)
{
int j;
j=nam.indexOf(":",i);
if(nam.substring(i,j)!
=null)
nam1[k]=nam.substrin
g(i,j); k++;
i=j;
}
String mk1[]=new String[k];
for(int i=0;i<k;i++)
mk1[i]=nam1[i];
lstName.setListData(mk1);
+e1); }catch(Exception e1){System.out.println("Error during
} inserting names :"
uName=ct.getPersonal(sName);
if(uName.length()>0)
{
int
fla=0,l;
for(l=0;l<users.length && users[l]!=null;l++)
{
if(users[l].equals(uName))
fla=1
;
}
if(fla==
0)
{
users[l]=uNa
me;
final Personal p1=new
Personal(sName,uName);
p1.setTitle("ChatClient : " +uName);
p1.setSize(315,210);
p1.setResizable(false);
p1.setVisible(tr
ue);
p1.addWindowListener(new WindowAdapter(){public void
windowClosing(WindowEvent e1){p1.setVisible(false);}});
}
}
Thread.sleep(500);
}catch(Exception es){}
}
}
{
public void windowClosing(WindowEvent e1)
{ String tt=p1.getTitle();
tt=tt.substring(tt.indexOf(":
")+2);
System.out.println(tt);
} p1.setVisible(false);
});
}
}
}
}
catch(Exception abc){}
}
jSP.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROL
LBAR_ALWAYS);
jSP.setViewportView(main
Text);
sendBut=new JButton("Send");
jSP.setBounds(5,5,300,
150);
msgText.setBounds(5,160,225,2
0);
sendBut.setBounds(235,160,70,2
0); cp.add(jSP);cp.add(msgText);
cp.add(sendBut);
msgText.addActionListener
(this);
sendBut.addActionListener
(this); try{
ct1=(ChatMain)Naming.lookup("rmi://localhost/bansal");
}catch(Exception e){mainText.setText(mainText.getText()+"Error :Can't connect to
Server");}
th=new Thread(this,"mk1");
th.start();
}
public void run()
{
String
try{ st;
while(true)
{
st=ct1.getValue(uId,sId);
if(st.length()>0)
{
st=mainText.getText()
+"\n"+st;
mainText.setText("");
mainText.insert(st,0);
}
//mainText.insert(st +
"\n",0);
Thread.sleep(1000);
}
}catch(Exception es){}
}
}
Part 7
Progress Table
Conclusion
Bibliography
Progress Table:
-
9. Integration -
CONCLUSION
o User Friendly ness is provided, as user has to just login and use the
chat server.
o A user can only login by giving a unique user name.
o A no. of user can login at a time.
o All the information in the database is deleted time to time, so the
size of database will remain null most of the time.
o There are two type of chat facility provided:
-
Gro
up
chat
- Personal Chat
o Due to lake of time, there are no password mechanism. But
soon
I will implement it.
o Its only a text based chat system, but soon I will implement
voice chat also.
Bibliography
Fifth Edition