Class SnmpTrapSink

    • Field Detail

      • LOG

        public static final org.slf4j.Logger LOG
        The Constant LOG.
      • MAPPINGS_DIRECTORY_NAME

        public static final String MAPPINGS_DIRECTORY_NAME
        The Constant MAPPINGS_DIRECTORY_NAME.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SnmpTrapSink

        public SnmpTrapSink()
    • Method Detail

      • isFirstOccurrenceOnly

        public boolean isFirstOccurrenceOnly()
        Description copied from interface: Destination
        Checks if is first occurrence only.
        Specified by:
        isFirstOccurrenceOnly in interface Destination
        Returns:
        true, if is first occurrence only
      • getName

        public String getName()
        Description copied from interface: Destination
        Gets the destination name.
        Specified by:
        getName in interface Destination
        Returns:
        the destination name
      • getIpAddress

        public String getIpAddress()
        Gets the IP address.
        Returns:
        the IP address
      • getPort

        public Integer getPort()
        Gets the port.
        Returns:
        the port
      • getV1AgentIpAddress

        public String getV1AgentIpAddress()
        Gets the v1 agent IP address.
        Returns:
        the v1 agent IP address
      • getVersion

        public SnmpVersion getVersion()
        Gets the version.
        Returns:
        the version
      • getCommunity

        public String getCommunity()
        Gets the community.
        Returns:
        the community
      • getImportMappings

        public List<String> getImportMappings()
        Gets the import mappings.
        Returns:
        the import mappings
      • setName

        public void setName​(String name)
        Sets the name.
        Parameters:
        name - the new name
      • setIpAddress

        public void setIpAddress​(String ipAddress)
        Sets the IP address.
        Parameters:
        ipAddress - the new IP address
      • setPort

        public void setPort​(int port)
        Sets the port.
        Parameters:
        port - the new port
      • setV1AgentIpAddress

        public void setV1AgentIpAddress​(String v1AgentIpAddress)
        Sets the v1 agent IP address.
        Parameters:
        v1AgentIpAddress - the new v1 agent IP address
      • setVersion

        public void setVersion​(SnmpVersion version)
        Sets the version.
        Parameters:
        version - the new version
      • setCommunity

        public void setCommunity​(String community)
        Sets the community.
        Parameters:
        community - the new community
      • setMappings

        public void setMappings​(List<SnmpTrapMappingGroup> mappings)
        Sets the mappings.
        Parameters:
        mappings - the new mappings
      • setImportMappings

        public void setImportMappings​(List<String> importMappings)
        Sets the import mappings.
        Parameters:
        importMappings - the new import mappings
      • addMappingGroup

        public void addMappingGroup​(SnmpTrapMappingGroup mappingGroup)
        Adds the mapping group.

        If there is a mapping group with the same name, the existing one will be overridden.

        Parameters:
        mappingGroup - the mapping group
      • getMappingGroupFileName

        public String getMappingGroupFileName​(String mappingName)
        Gets the mapping group file name.
        Parameters:
        mappingName - the mapping name
        Returns:
        the full path for the mapping group file name
      • getMappingGroupFile

        public File getMappingGroupFile​(String mappingFileName)
        Gets the mapping group file.
        Parameters:
        mappingFileName - the mapping file name
        Returns:
        the mapping group file
      • getImportMapping

        public SnmpTrapMappingGroup getImportMapping​(String mappingName)
                                              throws Exception
        Gets the import mapping.
        Parameters:
        mappingName - the mapping name
        Returns:
        the import mapping
        Throws:
        Exception - the exception
      • addImportMapping

        public void addImportMapping​(SnmpTrapMappingGroup mappingGroup)
                              throws Exception
        Adds the import mapping.
        Parameters:
        mappingGroup - the mapping group
        fileName - the file name
        Throws:
        Exception
      • removeImportMapping

        public boolean removeImportMapping​(String mappingName)
        Removes the import mapping.
        Parameters:
        mappingName - the mapping name
        Returns:
        true, if successful
      • accepts

        public boolean accepts​(NorthboundAlarm alarm)
        Verifies if the sink accepts a given northbound alarm.
        Parameters:
        alarm - the northbound alarm
        Returns:
        true, if the alarm is accepted
      • cleanMappingGroups

        public void cleanMappingGroups()
        Clean mapping groups.

        This is intended to be used when saving the configuration on a file.

        All the groups that currently exist on the mappings list and also on the import-mappings list will be removed from the mapping list to avoid duplicates.