Skip to content

Embloy/Embloy-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Embloy's Java SDK for interacting with your Embloy integration.

Usage

Add Embloy-Java SDK:

/*
  For Gradle, add the following dependency to your build.gradle and replace with
  the version number you want to use from:
  - https://mvnrepository.com/artifact/com.embloy/sdk or
  - https://github.com/embloy/embloy-java/releases/latest
*/
implementation "com.embloy:sdk:0.1.14"
/*
  For Gradle with Kotlin, add the following dependency to your build.gradle.kts and replace with
  the version number you want to use from:
  - https://mvnrepository.com/artifact/com.embloy/sdk or
  - https://github.com/embloy/embloy-java/releases/latest
*/
implementation("com.embloy:sdk:0.1.14")
<!--
  For Maven, add the following dependency to your POM and replace with the
  version number you want to use from:
  - https://mvnrepository.com/artifact/com.embloy/sdk or
  - https://github.com/embloy/embloy-java/releases/latest
-->
<dependency>
  <groupId>com.embloy</groupId>
  <artifactId>sdk</artifactId>
  <version>0.1.14</version>
</dependency>

Integrate it in your service:

import embloy.EmbloyClient;
import embloy.EmbloySession;

public class ExampleClass {
    public static void exampleEndpoint() {
        // Replace these values with your actual client token and session data
        String clientToken = "your-client-token";

        EmbloySession session = new EmbloySession(EmbloySession.EmbloyRequestMode.JOB_MODE, "your-job-slug", "your-success-url", "your-cancel-url");

        EmbloyClient embloyClient = new EmbloyClient(clientToken, session);

        try {
            String applyUrl = embloyClient.makeRequest();
            System.out.println("Redirect URL: " + applyUrl);
        } catch (Exception e) {
            System.err.println("Error: " + e.getMessage());
        }
    }
}

Build package from source (Reference)

javac src/main/java/embloy/EmbloyClient.java src/main/java/embloy/EmbloySession.java

mvn clean install # you'll be prompted to insert your gpg key passphrase

mvn release:clean release:prepare release:perform

mvn clean deploy # or alternatively mvn clean deploy -P release

:::note Make sure to have set up correct credentials in your settings.xml file (Reference)

<settings>
    <profiles>
        <profile>
            <id>central</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <gpg.executable>gpg2</gpg.executable>
                <gpg.passphrase>passphrase</gpg.passphrase>
            </properties>
        </profile>
    </profiles>
    <servers>
        <server>
            <id>central</id>
            <username>token_id</username>
            <password>token_secret</password>
        </server>
    </servers>
</settings>

:::

© Carlo Bortolan, Jan Hummel

Carlo Bortolan  ·  GitHub @carlobortolan  ·  contact via bortolanoffice@embloy.com

Jan Hummel  ·  GitHub @github4touchdouble  ·  contact via hummeloffice@embloy.com