SlideShare a Scribd company logo
1 of 26
Connection Management
Srilatha Kante
Objective
• Overview of Devkit
• Custom Connector Creation
• Connection Management Framework introduction
• Authentication Protocols
• Connection Management Annotation
• Connection Management Devkit Annotations
Overview of Devkit
• What is Devkit?
• Devkit has the tooling and interfaces for the custom connector creation
• Where to get it?
• Devkit can be found as a plugin to the Anypoint Studio in update sites.
• What it does?
• Devkit provides all the supporting tools and pulls all the dependency
interfaces in order to create our own custom connector.
Custom Connector Creation
• Anypoint Studio supports to create our own connector project
• Steps :
• New – Select Anypoint Connector Project
• This should be maven based project
• Should automatically pull all the dependencies for the connector project
• Look for the FunctionalTest java file which is implemented with the sample
processor.
• By default there should be Greet operation implemented for this connector
Connection Management
• The Connection Management framework provides multi-tenancy
capabilities for a connector (managing multiple simultaneous
connections with different credentials for each connector within your
application), as well as connection pooling and instance pooling.
• These benefits are available for most authentication schemes other
than OAuth, and for APIs that do not require authentication. Basic
Authentication is designated in a connector with the
@ConnectionManagement attribute.
About Connection Management
• Transparent multi-tenancy – A Mule application can open many
connections to a single target using different credentials to connect
on behalf of many users simultaneously.
• Connection pooling – Automated management of a pool of instances
of the connector class to manage connection resources effectively.
• Exceptions - The ability to automatically invalidate connections on
exceptions and to reconnect as needed.
Connection Management Framework and
Authentication Protocols
• Connection Management framework in conjunction with most
authentication protocols, such as
• username and password authentication (most common),
• SAML,
• Kerberos,
• LDAP,
• NTLM
• OAuth related annotations can be used for more OAuth based
authentication
Connection Management Annotation
• @ConnectionManagement uses following method level annotations
• @Connect method - Creates a connection
• @Disconnect method - Explicitly closes a connection
• @ValidateConnection method - Returns true if a connection is still valid, false
otherwise
• @ConnectionIdentifier method - Returns a prefix used in generating unique
identifiers for connector instances in the connection pool
ConnectionManagementStrategy class
• @ConnectionManagement(friendlyName="Connector Connection")
public class ConnectionManagementStrategy{
@Connect @TestConnectivity public void
connect(@ConnectionKey String username, @Password String
password){ ... }
@Disconnect public void disconnect() { client = null; }
@ValidateConnection public boolean isConnected() { return client !=
null; }
@ConnectionIdentifier public String connectionId() { return
client.toString(); } }
Note:
• All the annotated methods are called automatically as needed by the
DevKit framework; you never call them directly from your code
@Connector class
• @Connector(name = "connector")
public class MyConnectorWithConnectionManagement {
@ConnectionStrategy
@Config
ConnectorConfig config;
private ConnectionManagementStrategy strategy;
/** * Processors */
}
In Connector Class
@Connect
• This method is responsible for creating a connection to the target.
• The @Connect method is called automatically by Mule when the
connector starts up, or if the connection to the API has been lost and
must be reestablished.
• When this method finishes, if authentication is successful, the
connector instance is ready to make operations
More on @Connect
• A method annotated with @Connect must:
• Be public
• Throw org.mule.api.ConnectionException (and no other exceptions)
• Have a void return type
• Annotate only one method with @Connect
• Annotate @Connect method with @TestConnectivity
• Annotate at least one parameter with @ConnectionKey
Example of @Connect
@TestConnectivity
• Annotation displays a button in Anypoint Studio when configuring the
Connector, this button allows the user to test if the connection is
successful with his configuration.
• @TestConnectivity runs @Connect method and expects an
org.mule.api.ConnectionExcetion, if this exception occurs then the
test fails, if not connection is assumed successful.
• This can be set as inactive by specifying,
• @TestConnectivity(active = false)
@ConnectionKey
• For username and password authentication, the username is the
obvious choice for @ConnectionKey
• For other protocols, identify the value that is most obviously
associated with different users and access privileges that connect to
your service, and use this value as your @ConnectionKey
@Disconnect
• This annotation indicates the method inside a
@ConnectionManagement class that is responsible for disposal of a
connection. This method is called when the connector is shut down
or the connection is explicitly terminated.
• A method annotated with @Disconnect must:
Be public
Take no input parameters
Have a void return type
The class must have exactly one annotated @Disconnect method
@Disconnect Example
@ValidateConnection
• This method is called by Mule to check whether the connection is
actually open or not.
• A method annotated with @ValidateConnection
• Be public
• Take no input parameters
• Return boolean or java.lang.Boolean
• Only one method on the class can be annotated with @ValidateConnection
Example of ValidateConnection
• @ValidateConnection
public boolean isConnected() {
return connection != null;
}
@ConnectionIdentifier
• This annotation identifies a method inside the
@ConnectionManagement class that returns a unique identifier for
the connection, used for logging and debugging.
• A method annotated with @ConnectionIdentifier must,
• Be public
• Not be static
• Not take arguments
• Return java.lang.String
• Annotate only one method with @ConnectionIdentifier
@ConnectionIdentifier
• This code returns the connection
SessionId as an identifier (if
available).
• The SessionHeader object in this
case contains header
information about the current
connection to the API, including
the session ID.
@ReconnectOn
• Receives list of exceptions instead of just a single exception, and can
be used at both the class and processor levels.
• This annotation is used for exception handling related to connections.
It can be used at class level or at a method level. If the Connector or
Processor throws an exception of this class @ReconnectOn then
automatically invalidates the connection
• @ReconnectOn receives a list containing the classes of the exceptions
to be caught.
When an exception occurs, the @ReconnectOn behavior is based on the configured reconnection strategy
Example @ReconnectOn
• @Processor @ReconnectOn(exceptions = {InvalidSessionFault.class,
PasswordChangedException.class})
public void myOperation(@Optional String source, @Optional Object
destination) throws InvalidSessionFault, PasswordChangedException,
InvalidParameterException {
/** * CODE FOR MY OPERATION */
}
Enjoy Your Connector!!
Thank You

