mil.dod.th.ose.remote/src/mil/dod/th/ose/remote/osgi/BundleManagementMessageService.java
private BundleInfoType createBundleInfoType(final GetBundleInfoRequestData request, final Bundle bundle) //NOCHECKSTYLE 
                                               // n-complexity reached. Only if the return requested fields.
    {                                          //Therefore need to check and append data for only what was requested.
        final BundleInfoType.Builder infoBuilder = BundleInfoType.newBuilder();
        
        final Dictionary<String, String> headerDetails = bundle.getHeaders();
        
        infoBuilder.setBundleId(bundle.getBundleId());
        
        //add the correct requested fields
        if (request.getBundleState())
        {
            infoBuilder.setBundleState(bundle.getState());
        }
        
        if (request.getBundleSymbolicName())
        {
            infoBuilder.setBundleSymbolicName(getItem(headerDetails, Constants.BUNDLE_SYMBOLICNAME));
        }
        
        if (request.getBundleDescription())
        {
            infoBuilder.setBundleDescription(getItem(headerDetails, Constants.BUNDLE_DESCRIPTION));
        }
        
        if (request.getBundleVendor())
        {
            infoBuilder.setBundleVendor(getItem(headerDetails, Constants.BUNDLE_VENDOR));
        }
        
        if (request.getBundleVersion())
        {
            infoBuilder.setBundleVersion(getItem(headerDetails, Constants.BUNDLE_VERSION));
        }
        
        if (request.getPackageImports())
        {
            infoBuilder.addAllPackageImport(parseImportExportHeaders(getItem(headerDetails, Constants.IMPORT_PACKAGE)));
            
        }
        
        if (request.getPackageExports())
        {
            infoBuilder.addAllPackageExport(parseImportExportHeaders(getItem(headerDetails, Constants.EXPORT_PACKAGE)));
        }
        
        if (request.getBundleLocation())
        {
            infoBuilder.setBundleLocation(bundle.getLocation());
        }
        
        if (request.getBundleName())
        {
            infoBuilder.setBundleName(getItem(headerDetails, Constants.BUNDLE_NAME));
        }
        
        if (request.getBundleLastModified())
        {
            infoBuilder.setBundleLastModified(bundle.getLastModified());
        }
        
        return infoBuilder.build();
    }
/**
     * Creates a {@link BundleInfoType} based on the request's required values and the bundle. 
     * @param request
     *  the info request that specifies which information to pull from the found bundle.
     * @param bundle
     *  the bundle that information is being retrieved for.
     * @return
     *  the {@link BundleInfoType} which holds all required information from the passed in bundle.
     */
Creates a  BundleInfoType based on the request's required values and the bundle.
@param request
the info request that specifies which information to pull from the found bundle.
@param bundle
the bundle that information is being retrieved for.
@return
the  BundleInfoType which holds all required information from the passed in bundle.
Creates a BundleInfoType based on the request ' s required values and the bundle . @param request the info request that specifies which information to pull from the found bundle . @param bundle the bundle that information is being retrieved for . @return the BundleInfoType which holds all required information from the passed in bundle .
private BundleInfoType createBundleInfoType(final GetBundleInfoRequestData request, final Bundle bundle) 
    {                                          
        final BundleInfoType.Builder infoBuilder = BundleInfoType.newBuilder();
        final Dictionary<String, String> headerDetails = bundle.getHeaders();
        infoBuilder.setBundleId(bundle.getBundleId());
        if (request.getBundleState())
        {
            infoBuilder.setBundleState(bundle.getState());
        }
        if (request.getBundleSymbolicName())
        {
            infoBuilder.setBundleSymbolicName(getItem(headerDetails, Constants.BUNDLE_SYMBOLICNAME));
        }
        if (request.getBundleDescription())
        {
            infoBuilder.setBundleDescription(getItem(headerDetails, Constants.BUNDLE_DESCRIPTION));
        }
        if (request.getBundleVendor())
        {
            infoBuilder.setBundleVendor(getItem(headerDetails, Constants.BUNDLE_VENDOR));
        }
        if (request.getBundleVersion())
        {
            infoBuilder.setBundleVersion(getItem(headerDetails, Constants.BUNDLE_VERSION));
        }
        if (request.getPackageImports())
        {
            infoBuilder.addAllPackageImport(parseImportExportHeaders(getItem(headerDetails, Constants.IMPORT_PACKAGE)));
        }
        if (request.getPackageExports())
        {
            infoBuilder.addAllPackageExport(parseImportExportHeaders(getItem(headerDetails, Constants.EXPORT_PACKAGE)));
        }
        if (request.getBundleLocation())
        {
            infoBuilder.setBundleLocation(bundle.getLocation());
        }
        if (request.getBundleName())
        {
            infoBuilder.setBundleName(getItem(headerDetails, Constants.BUNDLE_NAME));
        }
        if (request.getBundleLastModified())
        {
            infoBuilder.setBundleLastModified(bundle.getLastModified());
        }
        return infoBuilder.build();
    }
private BundleInfoType createBundleInfoType ( final GetBundleInfoRequestData request , final Bundle bundle ) { final BundleInfoType . Builder infoBuilder = BundleInfoType . newBuilder ( ) ; final Dictionary < String , String > headerDetails = bundle . getHeaders ( ) ; infoBuilder . setBundleId ( bundle . getBundleId ( ) ) ; if ( request . getBundleState ( ) ) { infoBuilder . setBundleState ( bundle . getState ( ) ) ; } if ( request . getBundleSymbolicName ( ) ) { infoBuilder . setBundleSymbolicName ( getItem ( headerDetails , Constants . BUNDLE_SYMBOLICNAME ) ) ; } if ( request . getBundleDescription ( ) ) { infoBuilder . setBundleDescription ( getItem ( headerDetails , Constants . BUNDLE_DESCRIPTION ) ) ; } if ( request . getBundleVendor ( ) ) { infoBuilder . setBundleVendor ( getItem ( headerDetails , Constants . BUNDLE_VENDOR ) ) ; } if ( request . getBundleVersion ( ) ) { infoBuilder . setBundleVersion ( getItem ( headerDetails , Constants . BUNDLE_VERSION ) ) ; } if ( request . getPackageImports ( ) ) { infoBuilder . addAllPackageImport ( parseImportExportHeaders ( getItem ( headerDetails , Constants . IMPORT_PACKAGE ) ) ) ; } if ( request . getPackageExports ( ) ) { infoBuilder . addAllPackageExport ( parseImportExportHeaders ( getItem ( headerDetails , Constants . EXPORT_PACKAGE ) ) ) ; } if ( request . getBundleLocation ( ) ) { infoBuilder . setBundleLocation ( bundle . getLocation ( ) ) ; } if ( request . getBundleName ( ) ) { infoBuilder . setBundleName ( getItem ( headerDetails , Constants . BUNDLE_NAME ) ) ; } if ( request . getBundleLastModified ( ) ) { infoBuilder . setBundleLastModified ( bundle . getLastModified ( ) ) ; } return infoBuilder . build ( ) ; }
Creates a {@link BundleInfoType} based on the request's required values and the bundle.
Creates a { @link BundleInfoType } based on the request ' s required values and the bundle .
//NOCHECKSTYLE  // n-complexity reached. Only if the return requested fields. //Therefore need to check and append data for only what was requested. //add the correct requested fields