WiseTime Connector

WiseTime Connector Library

License

License

GroupId

GroupId

io.wisetime
ArtifactId

ArtifactId

wisetime-connector
Last Version

Last Version

2.2.6
Release Date

Release Date

Type

Type

jar
Description

Description

WiseTime Connector
WiseTime Connector Library
Project URL

Project URL

https://wisetime.io/docs/connect/
Source Code Management

Source Code Management

https://github.com/wisetime-io/wisetime-connector-java

Download wisetime-connector

How to add to project

<!-- https://jarcasting.com/artifacts/io.wisetime/wisetime-connector/ -->
<dependency>
    <groupId>io.wisetime</groupId>
    <artifactId>wisetime-connector</artifactId>
    <version>2.2.6</version>
</dependency>
// https://jarcasting.com/artifacts/io.wisetime/wisetime-connector/
implementation 'io.wisetime:wisetime-connector:2.2.6'
// https://jarcasting.com/artifacts/io.wisetime/wisetime-connector/
implementation ("io.wisetime:wisetime-connector:2.2.6")
'io.wisetime:wisetime-connector:jar:2.2.6'
<dependency org="io.wisetime" name="wisetime-connector" rev="2.2.6">
  <artifact name="wisetime-connector" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.wisetime', module='wisetime-connector', version='2.2.6')
)
libraryDependencies += "io.wisetime" % "wisetime-connector" % "2.2.6"
[io.wisetime/wisetime-connector "2.2.6"]

Dependencies

compile (29)

Group / Artifact Type Version
com.sparkjava : spark-core jar 2.9.1
com.sparkjava : spark-template-thymeleaf jar 2.7.1
org.thymeleaf : thymeleaf jar 3.0.11.RELEASE
joda-time : joda-time jar 2.9.9
org.apache.commons : commons-configuration2 jar 2.4
org.apache.commons : commons-lang3 jar 3.9
net.jodah : failsafe jar 1.1.0
com.amazonaws : aws-java-sdk-logs jar 1.11.611
com.amazonaws : aws-java-sdk-cloudwatch jar 1.11.611
org.slf4j : jcl-over-slf4j jar 1.7.26
org.slf4j : jul-to-slf4j jar 1.7.26
com.fasterxml.jackson.core : jackson-databind jar 2.9.8
com.fasterxml.jackson.core : jackson-core jar 2.9.8
com.fasterxml.jackson.dataformat : jackson-dataformat-cbor jar 2.9.8
org.apache.commons : commons-collections4 jar 4.3
com.google.guava : guava jar 27.1-jre
commons-io : commons-io jar 2.6
org.xerial : sqlite-jdbc jar 3.28.0
org.codejargon : fluentjdbc jar 1.8.3
org.apache.httpcomponents : httpclient jar 4.5.8
org.apache.httpcomponents : httpcore jar 4.4.11
org.apache.httpcomponents : fluent-hc jar 4.5.8
commons-codec : commons-codec jar 1.12
ch.qos.logback : logback-core jar 1.2.3
ch.qos.logback : logback-classic jar 1.2.3
org.slf4j : slf4j-api jar 1.7.26
org.freemarker : freemarker jar 2.3.28
io.swagger : swagger-annotations jar 1.5.3
javax.validation : validation-api jar 2.0.1.Final

Project Modules

There are no modules declared in this project.

WiseTime Java Connector

Javadocs

WiseTime Java Connector is an open source library that enables you to write a WiseTime connector with a few lines of Java code. It calls the WiseTime Connect API to communicate with WiseTime.

WiseTime is a passive, privacy-first timekeeping system that summarises your tasks while you work. With WiseTime Connect, you can connect your systems to WiseTime, so that you can automatically:

  • Create tags and tag keywords in WiseTime when records are added to your system
  • Receive posted time when users post their time sheets to WiseTime

Getting Started

Set Up the Dependency

The WiseTime Connector Library is available on Maven Central. You can include it in your Java projects like so:

Gradle

compile 'io.wisetime:wisetime-connector:2.5.1'

Maven

<dependency>
  <groupId>io.wisetime</groupId>
  <artifactId>wisetime-connector</artifactId>
  <version>2.5.1</version>
</dependency>

Implement the WiseTimeConnector Interface

To create a connector, simply implement the WiseTimeConnector interface. Here's an example of a minimal implementation.

public class HelloConnector implements WiseTimeConnector {

  private ConnectorModule cm;

  /**
   * Called by the WiseTime Connector library on connector initialization.
   */
  @Override
  public void init(final ConnectorModule connectorModule) {
    cm = connectorModule;
  }

  /**
   * Called by the WiseTime Connector library on a regular schedule.
   */
  @Override
  public void performTagUpdate() {
    // This is where you would query the connected system and send new tags to WiseTime.
    cm.apiClient.tagUpsert(
        new UpsertTagRequest()
            .name("Hello, World!")
            .path("/hello/connector/")
    );
  }

  /**
   * Called by the WiseTime Connector library whenever a user posts time to the team.
   */
  @Override
  public PostResult postTime(final Request request, final TimeGroup userPostedTime) {
    // This is where you would process the userPostedTime and create relevant
    // records in the connected system.
    return PostResult.SUCCESS;
  }
  
  /**
   * Identifies the type of the connector.
   */
  @Override
  public String getConnectorType() {
    // Custom implementation type 
    return "HELLO";
  }
}

Start the Connector

Then, use your connector implementation when starting the connector.

public class ConnectorLauncher {

  /**
   * Application entry point
   */
  public static void main(final String... args) throws Exception {
    
    Connector.newBuilder()
        .useWebhook() // or useFetchClient()
        .withWiseTimeConnector(new HelloConnector())
        .build()
        .start();
  }
}

The connector will launch a web server at port 8080 when calling useWebhook(). The server implements the Posted Time Webhook that WiseTime will call whenever a user posts time to the team.

If you use .useFetchClient() instead, the connector will start in long polling mode to retrieve time posted to the team from WiseTime.

Sample Project

Take a look at our open source Jira Connector for an example of a fully implemented, production-ready connector project. The connector is implemented in just 3 classes and comes with great test coverage.

Javadoc

The latest javadoc for the WiseTime Connector Library can be accessed here.

io.wisetime

WiseTime

Privacy-First Autonomous Time Analytics

Versions

Version
2.2.6
2.2.5
1.4.0
1.3.9
1.3.8
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.2
1.2.1
1.2.0
1.1.3
1.1.2
1.1.1
1.1.0
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.0.0-NOT_A_GIT_REPOSITORY