Package com.denimgroup.threadfix.data.entities

Examples of com.denimgroup.threadfix.data.entities.ChannelVulnerability


        if (channelType == null) {
            LOG.warn("Invalid ChannelType (" + channelName + ") submitted.");
            result = MappingCreateResult.BAD_CHANNEL_TYPE;
        } else {

            ChannelVulnerability channelVulnerability =
                    channelVulnerabilityDao.retrieveByCode(channelType, channelVulnerabilityCode);

            if (channelVulnerability == null) {
                LOG.info("Channel Vulnerability lookup by code failed, trying by name.");
                channelVulnerability =
                        channelVulnerabilityDao.retrieveByName(channelType, channelVulnerabilityCode);
            }

            if (channelVulnerability == null) {
                LOG.warn("Invalid ChannelVulnerability code (" + channelVulnerabilityCode + ") submitted.");
                result = MappingCreateResult.BAD_CHANNEL_VULNERABILITY;
            } else {

                GenericVulnerability genericVulnerability =
                        genericVulnerabilityDao.retrieveByDisplayId(integerId);

                if (genericVulnerability == null) {
                    LOG.warn("Unable to find GenericVulnerability with code " + genericVulnerabilityId);
                    result = MappingCreateResult.BAD_GENERIC_VULNERABILITY_ID;
                } else {

                    VulnerabilityMap newMap = new VulnerabilityMap();
                    newMap.setChannelVulnerability(channelVulnerability);
                    newMap.setGenericVulnerability(genericVulnerability);

                    channelVulnerability.setVulnerabilityMaps(Arrays.asList(newMap));
                    channelVulnerability.setUserCreated(true);

                    channelVulnerabilityDao.saveOrUpdate(channelVulnerability);

                    result = MappingCreateResult.SUCCESS;
                }
View Full Code Here



    private void updateManualVuln(GenericVulnerability genericVulnerability, String oldName, String newName, ChannelType channelType) {
        if (channelType == null) return;

        ChannelVulnerability vulnerability;
        if (oldName != null) {
            LOG.info("Update Manual Vulnerability: " + oldName + " to: " + newName);
            vulnerability = channelVulnerabilityDao.retrieveByName(channelType, oldName);
            vulnerability.setCode(newName);
            vulnerability.setName(newName);
            channelVulnerabilityDao.saveOrUpdate(vulnerability);
        } else {
            LOG.info("Create new Manual Vulnerability: " + newName);
            channelVulnerabilityUpdater.createNewChannelVulnerability(newName, newName, genericVulnerability, channelType);
        }
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.data.entities.ChannelVulnerability

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.