Create Custom Adapter in Java

This section provides information on creating custom adapter in Java:

  1. To set up Git access to the Longhorn Bitbucket repositories, contact CloudCenter Suite Support team.

  2. Install Java JDK locally, see https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html.

  3. Fetch source code of Java template adapter, perform the following:

    1. git clone, see Java Adapter Template.

    2. Under the template folder, git checkout dev.

  4. Make a clone of the adapter-template-java folder. Rename the folder to appropriate custom adapter name.

  5. Open the custom adapter project in an IDE like Visual Studio Code or another IDE and update the following files:

    1. Under actions folder, rename ActionJsonPathQuery.java to appropriate activity name, update activity inputs and outputs using proper convention.

    2. Under events folder, update EventResolver.java to add switch case to make a call to appropriate action class.

    3. Under Project Directory adapter-template-java, replace all adapter-template-java name with custom adapter name and add required dependencies for custom adapter in pom.xml.

  6. Under constants folder, update Constants.java to include input configurations.

  7. To create schema for adapters from UI, see Manage Schemas.

  8. On command line, go under the custom adapter folder and perform the following:

    1. Update Vendor folder to include any additional libraries.

    2. Create class files that should be overridden under the same path of the library where the actual class files exists.

    3. Run docker build command to build a docker image. Change adapter-template-java in the command to appropriate adapter name defined in demo-adapter.yaml:docker build . -t adapter-template-java -f Dockerfile

    4. Run the following kubectl command to deploy the custom adapter in Kubernetes cluster:kubectl create -f yaml/demo-adapter.yaml -n orch-platform 

  9. Open Action Orchestrator UI.

  10. Create New Workflow. Make sure that the custom adapter activities show up in the Workflow Editor toolbox and validate those activities.

  • No labels
© 2017-2019 Cisco Systems, Inc. All rights reserved