Skip to content

cagritepebasili/emp3-mirror-cache

 
 

Repository files navigation

emp3-mirror-cache

Build Status Download

About

Geospatial data sharing and collaboration service.

Building

Prerequisites

Software

Build

$ ./gradlew build publishToMavenLocal
$ cd wildfly-swarm
$ mvn clean package

Running

To launch the server:

$ cd wildfly-swarm
$ java -jar target/wildfly-swarm-swarm.jar

To launch the Java client:

$ ./gradlew :mirrorcache-client:run

To launch the Web client:

visit: 127.0.0.1:8080/client

(NOTE: The Web client assumes a channel named 'inject' exists when performing certain functions.)

To view server state:

visit: 127.0.0.1:8080/status.html

WebSocket Endpoints

Endpoint Description
ws://127.0.0.1:8080/mirrorcache All clients interested in participating in MirrorCache message exchanges must connect to this endpoint. Only ProtoMessage objects are recognized.

REST endpoints

Endpoint Description
/rest/status This endpoint returns the current state of the system. Returned data currently includes all active WebSocket sessions, all created channels, all created channelGroups, and outbound queues sizes.
/rest/channels This endpoint returns a listing of channels currently available.
/rest/channelgroups This endpoint returns a listing of channelGroups currently avaialble.
/rest/queues This endpoint returns detailed information about each outbound queue.
/rest/cache/channel This endpoint returns detailed information about each channel cache.
/rest/cache/channelgroup This endpoint returns detailed information about each channelGroup cache.
/rest/cache/entity This endpoint returns detailed information about each cached entity.

API Notes

ProtoMessage

A ProtoMessage is a Protocol Buffer defined type. It is declared as follows:

message ProtoMessage {
    string id                    = 1;
    map<string, string> property = 2;
    int32 priority               = 3;
    OneOfOperation operation     = 4;
    ProtoPayload payload         = 5;
}

Channel

A channel represents the path message data travels through. A client can open a channel and produce or consume message data (or both) on it by specificying a flow pattern. Once a channel has been opened data can be published to it or consumed from it.

Channel Types:

Type Description
TEMPORARY A temporary channel will exist only while the owning client is still connected.
PERSISTENT A persistent channel will remain available until it has been explicitly deleted.

Channel Visibility:

Visibility Description
PUBLIC A public channel is made available for any other client to discover and subscribe to.
PRIVATE A private channel can only be discovered and subscribed to after being invited.

Channel Flow:

Flow Description
INGRESS An ingress flow denotes a client who is only interested in consuming messages.
EGRESS An egress flow denotes a client who is only interested in producing messages.
BOTH A both flow denotes a client interested in producing and consuming.

ChannelGroup

A ChannelGroup represents a collection of channels. Clients who open a channelGroup will receive published data from each channel participating in the channelGroup. The owner of a channelGroup can publish data to the channelGroup, this has the effect of broadcasting data to each participating channel in the channelGroup. A channelGroup will persist until the owning session is closed.

Server Operations

Operation Properties
GET_CLIENT_INFO
  • status
  • clientInfo
CREATE_CHANNEL
  • status
  • channelName
  • type
  • visibility
CREATE_CHANNEL
  • status
  • channelName
  • type
  • visibility
DELETE_CHANNEL
  • status
  • channelName
FIND_CHANNELS
  • status
  • filter
  • channel
CHANNEL_OPEN
  • status
  • channelName
  • flow
  • filter
CHANNEL_CLOSE
  • status
  • channelName
CHANNEL_PUBLISH
  • status
  • channelName
CHANNEL_DELETE
  • status
  • channelName
  • payloadId
  • sourceId
CHANNEL_CACHE
  • status
  • channelName
  • entityId
CHANNEL_HISTORY
  • status
  • channelName
  • startTime
  • endTime
  • history
CREATE_CHANNELGROUP
  • status
  • channelGroupName
DELETE_CHANNELGROUP
  • status
  • channelGroupName
FIND_CHANNELGROUPS
  • status
  • filter
  • channelGroup
CHANNELGROUP_OPEN
  • status
  • channelGroupName
CHANNELGROUP_CLOSE
  • status
  • channelGroupName
CHANNELGROUP_ADD_CHANNEL
  • status
  • channelGroupName
  • channelName
CHANNELGROUP_REMOVE_CHANNEL
  • status
  • channelGroupName
  • channelName
CHANNELGROUP_PUBLISH
  • status
  • channelGroupName
CHANNELGROUP_DELETE
  • status
  • channelGroupName
  • payloadId
  • sourceId
CHANNELGROUP_CACHE
  • status
  • channelGroupName
  • entityId
CHANNELGROUP_HISTORY
  • status
  • channelGroupName
  • entityId
  • startTime
  • endTime
  • history

MirrorCacheProductManager

Manages the list(s) of overlays that are created as products, or feeds.

MirrorCacheCollaborationManager

Manages all the different sessions being used for collaboration. Each collaboration session is essentially a map with numerous overlays, a shared camera, and a list of connected users.

MirrorCacheStorage

Similar to EMP core Storage Manager where it has a store of all the unique data elements and understands all their relationships.

ClientMessageQueue

When messages the user is subscribed to are processed, the result will be inserted in a first in, first out queue. If an update occurs on a piece of data that was already in the queue, that item remains in the same queue position, but has the latest update applied. Because it will likely just be a reference to the actual item in the MirrorCacheStorage, not much needs to happen to client queue if it finds that the updated item already exists in the queue.

MirrorCacheClient

Stores the endpoint, name, uuid, DateTime connected, reference to its ClientMessageQueue, and other user related attributes.

License

Apache 2.0

About

Geospatial data sharing and collaboration service

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 95.8%
  • JavaScript 2.1%
  • HTML 1.6%
  • Shell 0.5%