More Related Content

What's hot

Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium  Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium Zoe Gilbert
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionGanuka Yashantha
 
Write testable code in java, best practices
Write testable code in java, best practicesWrite testable code in java, best practices
Write testable code in java, best practicesMarian Wamsiedel
 
Testing with laravel
Testing with laravelTesting with laravel
Testing with laravelDerek Binkley
 
Dependency injection
Dependency injectionDependency injection
Dependency injectionEugenio Lentini
 
3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_kIBM
 
SQL Injection in JAVA
SQL Injection in JAVASQL Injection in JAVA
SQL Injection in JAVAHossein Yavari
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureAllan Huang
 
CNIT 129S: 9: Attacking Data Stores (Part 2 of 2)
CNIT 129S: 9: Attacking Data Stores (Part 2 of 2)CNIT 129S: 9: Attacking Data Stores (Part 2 of 2)
CNIT 129S: 9: Attacking Data Stores (Part 2 of 2)Sam Bowne
 
Ivan Pashko - Simplifying test automation with design patterns
Ivan Pashko - Simplifying test automation with design patternsIvan Pashko - Simplifying test automation with design patterns
Ivan Pashko - Simplifying test automation with design patternsIevgenii Katsan
 
Object-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & ProgrammingObject-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & ProgrammingAllan Mangune
 
What are the components in React?
What are the components in React?What are the components in React?
What are the components in React?BOSC Tech Labs
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApiRaffaele Rialdi
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentationAndrei Burian
 
Spray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSpray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSandeep Purohit
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentChui-Wen Chiu
 
Rpt ppt
Rpt pptRpt ppt
Rpt pptsindhu T
 
Testing Java applications with Maveryx
Testing Java applications with MaveryxTesting Java applications with Maveryx
Testing Java applications with MaveryxMaveryx
 

What's hot (20)

Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium  Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introduction
 
Write testable code in java, best practices
Write testable code in java, best practicesWrite testable code in java, best practices
Write testable code in java, best practices
 
Testing with laravel
Testing with laravelTesting with laravel
Testing with laravel
 
Dependency injection
Dependency injectionDependency injection
Dependency injection
 
3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k
 
SQL Injection in JAVA
SQL Injection in JAVASQL Injection in JAVA
SQL Injection in JAVA
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered Architecture
 
CNIT 129S: 9: Attacking Data Stores (Part 2 of 2)
CNIT 129S: 9: Attacking Data Stores (Part 2 of 2)CNIT 129S: 9: Attacking Data Stores (Part 2 of 2)
CNIT 129S: 9: Attacking Data Stores (Part 2 of 2)
 
Ivan Pashko - Simplifying test automation with design patterns
Ivan Pashko - Simplifying test automation with design patternsIvan Pashko - Simplifying test automation with design patterns
Ivan Pashko - Simplifying test automation with design patterns
 
Object-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & ProgrammingObject-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & Programming
 
What are the components in React?
What are the components in React?What are the components in React?
What are the components in React?
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApi
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentation
 
Backbone js
Backbone jsBackbone js
Backbone js
 
Spray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSpray - Build RESTfull services in scala
Spray - Build RESTfull services in scala
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Rpt ppt
Rpt pptRpt ppt
Rpt ppt
 
Testing Java applications with Maveryx
Testing Java applications with MaveryxTesting Java applications with Maveryx
Testing Java applications with Maveryx
 

Viewers also liked

Java-JSON-Jackson
Java-JSON-JacksonJava-JSON-Jackson
Java-JSON-JacksonSrilatha Kante
 
Mule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuthMule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuthSara Peralta
 
Mule message
Mule messageMule message
Mule messageMarta Bryla
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopesRamakrishna kapa
 
Anypoint platform security components
Anypoint platform security componentsAnypoint platform security components
Anypoint platform security componentsD.Rajesh Kumar
 
Mule message structure
Mule message structureMule message structure
Mule message structureSrilatha Kante
 
Mule exception handlingstrategies
Mule exception handlingstrategiesMule exception handlingstrategies
Mule exception handlingstrategiesD.Rajesh Kumar
 
Invoke component
Invoke componentInvoke component
Invoke componentSrilatha Kante
 
Mule message structure
Mule message structureMule message structure
Mule message structureShanky Gupta
 
Connection management
Connection managementConnection management
Connection managementSrilatha Kante
 

Viewers also liked (19)

Mule advanced
Mule advancedMule advanced
Mule advanced
 
Mule esb domain
Mule esb domainMule esb domain
Mule esb domain
 
Java component
Java componentJava component
Java component
 
Java-JSON-Jackson
Java-JSON-JacksonJava-JSON-Jackson
Java-JSON-Jackson
 
Mule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuthMule Cloud Connectors-Save and Load OAuth
Mule Cloud Connectors-Save and Load OAuth
 
Mule_Portal
Mule_PortalMule_Portal
Mule_Portal
 
Web services
Web servicesWeb services
Web services
 
Mule message
Mule messageMule message
Mule message
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopes
 
MMC
MMCMMC
MMC
 
Logger
LoggerLogger
Logger
 
Anypoint platform security components
Anypoint platform security componentsAnypoint platform security components
Anypoint platform security components
 
Mule message structure
Mule message structureMule message structure
Mule message structure
 
Mule exception handlingstrategies
Mule exception handlingstrategiesMule exception handlingstrategies
Mule exception handlingstrategies
 
Invoke component
Invoke componentInvoke component
Invoke component
 
Mule message structure
Mule message structureMule message structure
Mule message structure
 
Atm
AtmAtm
Atm
 
Atm
AtmAtm
Atm
 
Connection management
Connection managementConnection management
Connection management
 

Similar to Connection management

Anypoint connector dev kit
Anypoint connector dev kitAnypoint connector dev kit
Anypoint connector dev kitSon Nguyen
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationStephen Fuqua
 
Anypointconnectordevkit 160816041722
Anypointconnectordevkit 160816041722Anypointconnectordevkit 160816041722
Anypointconnectordevkit 160816041722ppts123456
 
Unit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step TrainingUnit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step TrainingRam Awadh Prasad, PMP
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Justin Ison
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3Buu Nguyen
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lessonSadaaki Emura
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Steven Smith
 
Test driven
Test drivenTest driven
Test drivenAnand Iyer
 
Testing, a pragmatic approach
Testing, a pragmatic approachTesting, a pragmatic approach
Testing, a pragmatic approachEnrico Da Ros
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing SoftwareSteven Smith
 
Azure serverless architectures
Azure serverless architecturesAzure serverless architectures
Azure serverless architecturesBenoit Le Pichon
 
Take Your Web Development To The Next Level With These Top 2 Libraries
Take Your Web Development To The Next Level With These Top 2 LibrariesTake Your Web Development To The Next Level With These Top 2 Libraries
Take Your Web Development To The Next Level With These Top 2 LibrariesPolyxer Systems
 
