mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/RemoteChannelLookupImpl.java
private void persistChannelData(final SystemChannels systemChannels)
    {
        final String systemIdStr = Integer.toString(systemChannels.getSysId());
        // merge with existing if already there
        final Collection<PersistentData> existingDataList = m_PersistentDataStore.query(getClass(), systemIdStr);
        if (existingDataList.isEmpty())
        {
            // not found, persist new entry
            try
            {
                m_PersistentDataStore.persist(getClass(), UUID.randomUUID(), systemIdStr, systemChannels.toByteArray());
            }
            catch (final PersistenceFailedException e)
            {
                m_Logging.error(e, "Unable to persist new channel for system id 0x%08x", systemChannels.getSysId());
            }
        }
        else
        {
            final PersistentData existingData = existingDataList.iterator().next();
            existingData.setEntity(systemChannels.toByteArray());
            try
            {
                m_PersistentDataStore.merge(existingData);
            }
            catch (final PersistenceFailedException | IllegalArgumentException | ValidationFailedException e)
            {
                m_Logging.error(e, "Unable to update existing channel(s) for system id 0x%08x", 
                        systemChannels.getSysId());
            }
        }
    }
/**
     * Persist data for a whole channel set where the string description in the store will be the system id.
     * 
     * @param systemChannels
     *      channel data to persist
     */
Persist data for a whole channel set where the string description in the store will be the system id.

@param systemChannels
channel data to persist
Persist data for a whole channel set where the string description in the store will be the system id . @param systemChannels channel data to persist
private void persistChannelData(final SystemChannels systemChannels)
    {
        final String systemIdStr = Integer.toString(systemChannels.getSysId());
        final Collection<PersistentData> existingDataList = m_PersistentDataStore.query(getClass(), systemIdStr);
        if (existingDataList.isEmpty())
        {
            try
            {
                m_PersistentDataStore.persist(getClass(), UUID.randomUUID(), systemIdStr, systemChannels.toByteArray());
            }
            catch (final PersistenceFailedException e)
            {
                m_Logging.error(e, "Unable to persist new channel for system id 0x%08x", systemChannels.getSysId());
            }
        }
        else
        {
            final PersistentData existingData = existingDataList.iterator().next();
            existingData.setEntity(systemChannels.toByteArray());
            try
            {
                m_PersistentDataStore.merge(existingData);
            }
            catch (final PersistenceFailedException | IllegalArgumentException | ValidationFailedException e)
            {
                m_Logging.error(e, "Unable to update existing channel(s) for system id 0x%08x", 
                        systemChannels.getSysId());
            }
        }
    }
private void persistChannelData ( final SystemChannels systemChannels ) { final String systemIdStr = Integer . toString ( systemChannels . getSysId ( ) ) ; final Collection < PersistentData > existingDataList = m_PersistentDataStore . query ( getClass ( ) , systemIdStr ) ; if ( existingDataList . isEmpty ( ) ) { try { m_PersistentDataStore . persist ( getClass ( ) , UUID . randomUUID ( ) , systemIdStr , systemChannels . toByteArray ( ) ) ; } catch ( final PersistenceFailedException e ) { m_Logging . error ( e , "Unable to persist new channel for system id 0x%08x" , systemChannels . getSysId ( ) ) ; } } else { final PersistentData existingData = existingDataList . iterator ( ) . next ( ) ; existingData . setEntity ( systemChannels . toByteArray ( ) ) ; try { m_PersistentDataStore . merge ( existingData ) ; } catch ( final PersistenceFailedException | IllegalArgumentException | ValidationFailedException e ) { m_Logging . error ( e , "Unable to update existing channel(s) for system id 0x%08x" , systemChannels . getSysId ( ) ) ; } } }
Persist data for a whole channel set where the string description in the store will be the system id.
Persist data for a whole channel set where the string description in the store will be the system id .
// merge with existing if already there // not found, persist new entry