SlideShare a Scribd company logo
Overthere
  Design and implementation of a Java remote file and execution framework
xebialabs.com
                             Vincent Partington
                              CTO, XebiaLabs
Speaker


  •   Been working with Java since 1996. Built first production Servlet in
      1997.

  •   At Xebia since 2003, CTO of XebiaLabs since 2008.

  •   Interests: middleware, deployment automation, performance, security.
      Basically anything Java and hard!




xebialabs.com
Agenda


  •   Why Overthere?

  •   Exploring the API.

  •   Designing, extending and testing Overthere.




xebialabs.com
The problem

  •   For an internet language and an enterprise language, Java has pretty poor
      support for manipulating remote resources.

      •   Apache’s HttpClient is way better than JDK’s HTTP support.

      •   There is no facility to manipulate remote files (FTP, WebDAV, SFTP,
          SCP, CIFS, etc.)

      •   There is no facility to run commands on remote machines.



xebialabs.com
The solution


  •   Interfaces: java.io.File and java.lang.Process should’ve been interfaces!

  •   Factory: And there should be a factory to create instances of them!!

  •   SPI: And there should be an SPI to hook in new implementations!!!




xebialabs.com
Overthere


  •   OverthereFile - equivalent of java.io.File.

  •   OverthereProcess - equivalent of java.lang.Process.

  •   Overthere - the factory.

  •   OverthereConnectionBuilder - the SPI




xebialabs.com
Create a connection (Unix)




  ‣ Examine ExecuteOnUnix in the examples project.
xebialabs.com
Create a connection (Windows)




  ‣ Examine ExecuteOnWindows in the examples project.
xebialabs.com
Execute a command




  ‣ Run ExecuteOnUnix in the examples project.
xebialabs.com
Start a process




  ‣ Run StartProcess in the examples project.
xebialabs.com
Read a file




  ‣ Run ReadFile in the examples project.
xebialabs.com
Write a file




  ‣ Run WriteFile in the examples project.
xebialabs.com
Get info about a file




  ‣ Run GetFileInfo in the examples project.
xebialabs.com
Manipulate a file




  ‣ Run ManipulateFile in the examples project.
xebialabs.com
Manipulate a directory




  ‣ Run ManipulateDirectory in the examples project.
xebialabs.com
Supported technologies
  •       SSH - for Unix and Windows:

      •     SFTP - using SFTP for file transfer.

      •     SCP - using SCP for file transfer.

      •     SUDO - using SUDO for command execution (and SCP for file transfer).

      •     INTERACTIVE_SUDO - as SUDO but tries to answer sudo password prompts.

      •     SFTP_CYGWIN - using SFTP for file transfer, to a Windows host running OpenSSH on Cygwin.

      •     SFTP_WINSSHD - using SFTP for file transfer, to a Windows host running WinSSHD.

  •       CIFS - for Windows:

      •     TELNET - using Telnet for command execution.

      •     WINRM - using WinRM for command execution (Java implementation).

  •       LOCAL - Layer on top of java.io.File and java.lang.Process.


xebialabs.com
Advanced topics


  •   Designing Overthere.

  •   Extending Overthere.

  •   Testing Overthere.




xebialabs.com
Designing Overthere (1/4)



    •   Make OverthereFile an interface or a subclass of
        java.io.File?




xebialabs.com
Designing Overthere (2/4)



    •   Exceptions or booleans for delete(), mkdir(), mkdirs() and
        renameTo()?

    •   Use checked or unchecked exceptions?




xebialabs.com
Designing Overthere (3/4)




    •   Use JSch or SSH/J to handle SSH connections?




xebialabs.com
Designing Overthere (4/4)




    •   Telnet or WinRM for remote execution on Windows?




xebialabs.com
Extending Overthere - SPI
•   At startup, all classes implementing OverthereConnectionBuilder
    are found.

•   When a connection is created, all builders are invoked in turn to see if they
    can build a connection for that protocol and with those connection options.




‣ Examine LocalConnection and SshConnectionBuilder.
xebialabs.com
Testing Overthere


  •   How to test?

      •   Against target operating systems - Unix and Windows.

      •   Portable - no VMware images.

      •   From IDE (adhoc) and from build systems.