Cache Security- Configuring a Secure Environment
Cache Security- Configuring a Secure EnvironmentCache Security- Configuring a Secure Environment
Cache Security- Configuring a Secure EnvironmentInterSystems Corporation
 
Code your Own: Authentication Provider for Blackboard Learn
Code your Own: Authentication Provider for Blackboard LearnCode your Own: Authentication Provider for Blackboard Learn
Code your Own: Authentication Provider for Blackboard LearnDan Rinzel
 
How to build custom connectors in MuleSOft
How to build custom connectors in MuleSOftHow to build custom connectors in MuleSOft
How to build custom connectors in MuleSOftSanthosh Ramagiri
 
Testing the Untestable
Testing the UntestableTesting the Untestable
Testing the UntestableMark Baker
 

Similar to Connection management (20)

Anypoint connector dev kit
Anypoint connector dev kitAnypoint connector dev kit
Anypoint connector dev kit
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test Automation
 
Anypointconnectordevkit 160816041722
Anypointconnectordevkit 160816041722Anypointconnectordevkit 160816041722
Anypointconnectordevkit 160816041722
 
Unit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step TrainingUnit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step Training
 
Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014Helpful Automation Techniques - Selenium Camp 2014
Helpful Automation Techniques - Selenium Camp 2014
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lesson
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
java.pptx
java.pptxjava.pptx
java.pptx
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016
 
Test driven
Test drivenTest driven
Test driven
 
Testing, a pragmatic approach
Testing, a pragmatic approachTesting, a pragmatic approach
Testing, a pragmatic approach
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
Azure serverless architectures
Azure serverless architecturesAzure serverless architectures
Azure serverless architectures
 
Take Your Web Development To The Next Level With These Top 2 Libraries
Take Your Web Development To The Next Level With These Top 2 LibrariesTake Your Web Development To The Next Level With These Top 2 Libraries
Take Your Web Development To The Next Level With These Top 2 Libraries
 
Cache Security- Configuring a Secure Environment
Cache Security- Configuring a Secure EnvironmentCache Security- Configuring a Secure Environment
Cache Security- Configuring a Secure Environment
 
Code your Own: Authentication Provider for Blackboard Learn
Code your Own: Authentication Provider for Blackboard LearnCode your Own: Authentication Provider for Blackboard Learn
Code your Own: Authentication Provider for Blackboard Learn
 
How to build custom connectors in MuleSOft
How to build custom connectors in MuleSOftHow to build custom connectors in MuleSOft
How to build custom connectors in MuleSOft
 
Testing the Untestable
Testing the UntestableTesting the Untestable
Testing the Untestable
 
Mvc
MvcMvc
Mvc
 

Recently uploaded

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 

Recently uploaded (20)

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 

