Introduction

REDHAWK Enterprise Integration is a suite of software for interacting with a REDHAWK Domain in the Java Runtime Environment. The suite includes:

  • REDHAWK Driver: Provides simplified access to REDHAWK via standard Java interfaces. The goal is to streamline all interaction with the underlying REDHAWK Components as well as provide a simplified API for Java developers interacting with a REDHAWK Domain. The driver can be leveraged as a standalone Java ARchive (JAR) file.

  • REDHAWK Connector: Implements OSGi’s Managed Service Factory interface to allow users to register pre-configured instances of REDHAWK connections into a Karaf container.

  • REDHAWK REST: Provides REST Service to command and control a REDHAWK instance.

  • REDHAWK WebSocket: Provides an HTML5-compliant Websocket implementation that enables the ability to stream data from any REDHAWK BulkIO-enabled Port or Event Channel.

  • REDHAWK Camel Component: Provides a Camel Component for interacting with a REDHAWK Domain. This Component can be connected with other Apache Camel Components as a data flow solution.

The suite of software is prepackaged in a custom Karaf distribution to help users easily get started using REDHAWK Enterprise Integration.

All assets have been tested against REDHAWK 2.1.2.

Installing REDHAWK Enterprise Integration

Installing via Tarball

  1. Navigate to the directory where you want to install REDHAWK Enterprise Integration, and untar the tarball:

    tar -xzf redhawk-enterprise-integration.gz
  2. If not already set in your .bashrc/.bash_profile, set the JAVA_HOME environment variable by adding the following:

    JAVA_HOME=[path to java 8]
    export JAVA_HOME
  3. Source your .bashrc/.bash_profile:

    . ~/.bashrc or ~/.bash_profile

Installing via RPM

Important
If installing via RPM, you must be root or have sudo privileges.
  1. Run this command to install the RPM:

     rpm -i redhawk-enterprise-integration-dist-2.1.2-noach.rpm

    By default, the RPM is installed in /usr/local/redhawk. If you resolved the dependency during install, the RPM installs jre-1.8 for you.

  2. If you did not resolve the dependency during install, add a JAVA_HOME environment variable for Karaf to run properly (refer to the previous procedure, Installing via Tarball).

Getting Started

After installing REDHAWK Enterprise Integration, the following directories are displayed:

  • karaf-4.1.2: Directory contains a custom distribution of Karaf prepackaged with all REDHAWK Java Tool assets.

  • shell: Programatic access to REDHAWK Driver via the shell.

  • jacorb-deps: All dependencies needed to configure REDHAWK Driver to use JacORB instead of the default ORB provided by Java.

Working with Karaf

  1. To start Karaf, in the bin directory for Karaf, run the start script:

     ./start
  2. To access the Karaf console, in the bin directory for Karaf, run the client script:

     ./client
  3. Once logged in, run the command list to display the REDHAWK Assets that have been preinstalled. Each asset includes documentation. Refer to the appropriate section in the online documentation for information about interacting with the individual assets. For more details on Karaf, refer to Apache Karaf documentation.

  4. Begin using the bundles provided to interact with REDHAWK or write your own applications that leverage the REDHAWK Enterprise Integration bundles to interact with REDHAWK.

Configuring JacORB w/ Karaf

To configure the REDHAWK Driver running inside of Karaf to use JacORB instead of Sun ORB, perform the following steps:

  1. Update the ${karaf.base}/etc/system.properties file to include the system properties necessary for JacORB.

    #Jacorb configuration
    org.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton
    org.omg.PortableInterceptor.ORBInitializerClass.standard_init=org.jacorb.orb.standardInterceptors.IORInterceptorInitializer
    org.omg.CORBA.ORBClass=org.jacorb.orb.ORB
  2. Copy the jacorb-deps into ${karaf.base}/lib/ext directory.

  3. If Karaf was started previously, restart it.

Configure JacORB logging w/ Karaf

To prevent JacORB logging from filling the general karaf.log file, add the following lines to the bottom of your org.ops4j.pax.logging.cfg, which is located in the ${karaf.base}/etc directory:

# Jacorb Logging
log4j.logger.org.jacorb=INFO, jacorb

# Jacorb appender
log4j.appender.jacorb=org.apache.log4j.RollingFileAppender
log4j.appender.jacorb.layout=org.apache.log4j.PatternLayout
log4j.appender.jacorb.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
log4j.appender.jacorb.file=${karaf.data}/jacorb/jacorb.log
log4j.appender.jacorb.append=true
log4j.appender.jacorb.maxFileSize=1MB
log4j.appender.jacorb.maxBackupIndex=10

Additional JacORB Configuration

To specify specific properties, add a jacorb.properties file to ${karaf.base}. For example, if you want to control the number of ClientMessageReceptor threads created by JacORB and manage the Idle threads, add the following jacorb.properties file:

#Jacorb Properties
jacorb.connection.client.max_idle_receptor_threads=5
jacorb.connection.client.max_receptor_threads=100

For additional JacORB information, refer to the JacORB Official Documentation.

Web Server Configuration

The web endpoints REDHAWK REST and websocket endpoints REDHAWK WebSocket are all hosted by a Jetty server in the OSGi environment. You can configure Jetty by using Pax Web or using a standard Jetty configuration file.

Using Pax Web to Configure Jetty

Using Pax Web enables you to dynamically manage the Jetty instance without restarting Karaf. The ${karaf.base}/etc/org.ops4j.pax.web.cfg file has the parameters necessary for Pax to configure the Jetty server. By default, SSL is setup through Pax Web. For more information, refer to the SSL Configuration section of Pax Web documentation.

Certificates

The keystore and truststore information is contained in systems.properties, and standard javax.net.ssl.* properties are used to set them. This is useful because if you have other bundles that need keystore or truststore information, it can be retrieved in this one location.

  • javax.net.ssl.keyStore: Path to your key store.

  • javax.net.ssl.keyStorePassword: Password for your key store.

  • javax.net.ssl.keyStoreType: Type for your key store.

  • javax.net.ssl.trustStore: Path to your trust store.

  • javax.net.ssl.trustStorePassword: Password for your trust store.

  • javax.net.ssl.trustStoreType: Type for your trust store.

Update HTTP Port

To change your http port, update the org.osgi.service.http.port property. By default, this is 8181.

Update HTTPS Port

To change your https port, update the org.osgi.service.http.port.secure property. By default, this is 8182.

Disable HTTP

To disable http, set org.osgi.service.http.enabled to false instead of true.

Disable HTTPS

To disable https, set org.osgi.service.http.secure.enabled to false instead of true.

Cipher Suites and other Security Configs

You can enable and disable numerous cipher suites via the org.ops4j.pax.web.cfg/jetty.xml file. The available ciphers are dependent on the version of the JRE/JDK, browser type/version, and the security posture applicable to your situation. Because of this variation, cipher suites have not been included/excluded in the default configuration.

  • org.ops4j.pax.web.ssl.ciphersuites.included: Included SSL/TLS Cipher Suites Regex.

  • org.ops4j.pax.web.ssl.ciphersuites.excluded: Excluded SSL/TLS Cipher Suites Regex.

  • org.ops4j.pax.web.ssl.protocols.included: Included SSL/TLS Protocols.

  • org.ops4j.pax.web.ssl.protocols.excluded: Excluded SSL/TLS Protocols.

  • org.ops4j.pax.web.ssl.renegotiationAllowed: SSL Renegotiation allowed, is defaulted to true.

Additional Info:

Logging

Pax Web logs have been preconfigured to go in the ${karaf.data}/pax-web/pax-web.log file. You can find the log configuration in org.ops4j.pax.logging.cfg. If you need to see additional logs, update the logger log4j.logger.org.eclipse.pax.web to your desired state.

Additional Pax Web Information

To set up additional Jetty configuration information (for example, login modules, connectors, and so forth), use an external jetty.xml file. This property is set via:

  • org.ops4j.pax.web.config.file: By default, this file is in ${karaf.base}/etc/jetty.xml.

For more information, refer to Advanced Jetty Configuration. Pax Web can also be configured via the web using the Pax Web Runtime configuration available in your system/console/configMgr endpoint provided by Karaf.

Using a Jetty Configuration

Jetty configuration can be found in ${karaf.base}/etc/jetty.xml. The jetty configuration sets up the login modules for your HTTP server. For more information about Jetty and JAAS support, refer to the JAAS Support section of the Jetty docs. For information on the Login Service that is preconfigured in your container, refer to the JAASLoginService section.

As previously mentioned, SSL/TLS params can be configured via the org.ops4j.pax.web.cfg; however, you can configure everything via the jetty.xml file. For more information, refer to the Configuring SSL/TLS section of the Jetty documentation.

SSL Configuration via Jetty

If you prefer to use Jetty to configure your SSL, you can add the following to the jetty.xml for a minimum SSL/TLS configuration.

<!-- =========================================================== -->
        <!-- SSL Configuration below -->
        <!-- Set up sslContext Factory with standard javax properties -->
        <!-- Latest docs: https://www.eclipse.org/jetty/documentation/9.4.x/configuring-ssl.html, remember to
                use docs relevant to jetty available in your karaf instance
         -->
        <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
                <Set name="KeyStorePath"><SystemProperty name="javax.net.ssl.keyStore" /></Set>
                <Set name="KeyStorePassword"><SystemProperty name="javax.net.ssl.keyStorePassword" /></Set>
                <Set name="KeyManagerPassword"><SystemProperty name="javax.net.ssl.keyStorePassword" /></Set>
                <Set name="TrustStorePath"><SystemProperty name="javax.net.ssl.keyStore" /></Set>
                <Set name="TrustStorePassword"><SystemProperty name="javax.net.ssl.keyStorePassword" /></Set>
                <Set name="renegotiationAllowed">FALSE</Set>
        </New>

        <New id="httpsConnector" class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server"><Ref refid="Server"/></Arg>
                <Arg name="factories">
                        <Array type="org.eclipse.jetty.server.ConnectionFactory">
              <Item>
                <New class="org.eclipse.jetty.server.SslConnectionFactory">
                  <Arg name="next">http/1.1</Arg>
                  <Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
                </New>
              </Item>
              <Item>
                <New class="org.eclipse.jetty.server.HttpConnectionFactory">
                  <Arg name="config"><Ref refid="httpConfig"/></Arg>
                </New>
              </Item>
                       </Array>
                </Arg>
                <Set name="name">redhawkHTTPS</Set>
        </New>

        <Call name="addConnector">
                <Arg>
                        <Ref refid="httpsConnector"/>
                </Arg>
        </Call>
