Files
transsecs
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#![warn(missing_docs)]

//! Library for interacting with TransSecs using Rust. To use, the system jvm library must be on the library path. This is different by operating system:\
//!     Windows: jvm.dll on PATH environment variable\
//!     Linux: libjvm.so on LD_LIBRARY_PATH\
//!     MacOS: libjvm.dylib on LD_LIBRARY_PATH\
//! 
//! In every case, the library should be under the java home directory, probably under jre/lib/amd64/server (or similar)

#[macro_use]
extern crate lazy_static;


/// Main wrapper and entry point
pub mod transsecs_wrapper;

/// Struct for interacting with ValueObjects returned from TransSecs
pub mod value_object;

/// Errors
pub mod error;

#[cfg(test)]
mod tests {
    use crate::transsecs_wrapper::TransSecsWrapper;
    #[test]
    fn it_works() {
        // let wrapper = TransSecsWrapper::new("/home/colin/Documents/workspace-spring-tool-suite-4-4.2.2.RELEASE/MIStudio/classes").unwrap();
        let wrapper = TransSecsWrapper::new("/home/colin/Documents/workspace-spring-tool-suite-4-4.2.2.RELEASE/MIStudio/classes:/home/colin/Documents/workspace-spring-tool-suite-4-4.2.2.RELEASE/MIStudio/vib/vib/lib/json-20190722.jar:/home/colin/TransSECS_Servers/Projects/GEMHost/NativeWrapper/GEMHostRuntime.jar:/home/colin/TransSECS_Servers/Projects/GEMHost/generatedjars/GEMHost.jar").unwrap();

        wrapper.start_main("GEMHost").unwrap();
        wrapper.subscribe("testint", |topic,value| {println!("Callback called on {} with {:?}", topic, value)}).unwrap();
        // wrapper.add_test_values_to_broker().unwrap();
        // let res = wrapper.get("TestInt");
        // println!("Got: {:?}", res); 
        // wrapper.publish_int("TestInt", 70).unwrap();
        // let res = wrapper.get("TestInt");
        // println!("Got: {:?}", res); 
    }
}