Connection management

  • 2. Objective • Overview of Devkit • Custom Connector Creation • Connection Management Framework introduction • Authentication Protocols • Connection Management Annotation • Connection Management Devkit Annotations
  • 3. Overview of Devkit • What is Devkit? • Devkit has the tooling and interfaces for the custom connector creation • Where to get it? • Devkit can be found as a plugin to the Anypoint Studio in update sites. • What it does? • Devkit provides all the supporting tools and pulls all the dependency interfaces in order to create our own custom connector.
  • 4. Custom Connector Creation • Anypoint Studio supports to create our own connector project • Steps : • New – Select Anypoint Connector Project • This should be maven based project • Should automatically pull all the dependencies for the connector project • Look for the FunctionalTest java file which is implemented with the sample processor. • By default there should be Greet operation implemented for this connector
  • 5. Connection Management • The Connection Management framework provides multi-tenancy capabilities for a connector (managing multiple simultaneous connections with different credentials for each connector within your application), as well as connection pooling and instance pooling. • These benefits are available for most authentication schemes other than OAuth, and for APIs that do not require authentication. Basic Authentication is designated in a connector with the @ConnectionManagement attribute.
  • 6. About Connection Management • Transparent multi-tenancy – A Mule application can open many connections to a single target using different credentials to connect on behalf of many users simultaneously. • Connection pooling – Automated management of a pool of instances of the connector class to manage connection resources effectively. • Exceptions - The ability to automatically invalidate connections on exceptions and to reconnect as needed.
  • 7. Connection Management Framework and Authentication Protocols • Connection Management framework in conjunction with most authentication protocols, such as • username and password authentication (most common), • SAML, • Kerberos, • LDAP, • NTLM • OAuth related annotations can be used for more OAuth based authentication
  • 8. Connection Management Annotation • @ConnectionManagement uses following method level annotations • @Connect method - Creates a connection • @Disconnect method - Explicitly closes a connection • @ValidateConnection method - Returns true if a connection is still valid, false otherwise • @ConnectionIdentifier method - Returns a prefix used in generating unique identifiers for connector instances in the connection pool
  • 9. ConnectionManagementStrategy class • @ConnectionManagement(friendlyName="Connector Connection") public class ConnectionManagementStrategy{ @Connect @TestConnectivity public void connect(@ConnectionKey String username, @Password String password){ ... } @Disconnect public void disconnect() { client = null; } @ValidateConnection public boolean isConnected() { return client != null; } @ConnectionIdentifier public String connectionId() { return client.toString(); } }
  • 10. Note: • All the annotated methods are called automatically as needed by the DevKit framework; you never call them directly from your code
  • 11. @Connector class • @Connector(name = "connector") public class MyConnectorWithConnectionManagement { @ConnectionStrategy @Config ConnectorConfig config; private ConnectionManagementStrategy strategy; /** * Processors */ }
  • 13. @Connect • This method is responsible for creating a connection to the target. • The @Connect method is called automatically by Mule when the connector starts up, or if the connection to the API has been lost and must be reestablished. • When this method finishes, if authentication is successful, the connector instance is ready to make operations
  • 14. More on @Connect • A method annotated with @Connect must: • Be public • Throw org.mule.api.ConnectionException (and no other exceptions) • Have a void return type • Annotate only one method with @Connect • Annotate @Connect method with @TestConnectivity • Annotate at least one parameter with @ConnectionKey
  • 16. @TestConnectivity • Annotation displays a button in Anypoint Studio when configuring the Connector, this button allows the user to test if the connection is successful with his configuration. • @TestConnectivity runs @Connect method and expects an org.mule.api.ConnectionExcetion, if this exception occurs then the test fails, if not connection is assumed successful. • This can be set as inactive by specifying, • @TestConnectivity(active = false)
  • 17. @ConnectionKey • For username and password authentication, the username is the obvious choice for @ConnectionKey • For other protocols, identify the value that is most obviously associated with different users and access privileges that connect to your service, and use this value as your @ConnectionKey
  • 18. @Disconnect • This annotation indicates the method inside a @ConnectionManagement class that is responsible for disposal of a connection. This method is called when the connector is shut down or the connection is explicitly terminated. • A method annotated with @Disconnect must: Be public Take no input parameters Have a void return type The class must have exactly one annotated @Disconnect method
  • 20. @ValidateConnection • This method is called by Mule to check whether the connection is actually open or not. • A method annotated with @ValidateConnection • Be public • Take no input parameters • Return boolean or java.lang.Boolean • Only one method on the class can be annotated with @ValidateConnection
  • 21. Example of ValidateConnection • @ValidateConnection public boolean isConnected() { return connection != null; }
  • 22. @ConnectionIdentifier • This annotation identifies a method inside the @ConnectionManagement class that returns a unique identifier for the connection, used for logging and debugging. • A method annotated with @ConnectionIdentifier must, • Be public • Not be static • Not take arguments • Return java.lang.String • Annotate only one method with @ConnectionIdentifier
  • 23. @ConnectionIdentifier • This code returns the connection SessionId as an identifier (if available). • The SessionHeader object in this case contains header information about the current connection to the API, including the session ID.
  • 24. @ReconnectOn • Receives list of exceptions instead of just a single exception, and can be used at both the class and processor levels. • This annotation is used for exception handling related to connections. It can be used at class level or at a method level. If the Connector or Processor throws an exception of this class @ReconnectOn then automatically invalidates the connection • @ReconnectOn receives a list containing the classes of the exceptions to be caught. When an exception occurs, the @ReconnectOn behavior is based on the configured reconnection strategy
  • 25. Example @ReconnectOn • @Processor @ReconnectOn(exceptions = {InvalidSessionFault.class, PasswordChangedException.class}) public void myOperation(@Optional String source, @Optional Object destination) throws InvalidSessionFault, PasswordChangedException, InvalidParameterException { /** * CODE FOR MY OPERATION */ }