xebialabs.com
Subproject: itest-support
  •       Framework to allow for integration testing with virtual images.

  •       An ItestHost is a host against which to run tests.

  •       Created by invoking the ItestHostFactory.

  •       Depending on settings in itest.properties and system properties one of two
          things happens:

      •    A pointer to an existing host (VMware image or manually launched EC2 instance) is
           returned.

      •    An AMI is launched and when it has started up, a pointer to the EC2 is returned.

  •       At the end of the itest, any EC2 instances launched on-the-fly are terminated.

xebialabs.com
Some examples
  •   Parametrized tests to run multiple connection types on one platform:

      •   SCP, SFTP, etc. on Unix or

      •   TELNET, WINRM_HTTP, etc. on Windows.




  ‣ Examine OverthereOnUnixItest and its parent classes.
xebialabs.com
SSH tunneling

  •   Port 445 blocked by Amazon and many internet providers.

  •   Solution: create SSH tunnels when starting itests. And don’t forget to
      use the new host and port in your test code!




  ‣ Examine OverthereOnWindowsItest.setTypeAndOptions()

xebialabs.com
Ad-hoc usage

  •   Provisioning an EC2 AMI can take a while, especially provisioning a
      Windows AMI.

  •   Might even want to run just one test while developing a new feature.



  ‣ Examine overthere/itest.properties and
      overthere/src/test/resources/itest.properties.



xebialabs.com
Open source

  •   Overthere 1.0 is part of Deployit 3.5 and up.

  •   Overthere has been released as open source, under the ASLv2 license.

  •   Check the Github repository:
      https://github.com/xebialabs/overthere

  •   Have fun and don’t forget to mention any issues!

  •   Even better: send us a pull request with a fix. :-)


xebialabs.com
More information


  •   Overthere: https://github.com/xebialabs/overthere

  •   XebiaLabs: http://www.xebialabs.com/

  •   Integration testing: http://bit.ly/ess5Xh




xebialabs.com

More Related Content

PDF
Testing Automaton - CFSummit 2016
PDF
How do I Write Testable Javascript so I can Test my CF API on Server and Client
PPTX
Automated ui-testing
PPTX
My Database Skills Killed the Server
PDF
Hack & Fix, Hands on ColdFusion Security Training
PPTX
Scaling and Managing Selenium Grid
PDF
Deploying WO on Windows
PPTX
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
Testing Automaton - CFSummit 2016
How do I Write Testable Javascript so I can Test my CF API on Server and Client
Automated ui-testing
My Database Skills Killed the Server
Hack & Fix, Hands on ColdFusion Security Training
Scaling and Managing Selenium Grid
Deploying WO on Windows
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable

What's hot (20)

PDF
Hacking on WildFly 9
PDF
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
PDF
Securing Legacy CFML Code
PDF
Conquering AngularJS Limitations
PDF
Live Testing A Legacy App
PDF
Can you contain the future - Docker, Container Technologies, The Future, and You
PPTX
Manage your environment with DSC
PPTX
CollabSphere 2018 - Java in Domino After XPages
PPTX
Vagrant to-aws-flow
PDF
Oscp preparation
PDF
Testing the Enterprise layers, with Arquillian
KEY
Jellyfish, JSCONF 2011
PDF
Open stack and_vagrant-os-meetup-2015
PDF
Cfml features modern_coding
PDF
Gr8conf EU 2013 Speed up your development: GroovyServ and Grails Improx Plugin
PDF
Puppet Camp New York 2015: "Safer Puppet" in 4 quick demos (Beginner)
PDF
Locking Down CF Servers
PDF
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
ODP
Jenkins 101: Continuos Integration with Jenkins
KEY
Selenium Grid
Hacking on WildFly 9
How do I write Testable Javascript - Presented at dev.Objective() June 16, 2016
Securing Legacy CFML Code
Conquering AngularJS Limitations
Live Testing A Legacy App
Can you contain the future - Docker, Container Technologies, The Future, and You
Manage your environment with DSC
CollabSphere 2018 - Java in Domino After XPages
Vagrant to-aws-flow
Oscp preparation
Testing the Enterprise layers, with Arquillian
Jellyfish, JSCONF 2011
Open stack and_vagrant-os-meetup-2015
Cfml features modern_coding
Gr8conf EU 2013 Speed up your development: GroovyServ and Grails Improx Plugin
Puppet Camp New York 2015: "Safer Puppet" in 4 quick demos (Beginner)
Locking Down CF Servers
Oscar: Rapid Iteration with Vagrant and Puppet Enterprise - PuppetConf 2013
Jenkins 101: Continuos Integration with Jenkins
Selenium Grid
Ad

