SlideShare a Scribd company logo
1 of 14
Generic Connection Framework
Prepared BY:
KADARI SHIVRAJ
M.Sc. Cyber Security,IIITMK
What is GCF?
-The GCF is a straightforward hierarchy of interfaces and classes to create connections (such
as HTTP, datagram, or streams) and perform I/O.(Oracle)
- GCF is a set of interfaces defined within the javax.microedition.io package.(IBM)
-generalization is possible through the use of:
I. An interface hierarchy that is extensible
II. A connection factory
III. Standard Uniform Resource Locators (URLs) to indicate the connection types to create
I) An interface hierarchy that is extensible:-
New connection types, which are defined and standardized via the Java Community
Process (JCP), can be added by defining a new Connection subtype and supporting classes,
providing a Connector factory class that supports the newly defined connection type, and
defining a new URL scheme that identifies the new connection type.
II)Connection Factory: A connection factory is the object a client uses to create
a connection to a provider. It encapsulates a set of connection configuration parameters that
has been defined by an administrator.
III) A URL (Uniform Resource Locator), as the name suggests, provides a way to locate a
resource on the web, the hypertext system that operates over the internet. The URL contains
the name of the protocol to be used to access the resource and a resource name. The first part
of a URL identifies what protocol to use. The second part identifies the IP address or domain
name where the resource is located.
The CLDC Generic Connection Framework Interface
Hierarchy and Related Classes
GCF class support for HTTP
1)Connection:This method closes the connection.
The Connection interface has one method:
void close
2) InputConnection:
The InputConnection interface has two methods:
DataInputStream openDataInputStream()
This method opens a data input stream from the connection.
InputStream openInputStream()
This method opens an input stream from the connection.
3)OutputConnection:
The OutputConnection interface has two methods:
i)DataOutputStream openDataOutputStream()
This method opens a data output stream from the connection.
ii)OutputStream openOutputStream()
This method opens an output stream from the connection.
4) DatagramConnection
The DatagramConnection interface is used to create a datagram for a UDP communication.
int getMaximumLength()
This method returns the maximum length that is allowed for a datagram packet.
int getNominalLength()
This method returns the nominal length for datagram packets.
Datagram newDatagram(byte[] buf, int size)
This method creates a new Datagram object. Ais the placeholder for the data packet, and size is the
length of the buffer to be allocated for the Datagram object.
• Datagram newDatagram(byte[] buf, int size, String addr)
• This method creates a new Datagram object. The additional parameter addr specifies the
destination of this datagram message. It is in the format {protocol}://[{host}]:{port}.
• Datagram newDatagram(int size)
• This method creates a new Datagram object with an automatically allocated buffer with
length size.Datagram newDatagram(int size, String addr)
• This method creates a new Datagram object. addr specifies the destination of this datagram
message.
• void receive(Datagram dgram)
• This method receives a Datagram object dgram from the remote host.
• void send(Datagram dgram)
• This method sends a Datagram object dgram to the remote host.
5) StreamConnection
The StreamConnection interface offers both send and receive capabilities for socket-based
communication. All four of its methods are inherited from InputConnection and
OutputConnection:
• DataInputStream openDataInputStream()
• InputStream openInputStream()
• DataOutputStream openDataOutputStream()
• OutputStream openOutputStream()
6) StreamConnectionNotifier
The StreamConnectionNotifier interface has one method:
• StreamConnection acceptAndOpen()
This method returns a StreamConnection that represents a server-side socket connection to
communicate with a client.
7) ContentConnection
• The ContentConnection interface extends from StreamConnection and adds three methods to
determine an HTTP stream's character encoding, MIME type, and size:
i) String getEncoding()
• This method returns the value of the content-encoding in the HTTP header of an HTTP stream.
• long getLength()
• This method returns the value of the content-length in the HTTP header of an HTTP stream.
ii)String getType()
• This method returns the value of the content-type in the HTTP header of an HTTP stream.
• The methods inherited from StreamConnection are as follows:
• DataInputStream openDataInputStream()
• InputStream openInputStream()
• DataOutputStream openDataOutputStream()
• OutputStream openOutputStream()
8)HttpConnection
• The HttpConnection extends from ContentConnection.The HttpConnection interface is
mandatory for all MIDP vendor implementations. It adds the following methods to
support the HTTP 1.1 protocol:
 long getDate()
 long getExpiration()
 String getFile()
 String getHeaderField(int index)
 String getHeaderField(String name)
 long getHeaderFieldDate(String name, long def)
 int getHeaderFieldInt(String name, int def)
 String getHeaderFieldKey(int n)
 String getHost()
 long getLastModified()
 int getPort()
 String getProtocol()
 String getQuery()
 String getRef()
 String getRequestMethod()
 String getRequestProperty(String key)
 int getResponseCode()
 String getResponseMessage()
 String getURL()
 void setRequestMethod(String method)
 void setRequestProperty(String key, String value)