JAASLoginService

By default, a JAASLoginService has been configured for you in the jetty.xml file:

        <Call name="addBean">
                <Arg>
                        <New class="org.eclipse.jetty.jaas.JAASLoginService">
                                <Set name="name">karaf</Set>
                                <Set name="loginModuleName">karaf</Set>
                                <Set name="roleClassNames">
                                        <Array type="java.lang.String">
                                                <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
                                                </Item>
                                        </Array>
                                </Set>
                        </New>
                </Arg>
        </Call>
        <Call name="addBean">
                <Arg>
                        <New class="org.eclipse.jetty.jaas.JAASLoginService">
                                <Set name="name">default</Set>
                                <Set name="loginModuleName">karaf</Set>
                                <Set name="roleClassNames">
                                        <Array type="java.lang.String">
                                                <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal
                                                </Item>
                                        </Array>
                                </Set>
                        </New>
                </Arg>
        </Call>

The configuration above configures Jetty to have a login module using the default karaf user. For more information on Karaf Security (such as updating user passwords, protecting the console, and so forth), refer to the console security and Karaf security sections of the Karaf manual.

Cipher Suites

For information about adding/excluding ciphers, refer to the Disabling/Endabling Specific Cipher Suites section of the Jetty documentation.

Password Obfuscation

By default, the passwords for your keystore/truststore are stored in plain text. If you want to obfuscate the passwords, Jetty provides utilities to do so. For more information, refer to the Secure Password Obfuscation. The jar necessary for generating the obsfucated password can be found in ${karaf.base}/system/org/eclipse/jetty/jetty-util/{jetty.version}/jetty-util-{jetty.version}.jar.

Logging

Jetty logs have been preconfigured to go in the ${karaf.data}/jetty/jetty.log file. The log configuration is in org.ops4j.pax.logging.cfg. If you need to see additional logs, update the logger log4j.logger.org.eclipse.jetty to your desired state.

Note: There are many versions of Jetty. Make sure you are accessing the documentation for the version of Jetty found in your Karaf container.

REDHAWK Driver

The REDHAWK Driver asset encompasses several utility interfaces that give users convienent API access to REDHAWK via Java. The goal is to hide any CORBA interaction from programmers so they can focus effort on writing the logic for their application.

Getting Started

If using Maven, add the following to the dependency section of your project’s pom:

        <groupId>redhawk</groupId>
        <artifactId>redhawk-driver</artifactId>
        <version>2.1.2</version>

If familiar with Maven, and you are starting from scratch, you can use the redhawk-driver-bundle-archetype to generate your project structure by running this command:

mvn archetype:generate -DarchetypeGroupId=redhawk \
 -DarchetypeArtifactId=redhawk-driver-bundle-archetype \
 -DarchetypeVersion=1.0.0-SNAPSHOT

After running the command, you are prompted for the following information:

  • groupId

  • artifactId

  • version

  • package

After entering the necessary information, a template project is created that already has the REDHAWK Driver dependency in your pom and a simple main method in App.java that utilizes the REDHAWK Driver asset.

Important

We’re in the process of making the REDHAWK Enterprise Integration dependencies available on a public maven repository. Until then you will need to follow the Build From Source instructions in the readme included with this projects source code to add the redhawk-driver to your local maven repository.

Alternatively, when you installed the redhawk-enterprise-integration tgz/rpm the karaf distribution came with a system maven repository. Add this system maven repository to your settings.xml file. Here is an example profile you could add to your settings.

<profile>
        <id>rei</id>
        <repositories>
                <repository>
                        <id>dev-rei</id>
                        <name>Development REI</name>
                        <url>file://<!-- path to ${karaf.base}/system repo --></url><releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases><snapshots><enabled>false</enabled><updatePolicy>never</updatePolicy></snapshots>
                </repository>
        </repositories>
</profile>

If using profile make sure you add to your active profiles

If not using Maven, you can add the .jar file to your project’s build path or configure it with your project’s build tool as needed.

The following code examples may be helpful to developers getting started with the REDHAWK Driver.

Note

All code examples are coming directly from actual REDHAWK Driver Integration Tests. For the full imports needed for the code examples and more details refer to the source files where the examples(snippets) are taken from. The source files for all test relevant to the REDHAWK Driver can be found in the src/test/java directory for the REDHAWK Driver module.

RedhawkDriver Code Examples

The following code examples explain how to use the RedhawkDriver class.

Get a REDHAWK Domain

RedhawkDriverIT.java
RedhawkDomainManager domain = driver.getDomain(domainName);

Get a REDHAWK Device Manager

RedhawkDriverIT.java
//Path to dev Manager
String pathForDevManager = domainName+"/"+deviceManagerName;
logger.info(pathForDevManager);

RedhawkDeviceManager deviceManager = driver.getDeviceManager(pathForDevManager);

Get a REDHAWK Device

RedhawkDriverIT.java
//Path to device
String pathForDevice = domainName+File.separator+devManager.getName()+File.separator+deviceName;
logger.info(pathForDevice);

RedhawkDevice device = driver.getDevice(pathForDevice);

Get a REDHAWK Application

RedhawkDriverIT.java
//Get a specific application
RedhawkApplication application = driver.getApplication(domainName+"/"+sampleApp);

Get a REDHAWK Component

RedhawkDriverIT.java
RedhawkComponent component = driver.getComponent(domainName+"/"+sampleApp+"/SigGen_sine.*");

Get a REDHAWK Component’s Port

RedhawkDriverIT.java
RedhawkPort port = driver.getPort(domainName+"/"+sampleApp+"/SigGen_sine.*/dataFloat_out");

Helper Utility Examples

The RedhawkDriver includes helper utilities to enable users to easily access their REDHAWK Domain/REDHAWK Device Managers/REDHAWK Devices. These helper methods only work if there is only one REDHAWK Domain/REDHAWK Device Manager/REDHAWK Device available. If more than one REDHAWK Domain/REDHAWK Device Manager/REDHAWK Device exists, use the methods provided in Get a REDHAWK Domain, Get a REDHAWK Device Manager, or Get a REDHAWK Device to access those resources.

RedhawkDriverIT.java
//Use these utility methods if you only have one REDHAWK Domain/Redhawk Device Manager/Redhawk Device
RedhawkDomainManager domainManager = driver.getDomain();
RedhawkDeviceManager deviceManager = driver.getDeviceManager();

RedhawkDevice device = driver.getDevice();

RedhawkDomainManager Code Examples

The following code examples explain how to use the RedhawkDomainManager interface.

Create an Application

Sample code for creating an Application from a Waveform that is already in your Domain.

RedhawkDomainManagerImplIT.java
//Create an application that already exists in your $SDRROOT
RedhawkApplication application = domainManager.createApplication(applicationName, waveformLocation);

//Retrieve applications launched in your domain
List<RedhawkApplication> applications = domainManager.getApplications();

Sample code for creating an Application from a SAD file on a file system.

RedhawkComponentImplIT.java
driver.getDomain("REDHAWK_DEV").createApplication(applicationName, new File("src/test/resources/waveforms/rh/testWaveform.sad.xml"));

Get an Application from a REDHAWK Domain

RedhawkDomainManagerImplIT.java
//Retrieve a specific application in your domain
application = domainManager.getApplicationByName(applicationName);

Get a Device from a REDHAWK Domain

RedhawkDomainManagerImplIT.java
//Retrieve a group of devices by regex
devices = domainManager.getDevicesByName("GPP.*");

//Retrieve a device by name
String deviceName = devices.get(0).getName();
RedhawkDevice device = domainManager.getDeviceByName(deviceName);

Get a Device Manager from a REDHAWK Domain

RedhawkDomainManagerImplIT.java
//Retrieve all available device managers
List<RedhawkDeviceManager> managers = domainManager.getDeviceManagers();

//Get a specific device manager
RedhawkDeviceManager devManager = domainManager.getDeviceManagerByName(managers.get(0).getName());

RedhawkApplication Code Examples

The following code examples explain how to use the RedhawkApplication interface.

Managing an Application’s Lifecycle

RedhawkApplicationImplIT.java
RedhawkComponent component = application.getComponentByName(componentName);

// Example code for managing an applications lifecyle
// Stop an application
application.stop();

// Start an application
application.start();

// Check to see if an application is started
if (application.isStarted())
        application.stop();

Interacting with Components in an Application

RedhawkApplicationImplIT.java
// Get all components
List<RedhawkComponent> components = application.getComponents();

// Get a specific component
String componentName = components.get(0).getName();
RedhawkComponent component = application.getComponentByName(componentName);

Example of How to Get Metrics from an Application

RedhawkApplicationImplIT.java
Map<String, Map<String, Object>> metrics = application.getMetrics();

Example of How to Get and Set the Log Level of an Application

RedhawkLoggingIT.java
application = driver.getDomain().createApplication(appName, "/waveforms/rh/basic_components_demo/basic_components_demo.sad.xml");

assertEquals(RedhawkLogLevel.INFO, application.getLogLevel());

