public class CollectorValidationUtils
extends java.lang.Object
CollectorValidationException
being thrown.CollectorValidationException
Constructor and Description |
---|
CollectorValidationUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
validateAddressData(java.util.Map<java.lang.String,java.lang.Object> addressData)
Validate that the address data provided adheres to the following
definition:
|
static boolean |
validateAddresses(NetworkDevice device)
Validate all address data associated with a device
|
static boolean |
validateCollectorData(DataStore dataStore)
Validate that basic collector data is present and valid
|
static boolean |
validateConnectionData(java.util.Map<java.lang.String,java.lang.Object> connectionData)
Validate that the connection data provided adheres to the following
definition:
|
static boolean |
validateData(java.util.Map<java.lang.String,java.lang.Object> data,
java.util.Set<java.lang.String> validFields,
java.lang.String dataType)
Validate that given data contains valid fields.
|
static boolean |
validateDataSourceData(DataSource dataSource)
Validate the basic data source data is correct
|
static boolean |
validateDeviceData(NetworkDevice device)
Validate the data for a given device to ensure that both an ID and unique
address (ip attribute) are present
|
static boolean |
validateDevices(DataSource dataSource)
Validate basic device data for all devices for a given data source
|
static boolean |
validateEntityData(java.util.Map<java.lang.String,java.lang.Object> entityData)
Validate that the entity data provided adheres to the following
definition:
|
static boolean |
validateGeographicData(java.util.Map<java.lang.String,java.lang.Object> data)
Validate that the geographic data provided adheres to the following
definition:
|
static boolean |
validateInterfaceData(java.util.Map<java.lang.String,java.lang.Object> interfaceData)
Validate that the interface data provided adheres to the following
definition:
|
static boolean |
validateInterfaceID(java.util.Map<java.lang.String,java.lang.Object> data)
Validate that the data contains either an interfaceId or a numeric
ifIndex attribute
|
static boolean |
validateInterfaces(NetworkDevice device)
Validate all interfaces on a given device
|
static boolean |
validateL2VPNData(java.util.Map<java.lang.String,java.lang.Object> vpnData)
Validate that the layer 2 VPN data provided adheres to the following
definition:
|
static boolean |
validateL3ConnectionData(java.util.Map<java.lang.String,java.lang.Object> connectionData)
Validate that the layer 3 connection data provided adheres to the
following definition:
|
static boolean |
validateL3VPNData(java.util.Map<java.lang.String,java.lang.Object> vpnData)
Validate that the layer 3 VPN data provided adheres to the following
definition:
|
static boolean |
validateL3VPNInterfaceData(java.util.Map<java.lang.String,java.lang.Object> vpnInterfaceData)
Validate the L3 VPN interface data
|
static boolean |
validateL3VPNRTData(java.lang.String routeTarget,
int routeTargetType)
Validate the L3 VPN route target data
|
static boolean |
validateLSPData(java.util.Map<java.lang.String,java.lang.Object> lspData)
Validate LSP Data
|
static boolean |
validateMobileSwitchingCentreType(java.lang.String mscType)
Validate whether a given mobile switching centre type is one of the
expected values
|
static boolean |
validateMPLSData(java.util.Map<java.lang.String,java.lang.Object> mplsData)
Validate MPLS data
|
static boolean |
validateRanNodeBLocalCellTechnologyType(java.lang.String technologyType)
Validate whether a given RAN node B local cell technology type is one of
the expected values
|
static boolean |
validateRanTechnologyType(java.lang.String technologyType)
Validate whether a given RAN cell technology type is one of the expected
values
|
static boolean |
validateRanTransceiverTechnologyType(java.lang.String technologyType)
Validate whether a given RAN transceiver technology type is one of the
expected values
|
static boolean |
validateRelationshipData(java.util.Map<java.lang.String,java.lang.Object> relationshipData)
Validate that the relationship data provided contains all required
parameters, such as an identifier for the entity involved in the
relationship, such as a device ID or entity name.
|
public static boolean validateAddressData(java.util.Map<java.lang.String,java.lang.Object> addressData) throws CollectorValidationException
Validate that the address data provided adheres to the following definition:
<xs:element name="ifIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="interfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="ifOperStatus" type="xs:integer" minOccurs="1"/>
<xs:element name="ipAddress" type="xs:string" minOccurs="1"/>
addressData
- The address data to validateCollectorValidationException
- The data provided in the addressData map does not match the
specified data definitionpublic static boolean validateAddresses(NetworkDevice device) throws CollectorValidationException
device
- The device on which all addresses should be validatedCollectorValidationException
- One or more of the addresses are not valid as specified by
validateAddressData(Map)
public static boolean validateCollectorData(DataStore dataStore) throws CollectorValidationException
dataStore
- The data store to validateCollectorValidationException
- The data store is missing a collector name or one of the data
sources is not valid as defined by
validateDataSourceData(DataSource)
public static boolean validateConnectionData(java.util.Map<java.lang.String,java.lang.Object> connectionData) throws CollectorValidationException
Validate that the connection data provided adheres to the following definition:
<xs:element name="dest" type="xs:string" minOccurs="1"/>
<xs:element name="destIfIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="destInterfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="src" type="xs:string" minOccurs="0"/>
<xs:element name="srcIfIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="srcInterfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="extraInfo" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:any maxOccurs="unbounded">
</xs:sequence>
</xs:complexType>
</xs:element>
connectionData
- The connection data to validateCollectorValidationException
- The data provided in the connectionData map does not match
the specified data definitionpublic static boolean validateData(java.util.Map<java.lang.String,java.lang.Object> data, java.util.Set<java.lang.String> validFields, java.lang.String dataType) throws CollectorValidationException
data
- The data (map) to validatevalidFields
- A list of all the valid fields for that piece of datadataType
- What kind of data we're parsingCollectorValidationException
- The data for the particular dataType as contained in the data
map contains a field that is not listed as a valid fieldpublic static boolean validateDataSourceData(DataSource dataSource) throws CollectorValidationException
dataSource
- The data source to validateCollectorValidationException
- The data source is missing an IDpublic static boolean validateDeviceData(NetworkDevice device) throws CollectorValidationException
device
- The device to validateCollectorValidationException
- The device data is missing a device ID or unique addresspublic static boolean validateDevices(DataSource dataSource) throws CollectorValidationException
dataSource
- The data source for which all devices should be validatedCollectorValidationException
- The data source is null or one of the devices stored on the
data source is not valid as defined by
validateDeviceData(NetworkDevice)
public static boolean validateEntityData(java.util.Map<java.lang.String,java.lang.Object> entityData) throws CollectorValidationException
Validate that the entity data provided adheres to the following definition:
<xs:element name="name" type="xs:string" minOccurs="1"/>
<xs:element name="descr" type="xs:string" minOccurs="0"/>
<xs:element name="alias" type="xs:string" minOccurs="0"/>
<xs:element name="parentRelPos" type="xs:integer" minOccurs="1"/>
<xs:element name="fwRev" type="xs:string" minOccurs="0"/>
<xs:element name="hwRev" type="xs:string" minOccurs="0"/>
<xs:element name="swRev" type="xs:string" minOccurs="0"/>
<xs:element name="serialNumber" type="xs:string" minOccurs="0"/>
<xs:element name="ifIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="interfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="extraInfo" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:any maxOccurs="unbounded">
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="index" type="xs:integer" minOccurs="1"/>
<xs:element name="class" type="xs:string" minOccurs="1"/>
<xs:element name="containedIn" type="xs:integer" minOccurs="1"/>
<xs:element name="vendorType" type="xs:string" minOccurs="0"/>
<xs:element name="parent" type="xs:string" minOccurs="1"/>
<xs:element name="cdmType" type="xs:integer" minOccurs="1"/>
entityData
- The entity-MIB style data to validateCollectorValidationException
- The data provided in the entityData map does not match the
specified data definitionpublic static boolean validateGeographicData(java.util.Map<java.lang.String,java.lang.Object> data) throws CollectorValidationException
Validate that the geographic data provided adheres to the following definition:
data
- The geographic data to validateCollectorValidationException
- The data provided in the data map does not match the
specified data definitionpublic static boolean validateInterfaceData(java.util.Map<java.lang.String,java.lang.Object> interfaceData) throws CollectorValidationException
Validate that the interface data provided adheres to the following definition:
<xs:element name="ifIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="interfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="card" type="xs:integer" minOccurs="0"/>
<xs:element name="port" type="xs:integer" minOccurs="0"/>
<xs:element name="ifOperStatus" type="xs:integer" minOccurs="0"/>
<xs:element name="ifAdminStatus" type="xs:integer minOccurs="0""/>
<xs:element name="ifPhysAddress" type="xs:integer" minOccurs="0"/>
<xs:element name="ifDescr" type="xs:string" minOccurs="0"/>
<xs:element name="ifName" type="xs:string" minOccurs="0"/>
<xs:element name="ifType" type="xs:integer" minOccurs="0"/>
<xs:element name="isConnected" type="xs:integer" minOccurs="0"/>
<xs:element name="ipAddress" type="xs:string" minOccurs="0"/>
<xs:element name="netmask" type="xs:integer" minOccurs="0"/>
<xs:element name="subnet" type="xs:string" minOccurs="0"/>
<xs:element name="subnetMask" type="xs:string" minOccurs="0"/>
<xs:element name="extraInfo" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:any maxOccurs="unbounded">
</xs:sequence>
</xs:complexType>
</xs:element>
interfaceData
- Map of data for an interfaceCollectorValidationException
- The data provided in the interfaceData map does not match the
specified data definitionpublic static boolean validateInterfaceID(java.util.Map<java.lang.String,java.lang.Object> data) throws CollectorValidationException
data
- The data to validateCollectorValidationException
- The data provided does not have a String field
interfaceId
or an integer field ifIndex
public static boolean validateInterfaces(NetworkDevice device) throws CollectorValidationException
device
- The network device containing the interfacesCollectorValidationException
- One or more of the interface data entries is invalid as
specified by validateInterfaceData(Map)
public static boolean validateL2VPNData(java.util.Map<java.lang.String,java.lang.Object> vpnData) throws CollectorValidationException
Validate that the layer 2 VPN data provided adheres to the following definition:
<xs:element name="vpnName" type="xs:string" minOccurs="1"/>
<xs:element name="vcId" type="xs:string" minOccurs="1"/>
<xs:element name="vcType" type="xs:integer" minOccurs="1"/>
<xs:element name="peerIp" type="xs:string" minOccurs="0"/>
<xs:element name="peerIfIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="peerInterfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="localIfIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="localInterfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="status" type="xs:integer" minOccurs="0"/>
<xs:element name="topologyType" type="xs:integer" minOccurs="0"/>
<xs:element name="localLabel" type="xs:integer" minOccurs="1"/>
<xs:element name="peerLabel" type="xs:integer" minOccurs="1"/>
<xs:element name="extraInfo" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:any maxOccurs="unbounded">
</xs:sequence>
</xs:complexType>
</xs:element>
vpnData
- The Layer 2 VPN data to validateCollectorValidationException
- The data provided in the vpnData map does not match the
specified data definitionpublic static boolean validateL3ConnectionData(java.util.Map<java.lang.String,java.lang.Object> connectionData) throws CollectorValidationException
Validate that the layer 3 connection data provided adheres to the following definition:
<xs:element name="dest" type="xs:string" minOccurs="1"/>
<xs:element name="destIfIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="destInterfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="src" type="xs:string" minOccurs="0"/>
<xs:element name="srcIfIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="srcInterfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="extraInfo" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:any maxOccurs="unbounded">
</xs:sequence>
</xs:complexType>
</xs:element>
connectionData
- The layer 3 connection data to validateCollectorValidationException
- The data provided in the connectionData map does not match
the specified data definitionpublic static boolean validateL3VPNData(java.util.Map<java.lang.String,java.lang.Object> vpnData) throws CollectorValidationException
Validate that the layer 3 VPN data provided adheres to the following definition:
<xs:element name="vpnName" type="xs:string" minOccurs="0"/>
<xs:element name="vrfName" type="xs:string" minOccurs="1"/>
<xs:element name="rd" type="xs:string" minOccurs="1"/>
<xs:element name="descr" type="xs:string" minOccurs="0"/>
<xs:element name="status" type="xs:integer" minOccurs="0"/>
<xs:element name="importRTs" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="rt" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="exportRTs" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="rt" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
vpnData
- The Layer 3 VPN data to validateCollectorValidationException
- The data provided in the vpnData map does not match the
specified data definitionpublic static boolean validateL3VPNInterfaceData(java.util.Map<java.lang.String,java.lang.Object> vpnInterfaceData) throws CollectorValidationException
<xs:element name="ifIndex" type="xs:integer" minOccurs="0"/>
<xs:element name="interfaceId" type="xs:string" minOccurs="0"/>
<xs:element name="ceIp" type="xs:string" minOccurs="0"/>
<xs:element name="protocol" type="xs:string" minOccurs="0"/>
<xs:element name="customerName" type="xs:string" minOccurs="0"/>
<xs:element name="customerDescr" type="xs:string" minOccurs="0"/>
<xs:element name="extraInfo" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:any maxOccurs="unbounded">
</xs:sequence>
</xs:complexType>
</xs:element>
vpnInterfaceData
- The L3 VPN interface data to validateCollectorValidationException
- The data provided in the vpnInterfaceData map does not match
the specified data definitionpublic static boolean validateL3VPNRTData(java.lang.String routeTarget, int routeTargetType) throws CollectorValidationException
routeTarget
- The route targetrouteTargetType
- The route target type - 1, 2 or 3CollectorValidationException
- The route target type is not one of the expected values (1, 2
or 3)public static boolean validateLSPData(java.util.Map<java.lang.String,java.lang.Object> lspData) throws CollectorValidationException
lspData
- The LSP data to validateCollectorValidationException
- The data provided in the lspData does not have both a source
name (src) or a destination name (dest) attributepublic static boolean validateMobileSwitchingCentreType(java.lang.String mscType) throws CollectorValidationException
mscType
- The mobile switching centre type to validateCollectorValidationException
- The mobile switching centre type is not one of the expected
valuespublic static boolean validateMPLSData(java.util.Map<java.lang.String,java.lang.Object> mplsData) throws CollectorValidationException
mplsData
- The MPLS data to validateCollectorValidationException
- The data provided in the mplsData map does not have an
interface ID (ifIndex or interfaceId) attributepublic static boolean validateRanNodeBLocalCellTechnologyType(java.lang.String technologyType) throws CollectorValidationException
technologyType
- The RAN node B local cell technology type to validateCollectorValidationException
- The RAN node B local cell technology type is not one of the
expected valuespublic static boolean validateRanTechnologyType(java.lang.String technologyType) throws CollectorValidationException
technologyType
- The RAN technology type to validateCollectorValidationException
- The RAN cell technology type is not one of the expected
valuespublic static boolean validateRanTransceiverTechnologyType(java.lang.String technologyType) throws CollectorValidationException
technologyType
- The RAN transceiver technology type to validateCollectorValidationException
- The RAN transceiver technology type is not one of the
expected valuespublic static boolean validateRelationshipData(java.util.Map<java.lang.String,java.lang.Object> relationshipData) throws CollectorValidationException
relationshipData
- The relationship data to validateCollectorValidationException