Giter Site home page Giter Site logo

haystack-java's Introduction

README

The haystack-java library provides a java implementation of the haystack data model. It also includes a haystack 3.0 compliant client, and reference server.

Building

The project is built with Gradle. It makes uses of the gradle wrapper so that you don't have to actually install Gradle yourself. You should use the gradlew script to run all gradle tasks for this project.

After cloning the repository, run the following command to build and test the library.

./gradlew build (Unix)

./gradlew.bat build (Windows)

It is highly recommended to enable the gradle daemon so builds go faster.

Gradle Dependency

If you have Gradle-based java projects that depend on this library, you can configure your build scripts to get the artifact from GitHub using https://jitpack.io

repositories {
    mavenCentral()
    maven { url = 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.skyfoundry:haystack-java:3.0.7'
}

Maven Dependency

If you have Maven-based java projects that depend on this library, you can configure your build scripts to get the artifact from GitHub using https://jitpack.io

<repositories>
    <repository>
        <id>jitpack.io</id>
        <name>JitPack</name>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
  <groupId>com.github.skyfoundry</groupId>
  <artifactId>haystack-java</artifactId>
  <version>3.0.7</version>
</dependency>

haystack-java's People

Contributors

bedla avatar briansfrank avatar ci-richard-mcelhinney avatar jhughescontrolco avatar mgiannini avatar mjarmy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

haystack-java's Issues

Unexpected symbol: '^' (0x5e)

The following is happening in version 3.0.5, against SkySpark 3.0.26. My customer is reporting that one of the tags equals or contains the '^' char. Is this a problem with this lib, or some sort of version incompatibility?

[2020-11-20 15:01:47.452115] 2020-11-20 15:01:47.451 [Thread-4] ERROR org.dsa.iot.haystack.Haystack - read(navName == "SaTemp")
[2020-11-20 15:01:47.452115] org.projecthaystack.ParseException: Unexpected symbol: '^' (0x5e) [line 3]
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HaystackTokenizer.err(HaystackTokenizer.java:469)
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HaystackTokenizer.symbol(HaystackTokenizer.java:430)
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HaystackTokenizer.next(HaystackTokenizer.java:89)
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HZincReader.consume(HZincReader.java:385)
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HZincReader.consume(HZincReader.java:376)
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HZincReader.parseLiteral(HZincReader.java:218)
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HZincReader.parseVal(HZincReader.java:157)
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HZincReader.parseGrid(HZincReader.java:313)
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HZincReader.readVal(HZincReader.java:76)
[2020-11-20 15:01:47.452115] at org.projecthaystack.io.HZincReader.readGrid(HZincReader.java:92)
[2020-11-20 15:01:47.452115] at org.projecthaystack.client.HClient.postGrid(HClient.java:606)
[2020-11-20 15:01:47.452115] at org.projecthaystack.client.HClient.call(HClient.java:597)
[2020-11-20 15:01:47.452115] at org.projecthaystack.client.HClient.eval(HClient.java:253)
[2020-11-20 15:01:47.452115] at org.dsa.iot.haystack.Haystack$5.handle(Haystack.java:160)
[2020-11-20 15:01:47.452115] at org.dsa.iot.haystack.Haystack$5.handle(Haystack.java:156)
[2020-11-20 15:01:47.452115] at org.dsa.iot.haystack.helpers.ConnectionHelper.connect(ConnectionHelper.java:164)
[2020-11-20 15:01:47.452115] at org.dsa.iot.haystack.helpers.ConnectionHelper.getClient(ConnectionHelper.java:133)
[2020-11-20 15:01:47.452115] at org.dsa.iot.haystack.Haystack.eval(Haystack.java:156)
[2020-11-20 15:01:47.452115] at org.dsa.iot.haystack.actions.Actions$4.handle(Actions.java:290)
[2020-11-20 15:01:47.452115] at org.dsa.iot.haystack.actions.Actions$4.handle(Actions.java:284)
[2020-11-20 15:01:47.452115] at org.dsa.iot.dslink.node.actions.Action.invoke(Action.java:159)

Thanks,
Aaron

Library is not available in Maven repository

jCenter has been flagged for deprecation for a while and now it seems that the URL https://jcenter.bintray.com/org/projecthaystack/haystack-java/3.0.7/haystack-java-3.0.7.pom is redirecting to maven.org which results in a 404 (See below) Is it possible to get the library published to Maven asap?

> GET /org/projecthaystack/haystack-java/3.0.7/haystack-java-3.0.7.pom HTTP/1.1
> Host: jcenter.bintray.com
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 05 Aug 2024 07:28:48 GMT
< Content-Type: text/html
< Content-Length: 162
< Connection: keep-alive
< Location: https://repo1.maven.org/maven2/org/projecthaystack/haystack-java/3.0.7/haystack-java-3.0.7.pom

Question - Batch calls?

Our haystack integration can make a lot of nav calls in a very short period of time. Is it possible to batch those?

Time Units Missing

Would it be possible to get the full list of time units defined into HNum when calculating duration? You can see from the image below that only a subset of them are defined in the millis function but there are more defined by haystack. At the very least, day should be implemented to keep in line with SkySpark's implementation of Duration which essentially does the same thing as this function but includes day as a valid unit.

image

HDateTimeRangeTest fails if HDate.today() != today in New York

> Task :test FAILED

Gradle suite > Gradle test > org.projecthaystack.HDateTimeRangeTest > testRange
Gradle suite > Gradle test > org.projecthaystack.HDateTimeRangeTest > testRange
FAILED
    java.lang.AssertionError at HDateTimeRangeTest.java:38

The test uses the "New York" time zone. Here being 17-19 hours ahead of New York , HDate.today() is usually the day after today in New York. Changing the time zone string to the local one lets the test pass.

Licence of the code

Hi,
Is it possible if you can describe the license for this project. From the source code it states AFL3.0.

In order to be publicly used without declaration, is it possible to release it under MIT as well? Cheers

running HClient

How can I actually run HClient from a linux console.

after running ./gradlew build successfully

I then try to call

java -jar build/libs/haystack-java-3.0.5.jar org.projecthaystack.client.HClient http://127.0.0.1:4337 user pencel

but I just get

no main manifest attribute, in build/libs/haystack-java-3.0.5.jar

I am new to gradle and its been many years since I touched Java. Trying to test against my server implementation.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.