// Change log level
application.setLogLevel(RedhawkLogLevel.DEBUG);
assertEquals(RedhawkLogLevel.DEBUG, application.getLogLevel());

RedhawkComponent Code Examples

The following code examples explain how to use the RedhawkComponent interface.

Managing Your Component’s Lifecycle

RedhawkComponentImplIT.java
// Stop a component
component.stop();

// Start a component
component.start();

// Check if a component is started
if (!component.started())
        component.start();

Interacting with Component Properties on Your Component

RedhawkComponentImplIT.java
// Get your component from the application by full name
//or using a regex that matches one component in the application
RedhawkComponent component = application.getComponentByName("SigGen.*");

//Set the desired property on the compenent
component.setProperty("sample_rate", 1000);

Example of How to Get and Set the Log Level of a Component

RedhawkLoggingIT.java
component = application.getComponents().get(0);

assertEquals(RedhawkLogLevel.INFO, component.getLogLevel());

// Change log level
component.setLogLevel(RedhawkLogLevel.ALL);
assertEquals(RedhawkLogLevel.ALL, component.getLogLevel());

RedhawkPort Code Examples

The following code examples explain how to use the RedhawkPort interface.

Consuming Messages from a REDHAWK Port

MessageConsumerPortIT.java
MessageConsumerPort msgConsumerPort = new MessageConsumerPort("message_out");
InMsgHandler msgHandler = new InMsgHandler();

//Appropriate Message Id is important!!!!!
msgConsumerPort.registerMessage("myMessage", myMessage_struct.class, msgHandler);
POA rootPOA = POAHelper.narrow(driver.getOrb().resolve_initial_references("RootPOA"));

rootPOA.the_POAManager().activate();
rootPOA.activate_object(msgConsumerPort);

RedhawkPort messageConsumer = rhApplication.getComponents().get(0).getPorts().get(0);

CF.Port messageConsumerPort = CF.PortHelper.narrow(messageConsumer.getCorbaObject());

try {
        messageConsumerPort.connectPort(msgConsumerPort._this(), "test-message-processing");

        Thread.sleep(5000l);
        assertTrue(msgHandler.getMessageCount()>0);
} catch (InvalidPort e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
} catch (OccupiedPort e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
}

Retrieving Metadata from a REDHAWK Port

The following code examples explain how to retrieve the following metadata from a REDHAWK Port object:

  • statistics

  • state

  • connections

  • activeSRI

Get Port Statistics from a Uses/Provides Port
RedhawkPortImplIT
RedhawkComponent comp = driver.getComponent("REDHAWK_DEV/myApp/HardLimit.*");

// Checks to make sure you're able to retrieve Uses Port Statistics
assertNotNull(comp.getPort("dataFloat_out").getPortStatistics());
comp = driver.getComponent("REDHAWK_DEV/myApp/HardLimit.*");

// Checks to make sure you're able to retrieve Provides Port Statistics
assertNotNull(comp.getPort("dataFloat_in").getPortStatistics());
Get ActiveSRI from a Provides Port
RedhawkPortImplIT
// Start app so SRI is present
application.start();
RedhawkPort port = driver.getPort("REDHAWK_DEV/myApp/HardLimit.*/dataFloat_in");
assertNotNull(port.getActiveSRIs());
Get Port State from a Provides Port
RedhawkPortImplIT
port = driver.getPort("REDHAWK_DEV/myApp/HardLimit.*/dataFloat_in");

// Checks to make sure port State is not null
assertNotNull(port.getPortState());
Get Port Connections and Disconnect by Connection Id
RedhawkPortImplIT
comp = driver.getComponent("REDHAWK_DEV/myApp/HardLimit.*");

RedhawkPort port = comp.getPort("dataFloat_out");
assertTrue("Should be atleast 1 connection id", !port.getConnectionIds().isEmpty());

/*
 * Remove connections by connectionId
 */
for (String connectionId : port.getConnectionIds()) {
        port.disconnect(connectionId);
}

assertTrue("Should no longer be any connections", port.getConnectionIds().isEmpty());

RedhawkDevice Code Examples

The following code examples explain how to use the RedhawkDevice interface.

Allocate and Deallocate a Device

Sample code for allocating and deallocating a FrontEnd Device.

RedhawkDeviceImplIT.java
//Get Device Manager
RedhawkDeviceManager deviceManager = driver.getDomain().getDeviceManagerByName("Simulator.*");

//Get Device you want
RedhawkDeviceImpl device = (RedhawkDeviceImpl) deviceManager.getDeviceByName("FmRdsSimulator.*");


//Section 7.1 REDHAWK Manual for these properties
//Create Allocation Map
String allocId = "myTestAllocationId";
Map<String, Object> allocation = AllocationFactory.createTunerAllocation();
allocation.put(AllocationFactory.CENTER_FREQUENCY, 101100000d);
allocation.put(AllocationFactory.SAMPLE_RATE, 256000d);
allocation.put(AllocationFactory.BANDWIDTH_TOLERANCE, 20.0);
allocation.put(AllocationFactory.SAMPLE_RATE_TOLERANCE, 20.0);
allocation.put(AllocationFactory.ALLOCATION_ID, allocId);

//Allocate Device
device.allocate(allocation);

//Should now have a used tuner
assertEquals(false, device.getUsedTuners().isEmpty());

//Should now be no unused tuners
assertEquals(true, device.getUnusedTuners().isEmpty());

//Check to make sure center frequency is correct
assertEquals(101100000d, device.getUsedTuners().get(0).get("FRONTEND::tuner_status::center_frequency"));

//Deallocate Device
device.deallocate(allocId);

Example of How to Get and Set the Log Level of a Device

RedhawkLoggingIT.java
assertEquals(RedhawkLogLevel.INFO, dev.getLogLevel());

// Change log level
dev.setLogLevel(RedhawkLogLevel.TRACE);
assertEquals(RedhawkLogLevel.TRACE, dev.getLogLevel());

RedhawkEventChannelManager Code Examples

The following code examples explain how to use the RedhawkEventChannelManager interface.

Interacting with the EventChannelManager

RedhawkEventChannelManagerIT.java
RedhawkEventChannelManager ecManager = driver.getDomain().getEventChannelManager();

//Get the event channels in your domain
List<RedhawkEventChannel> eventChannels = ecManager.getEventChannels();

//Create an Event Channel
String eventChannelName  = "myEventChannel";
ecManager.createEventChannel(eventChannelName);

//Retrieve an Event Channel
RedhawkEventChannel ec = ecManager.getEventChannel(eventChannelName);

//Release an Event Channel
ecManager.releaseEventChannel(eventChannelName);

RedhawkEventChannel Code Examples

The following code examples explain how to use the RedhawkEventChannel interface.

Create an Event Channel Listener

The REDHAWKDriver has abstract classes that provide base functionality for the different event types provided in REDHAWK. Users may extend one of the Helper abstract classes as shown in the following example. If a Helper abstract class is extended, then the onMessage function must be implemented.

RedhawkEventChannelIT.java
class MyMessageListener extends GenericEventListener{
        private Integer messageCount = 0;

        public Integer getMessageCount() {
                return messageCount;
        }

        @Override
        public void onMessage(Object message) {
                //Code for what to do when you have a message.
                messageCount++;
                System.out.println("Received a message "+message);
                System.out.println("Message count: "+messageCount);
        }
}

Subscribe and Unsubscribe to an Event Channel

Using the Listener defined in the previous example, use the follwing code to subscribe to an Event Channel.

RedhawkEventChannelIT.java
RedhawkEventChannelImpl impl = (RedhawkEventChannelImpl) driver.getDomain().getEventChannelManager().getEventChannel("ODM_Channel");

MyMessageListener testMessageListener = new MyMessageListener();

//Register a listener and do stuff on events
impl.subscribe(testMessageListener);

Using the Listener defined in the previous example, use the following code to unsubscribe to and Event Channel:

RedhawkEventChannelIT.java
impl.unsubscribe();

Interacting with Event Channel Registrants

Every time a user subscribes or produces data to an Event Channel, a Registrant is created. The following code can be used to display the list of registrants and unsubscribe particular registrants.

RedhawkEventChannelIT.java
//Get Event Channel
RedhawkEventChannelImpl impl = (RedhawkEventChannelImpl) driver.getDomain().getEventChannelManager().getEventChannel("IDM_Channel");

//Get number of Registrants
Integer initialRegistrants = impl.getRegistrants(1000).size();
RedhawkEventChannelIT.java
//Unregister a registrant you added
impl.unsubscribe(new RedhawkEventRegistrant(subscriptionId, impl.getName(), null));

RedhawkAllocationManager Code Examples

The following code examples explain how to use the RedhawkAllocationManager interface.

Get the AllocationManager

RedhawkAllocationManagerIT.java
allocMgr = driver.getDomain().getAllocationManager();

List Devices from the AllocationManager

List Devices to which the AllocationManager has access.

RedhawkAllocationManagerIT.java
List<RedhawkDevice> devices = allocMgr.listDevices();

Allocate a Device

RedhawkAllocationManagerIT.java
//Get device from Device Manager
RedhawkDevice device = driver.getDeviceManager("REDHAWK_DEV/Simulator.*").getDevices().get(0);

String identifier = device.getIdentifier();

//Perform allocation
allocMgr.allocate(identifier, AllocationFactory.TUNER_ALLOCATION_TYPE, this.getAllocationProperties());
private Map<String, Object> getAllocationProperties(){
        String allocId = "myTestAllocationId";
        Map<String, Object> allocation = AllocationFactory.createTunerAllocation();
        allocation.put(AllocationFactory.CENTER_FREQUENCY, 101100000d);
        allocation.put(AllocationFactory.SAMPLE_RATE, 256000d);
        allocation.put(AllocationFactory.BANDWIDTH_TOLERANCE, 20.0);
        allocation.put(AllocationFactory.SAMPLE_RATE_TOLERANCE, 20.0);
        allocation.put(AllocationFactory.ALLOCATION_ID, allocId);

        return allocation;
}