References:-
 https://www.oracle.com/technetwork/systems/index-155711.html
 https://www.ibm.com/developerworks/library/j-j2me4/
 http://www.informit.com/articles/article.aspx?p=131116&seqNum=4
THANK YOU

More Related Content

What's hot

HyperText Transfer Protocol
HyperText Transfer ProtocolHyperText Transfer Protocol
HyperText Transfer Protocolponduse
 
Web and http computer network
Web and http computer networkWeb and http computer network
Web and http computer networkAnil Pokhrel
 
Http and its Applications
Http and its ApplicationsHttp and its Applications
Http and its ApplicationsNayan Dagliya
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocolselvakumar_b1985
 
Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014Navaneethan Naveen
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer ProtocolRajan Pandey
 
HTTP Definition and Basics.
HTTP Definition and Basics.HTTP Definition and Basics.
HTTP Definition and Basics.Halah Salih
 
Computer networks unit v
Computer networks    unit vComputer networks    unit v
Computer networks unit vJAIGANESH SEKAR
 
transfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imaptransfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imapAKSHIT KOHLI
 
Unit 5 application layer
Unit 5 application layerUnit 5 application layer
Unit 5 application layerKritika Purohit
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik TambekarPratik Tambekar
 

What's hot (20)

HyperText Transfer Protocol
HyperText Transfer ProtocolHyperText Transfer Protocol
HyperText Transfer Protocol
 
Web and http computer network
Web and http computer networkWeb and http computer network
Web and http computer network
 
The HTTP and Web
The HTTP and Web The HTTP and Web
The HTTP and Web
 
Http and its Applications
Http and its ApplicationsHttp and its Applications
Http and its Applications
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
HTTP Basic
HTTP BasicHTTP Basic
HTTP Basic
 
Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
Application layer
Application layerApplication layer
Application layer
 
CS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKSCS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKS
 
Http Protocol
Http ProtocolHttp Protocol
Http Protocol
 
HTTP Definition and Basics.
HTTP Definition and Basics.HTTP Definition and Basics.
HTTP Definition and Basics.
 
Computer networks unit v
Computer networks    unit vComputer networks    unit v
Computer networks unit v
 
transfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imaptransfer protocols,ftp,smtp,pop,imap
transfer protocols,ftp,smtp,pop,imap
 
Unit 5 application layer
Unit 5 application layerUnit 5 application layer
Unit 5 application layer
 
Network layer
Network layerNetwork layer
Network layer
 
J2ME IO Classes
J2ME IO ClassesJ2ME IO Classes
J2ME IO Classes
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
 
Http Introduction
Http IntroductionHttp Introduction
Http Introduction
 
Network Protocol and TCP/IP
Network Protocol and TCP/IPNetwork Protocol and TCP/IP
Network Protocol and TCP/IP
 

Similar to Generic Connection Framework

Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project ReportKavita Sharma
 
Java Network Programming 1197644949195966 4
Java Network Programming 1197644949195966 4Java Network Programming 1197644949195966 4
Java Network Programming 1197644949195966 4chendi.bhargavi
 
Java Network Programming
Java Network ProgrammingJava Network Programming
Java Network Programmingbackdoor
 