Similar to Presentation about Overthere for J-Fall 2011 (20)

PPT
Secure Ftp Java Style Rev004
PDF
Fluentd v1 and future at techtalk
PDF
Into The Box 2018 Automate Your Test
PPT
Perl Intro 6 Ftp
PPT
Integrating Active Networking and Commercial-Grade Routing Platforms
PPTX
¡El mejor lenguaje para automatizar pruebas!
PDF
Python tools for testing web services over HTTP
PDF
Apidays Paris 2023 - OpenAPI Extensibility - The Good, The Bad and The Ugly, ...
PDF
Deploying Hadoop-Based Bigdata Environments
PDF
Deploying Hadoop-based Bigdata Environments
PPTX
FlowER Erlang Openflow Controller
PDF
Balisage - EXPath - A practical introduction
PDF
XS Japan 2008 Xen Mgmt English
ODP
London Ceph Day: The Future of CephFS
PDF
Netty training
PDF
Dssh @ Confidence, Prague 2010
PDF
Ready player 2 Multiplayer Red Teaming Against macOS
PPT
Linux Based Advanced Routing with Firewall and Traffic Control
PDF
TDD for jenkins pipelines
PPT
Collaborative Workflow Development and Experimentation in the Digital Humanities
Secure Ftp Java Style Rev004
Fluentd v1 and future at techtalk
Into The Box 2018 Automate Your Test
Perl Intro 6 Ftp
Integrating Active Networking and Commercial-Grade Routing Platforms
¡El mejor lenguaje para automatizar pruebas!
Python tools for testing web services over HTTP
Apidays Paris 2023 - OpenAPI Extensibility - The Good, The Bad and The Ugly, ...
Deploying Hadoop-Based Bigdata Environments
Deploying Hadoop-based Bigdata Environments
FlowER Erlang Openflow Controller
Balisage - EXPath - A practical introduction
XS Japan 2008 Xen Mgmt English
London Ceph Day: The Future of CephFS
Netty training
Dssh @ Confidence, Prague 2010
Ready player 2 Multiplayer Red Teaming Against macOS
Linux Based Advanced Routing with Firewall and Traffic Control
TDD for jenkins pipelines
Collaborative Workflow Development and Experimentation in the Digital Humanities
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
1. Introduction to Computer Programming.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPT
Teaching material agriculture food technology
PPTX
Tartificialntelligence_presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
Mobile App Security Testing_ A Comprehensive Guide.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Reach Out and Touch Someone: Haptics and Empathic Computing
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
1. Introduction to Computer Programming.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
OMC Textile Division Presentation 2021.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Heart disease approach using modified random forest and particle swarm optimi...
cloud_computing_Infrastucture_as_cloud_p
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
TLE Review Electricity (Electricity).pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Teaching material agriculture food technology
Tartificialntelligence_presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MIND Revenue Release Quarter 2 2025 Press Release