Deallocate a Device

RedhawkAllocationManagerIT.java
//Use allocation manager to get a list of Allocations
List<AllocationInfo> allocation = allocMgr.getAllocations();

Integer allocNum = allocation.size();

assertTrue("Needs to be an allocation to deallocate ", allocNum>0);
String allocationId = allocMgr.getAllocations().get(0).getAllocationId();

//Deallocate a specific allocation
allocMgr.deallocate(allocationId);
assertEquals("Should be less allocations than original amount", allocNum-1, allocMgr.getAllocations().size());

RedhawkConnectionManager Code Examples

The following code examples explain how to use the RedhawkConnectionManager interface.

Get the ConnectionManager

RedhawkConnectionManagerIT.java
connectionManager = driver.getDomain().getConnectionManager();

Create A REDHAWK Endpoint

RedhawkConnectionManagerIT.java
private RedhawkPortEndpoint createRedhawkEndpoint(RedhawkPort port, String resourceId, EndpointType type){
        return new RedhawkPortEndpoint(type, resourceId, port);
}

Connect a Device Port to an Application Port

RedhawkConnectionManagerIT.java
//Create application
String appName = "FM_RBDS_demo";
RedhawkApplication app = driver.getDomain().createApplication(appName, "/waveforms/rh/FM_RBDS_demo/FM_RBDS_demo.sad.xml");

//Create Endpoints
String connectionId = "myConnection";
RedhawkEndpoint providesEndpoint = this.createRedhawkEndpoint(app.getPort("tunerFloat_in"), app.getIdentifier(), EndpointType.Application);

RedhawkDevice dev = driver.getDevice("REDHAWK_DEV/Simulator.*/FmRds.*");
RedhawkEndpoint usesEndpoint = this.createRedhawkEndpoint(dev.getPort("dataFloat_out"), dev.getIdentifier(), EndpointType.Device);

//Number of connections prior to creating one
Integer connectionNumber = connectionManager.getConnections().size();
assertEquals("Should be zero connections currently", new Integer(0), connectionNumber);
connectionManager.connect(usesEndpoint, providesEndpoint, UUID.randomUUID().toString(), connectionId);

//Connection size should have gone up 1
assertEquals("Should be 1 connection", 1, connectionManager.getConnections().size());
assertEquals("Number of connection should be "+connectionNumber+1, connectionNumber+1, connectionManager.getConnections().size());

Connect Two Application Ports

RedhawkConnectionManagerIT.java
//Create Applications
providesApp = driver.getDomain().createApplication(appName, "/waveforms/rh/FM_RBDS_demo/FM_RBDS_demo.sad.xml");
usesApp = driver.getDomain().createApplication(connMgrTestAppName, new File("src/test/resources/waveforms/ConnectionManagerTest/ConnectionManagerTest.sad.xml"));

//Create Endpoints
RedhawkEndpoint usesEndpoint = this.createRedhawkEndpoint(usesApp.getPort("floatOutput"), usesApp.getIdentifier(), EndpointType.Application);
RedhawkEndpoint providesEndpoint = this.createRedhawkEndpoint(providesApp.getPort("tunerFloat_in"), providesApp.getIdentifier(), EndpointType.Application);

//Number of connections prior to creating one
Integer connectionNumber = connectionManager.getConnections().size();
assertEquals("Should be zero connections currently", new Integer(0), connectionNumber);
connectionManager.connect(usesEndpoint, providesEndpoint, UUID.randomUUID().toString(), connectionId);

//Connection size should have gone up 1
assertEquals("Should be 1 connection", 1, connectionManager.getConnections().size());
assertEquals("Number of connection should be "+connectionNumber+1, connectionNumber+1, connectionManager.getConnections().size());

Connect Application Port to an Event Channel

RedhawkConnectionManagerIT.java
//Create Application and Event Channel
usesApp = driver.getDomain().createApplication(connMgrTestAppName, new File("src/test/resources/waveforms/ConnectionManagerTest/ConnectionManagerTest.sad.xml"));
driver.getDomain().getEventChannelManager().createEventChannel(channelName);
eventChannel = driver.getDomain().getEventChannelManager().getEventChannel(channelName);

//Create Endpoints
RedhawkEndpoint usesEndpoint = this.createRedhawkEndpoint(usesApp.getPort("messageOut"), usesApp.getIdentifier(), EndpointType.Application);
RedhawkEndpoint providesEndpoint = new RedhawkEventChannelEndpoint(EndpointType.EventChannel, eventChannel.getName(), eventChannel);

//Number of connections prior to creating one
Integer connectionNumber = connectionManager.getConnections().size();
assertEquals("Should be zero connections currently", new Integer(0), connectionNumber);
connectionManager.connect(usesEndpoint, providesEndpoint, UUID.randomUUID().toString(), connectionId);

//Connection size should have gone up 1
assertEquals("Should be 1 connection", 1, connectionManager.getConnections().size());
assertEquals("Number of connection should be "+connectionNumber+1, connectionNumber+1, connectionManager.getConnections().size());

REDHAWK Connector

Overview

Using the REDHAWK Connector to create a Redhawk Connection results in the following:

  • A REDHAWK Driver instance is registered in the OSGi Service Registry.

  • A REDHAWK Camel Component is resolved with the Connection Name configured.

  • A Websocket service is available for the connection.

  • A REST Endpoint is available for the connection.

Configuring REDHAWK Connector

Table 1. Configuration Table

Name

Key

Required

Default

Description

Connection Name

connectionName

Yes

null

Unique name used to identify this connection.

Server Name

host

Yes

localhost

Hostname or IP Address of the CORBA Naming Service.

Port

port

Yes

2809

Port where the CORBA naming service is listening.

Domain Manager Location

domainManager

No

REDHAWK_DEV

Optional name of the REDHAWK Domain Manager (as found in the CORBA Naming Service).

Device Manager Name

deviceManagerName

No

null

The name of the Device Manager to register with REDHAWK.

Device Manager File System

deviceManagerFileSystemRoot

No

null

The filesystem root of the Device Manager.

Creating a REDHAWK Connector Configuration

To create a REDHAWK Connector configuration in the Karaf web console:

  1. Open a browser to /system/console/configMgr of your running Karaf instance. For example:

    http://127.0.0.1:8181/system/console/configMgr

    You are prompted to enter a username and password.

  2. Enter a username and password. (The default username is karaf, and the default password is karaf.)

    Tip
    To change the default username or password, refer to the Apache Karaf documentation.
  3. In the list of configurable services displayed on the Apache Karaf Web Console Configuration page, locate REDHAWK Connector.

  4. To add a new configuration, click the '+' button.

    The REDHAWK Connector page is displayed.

    KarafConfiguration
  5. Enter the appropriate information for the new configuration and click Save.

    The new configuration is displayed in the list of configurable services.

To create a REDHAWK Connector configuration using a file:

  • In the $karaf.base/etc directory, add a file with this prefix: redhawk.datasource.factory and append a unique string with a leading dash (for example, -myConfig.cfg).

Example config file
connectionName=localRH
port=2809
host=localhost
domainManager=REDHAWK_DEV

Using Connection in blueprint

To inject the Redhawk Driver instance into your application, add the following lines in your blueprint.xml file:

<reference id="myRedhawkService" interface="redhawk.Redhawk" filter="(connectionName='insert connection name'"/>)

<bean id="myApplicationBean" class="com.example.MyApplicationBeanImpl">
        <property name="redhawk" ref="myRedhawkService" />
</bean>

REDHAWK REST

Overview

Version information

Version : 2.1.2

URI scheme

Host : 127.0.0.1
BasePath : rest/redhawk
Schemes : HTTP, HTTPS

Tags

  • {nameserver}domains

  • {nameserver}domains{domain}applications

  • {nameserver}domains{domain}applications{applicationId}components

  • {nameserver}domains{domain}applications{applicationId}components{componentId}ports

  • {nameserver}domains{domain}applications{applicationId}components{componentId}softwarecomponent

  • {nameserver}domains{domain}devicemanagers

  • {nameserver}domains{domain}devicemanagers{devmanager}devices

  • {nameserver}domains{domain}devicemanagers{devmanager}devices{deviceId}ports

  • {nameserver}domains{domain}eventchannels

  • {nameserver}domains{domain}metrics

  • {nameserver}domains{domain}waveforms

Note

If using the KARAF distribution see the ${karaf.home}/etc/users.properties file for username and password information. If using the Jetty distribution see the ${jetty.home}/etc/login.properties file for username and password information.

nameserver is the host/IP and the port of the omniNames server. This configuration is found in your omniORB.cfg file, and the line specifying the configuration is similar to the following:

InitRef = NameService=corbaname::127.0.0.1:2809

Use that host and port combination for the nameserver parameter in your URL. Below is the structure of a base URL for the REDHAWK REST endpoints:

http://{host}:8181/rest/redhawk/{nameserver host}:{nameserver port}

If you are using the REDHAWK Connector, you can replace nameserver and port with the connection name you specified when you created the connection. Refer to the REDHAWK Connector chapter for more details.

http://{host}:8181/rest/redhawk/{redhawk-connection-name}

Paths

GET REDHAWK Domains

GET /{nameserver}/domains
Parameters
Type Name Schema Default

Query

fetch
optional

enum (EAGER, LAZY)

"EAGER"

Responses
HTTP Code Description Schema

200

successful operation

DomainContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains

GET REDHAWK Domain

GET /{nameserver}/domains/{domain}
Parameters
Type Name Description Schema