Manual redes - network programming with j2 me wireless devices
Manual   redes - network programming with j2 me wireless devicesManual   redes - network programming with j2 me wireless devices
Manual redes - network programming with j2 me wireless devicesVictor Garcia Vara
 
Common gateway interface
Common gateway interfaceCommon gateway interface
Common gateway interfaceAnandita
 
SCWCD : The servlet model : CHAP : 2
SCWCD  : The servlet model : CHAP : 2SCWCD  : The servlet model : CHAP : 2
SCWCD : The servlet model : CHAP : 2Ben Abdallah Helmi
 
Networking Programming
Networking ProgrammingNetworking Programming
Networking Programmingssusere19c741
 
SCWCD : The servlet model CHAP : 2
SCWCD : The servlet model CHAP : 2SCWCD : The servlet model CHAP : 2
SCWCD : The servlet model CHAP : 2Ben Abdallah Helmi
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in JavaTushar B Kute
 
Network Programming in Java
Network Programming in JavaNetwork Programming in Java
Network Programming in JavaTushar B Kute
 
15network Programming Clients
15network Programming Clients15network Programming Clients
15network Programming ClientsAdil Jafri
 
Network Programming Clients
Network Programming ClientsNetwork Programming Clients
Network Programming ClientsAdil Jafri
 

Similar to Generic Connection Framework (20)

Scmad Chapter09
Scmad Chapter09Scmad Chapter09
Scmad Chapter09
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
 
Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project Report
 
Networking in Java
Networking in JavaNetworking in Java
Networking in Java
 
Java Network Programming 1197644949195966 4
Java Network Programming 1197644949195966 4Java Network Programming 1197644949195966 4
Java Network Programming 1197644949195966 4
 
Java Network Programming
Java Network ProgrammingJava Network Programming
Java Network Programming
 
Manual redes - network programming with j2 me wireless devices
Manual   redes - network programming with j2 me wireless devicesManual   redes - network programming with j2 me wireless devices
Manual redes - network programming with j2 me wireless devices
 
Common gateway interface
Common gateway interfaceCommon gateway interface
Common gateway interface
 
SCWCD : The servlet model : CHAP : 2
SCWCD  : The servlet model : CHAP : 2SCWCD  : The servlet model : CHAP : 2
SCWCD : The servlet model : CHAP : 2
 
Networking Programming
Networking ProgrammingNetworking Programming
Networking Programming
 
Intake 37 12
Intake 37 12Intake 37 12
Intake 37 12
 
28 networking
28  networking28  networking
28 networking
 
SCWCD : The servlet model CHAP : 2
SCWCD : The servlet model CHAP : 2SCWCD : The servlet model CHAP : 2
SCWCD : The servlet model CHAP : 2
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Network Programming in Java
Network Programming in JavaNetwork Programming in Java
Network Programming in Java
 
15network Programming Clients
15network Programming Clients15network Programming Clients
15network Programming Clients
 
Network Programming Clients
Network Programming ClientsNetwork Programming Clients
Network Programming Clients
 
Networking in python by Rj
Networking in python by RjNetworking in python by Rj
Networking in python by Rj
 
CS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKSCS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKS
 
Java seminar.pptx
Java seminar.pptxJava seminar.pptx
Java seminar.pptx
 

Recently uploaded

Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 

Recently uploaded (7)

Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 

