com.fortify.plugin.spi.VulnerabilityAttribute Maven / Gradle / Ivy
/*
* (c) Copyright 2017 Micro Focus or one of its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.fortify.plugin.spi;
/**
* Base interface for plugin specific custom attributes definitions.
* Parser plugins that produces custom attributes must implement this interface and define all the custom attributes
* that can be produced by the plugin in the implementation.
* Important note: every time when any changes are done in custom attributes definition (adding new attribute,
* changing type or name of some existed attribute, etc), plugin version and data version in the plugin.xml file
* must be increased. In this case SSC will be able to work correctly with vulnerabilities that were parsed by previous
* version of the plugin and the vulnerabilities that are going to be parsed by the plugin with changed custom attributes
* definitions.
*/
public interface VulnerabilityAttribute {
/**
* Attribute type enumeration.
*/
enum AttrType {
/**
* String attribute type. Length limitation for this type is {@link #MAX_STRING_LENGTH} characters.
*/
STRING,
/**
* Long string attribute type. Length limitation for this type is {@link #MAX_LONG_STRING_LENGTH} characters.
*/
LONG_STRING,
/**
* Decimal value type. Values' precision / scale should be {@link #MAX_DECIMAL_PRECISION} and {@link #MAX_DECIMAL_SCALE} respectively.
*/
DECIMAL,
/**
* Date value type. Value of this type must be java.util.Date class instances. Time part of the date is ignored.
*/
DATE,
}
/** Maximum supported length of STRING custom attributes */
int MAX_STRING_LENGTH = 1000;
/** Maximum supported length of LONG_STRING custom attributes */
int MAX_LONG_STRING_LENGTH = 20000;
/** Maximum supported precision for DECIMAL custom attributes */
int MAX_DECIMAL_PRECISION = 18;
/** Maximum supported scale for DECIMAL custom attributes */
int MAX_DECIMAL_SCALE = 9;
/**
* Returns attribute name
*/
String attributeName();
/**
* Returns attribute type
*/
AttrType attributeType();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy