mil.dod.th.remote.client/src/mil/dod/th/remote/client/impl/Commands.java
@Descriptor("Send event registration request message to receive observations")
    public void sendEventRegister(final CommandSession session) throws IOException
    {
        final PrintStream out = session.getConsole();
        final EventHandler eventHandler = new EventHandler()
        {
            @Override
            public void handleEvent(final Event event)
            {
                out.println("Received event: " + event.getTopic());
                for (String name : event.getPropertyNames())
                {
                    if (!name.equals(EventConstants.EVENT_TOPIC))
                    {
                        out.println(event.getProperty(name));
                    }
                }
            }
        };

        final Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put(EventConstants.EVENT_TOPIC,
            new String[] {ObservationStore.TOPIC_OBSERVATION_PERSISTED_WITH_OBS,
                ObservationStore.TOPIC_OBSERVATION_MERGED_WITH_OBS});
        m_EventHandlerReg = m_Context.registerService(EventHandler.class, eventHandler, props);

        m_EventAdminMessageGen.createEventRegRequest()
            .setCanQueueEvent(true)
            .setExpirationTimeHours(RemoteConstants.REMOTE_EVENT_DEFAULT_REG_TIMEOUT_HOURS)
            .setObjectFormat(LexiconFormat.Enum.XML)
            .setTopics(ObservationStore.TOPIC_OBSERVATION_PERSISTED_WITH_OBS,
                ObservationStore.TOPIC_OBSERVATION_MERGED_WITH_OBS)
            .send(CONTROLLER_ID);
    }
/**
     * Send an event registration request message for observation events. The {@link EventAdminMessageListener}
     * component will automatically receive the event messages and post them as local OSGi events.
     * 
     * @param session
     *      Provides access to the Gogo shell session
     * @throws IOException
     *      if there is an error sending the message
     */
Send an event registration request message for observation events. The  EventAdminMessageListener
component will automatically receive the event messages and post them as local OSGi events.

@param session
Provides access to the Gogo shell session
@throws IOException
if there is an error sending the message
Send an event registration request message for observation events . The EventAdminMessageListener component will automatically receive the event messages and post them as local OSGi events . @param session Provides access to the Gogo shell session @throws IOException if there is an error sending the message
@Descriptor("Send event registration request message to receive observations")
    public void sendEventRegister(final CommandSession session) throws IOException
    {
        final PrintStream out = session.getConsole();
        final EventHandler eventHandler = new EventHandler()
        {
            @Override
            public void handleEvent(final Event event)
            {
                out.println("Received event: " + event.getTopic());
                for (String name : event.getPropertyNames())
                {
                    if (!name.equals(EventConstants.EVENT_TOPIC))
                    {
                        out.println(event.getProperty(name));
                    }
                }
            }
        };
        final Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put(EventConstants.EVENT_TOPIC,
            new String[] {ObservationStore.TOPIC_OBSERVATION_PERSISTED_WITH_OBS,
                ObservationStore.TOPIC_OBSERVATION_MERGED_WITH_OBS});
        m_EventHandlerReg = m_Context.registerService(EventHandler.class, eventHandler, props);
        m_EventAdminMessageGen.createEventRegRequest()
            .setCanQueueEvent(true)
            .setExpirationTimeHours(RemoteConstants.REMOTE_EVENT_DEFAULT_REG_TIMEOUT_HOURS)
            .setObjectFormat(LexiconFormat.Enum.XML)
            .setTopics(ObservationStore.TOPIC_OBSERVATION_PERSISTED_WITH_OBS,
                ObservationStore.TOPIC_OBSERVATION_MERGED_WITH_OBS)
            .send(CONTROLLER_ID);
    }
@ Descriptor ( "Send event registration request message to receive observations" ) public void sendEventRegister ( final CommandSession session ) throws IOException { final PrintStream out = session . getConsole ( ) ; final EventHandler eventHandler = new EventHandler ( ) { @ Override public void handleEvent ( final Event event ) { out . println ( "Received event: " + event . getTopic ( ) ) ; for ( String name : event . getPropertyNames ( ) ) { if ( ! name . equals ( EventConstants . EVENT_TOPIC ) ) { out . println ( event . getProperty ( name ) ) ; } } } } ; final Dictionary < String , Object > props = new Hashtable < String , Object > ( ) ; props . put ( EventConstants . EVENT_TOPIC , new String [ ] { ObservationStore . TOPIC_OBSERVATION_PERSISTED_WITH_OBS , ObservationStore . TOPIC_OBSERVATION_MERGED_WITH_OBS } ) ; m_EventHandlerReg = m_Context . registerService ( EventHandler . class , eventHandler , props ) ; m_EventAdminMessageGen . createEventRegRequest ( ) . setCanQueueEvent ( true ) . setExpirationTimeHours ( RemoteConstants . REMOTE_EVENT_DEFAULT_REG_TIMEOUT_HOURS ) . setObjectFormat ( LexiconFormat . Enum . XML ) . setTopics ( ObservationStore . TOPIC_OBSERVATION_PERSISTED_WITH_OBS , ObservationStore . TOPIC_OBSERVATION_MERGED_WITH_OBS ) . send ( CONTROLLER_ID ) ; }
Send an event registration request message for observation events.
Send an event registration request message for observation events .