Path

domain
required

Name of REDHAWK Domain

string

Responses
HTTP Code Description Schema

200

successful operation

Domain

Produces
  • application/json

  • application/xml

  • text/plain

Tags
  • {nameserver}domains

GET Applications for a REDHAWK Domain

GET /{nameserver}/domains/{domain}/applications
Parameters
Type Name Schema Default

Query

fetch
optional

enum (EAGER, LAZY)

"EAGER"

Responses
HTTP Code Description Schema

200

successful operation

ApplicationContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

Stop/Start Application

POST /{nameserver}/domains/{domain}/applications/{applicationId}
Parameters
Type Name Description Schema

Path

applicationId
required

ID for Application

string

Body

body
required

Action to take on application start/stop

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

Tags
  • {nameserver}domains{domain}applications

GET Application for a REDHAWK Domain

GET /{nameserver}/domains/{domain}/applications/{applicationId}
Parameters
Type Name Schema

Path

applicationId
required

string

Responses
HTTP Code Description Schema

200

successful operation

Application

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

Release Application from a REDHAWK Domain

DELETE /{nameserver}/domains/{domain}/applications/{applicationId}
Parameters
Type Name Description Schema

Path

applicationId
required

ID for Application

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

GET Application Components

GET /{nameserver}/domains/{domain}/applications/{applicationId}/components
Parameters
Type Name Schema Default

Query

fetch
optional

enum (EAGER, LAZY)

"EAGER"

Responses
HTTP Code Description Schema

200

successful operation

ComponentContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components

GET Application Component

GET /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}
Parameters
Type Name Description Schema

Path

componentId
required

Name of Component

string

Responses
HTTP Code Description Schema

200

successful operation

Component

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components

GET REDHAWK Component Ports

GET /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}/ports
Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components{componentId}ports

GET REDHAWK Component Port

GET /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}/ports/{portId}
Parameters
Type Name Schema

Path

portId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components{componentId}ports

DELETE a Connection from a Port by connectionId

DELETE /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}/ports/{portId}/disconnect/{connectionId}
Parameters
Type Name Schema

Path

connectionId
required

string

Path

portId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components{componentId}ports

GET REDHAWK Component Port SRI

GET /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}/ports/{portId}/sri
Parameters
Type Name Schema

Path

portId
required

string

Responses
HTTP Code Description Schema

200

successful operation

SRIContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components{componentId}ports

GET REDHAWK Component Port Statistics

GET /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}/ports/{portId}/statistics
Parameters
Type Name Schema

Path

portId
required

string

Responses
HTTP Code Description Schema

200

successful operation

PortStatisticsContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components{componentId}ports

GET Application Component Properties

GET /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}/properties
Parameters
Type Name Schema

Path

componentId
required

string

Responses
HTTP Code Description Schema

200

successful operation

PropertyContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components

GET Application Component Property

GET /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}/properties/{propId}
Parameters
Type Name Description Schema

Path

componentId
required

Name of Component

string

Path

propId
required

Name of Property

string

Responses
HTTP Code Description Schema

200

successful operation

Property

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components

Set Application Component Property

PUT /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}/properties/{propId}
Parameters
Type Name Description Schema

Path

componentId
required

string

Path

propId
required

string

Body

body
required

Information to update property

FullProperty

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components

GET SCD for REDHAWK Component

GET /{nameserver}/domains/{domain}/applications/{applicationId}/components/{componentId}/softwarecomponent
Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications{applicationId}components{componentId}softwarecomponent

GET Application metrics with a filter

POST /{nameserver}/domains/{domain}/applications/{applicationId}/metrics
Parameters
Type Name Description Schema

Path

applicationId
required

ID for Application

string

Body

body
optional

Filter for metrics

MetricFilter

Responses
HTTP Code Description Schema

200

successful operation

< string, object > map

Produces
  • application/json

Tags
  • {nameserver}domains{domain}applications

GET Application metrics

GET /{nameserver}/domains/{domain}/applications/{applicationId}/metrics
Parameters
Type Name Description Schema

Path

applicationId
required

ID for Application

string

Responses
HTTP Code Description Schema

200

successful operation

< string, object > map

Produces
  • application/json

Tags
  • {nameserver}domains{domain}applications

GET Application Ports

GET /{nameserver}/domains/{domain}/applications/{applicationId}/ports
Parameters
Type Name Description Schema

Path

applicationId
required

ID/Name for Application

string

Responses
HTTP Code Description Schema

200

successful operation

ExternalPortContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

GET Application Port

GET /{nameserver}/domains/{domain}/applications/{applicationId}/ports/{portId}
Parameters
Type Name Description Schema

Path

applicationId
required

ID/Name for Application

string

Path

portId
required

External name for Port

string

Responses
HTTP Code Description Schema

200

successful operation

ExternalPort

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

DELETE a Connection from a Port by connectionId

DELETE /{nameserver}/domains/{domain}/applications/{applicationId}/ports/{portId}/disconnect/{connectionId}
Parameters
Type Name Description Schema

Path

applicationId
required

ID/Name for Application

string

Path

connectionId
required

string

Path

portId
required

External name for Port

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

GET Application Port SRI

GET /{nameserver}/domains/{domain}/applications/{applicationId}/ports/{portId}/sri
Parameters
Type Name Description Schema

Path

applicationId
required

ID/Name for Application

string

Path

portId
required

External name for Port

string

Responses
HTTP Code Description Schema

200

successful operation

SRIContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

GET Application Port Statistics

GET /{nameserver}/domains/{domain}/applications/{applicationId}/ports/{portId}/statistics
Parameters
Type Name Description Schema

Path

applicationId
required

ID/Name for Application

string

Path

portId
required

External name for Port

string

Responses
HTTP Code Description Schema

200

successful operation

PortStatisticsContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

GET Application Properties

GET /{nameserver}/domains/{domain}/applications/{applicationId}/properties
Parameters
Type Name Description Schema

Path

applicationId
required

ID for Application

string

Responses
HTTP Code Description Schema

200

successful operation

PropertyContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

GET Application Property

GET /{nameserver}/domains/{domain}/applications/{applicationId}/properties/{propId}
Parameters
Type Name Description Schema

Path

applicationId
required

ID/Name for Application

string

Path

propId
required

ID/Name for Property

string

Responses
HTTP Code Description Schema

200

successful operation

Property

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

Set Application Property

PUT /{nameserver}/domains/{domain}/applications/{applicationId}/properties/{propId}
Parameters
Type Name Description Schema

Path

applicationId
required

ID for Application

string

Path

propId
required

ID/Name for Property

string

Body

body
required

Updates for property

FullProperty

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

Launch Application

PUT /{nameserver}/domains/{domain}/applications/{instanceName}
Parameters
Type Name Description Schema

Path

instanceName
required

Name for Application

string

Body

body
required

SAD file Location w/ optional Id/name of waveform

WaveformInfo

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}applications

GET REDHAWK Device Managers

GET /{nameserver}/domains/{domain}/devicemanagers
Parameters
Type Name Schema Default

Query

fetch
optional

enum (EAGER, LAZY)

"EAGER"

Responses
HTTP Code Description Schema

200

successful operation

DeviceManagerContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers

GET REDHAWK Device Manager

GET /{nameserver}/domains/{domain}/devicemanagers/{devMgrId}
Parameters
Type Name Schema

Path

devMgrId
required

string

Responses
HTTP Code Description Schema

200

successful operation

DeviceManager

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers

DELETE REDHAWK Device Manager

DELETE /{nameserver}/domains/{domain}/devicemanagers/{devMgrId}
Parameters
Type Name Schema

Path

devMgrId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers

Set REDHAWK Device Manager properties

POST /{nameserver}/domains/{domain}/devicemanagers/{devMgrId}/properties
Parameters
Type Name Description Schema

Path

devMgrId
required

string

Body

body
required

List of updates to make to DeviceManager properties

< FullProperty > array

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers

GET REDHAWK Device Manager Properties

GET /{nameserver}/domains/{domain}/devicemanagers/{devMgrId}/properties
Parameters
Type Name Schema

Path

devMgrId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers

GET REDHAWK Device Manager Property

GET /{nameserver}/domains/{domain}/devicemanagers/{devMgrId}/properties/{propId}
Parameters
Type Name Schema

Path

devMgrId
required

string

Path

propId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers

Set REDHAWK Device Manager Property

PUT /{nameserver}/domains/{domain}/devicemanagers/{devMgrId}/properties/{propId}
Parameters
Type Name Description Schema

Path

devMgrId
required

string

Path

propId
required

string

Body

body
required

Updates to make to property

FullProperty

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers

GET REDHAWK Devices

GET /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices
Parameters
Type Name Schema Default

Query

fetch
optional

enum (EAGER, LAZY)

"EAGER"

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

GET REDHAWK Device

GET /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}
Parameters
Type Name Schema

Path

deviceId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

Set REDHAWK Device AdminState

PUT /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/adminstate
Parameters
Type Name Description Schema

Path

deviceId
required

string

Body

body
required

AdminState for the Device(e.g. LOCKED/UNLOCKED)

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

Allocate a REDHAWK Device

POST /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/allocate
Parameters
Type Name Description Schema

Path

deviceId
required

string

Body

body
required

Map representing an allocation

< string, object > map

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

Deallocate a REDHAWK Device

POST /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/deallocate
Parameters
Type Name Description Schema

Path

deviceId
required

string

Body

body
required

Allocation Id to delete

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

GET REDHAWK Device Ports

GET /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/ports
Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices{deviceId}ports

GET REDHAWK Device Port

GET /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/ports/{portId}
Parameters
Type Name Schema

Path

portId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices{deviceId}ports

GET REDHAWK Port Statistics for a Device

