An easy-to-use wrapper for many storage systems.

Related tags

Messaging data-store
Overview

Data Store

An easy-to-use wrapper for redis' cached storage system. (support for more data types coming soon)

Note: This project is unfinished, and the modules bukkit & proxy have nothing in them.

Usage:

Data Store is very simple, here's an example for the redis wrapper:

Create your application class, this should extend the DataStorePlatform available in the commons module.

public class NewTestApplication extends DataStorePlatform {

    public static void main(String[] args) {
        new NewTestApplication().initalizeLayer();
    }
    
    public void initalizeLayer() {
        
    }

    /**
     * the logger type to use for this app
     */
    @Override
    public ConsoleLogger getLogger() {
        return new SimpleConsoleLogger();
    }
}

You can now begin with definining a RedisConnection type.

Available types for redis:

  • AuthRedisConnection
  • NoAuthRedisConnection

For this example, i'll be using NoAuthRedisConnection as i'm using my local redis server.

    public void initalizeLayer() {
        final RedisConnection noAuthRedisConnection = new NoAuthRedisConnection("127.0.0.1", 6379);
        
    }

You can now initialize a new RedisStorageBuilder<YourObject>, with YourObject being the object you want to serialize.

    public void initalizeLayer() {
        final RedisConnection noAuthRedisConnection = new NoAuthRedisConnection("127.0.0.1", 6379);
        final RedisStorageBuilder<TestObject> testClassRedisStorageBuilder = new RedisStorageBuilder<>();
        
    }

Finally, you can build your RedisStorageLayer<YourObject> instance by using the chain methods provided in RedisStorageBuilder.

    public void initalizeLayer() {
        final RedisConnection noAuthRedisConnection = new NoAuthRedisConnection("127.0.0.1", 6379);
        final RedisStorageBuilder<TestObject> testClassRedisStorageBuilder = new RedisStorageBuilder<>();
        final RedisStorageLayer<TestObject> testObjectRedisStorageLayer = testClassRedisStorageBuilder
                .setSection("datastore_test")
                .setType(TestObject.class)
                .setConnection(noAuthRedisConnection)
                .build();

    }

OPTIONAL: Want to access your layer from a seperate class, or at another time? You can use the provided StorageLayerController instance in your application class to store your layer for use somewhere else.

    public void initalizeLayer() {
        final RedisConnection noAuthRedisConnection = new NoAuthRedisConnection("127.0.0.1", 6379);
        final RedisStorageBuilder<TestObject> testClassRedisStorageBuilder = new RedisStorageBuilder<>();
        final RedisStorageLayer<TestObject> testObjectRedisStorageLayer = testClassRedisStorageBuilder
                .setSection("datastore_test")
                .setType(TestObject.class)
                .setConnection(noAuthRedisConnection)
                .build();

        this.getStorageLayerController().registerLayer("testya", testObjectRedisStorageLayer);
    }
        // how to fetch the layer
        this.getStorageLayerController().getLayer("hello", RedisStorageLayer.class);

Congrats! You've setup your layer! You can now use these awesome methods to store/fetch data from your database!

    public CompletableFuture<Void> saveEntry(K k, V v);

    public CompletableFuture<Void> deleteEntry(K k);

    public CompletableFuture<V> fetchEntryByKey(K k);

    public CompletableFuture<Map<K, V>> fetchAllEntries();
You might also like...

Firehose is an extensible, no-code, and cloud-native service to load real-time streaming data from Kafka to data stores, data lakes, and analytical storage systems.

Firehose - Firehose is an extensible, no-code, and cloud-native service to load real-time streaming data from Kafka to data stores, data lakes, and analytical storage systems.

Dec 22, 2022

A Slimefun4 addon that adds a new storage solution for mass and organised storage without harsh performance.

A Slimefun4 addon that adds a new storage solution for mass and organised storage without harsh performance.

Networks is a Slimefun4 addon that brings a simple yet powerful item storage and movement network that works along side cargo. Network Grid / Crafting

Jan 7, 2023

An easy to use api to interact with many versions of minecraft in a version independent environment.

Glass - API An easy to use api to interact with many versions of minecraft in a version independent environment. Setup Instructions should be relative

Jan 25, 2022

fabric-carpet extension mod which attempts to fix as many vanilla bugs as possible. Feel free to add as many fixes as you want!

Carpet-Fixes Fabric Carpet extension mod which attempts to fix as many vanilla bugs as possible! Feel free to contribute by adding as many fixes as yo

Jan 6, 2023

Annotation/Reflection Based Bukkit Command API. Containing many features such as help-service, command providers, tab completion, and many more!

CommandAPI Annotation/Reflection Based Command API that just does what you want it to do without any problems. Importing Maven repository id

Jun 13, 2022

Spring JPA Many To Many example with Hibernate and Spring Boot CRUD Rest API - ManyToMany annotation

Spring JPA Many To Many example with Hibernate and Spring Boot CRUD Rest API - ManyToMany annotation

Dec 28, 2022

Easy-es - easy use for elastich search

Easy-es - easy use for elastich search

Born To Simplify Development What is Easy-Es? Easy-Es is a powerfully enhanced toolkit of RestHighLevelClient for simplify development. This toolkit p

Jan 6, 2023

A distributed lock that supports the use of Redis and Zookeeper, out of the box, fast and easy to use

lock-spring-boot-starter A distributed lock that supports the use of Redis and Zookeeper, out of the box, fast and easy to use 一款基于 Redis 和 Zookeeper

Oct 15, 2022

A simple-to-use storage ORM supporting several databases for Java.

Storage Handler This is a library based off of my old storage handler within my queue revamp. It's for easy storage handling for multiple platforms. N

Jun 22, 2022

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.

Seata: Simple Extensible Autonomous Transaction Architecture What is Seata? A distributed transaction solution with high performance and ease of use f

Jan 2, 2023

An advanced, but easy to use, platform for writing functional applications in Java 8.

An advanced, but easy to use, platform for writing functional applications in Java 8.

Getting Cyclops X (10) The latest version is cyclops:10.4.0 Stackoverflow tag cyclops-react Documentation (work in progress for Cyclops X) Integration

Dec 29, 2022

A Java library that implements a ByteChannel interface over SSLEngine, enabling easy-to-use (socket-like) TLS for Java applications.

TLS Channel TLS Channel is a library that implements a ByteChannel interface over a TLS (Transport Layer Security) connection. It delegates all crypto

Dec 31, 2022

A small and easy-to-use one-time password generator library for Java according to RFC 4226 (HOTP) and RFC 6238 (TOTP).

OTP-Java A small and easy-to-use one-time password generator for Java according to RFC 4226 (HOTP) and RFC 6238 (TOTP). Table of Contents Features Ins

Dec 30, 2022

Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.

Tink A multi-language, cross-platform library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse. Ubuntu

Jan 3, 2023

An advanced, but easy to use, platform for writing functional applications in Java 8.

An advanced, but easy to use, platform for writing functional applications in Java 8.

Getting Cyclops X (10) The latest version is cyclops:10.4.0 Stackoverflow tag cyclops-react Documentation (work in progress for Cyclops X) Integration

Dec 29, 2022

Elegant parsing in Java and Scala - lightweight, easy-to-use, powerful.

Please see https://repo1.maven.org/maven2/org/parboiled/ for download access to the artifacts https://github.com/sirthias/parboiled/wiki for all docum

Dec 21, 2022

MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJO to JSON in a declarative way.

MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJ

Sep 17, 2022
Owner
Subham
GrowlyX#4953
Subham
Dagger is an easy-to-use, configuration over code, cloud-native framework built on top of Apache Flink for stateful processing of real-time streaming data.

Dagger Dagger or Data Aggregator is an easy-to-use, configuration over code, cloud-native framework built on top of Apache Flink for stateful processi

Open DataOps Foundation 238 Dec 22, 2022
Apache Camel is an open source integration framework that empowers you to quickly and easily integrate various systems consuming or producing data.

Apache Camel Apache Camel is a powerful, open-source integration framework based on prevalent Enterprise Integration Patterns with powerful bean integ

The Apache Software Foundation 4.7k Dec 31, 2022
A JVM library to use RabbitMQ as an embedded service

Embedded RabbitMQ Compatibility: Builds: Linux OS X Windows Reports: Dist: Social: This library allows for the use of various RabbitMQ versions as if

Alejandro Rivera 88 Dec 25, 2021
SMS app based on QKSMS. DISCLAIMER: This project is intended for my own use. No issues are accepted

Messages Messages is an open source replacement to the stock messaging app on Android. DISCLAIMER: Unlike most other projects, this project is for my

Muntashir Al-Islam 13 Dec 16, 2022
Operating Systems - Concepts of computer operating systems including concurrency, memory management, file systems, multitasking, performance analysis, and security. Offered spring only.

Nachos for Java README Welcome to Nachos for Java. We believe that working in Java rather than C++ will greatly simplify the development process by p

Sabir Kirpal 1 Nov 28, 2021
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Jan Kotek 4.6k Dec 30, 2022
An extremely easy way to perform background processing in Java. Backed by persistent storage. Open and free for commercial use.

The ultimate library to perform background processing on the JVM. Dead simple API. Extensible. Reliable. Distributed and backed by persistent storage.

JobRunr 1.3k Jan 6, 2023
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.

Themis provides strong, usable cryptography for busy people General purpose cryptographic library for storage and messaging for iOS (Swift, Obj-C), An

Cossack Labs 1.6k Dec 29, 2022
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Jan Kotek 4.6k Jan 1, 2023
Netflix, Inc. 23.1k Jan 5, 2023