Presentation about Overthere for J-Fall 2011

  • 1. Overthere Design and implementation of a Java remote file and execution framework xebialabs.com Vincent Partington CTO, XebiaLabs
  • 2. Speaker • Been working with Java since 1996. Built first production Servlet in 1997. • At Xebia since 2003, CTO of XebiaLabs since 2008. • Interests: middleware, deployment automation, performance, security. Basically anything Java and hard! xebialabs.com
  • 3. Agenda • Why Overthere? • Exploring the API. • Designing, extending and testing Overthere. xebialabs.com
  • 4. The problem • For an internet language and an enterprise language, Java has pretty poor support for manipulating remote resources. • Apache’s HttpClient is way better than JDK’s HTTP support. • There is no facility to manipulate remote files (FTP, WebDAV, SFTP, SCP, CIFS, etc.) • There is no facility to run commands on remote machines. xebialabs.com
  • 5. The solution • Interfaces: java.io.File and java.lang.Process should’ve been interfaces! • Factory: And there should be a factory to create instances of them!! • SPI: And there should be an SPI to hook in new implementations!!! xebialabs.com
  • 6. Overthere • OverthereFile - equivalent of java.io.File. • OverthereProcess - equivalent of java.lang.Process. • Overthere - the factory. • OverthereConnectionBuilder - the SPI xebialabs.com
  • 7. Create a connection (Unix) ‣ Examine ExecuteOnUnix in the examples project. xebialabs.com
  • 8. Create a connection (Windows) ‣ Examine ExecuteOnWindows in the examples project. xebialabs.com
  • 9. Execute a command ‣ Run ExecuteOnUnix in the examples project. xebialabs.com
  • 10. Start a process ‣ Run StartProcess in the examples project. xebialabs.com
  • 11. Read a file ‣ Run ReadFile in the examples project. xebialabs.com
  • 12. Write a file ‣ Run WriteFile in the examples project. xebialabs.com
  • 13. Get info about a file ‣ Run GetFileInfo in the examples project. xebialabs.com
  • 14. Manipulate a file ‣ Run ManipulateFile in the examples project. xebialabs.com
  • 15. Manipulate a directory ‣ Run ManipulateDirectory in the examples project. xebialabs.com
  • 16. Supported technologies • SSH - for Unix and Windows: • SFTP - using SFTP for file transfer. • SCP - using SCP for file transfer. • SUDO - using SUDO for command execution (and SCP for file transfer). • INTERACTIVE_SUDO - as SUDO but tries to answer sudo password prompts. • SFTP_CYGWIN - using SFTP for file transfer, to a Windows host running OpenSSH on Cygwin. • SFTP_WINSSHD - using SFTP for file transfer, to a Windows host running WinSSHD. • CIFS - for Windows: • TELNET - using Telnet for command execution. • WINRM - using WinRM for command execution (Java implementation). • LOCAL - Layer on top of java.io.File and java.lang.Process. xebialabs.com
  • 17. Advanced topics • Designing Overthere. • Extending Overthere. • Testing Overthere. xebialabs.com
  • 18. Designing Overthere (1/4) • Make OverthereFile an interface or a subclass of java.io.File? xebialabs.com
  • 19. Designing Overthere (2/4) • Exceptions or booleans for delete(), mkdir(), mkdirs() and renameTo()? • Use checked or unchecked exceptions? xebialabs.com
  • 20. Designing Overthere (3/4) • Use JSch or SSH/J to handle SSH connections? xebialabs.com
  • 21. Designing Overthere (4/4) • Telnet or WinRM for remote execution on Windows? xebialabs.com
  • 22. Extending Overthere - SPI • At startup, all classes implementing OverthereConnectionBuilder are found. • When a connection is created, all builders are invoked in turn to see if they can build a connection for that protocol and with those connection options. ‣ Examine LocalConnection and SshConnectionBuilder. xebialabs.com
  • 23. Testing Overthere • How to test? • Against target operating systems - Unix and Windows. • Portable - no VMware images. • From IDE (adhoc) and from build systems. xebialabs.com
  • 24. Subproject: itest-support • Framework to allow for integration testing with virtual images. • An ItestHost is a host against which to run tests. • Created by invoking the ItestHostFactory. • Depending on settings in itest.properties and system properties one of two things happens: • A pointer to an existing host (VMware image or manually launched EC2 instance) is returned. • An AMI is launched and when it has started up, a pointer to the EC2 is returned. • At the end of the itest, any EC2 instances launched on-the-fly are terminated. xebialabs.com
  • 25. Some examples • Parametrized tests to run multiple connection types on one platform: • SCP, SFTP, etc. on Unix or • TELNET, WINRM_HTTP, etc. on Windows. ‣ Examine OverthereOnUnixItest and its parent classes. xebialabs.com
  • 26. SSH tunneling • Port 445 blocked by Amazon and many internet providers. • Solution: create SSH tunnels when starting itests. And don’t forget to use the new host and port in your test code! ‣ Examine OverthereOnWindowsItest.setTypeAndOptions() xebialabs.com
  • 27. Ad-hoc usage • Provisioning an EC2 AMI can take a while, especially provisioning a Windows AMI. • Might even want to run just one test while developing a new feature. ‣ Examine overthere/itest.properties and overthere/src/test/resources/itest.properties. xebialabs.com
  • 28. Open source • Overthere 1.0 is part of Deployit 3.5 and up. • Overthere has been released as open source, under the ASLv2 license. • Check the Github repository: https://github.com/xebialabs/overthere • Have fun and don’t forget to mention any issues! • Even better: send us a pull request with a fix. :-) xebialabs.com
  • 29. More information • Overthere: https://github.com/xebialabs/overthere • XebiaLabs: http://www.xebialabs.com/ • Integration testing: http://bit.ly/ess5Xh xebialabs.com