GET /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/ports/{portId}/statistics
Parameters
Type Name Schema

Path

portId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices{deviceId}ports

Set REDHAWK Device Properties

POST /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/properties
Parameters
Type Name Description Schema

Path

deviceId
required

string

Body

body
required

List of properties to update

< FullProperty > array

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

GET REDHAWK Device Properties

GET /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/properties
Parameters
Type Name Schema

Path

deviceId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

GET REDHAWK Device Property

GET /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/properties/{propId}
Parameters
Type Name Schema

Path

deviceId
required

string

Path

propId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

Set REDHAWK Device Property

PUT /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/properties/{propId}
Parameters
Type Name Description Schema

Path

deviceId
required

string

Path

propId
required

string

Body

body
required

Property to update

FullProperty

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

GET REDHAWK Device by tuner mode

GET /{nameserver}/domains/{domain}/devicemanagers/{devmanager}/devices/{deviceId}/tuners/{tunerMode}
Parameters
Type Name Schema

Path

deviceId
required

string

Path

tunerMode
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}devicemanagers{devmanager}devices

GET REDHAWK Event Channels

GET /{nameserver}/domains/{domain}/eventchannels
Responses
HTTP Code Description Schema

200

successful operation

EventChannelContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}eventchannels

GET REDHAWK Event Channel

GET /{nameserver}/domains/{domain}/eventchannels/{eventchannel}
Parameters
Type Name Schema

Path

eventchannel
required

string

Responses
HTTP Code Description Schema

200

successful operation

EventChannel

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}eventchannels

Create REDHAWK Event Channel

PUT /{nameserver}/domains/{domain}/eventchannels/{eventchannel}
Parameters
Type Name Schema

Path

eventchannel
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}eventchannels

DELETE REDHAWK Event Channel

DELETE /{nameserver}/domains/{domain}/eventchannels/{eventchannel}
Parameters
Type Name Schema

Path

eventchannel
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}eventchannels

DELETE REDHAWK Event Channel Registrant

DELETE /{nameserver}/domains/{domain}/eventchannels/{eventchannel}/registrant/{id}
Parameters
Type Name Schema

Path

eventchannel
required

string

Path

id
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}eventchannels

GET Metrics for a Domain

GET /{nameserver}/domains/{domain}/metrics
Responses
HTTP Code Description Schema

200

successful operation

RedhawkMetrics

Produces
  • application/json

Tags
  • {nameserver}domains{domain}metrics

GET all Application Metrics for a Domain

GET /{nameserver}/domains/{domain}/metrics/application
Responses
HTTP Code Description Schema

200

successful operation

< object > array

Produces
  • application/json

Tags
  • {nameserver}domains{domain}metrics

GET an Applications metrics

GET /{nameserver}/domains/{domain}/metrics/application/{applicationFilter}
Parameters
Type Name Description Schema

Path

applicationFilter
required

regex/application name

string

Responses
HTTP Code Description Schema

200

successful operation

< object > array

Produces
  • application/json

Tags
  • {nameserver}domains{domain}metrics

Retrieve a specific application metric based on a filter

POST /{nameserver}/domains/{domain}/metrics/application/{applicationName}
Parameters
Type Name Description Schema

Path

applicationName
required

application name

string

Body

body
optional

MetricFilter

Responses
HTTP Code Description Schema

200

successful operation

< string, object > map

Consumes
  • application/json

Produces
  • application/json

Tags
  • {nameserver}domains{domain}metrics

GET available metrics

GET /{nameserver}/domains/{domain}/metrics/available
Responses
HTTP Code Description Schema

200

successful operation

< string, object > map

Produces
  • application/json

Tags
  • {nameserver}domains{domain}metrics

GET GPP Metrics for a Domain

GET /{nameserver}/domains/{domain}/metrics/gpp
Responses
HTTP Code Description Schema

200

successful operation

< object > array

Produces
  • application/json

Tags
  • {nameserver}domains{domain}metrics

GET GPP Metrics for a Domain using a filter

GET /{nameserver}/domains/{domain}/metrics/gpp/{gppFilter}
Parameters
Type Name Description Schema

Path

gppFilter
required

regex/gpp name

string

Responses
HTTP Code Description Schema

200

successful operation

< object > array

Produces
  • application/json

Tags
  • {nameserver}domains{domain}metrics

GET all Port Metrics for a Domain

GET /{nameserver}/domains/{domain}/metrics/port
Responses
HTTP Code Description Schema

200

successful operation

< object > array

Produces
  • application/json

Tags
  • {nameserver}domains{domain}metrics

Set Properties on a REDHAWK Domain

POST /{nameserver}/domains/{domain}/properties
Parameters
Type Name Description Schema

Path

domain
required

Name of REDHAWK Domain

string

Body

body
required

List of Properties to set

< FullProperty > array

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains

GET REDHAWK Domain Properties

GET /{nameserver}/domains/{domain}/properties
Parameters
Type Name Description Schema

Path

domain
required

Name of REDHAWK Domain

string

Responses
HTTP Code Description Schema

200

successful operation

PropertyContainer

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains

GET REDHAWK Domain Property

GET /{nameserver}/domains/{domain}/properties/{propId}
Parameters
Type Name Description Schema

Path

domain
required

Name of REDHAWK Domain

string

Path

propId
required

Property name/ID

string

Responses
HTTP Code Description Schema

200

successful operation

Property

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains

Set a Property on a REDHAWK Domain

PUT /{nameserver}/domains/{domain}/properties/{propId}
Parameters
Type Name Description Schema

Path

domain
required

Name of REDHAWK Domain

string

Path

propId
required

Property name/ID

string

Body

body
required

Property to set

FullProperty

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains

Register a Remote REDHAWK Domain

POST /{nameserver}/domains/{domain}/registerremotedomain
Parameters
Type Name Description Schema

Path

domain
required

Name of REDHAWK Domain

string

Body

body
required

Remote Domain Information

RemoteDomainRegistrar

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains

Set a Property on a REDHAWK Domain

DELETE /{nameserver}/domains/{domain}/unregisterremotedomain
Parameters
Type Name Description Schema

Path

domain
required

Name of REDHAWK Domain

string

Body

body
required

Remote Domain Name

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Consumes
  • application/json

  • application/xml

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains

GET Waveforms in a REDHAWK Domain

GET /{nameserver}/domains/{domain}/waveforms
Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}waveforms

Returns a Specific Waveform in a REDHAWK Domain

GET /{nameserver}/domains/{domain}/waveforms/{waveformId}
Parameters
Type Name Schema

Path

waveformId
required

string

Responses
HTTP Code Description Schema

default

successful operation

No Content

Produces
  • application/json

  • application/xml

Tags
  • {nameserver}domains{domain}waveforms

Definitions

Action

Name Schema

type
optional

enum (GE, GT, EXTERNAL, LE, LT, NE, EQ)

Application

Name Description Schema

aware
optional

Default : false

boolean

components
optional

< Component > array

externalPorts
optional

< ExternalPort > array

identifier
optional

string

name
optional

string

properties
optional

< Property > array

started
optional

Default : false

boolean

ApplicationContainer

Name Schema

applications
optional

< Application > array

ApplicationMetrics

Name Schema

application
optional

string

dateTime
optional

string

metrics
optional

< < string, object > map > array

Component

Name Description Schema

configuration
optional

Properties

deviceIdentifier
optional

string

implementation
optional

string

name
optional

string

ports
optional

< Port > array

processId
optional

integer(int32)

properties
optional

< Property > array

softwareComponent
optional

Softwarecomponent

started
optional

Default : false

boolean

ComponentContainer

Name Schema

components
optional

< Component > array

ComponentFeatures

Name Schema

ports
required

Ports

supportsinterfaces
optional

< SupportsInterface > array

ComponentRepId

Name Schema

repid
optional

string

ConfigurationKind

Name Schema

kindtype
optional

enum (CONFIGURE, ALLOCATION, FACTORYPARAM, TEST, EVENT, MESSAGE, PROPERTY)

Device

Name Description Schema

adminState
optional

enum (LOCKED, SHUTTING_DOWN, UNLOCKED)

identifier
optional

string

implementation
optional

string

label
optional

string

operationState
optional

enum (ENABLED, DISABLED)

properties
optional

< Property > array

started
optional

Default : false

boolean

usageState
optional

enum (IDLE, ACTIVE, BUSY)

DeviceManager

Name Schema

devices
optional

< Device > array

identifier
optional

string

label
optional

string

properties
optional

< Property > array

services
optional

< Service > array

DeviceManagerContainer

Name Schema

deviceManagers
optional

< DeviceManager > array

Domain

Name Schema

applications
optional

< Application > array

deviceManagers
optional

< DeviceManager > array

eventChannels
optional

< EventChannel > array

identifier
optional

string

name
optional

string

properties
optional

< Property > array

remoteDomains
optional

< string > array

DomainContainer

Name Schema

domains
optional

< Domain > array

Enumeration

Name Schema

label
optional

string

value
optional

string

Enumerations

Name Schema

enumerations
required

< Enumeration > array

EventChannel

Name Schema

name
optional

string

registrantIds
optional

< string > array

EventChannelContainer

Name Schema

eventChannels
optional

< EventChannel > array

ExternalPort

Name Schema

componentRefId
optional

string

connectionIds
optional

< string > array

description
optional

string

externalname
optional

string

name
optional

string

repId
optional

string

state
optional

string

type
optional

string

ExternalPortContainer

Name Schema

ports
optional

< ExternalPort > array

FullProperty

Name Schema

action
optional

Action

attributes
optional

< object > array

commandline
optional

enum (FALSE, TRUE)

complex
optional

enum (FALSE, TRUE)

configurationKinds
optional

< ConfigurationKind > array

dataType
optional

