Get Started with Java

Install Java Development Kit

Download and install a JDK of your choice from the following vendors. Java versions 8 through 12 are supported.

Oracle: https://www.oracle.com/technetwork/java/javase/downloads/index.html
Amazon: https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html
RedHat: https://developers.redhat.com/products/openjdk/download
GraalVM: https://www.graalvm.org/downloads/

Install Maven

Download and install Maven from https://maven.apache.org/download.cgi

Get Sample Projects

Path 1: Using the Symphony Bot Generator

The easiest way to bootstrap new projects is by using the Symphony Bot Generator. This requires NodeJS and 2 npm packages. If your organisation does not allow the installation of NodeJS, refer to Path 2.

Install NodeJS

Install Yeoman and Symphony Generator

  • Run the command: npm i -g yo generator-symphony
  • Verify the installation by running the command: yo
    • You should see Symphony in the generators list
    • Press CTRL+C / CMD+C to exit

Run Bot Generator

  • Run the command: yo symphony
  • Answer the questions as follows:

📘

Bot Generator

What do you want to create? bot
What is the name of your project? my-bot-project (rename as desired)
What is your POD subdomain? my-company (provide your actual pod sub-domain)
What is your preferred programming language? Java
What is the BOT username? my-bot-username (rename as desired)
What is the BOT email address? [email protected] (rename as desired)
What is your preferred encryption technology? RSA - Generate New Keys
Which template do you want to start with? Request/Reply

Path 2: Clone Example Project from GitHub

This method only has the basic request-reply sample.

mkdir rsa
cd rsa
openssl genrsa -out rsa-mybot-private.pem 4096
openssl rsa -in rsa-mybot-private.pem -pubout -out rsa-mybot-public.pem

Create Service Account

  1. Go to your pod's Admin and Compliance Portal (https://[my-company].symphony.com/?admin)
  2. Create an Account > Service Account
  3. Fill in desired bot username and other details
  4. Paste in RSA public key from previous section
  5. Create

Fill Configuration File

  • If you've created the project using the bot generator, the config.json file should be more or less operational
    • If not, please review all items in the file and revise the values as appropriate
  • You will need to make these changes if your environment has the following:
    • an on-premise key manager (change keyAuthHost and keyAuthPort)
    • an on-premise API Agent (change agentHost and agentPort)
    • requirement for a proxy server to access the Internet (see next section)

Proxy Configuration

If you require proxy, add either proxyURL or podProxyURL to your config.json.

Proxy ConfigurationCloud API AgentOn-Premise API Agent
proxyURL
proxyUsername
proxyPassword

podProxyURL
podProxyUsername
podProxyPassword

Additionally, if you are using a cloud key manager, add keyManagerProxyURL.

Proxy ConfigurationCloud Key Manager
keyManagerProxyURL
keyManagerProxyUsername
keyManagerProxyPassword

Truststore Configuration

You will need to ship a custom truststore together with your bot if:

  • You are using on-premise Key Managers / API Agents that serve non-publicly trusted SSL certificates (e.g. internal root CA-signed certificates)
  • Your default JDK cacerts truststore does not already trust the GoDaddy/DigiCert root CA and intermediate certificates served on Symphony pods

The bot generator and sample project above both ship with a sample truststore that already contains the GoDaddy/DigiCert root CA and intermediary certificates served on Symphony pods. To add your own SSL certificates to the trust store:

  • Download all root and intermediate certificates in PEM format
  • For each certificate, run the command:
keytool -import -trustcacerts -keystore all_symphony_certs_truststore -storepass changeit -alias <your-cert-alias> -import -file <your-cert.pem>

Debug Project

Using IDE

Debug using standard Eclipse/IntelliJ Launch Configuration

Using Command Line

mvn install dependency:copy-dependencies
java -cp target/dependency/*:target/classes RequestReplyBot

Updated 10 months ago


Get Started with Java


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.