mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/osgi/ConfigAdminMessageService.java
private Message deleteConfig(final TerraHarvestMessage request, final ConfigAdminNamespace message, 
        final RemoteChannel channel) throws IOException
    {
        //parse the request data
        final DeleteConfigurationRequestData removeData = DeleteConfigurationRequestData.parseFrom(message.getData());
        final String pid = removeData.getPid();
        
        //remove the configuration
        try
        {
            //call to configuration admin to retrieve the configuration for a pid must use
            //the null location in the case that it is retrieving a configuration that has
            //not yet been bound to a service with the corresponding pid. If there happens to
            //be such a configuration, then the call without the null location leads to 
            //the configuration being assigned to the calling bundle. In this case,
            //it is assigned to the remote interface. Calling with null avoids this situation.
            final Configuration config = m_ConfigAdmin.getConfiguration(pid, null);
            config.delete();
        }
        catch (final IOException exception)
        {
            final String errorDescription = String.format("Unable to delete configuration with PID %s", pid);

            m_Logging.error(exception, errorDescription);
            final ConfigAdminNamespaceErrorData error = ConfigAdminNamespaceErrorData.newBuilder().
                setError(ConfigAdminErrorCode.ConfigurationPersistentStorageError).
                setErrorDescription(errorDescription + exception.getMessage()).build();

            //send message
            m_MessageFactory.createConfigAdminResponseMessage(request, 
                ConfigAdminMessageType.ConfigAdminNamespaceError, error).queue(channel);
            return removeData;
        }
        
        //send response
        final DeleteConfigurationResponseData response = DeleteConfigurationResponseData.newBuilder().
            setPid(pid).build();
        m_MessageFactory.createConfigAdminResponseMessage(request, 
            ConfigAdminMessageType.DeleteConfigurationResponse, response).queue(channel);
        return removeData;
    }
/**
     * Handle the request to remove a configuration.
     * @param request
     *      entire remote message for the request
     * @param message
     *      the config admin message that contains the request to remove a configuration
     * @param channel
     *      channel to use for sending a response
     * @throws IOException
     *      thrown if the message cannot be parsed correctly 
     * @return
     *     the data message associated with the request
     */
Handle the request to remove a configuration.
Handle the request to remove a configuration .
private Message deleteConfig(final TerraHarvestMessage request, final ConfigAdminNamespace message, 
        final RemoteChannel channel) throws IOException
    {
        final DeleteConfigurationRequestData removeData = DeleteConfigurationRequestData.parseFrom(message.getData());
        final String pid = removeData.getPid();
        try
        {
            final Configuration config = m_ConfigAdmin.getConfiguration(pid, null);
            config.delete();
        }
        catch (final IOException exception)
        {
            final String errorDescription = String.format("Unable to delete configuration with PID %s", pid);
            m_Logging.error(exception, errorDescription);
            final ConfigAdminNamespaceErrorData error = ConfigAdminNamespaceErrorData.newBuilder().
                setError(ConfigAdminErrorCode.ConfigurationPersistentStorageError).
                setErrorDescription(errorDescription + exception.getMessage()).build();
            m_MessageFactory.createConfigAdminResponseMessage(request, 
                ConfigAdminMessageType.ConfigAdminNamespaceError, error).queue(channel);
            return removeData;
        }
        final DeleteConfigurationResponseData response = DeleteConfigurationResponseData.newBuilder().
            setPid(pid).build();
        m_MessageFactory.createConfigAdminResponseMessage(request, 
            ConfigAdminMessageType.DeleteConfigurationResponse, response).queue(channel);
        return removeData;
    }
private Message deleteConfig ( final TerraHarvestMessage request , final ConfigAdminNamespace message , final RemoteChannel channel ) throws IOException { final DeleteConfigurationRequestData removeData = DeleteConfigurationRequestData . parseFrom ( message . getData ( ) ) ; final String pid = removeData . getPid ( ) ; try { final Configuration config = m_ConfigAdmin . getConfiguration ( pid , null ) ; config . delete ( ) ; } catch ( final IOException exception ) { final String errorDescription = String . format ( "Unable to delete configuration with PID %s" , pid ) ; m_Logging . error ( exception , errorDescription ) ; final ConfigAdminNamespaceErrorData error = ConfigAdminNamespaceErrorData . newBuilder ( ) . setError ( ConfigAdminErrorCode . ConfigurationPersistentStorageError ) . setErrorDescription ( errorDescription + exception . getMessage ( ) ) . build ( ) ; m_MessageFactory . createConfigAdminResponseMessage ( request , ConfigAdminMessageType . ConfigAdminNamespaceError , error ) . queue ( channel ) ; return removeData ; } final DeleteConfigurationResponseData response = DeleteConfigurationResponseData . newBuilder ( ) . setPid ( pid ) . build ( ) ; m_MessageFactory . createConfigAdminResponseMessage ( request , ConfigAdminMessageType . DeleteConfigurationResponse , response ) . queue ( channel ) ; return removeData ; }
Handle the request to remove a configuration.
Handle the request to remove a configuration .
//parse the request data //remove the configuration //call to configuration admin to retrieve the configuration for a pid must use //the null location in the case that it is retrieving a configuration that has //not yet been bound to a service with the corresponding pid. If there happens to //be such a configuration, then the call without the null location leads to  //the configuration being assigned to the calling bundle. In this case, //it is assigned to the remote interface. Calling with null avoids this situation. //send message //send response