string

description
optional

string

enumerations
optional

Enumerations

id
optional

string

kinds
optional

< Kind > array

mode
optional

enum (WRITEONLY, READONLY, READWRITE)

name
optional

string

optional
optional

enum (FALSE, TRUE)

propertyValueType
optional

enum (STRING, BOOLEAN, ULONG, OBJREF, SHORT, FLOAT, OCTET, CHAR, USHORT, DOUBLE, LONG, LONGLONG, ULONGLONG)

range
optional

Range

structs
optional

< object > array

type
optional

string

units
optional

string

value
optional

string

values
optional

< object > array

GPPMetrics

Name Schema

component_monitor
optional

< < string, object > map > array

dateTime
optional

string

device
optional

string

nic_metrics
optional

< < string, object > map > array

sys_limits
optional

< string, object > map

utilization
optional

< string, object > map

InheritsInterface

Name Schema

repid
optional

string

Interface

Name Schema

inheritsinterfaces
optional

< InheritsInterface > array

name
optional

string

repid
optional

string

Interfaces

Name Schema

interfaces
required

< Interface > array

Kind

Name Schema

kindtype
optional

enum (CONFIGURE, EXECPARAM, ALLOCATION, FACTORYPARAM, TEST, EVENT, MESSAGE, PROPERTY)

LocalFile

Name Schema

name
optional

string

MetricFilter

Name Schema

attributes
optional

< string > array

components
optional

< string > array

Port

Name Schema

connectionIds
optional

< string > array

name
optional

string

repId
optional

string

state
optional

string

type
optional

string

PortMetrics

Name Schema

application
optional

string

component
optional

string

dateTime
optional

string

port
optional

string

statistics
optional

< RedhawkPortStatistics > array

PortStatisticsContainer

Name Schema

statistics
optional

< RedhawkPortStatistics > array

Ports

Name Schema

providesAndUses
optional

< object > array

Properties

Name Schema

description
optional

string

simplesAndSimplesequencesAndTests
optional

< object > array

Property

Name Schema

description
optional

string

externalId
optional

string

id
optional

string

mode
optional

enum (WRITEONLY, READONLY, READWRITE)

name
optional

string

type
optional

string

PropertyContainer

Name Schema

properties
optional

< Property > array

PropertyFile

Name Schema

localfile
required

LocalFile

type
optional

string

Range

Name Schema

max
optional

string

min
optional

string

RedhawkMetrics

Name Schema

applicationMetrics
optional

< ApplicationMetrics > array

gppMetrics
optional

< GPPMetrics > array

portStatistics
optional

< PortMetrics > array

RedhawkPortStatistics

Name Schema

averageQueueDepth
optional

number(float)

bitsPerSecond
optional

number(float)

callsPerSecond
optional

number(float)

connectionId
optional

string

elementsPerSecond
optional

number(float)

keyWords
optional

< object > array

portName
optional

string

streamIDs
optional

< string > array

timeSinceLastCall
optional

number(float)

RedhawkStreamSRI

Name Description Schema

blocking
optional

Default : false

boolean

hversion
optional

integer(int32)

keywords
optional

< object > array

mode
optional

integer(int32)

streamID
optional

string

subsize
optional

integer(int32)

xdelta
optional

number(double)

xstart
optional

number(double)

xunits
optional

integer(int32)

ydelta
optional

number(double)

ystart
optional

number(double)

yunits
optional

integer(int32)

RemoteDomainRegistrar

Name Description Schema

domainName
required

Remote domain name to registrar

string

nameServerHost
required

omniORB host for the remote domain

string

nameServerPort
required

omniORB port for the remote domain

integer(int32)

SRIContainer

Name Schema

sris
optional

< RedhawkStreamSRI > array

Service

Name Schema

name
optional

string

Softwarecomponent

Name Schema

componentfeatures
required

ComponentFeatures

componentrepid
required

ComponentRepId

componenttype
required

string

corbaversion
required

string

interfaces
required

Interfaces

propertyfile
optional

PropertyFile

SupportsInterface

Name Schema

repid
optional

string

supportsname
optional

string

WaveformInfo

Name Schema

id
optional

string

name
optional

string

sadLocation
optional

string

REDHAWK WebSocket

Overview

Provides an HTML5-compliant WebSocket implementation that enables the ability to stream data from any REDHAWK BulkIO Port or Event Channel.

As long as HTTPS is enabled, Jetty will host each of the following endpoints in the wss (WebSocket Secure) protocol as well.

Connecting to the REDHAWK WebSocket

The WebSocket servlet resides at ws://{hostname}:8181/ws/redhawk.

  • To connect to a specific REDHAWK installation, provide the hostname/address along with the Port of the OmniORB Naming Server.

ws://localhost:8181/ws/redhawk/localhost:2809
  • If you are using the REDHAWK Connector, you can replace the address and Port with the connection name you specified when you created the connection.

ws://localhost:8181/ws/redhawk/redhawk-connection-name

REDHAWK Component Port Connection

To connect to a Component Port, use this syntax:

application/{applicationName}/components/{componentName}/ports/{portName}

The applicationName, componentName and portName variables all support matching on regular expressions. The following example is a complete Component Port url:

ws://localhost:8181/ws/redhawk/localRH/domains/REDHAWK_DEV/applications/myApplication/components/SigGen.*/ports/dataFloat_out.json

REDHAWK Device Port Connection

To connect to a Device Port, use this syntax:

devicemanagers/{deviceManagerName}/devices/{deviceLabel}/ports/{portName}

The deviceManagerName, deviceLabel, portName variables all support matching on regular expressions.

REDHAWK Event Channel Connection

To connect to an Event Channel, use this syntax: eventchannels/{eventChannelName}. The following example is a complete url for an Event Channel:

ws://localhost:8181/ws/redhawk/localRH/domains/REDHAWK_DEV/eventchannels/ODM_Channel

Code Example

The following example is a complete javascript example to connect to a REDHAWK Websocket:

var webSocket = new WebSocket('ws://localhost:8181/ws/redhawk/localRH/domains/REDHAWK_DEV/applications/myApplication/components/SigGen.*/ports/dataFloat_out.json')

webSocket.onopen = function(evt){ console.log('connected');}
webSocket.onmessage = function(evt){ console.log('message received '+evt.data);}

REDHAWK Camel Component

The REDHAWK Camel Component provides a convenient method to integrate REDHAWK Domain functionality in a Camel Context. Apache Camel is a tool for solving any routing (data flow) or mediation problems within your system. Using Apache Camel provides access to 100+ Components to solve routing/mediation problems. For example, if your system needs to persist data from an Event Channel, rather than writing more code, you can reuse the Components already provided by Camel to store your data in NoSQL/SQL data stores. Another possible use case is if your system needs to send data from the REDHAWK Corba File System to a JMS solution for distribution, rather than writing more code, you can integrate with one of the Camel Components for JMS. For additional information about using Apache Camel with your product, refer to the Apache Camel documentation.

REDHAWK Data Endpoint

Enables direct interaction between REDHAWK Component Ports and your Apache Camel Context.

URI Format

redhawk://data:<nameserver host>:<nameserver port>:<domain name>?waveformName=<waveform name>&componentName=<component name>&portName=<port name>&portType=<port type>
  • If you are using the REDHAWK Connector, you can replace the host, port, and domain name parameters with the Connection Name you specified when you configured your REDHAWK Connection. Make sure you specify Domain Manager in your REDHAWK Connector configuration. Refer to the REDHAWK Connector chapter for more details.

redhawk://data:<redhawk-connection-name>

Endpoint Options

Enables direct interaction between a REDHAWK Corba FileSystem and your Apache Camel Context.

The REDHAWK Data endpoint options are described in the following table.

Name

Default Value

Description

bufferSize

2000

Size of buffer for holding queued packets waiting to be processed.

decimateTo

-1

Sample size to take from the packets.

REDHAWK File Endpoint

Enables direct interaction between a REDHAWK Event Channel and your Apache Camel Context.

URI Format

redhawk://file-manager:<nameserver host>:<nameserver port>:<domain name>?directory=<directory on FS>
  • If you are using the REDHAWK Connector, you can replace the host, port, and domain name parameters with the Connection Name you specified when you configured your REDHAWK Connection. Make sure you specify Domain Manager in your REDHAWK Connector configuration. Refer to the REDHAWK Connector chapter for more details.

redhawk://file-manager:<redhawk-connection-name>

Endpoint Options

Enables direct interaction between a REDHAWK Corba FileSystem and your Apache Camel Context.

The REDHAWK File endpoint options are described in the following table.

Name

Default Value

Description

fileManagerType

domain

Location of the root of Corba FileSystem. If domain, then root is $SDROOT/dom . If dev, then root is root of the Device Manager you set.

deviceManagerName

n/a

Name of the Device Manager. Only used if the fileManagerType is device.

REDHAWK Event Channel Endpoint

URI Format

redhawk://event-channel:<nameserver host>:<nameserver port>:<domain name>?eventChannelName=<event channel name>&dataTypeName=<type of message>
  • If you are using the REDHAWK Connector, you can replace the host, port, and domain name parameters with the Connection Name you specified when you configured your REDHAWK Connection. Make sure you specify Domain Manager in your REDHAWK Connector configuration. Refer to the REDHAWK Connector chapter for more details.

redhawk://event-channel:<redhawk-connection-name>

Endpoint Options

Enables direct interaction between a REDHAWK Corba FileSystem and your Apache Camel Context.

The REDHAWK Event Channel endpoint options are described in the following table.

Name

Default Value

Description

eventChannelName

n/a

Name of the event channel to be used.

dataTypeName

n/a

Type of message for which to listen. Options are messages, properties, logEvent, propertyChanges.

Working with the Shell