Generic Connection Framework

  • 1. Generic Connection Framework Prepared BY: KADARI SHIVRAJ M.Sc. Cyber Security,IIITMK
  • 2. What is GCF? -The GCF is a straightforward hierarchy of interfaces and classes to create connections (such as HTTP, datagram, or streams) and perform I/O.(Oracle) - GCF is a set of interfaces defined within the javax.microedition.io package.(IBM) -generalization is possible through the use of: I. An interface hierarchy that is extensible II. A connection factory III. Standard Uniform Resource Locators (URLs) to indicate the connection types to create
  • 3. I) An interface hierarchy that is extensible:- New connection types, which are defined and standardized via the Java Community Process (JCP), can be added by defining a new Connection subtype and supporting classes, providing a Connector factory class that supports the newly defined connection type, and defining a new URL scheme that identifies the new connection type. II)Connection Factory: A connection factory is the object a client uses to create a connection to a provider. It encapsulates a set of connection configuration parameters that has been defined by an administrator. III) A URL (Uniform Resource Locator), as the name suggests, provides a way to locate a resource on the web, the hypertext system that operates over the internet. The URL contains the name of the protocol to be used to access the resource and a resource name. The first part of a URL identifies what protocol to use. The second part identifies the IP address or domain name where the resource is located.
  • 4. The CLDC Generic Connection Framework Interface Hierarchy and Related Classes
  • 5. GCF class support for HTTP
  • 6. 1)Connection:This method closes the connection. The Connection interface has one method: void close 2) InputConnection: The InputConnection interface has two methods: DataInputStream openDataInputStream() This method opens a data input stream from the connection. InputStream openInputStream() This method opens an input stream from the connection.
  • 7. 3)OutputConnection: The OutputConnection interface has two methods: i)DataOutputStream openDataOutputStream() This method opens a data output stream from the connection. ii)OutputStream openOutputStream() This method opens an output stream from the connection. 4) DatagramConnection The DatagramConnection interface is used to create a datagram for a UDP communication. int getMaximumLength() This method returns the maximum length that is allowed for a datagram packet. int getNominalLength() This method returns the nominal length for datagram packets. Datagram newDatagram(byte[] buf, int size) This method creates a new Datagram object. Ais the placeholder for the data packet, and size is the length of the buffer to be allocated for the Datagram object.
  • 8. • Datagram newDatagram(byte[] buf, int size, String addr) • This method creates a new Datagram object. The additional parameter addr specifies the destination of this datagram message. It is in the format {protocol}://[{host}]:{port}. • Datagram newDatagram(int size) • This method creates a new Datagram object with an automatically allocated buffer with length size.Datagram newDatagram(int size, String addr) • This method creates a new Datagram object. addr specifies the destination of this datagram message. • void receive(Datagram dgram) • This method receives a Datagram object dgram from the remote host. • void send(Datagram dgram) • This method sends a Datagram object dgram to the remote host.
  • 9. 5) StreamConnection The StreamConnection interface offers both send and receive capabilities for socket-based communication. All four of its methods are inherited from InputConnection and OutputConnection: • DataInputStream openDataInputStream() • InputStream openInputStream() • DataOutputStream openDataOutputStream() • OutputStream openOutputStream() 6) StreamConnectionNotifier The StreamConnectionNotifier interface has one method: • StreamConnection acceptAndOpen() This method returns a StreamConnection that represents a server-side socket connection to communicate with a client.
  • 10. 7) ContentConnection • The ContentConnection interface extends from StreamConnection and adds three methods to determine an HTTP stream's character encoding, MIME type, and size: i) String getEncoding() • This method returns the value of the content-encoding in the HTTP header of an HTTP stream. • long getLength() • This method returns the value of the content-length in the HTTP header of an HTTP stream. ii)String getType() • This method returns the value of the content-type in the HTTP header of an HTTP stream. • The methods inherited from StreamConnection are as follows: • DataInputStream openDataInputStream() • InputStream openInputStream() • DataOutputStream openDataOutputStream() • OutputStream openOutputStream()
  • 11. 8)HttpConnection • The HttpConnection extends from ContentConnection.The HttpConnection interface is mandatory for all MIDP vendor implementations. It adds the following methods to support the HTTP 1.1 protocol:  long getDate()  long getExpiration()  String getFile()  String getHeaderField(int index)  String getHeaderField(String name)  long getHeaderFieldDate(String name, long def)  int getHeaderFieldInt(String name, int def)  String getHeaderFieldKey(int n)
  • 12.  String getHost()  long getLastModified()  int getPort()  String getProtocol()  String getQuery()  String getRef()  String getRequestMethod()  String getRequestProperty(String key)  int getResponseCode()  String getResponseMessage()  String getURL()  void setRequestMethod(String method)  void setRequestProperty(String key, String value)