class SNMPUtils {

    public static FlowFile updateFlowFileAttributesWithPduProperties(PDU response, FlowFile flowFile, ProcessSession processSession) {
        if (response != null) {
            try {
                Method[] methods = PDU.class.getDeclaredMethods();
                Map<String, String> attributes = new HashMap<String, String>();
                for (Method method : methods) {
                    if (Modifier.isPublic(method.getModifiers()) && (method.getParameterTypes().length == 0) && method.getName().startsWith("get")) {
                        String propertyName = extractPropertyNameFromMethod(method);
                        if (isValidSnmpPropertyName(propertyName)) {
                            Object amqpPropertyValue = method.invoke(response);
                            if (amqpPropertyValue != null) {
                                if (propertyName.equals(SNMP_PROP_PREFIX + "variableBindings") && (amqpPropertyValue instanceof Vector)) {
                                    addGetOidValues(attributes, amqpPropertyValue);
                                } else {
                                    attributes.put(propertyName, amqpPropertyValue.toString());
                                }
                            }
                        }
                    }
                }
                flowFile = processSession.putAllAttributes(flowFile, attributes);
            } catch (Exception e) {
                logger.warn("Failed to update FlowFile with AMQP attributes", e);
            }
        }
        return flowFile;
    }

}