The shell provides a convenient method to use the REDHAWK Driver without an IDE or other development tools. It’s mainly a trouble shooting tool for developers so don’t expect to do everything you can do in an IDE with the shell. The shell is using a Java REPL(Read, Excecute, Print, Loop) and it’s source can be found here. To start the REDHAWK Driver shell environment:

Important
The following commands require access to a REDHAWK Domain and GPP.
  1. Run the jrepl script:

     ./jrepl

    In the console, you have access to the necessary imports for REDHAWK Driver via :eval driver-imports. You also have access to all the classes in REDHAWK Driver.

Tip
For additional instructions and information on trouble shooting, refer to the README.md file in the shell directory.

Example Commands

  • To create an Application:

    driver = new RedhawkDriver();
    application = driver.getDomain("REDHAWK_DEV").createApplication("MyFirstApplication", "/waveforms/rh/FM_mono_demo/FM_mono_demo.sad.xml")
  • To start an Application:

    application.start();
  • To release an Application:

    application.release();

More example commands can be found in the RedhawkDriver Code Examples section.

REDHAWK Enterprise Integration Demos

The REDHAWK Enterprise Integration Demos provide users with an example of how they can use each asset to interact with a REDHAWK Domain. The following sections explain how to use the demos.

The demos are available via tar.gz or RPM. The RPM has a dependency on REDHAWK Enterprise Integration artifact.

REDHAWK Demo Webapp

The REDHAWK Demo Webapp is an example web application that enables users to interact with a REDHAWK Domain via the web. The web application uses REDHAWK REST, REDHAWK WebSocket, and REDHAWK Driver. The jetty running in the Karaf Container serves as the web server.

Instructions

To use this application, copy redhawk-demo-webapp.jar into the $karaf.base/deploy directory, which deploys the web application into Karaf. After the application is deployed, you can view the path of the webapp by entering the following command:

web:list

Example output:

karaf@root()> web:list
ID  | State       | Web-State   | Level | Web-ContextPath | Name
------------------------------------------------------------------------------------------------------
158 | Active      | Deployed    | 80    | /redhawkwebdemo | REDHAWK :: DEMO :: WEBAPP (2.0.4.SNAPSHOT)

View the web application at:

http://{hostname}:8181/redhawkwebdemo  #hostname is the hostname of the server with your karaf instance

After opening the web application, to add a Domain, click the '+' button. Enter the information, and then click the 'view' button on the Domain you added. You have access to command and control your configured Domain from the web.

Screenshot:

Screen Shot of Demo Webapp

REDHAWK Metrics

The metric-related REST endpoints provide the option to access via REST the following metrics:

  • BulkIO Port Statistics

  • GPP Metrics

    • component_monitor

    • utilization

    • sys_limits

    • nic_metrics

  • Application Metrics

For more information about BulkIO Port statistics, GPP metrics, or Application metrics, refer to the REDHAWK Manual.

By combining the REST Endpoints, which produce JSON with a data flow framework (for example: Apache Camel, Apache NiFi), metrics can be retrieved from a REDHAWK Domain and put in a desired metrics solution. The following example provides a Camel route for getting metrics from a Domain at a specific interval:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <route id="REDHAWKMetricsRoute">
                <from uri="timer:metricTimer?period=1s&amp;fixedRate=true" /><!-- http://camel.apache.org/timer.html -->
                <setHeader headerName="CamelHttpMethod">
                                <constant>GET</constant>
                                    </setHeader>
                            <to uri="http4://localhost:8181/rest/redhawk/127.0.0.1:2809/domains/REDHAWK_DEV/metrics"/><!-- http://camel.apache.org/http4.html -->
                <log message="Timer hit ${body}" />
        </route>
    </camelContext>
</blueprint>

The data flow framework provides components for you to use for Persistence, such as Elastic Search and MongoDB. Once the data is stored in a Persistence backend, Dashboard GUI utilities, such as Kibana and Grafana, may be used to customize dashboards and write flexible queries against, which provide details about the domain.

REDHAWK Metrics Demo Webapp

To view metrics from the past and have the option to set up queries, use the techniques described in REDHAWK Metrics. To view a simple snapshot of a Domain’s metrics, use the demo metrics web application supplied in the redhawk-demo-dist.

If you performed a group install, REDHAWK Enterprise Integration, the demo metrics web application was installed then. Otherwise, you need to install the redhawk-demo-dist on your system before performing the following steps to launch the application on your karaf instance.

  1. Copy demo/redhawk-metrics/redhawk-metrics-webapp-{version}.jar into the deploy directory of Karaf(${karaf.base}/deploy).

  2. Open the browser to http://{hostname}:{karaf.port}/redhawkmetrics.

  3. Click the GPP, Application, PORT links to visualize each type of metric.

  4. Click Configuration to configure the REST endpoints the webapplication should be using.

Screenshot:

Screen Shot of Demo Metrics Webapp

Camel REDHAWK Demo

This example Application illustrates how to use a Camel REDHAWK Component to subscribe to an Event Channel and publish that data to a JMS Topic.

Set Up

  1. To run this demo, setup the example Component that will publish data to a REDHAWK Event Channel.

  2. Launch the Waveform to run the Component.

  3. Import each of the following projects into REDHAWK using the REDHAWK Import Wizard in the IDE.

    • EventSpitter: Sends out a struct every second.

    • SpitToChannel: Uses the EventSpitter Component to send data to the Event Channel, EventsSpat.

  4. After launching the SpitToChannel Waveform, ensure it is started by running the following command to see the event messages from your Component:

    eventviewer REDHAWK_DEV EventsSpat
  5. To publish events to an ActiveMQ instance, install ActiveMQ on your machine or any machine to which your machine has access. For more information about ActiveMQ, refer to the following links:

Example Output

eventviewer REDHAWK_DEV EventsSpat
Receiving events. Press 'enter' key to exit
[{'id': 'properties', 'value': [{'id': 'foo', 'value': 'foo-04edebfc-6a8b-4f56-b018-25bbc46a842a'}, {'id': 'bar', 'value': 1.6000000238418579}]}]
[{'id': 'properties', 'value': [{'id': 'foo', 'value': 'foo-09df6252-15fc-4af8-8e6e-5c6db2dbe3b5'}, {'id': 'bar', 'value': 1.6000000238418579}]}]
[{'id': 'properties', 'value': [{'id': 'foo', 'value': 'foo-0c34db0e-4dae-4315-a344-73d50b8d2a8f'}, {'id': 'bar', 'value': 1.6000000238418579}]}]
[{'id': 'properties', 'value': [{'id': 'foo', 'value': 'foo-38d514f1-29bc-4939-8b34-0e8e7246c0cb'}, {'id': 'bar', 'value': 1.6000000238418579}]}]
[{'id': 'properties', 'value': [{'id': 'foo', 'value': 'foo-5cb7f365-1488-4130-8917-8b9b3f03430e'}, {'id': 'bar', 'value': 1.6000000238418579}]}]
[{'id': 'properties', 'value': [{'id': 'foo', 'value': 'foo-a5ecffae-39dc-43a9-80ee-f3902dcd0929'}, {'id': 'bar', 'value': 1.6000000238418579}]}]

Instructions

  1. Start Karaf by running the start script in the KARAF bin directory:

    ./start
  2. Add a configuration for REDHAWK by moving redhawk.datasource.factory-localRH.cfg into the etc directory of your Karaf install.

  3. Add the Camel route to the deploy directory of Karaf.

  4. Start the SpitToChannel Waveform.

    The Karaf log displays the messages being sent to the Event Channel.

	2017-02-23 14:35:19,417 | INFO  | eadpool; w: Idle | eventTest                        | 31 - org.apache.camel.camel-core - 2.17.5 | Exchange[ExchangePattern: InOnly, BodyType: java.util.HashMap, Body: {bar=1.6, foo=foo-beff745f-6ab1-4d75-b5e3-a29a0c4e9a3d}]
	2017-02-23 14:35:20,548 | INFO  | eadpool; w: Idle | eventTest                        | 31 - org.apache.camel.camel-core - 2.17.5 | Exchange[ExchangePattern: InOnly, BodyType: java.util.HashMap, Body: {bar=1.6, foo=foo-fcda80f5-3b6b-46fb-8ada-80859ff7fcef}]
	2017-02-23 14:35:21,678 | INFO  | eadpool; w: Idle | eventTest                        | 31 - org.apache.camel.camel-core - 2.17.5 | Exchange[ExchangePattern: InOnly, BodyType: java.util.HashMap, Body: {bar=1.6, foo=foo-0dc62388-5dee-43b5-8c1b-7bfa91f2bc39}]
	2017-02-23 14:35:22,808 | INFO  | eadpool; w: Idle | eventTest                        | 31 - org.apache.camel.camel-core - 2.17.5 | Exchange[ExchangePattern: InOnly, BodyType: java.util.HashMap, Body: {bar=1.6, foo=foo-090be096-49ba-4943-ae65-3a4ae1438398}]
	2017-02-23 14:35:23,938 | INFO  | eadpool; w: Idle | eventTest                        | 31 - org.apache.camel.camel-core - 2.17.5 | Exchange[ExchangePattern: InOnly, BodyType: java.util.HashMap, Body: {bar=1.6, foo=foo-0dcc5772-0759-4122-ba11-fc7fe10c697f}]
[source]

ActiveMQ Integration

  1. Login to your Karaf console and run the following commands:

    feature:repo-add mvn:org.apache.activemq/activemq-karaf/5.14.3/xml/features
    feature:install activemq-camel

    ActiveMQ is available to use as a Camel Component.

  2. Uncomment the sections relevant to ActiveMQ in your route.

    After saving the file, the Camel Context will be redeployed automatically with your changes.

  3. To confirm messages are being sent to the topic, look at your ActiveMQ Admin console.