Creating an Adapter Project

Describes how to create an adapter project.

Pre/post processor

Procedure

  1. To create an adapter project, use the create-adpater script in the terminal or command prompt.
    • Command for Linux/MacOS X :
      /home/user/MasheryLocalSDK$ ./create-adapter.sh --project-name MyCustomAdapter --adapter-type TrafficEventListener --adapter-name MyCustomProcessor --package-name com.companyname.mashery.adapter
      
    • Command for MS Windows :
      C:\Users\Administrator\MasheryLocalSDK> create-adapter.bat --project-name MyCustomAdapter --adapter-type TrafficEventListener --adapter-name MyCustomProcessor --package-name com.companyname.mashery.adapter
      
  2. Change the project name, adapter name and package name.
    If you are running the script for first time, you will have to download the required libraries.
  3. Open the Java source MyCustomProcessor.java in a text editor and write the processing logic for pre and post processing.

Custom Authenticator

Procedure

  1. To create a project, use the create-adapter script in the terminal or command prompt.
    • Command for Linux/MacOS X :
      /home/user/MasheryLocalSDK$ ./create-adapter.sh --project-name MyCustomAdapter --adapter-type Authenticator --adapter-name MyCustomAuthenticator --package-name com.companyname.mashery.adapter
      
    • Command for MS Windows :
      C:\Users\Administrator\MasheryLocalSDK> create-adapter.bat --project-name MyCustomAdapter --adapter-type Authenticator --adapter-name MyCustomAuthenticator --package-name com.companyname.mashery.adapter
      
  2. Change the project name, adapter name and package name.
    If you are running the script for first time, you will have to download the required libraries.
  3. Open the Java source MyCustomProcessor.java in a text editor and implement authenticator logic.
    Note: To edit in an IDE, refer to Using the Adapter SDK in an IDE.