Get an attribute's properties

@param attributeName the attribute name
@return its properties
@throws DevFailed
171518
public AttributePropertiesImpl getAttributeProperties(final String attributeName) throws DevFailed {
        final AttributeImpl attr = AttributeGetterSetter.getAttribute(attributeName, device.getAttributeList());
        return attr.getProperties();
    }
312449
public DbHistory[] get_class_attribute_property_history(String classname, String attname, String propname) throws DevFailed {
		return databaseDAO.get_class_attribute_property_history(this, classname, attname, propname);
	}
727437
public static String getfullDeviceNameForAttribute(final String attributeName) throws DevFailed {
        String result;
        final String[] fields = attributeName.split("/");
        final Database db = ApiUtil.get_db_obj();
        if (fields.length == 1) {
            result = db.get_attribute_from_alias(fields[0]);
        } else if (fields.length == 2) {
            result = db.get_device_from_alias(fields[0]);
        } else if (fields.length == 4) {
            result = fields[0] + "/" + fields[1] + "/" + fields[2];
        } else {
            throw DevFailedUtils.newDevFailed("TANGO_WRONG_DATA_ERROR", "cannot retrieve device name");
        }
        return result;
    }
1046195
public DbHistory[] get_device_attribute_property_history(String devname, String attname, String propname) throws DevFailed {
		return databaseDAO.get_device_attribute_property_history(this, devname, attname, propname);
	}
686542
public AttributeInfoEx get_attribute_info_ex(final DeviceProxy deviceProxy, final String attname)
	    throws DevFailed {
        final String[] attributeNames = ApiUtil.toStringArray(attname);
        return get_attribute_info_ex(deviceProxy, attributeNames)[0];
    }
272114
public AttributeInfo[] get_attribute_info(final DeviceProxy deviceProxy,
                                              final String[] attributeNames) throws DevFailed {

        build_connection(deviceProxy);

        final int retries = deviceProxy.transparent_reconnection ? 2 : 1;
        for (int oneTry=1 ; oneTry<=retries ; oneTry++) {
            try {
                AttributeInfo[] result;
                AttributeConfig[] ac = new AttributeConfig[0];
                AttributeConfig_2[] ac_2 = null;
                if (deviceProxy.url.protocol == TANGO) {
                // Check IDL version
                if (deviceProxy.device_2 != null) {
                    ac_2 = deviceProxy.device_2.get_attribute_config_2(attributeNames);
                } else {
                    ac = deviceProxy.device.get_attribute_config(attributeNames);
                }
                } else {
                ac = deviceProxy.taco_device.get_attribute_config(attributeNames);
                }

                // Convert AttributeConfig(_2) object to AttributeInfo object
                final int size = ac_2 != null ? ac_2.length : ac.length;
                result = new AttributeInfo[size];
                for (int i = 0; i < size; i++) {
                if (ac_2 != null) {
                    result[i] = new AttributeInfo(ac_2[i]);
                } else {
                    result[i] = new AttributeInfo(ac[i]);
                }
                }
                return result;
            }
            catch (final DevFailed e) {
                if (oneTry>=retries) {
                    throw e;
                }
            }
            catch (final Exception e) {
                if (oneTry>=retries) {
                    ApiUtilDAODefaultImpl.removePendingRepliesOfDevice(deviceProxy);
                    throw_dev_failed(deviceProxy, e, "get_attribute_config", true);
                }
            }
        }
        return null;
    }
1042452
public Object getAttribute(String attributeName) {
    try {
      final int index = Integer.parseInt(attributeName) - 1;
      if (index < reportable.getMaxEntriesToKeep()) {
        return reportable.get(index).getValue();
      }
    } catch (NumberFormatException e) {
      LOGGER.error("Should never happen! Requested attribute should be an integer but was: " + attributeName);
    }
    return null;
  }
634907
public DbAttribute[] get_class_attribute_property(String classname, String[] attnames) throws DevFailed {
		return databaseDAO.get_class_attribute_property(this, classname, attnames);
	}
529454
public DbAttribute get_device_attribute_property(String devname, String attname) throws DevFailed {
		return databaseDAO.get_device_attribute_property(this, devname, attname);
	}
720129
public DbDatum[] get_device_property(String name, String[] propnames) throws DevFailed {
		return databaseDAO.get_device_property(this, name, propnames);
	}
632086
public DbPipe getClassPipeProperties(String className, String pipeName) throws DevFailed {
        return databaseDAO.getClassPipeProperties(this, className, pipeName);
    }
1310410
public AttributeInfoEx getAttributeInfo(String attributeName) {
        for (AttributeInfoEx attributeInfoEx : attributeInfoList)
            if (attributeInfoEx.name.toLowerCase().equals(attributeName.toLowerCase()))
                return attributeInfoEx;
        return null;
    }
400032
public AttributeInfo[] get_attribute_info(final DeviceProxy deviceProxy) throws DevFailed {

        build_connection(deviceProxy);

        final String[] attributeNames = new String[1];
        if (deviceProxy.device_3 != null) {
            attributeNames[0] = TangoConst.Tango_AllAttr_3;
        } else {
            attributeNames[0] = TangoConst.Tango_AllAttr;
        }

        return get_attribute_info(deviceProxy, attributeNames);
    }
657473
@Override
    public Map<String, String[]> getDeviceProperties(final String name, final String... propertyNames) throws DevFailed {
        Map<String, String[]> map;
        if (propertyNames.length == 0) {
            map = getProperties(PropertyType.Device, name);
        } else {
            map = getProperty(PropertyType.Device, name, propertyNames);
        }
        return map;
    }
197427
@Override
    public void setAttributeProperties(final String deviceName, final String attributeName,
            final Map<String, String[]> properties) throws DevFailed {
        cache.setAttributeProperties(deviceName, attributeName, properties);
    }
1005321
public void setAttributePropertiesInDB(final String attributeName, final Map<String, String[]> properties)
            throws DevFailed {
        xlogger.entry(properties);

        final Map<String, String> currentValues = getAttributePropertiesFromDBSingle(attributeName);
        final Map<String, String[]> propInsert = new HashMap<String, String[]>();
        for (final Entry<String, String[]> entry : properties.entrySet()) {
            final String propertyName = entry.getKey();
            final String[] valueArray = entry.getValue();
            // insert value in db only if input value is different and not a
            // default value
            if (valueArray.length == 1) {
                final String value = valueArray[0];
                final String presentValue = currentValues.get(propertyName);
                boolean isADefaultValue = false;
                if (presentValue != null) {
                    isADefaultValue = presentValue.isEmpty()
                            && (value.equalsIgnoreCase(Constants.NOT_SPECIFIED)
                                    || value.equalsIgnoreCase(Constants.NO_DIPLAY_UNIT)
                                    || value.equalsIgnoreCase(Constants.NO_UNIT) || value
                                        .equalsIgnoreCase(Constants.NO_STD_UNIT));
                }
                if (!isADefaultValue) {
                    if (presentValue == null) {
                        propInsert.put(propertyName, valueArray);
                    } else if (!presentValue.equals(value) && !value.isEmpty() && !value.equals("NaN")) {
                        propInsert.put(propertyName, valueArray);
                    }
                }
            } else {
                // do not check if not a single value
                propInsert.put(propertyName, valueArray);
            }
        }
        logger.debug("update attribute {} properties {} in DB ", attributeName, properties.keySet());
        DatabaseFactory.getDatabase().setAttributeProperties(deviceName, attributeName, propInsert);
        xlogger.exit();
    }
1229339
@Override
    public AttributeConfig_5[] get_attribute_config_5(final String[] attributeNames) throws DevFailed {
        MDC.setContextMap(contextMap);
        xlogger.entry(Arrays.toString(attributeNames));
        // checkInitialization();
        deviceMonitoring.startRequest("get_attribute_config_5 " + Arrays.toString(attributeNames));
        // check if we must retrieve all attributes config
        final int length = attributeNames.length;
        boolean getAllConfig = false;

        if (length == 1 && attributeNames[0].contains(ALL_ATTR)) {
            getAllConfig = true;
        }
        AttributeConfig_5[] result;
        if (getAllConfig) {
            logger.debug("get All");
            final List<AttributeImpl> attrList = getAttributeList();
            // Collections.sort(attrList);
            result = new AttributeConfig_5[attributeList.size()];
            int i = 0;
            for (final AttributeImpl attribute : attrList) {
                if (!attribute.getName().equals(STATE_NAME) && !attribute.getName().equals(STATUS_NAME)) {
                    result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(attribute);
                }
            }

            result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(AttributeGetterSetter.getAttribute(STATE_NAME,
                    attrList));

            result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(AttributeGetterSetter.getAttribute(STATUS_NAME,
                    attrList));

        } else {
            result = new AttributeConfig_5[attributeNames.length];
            int i = 0;
            for (final String attributeName : attributeNames) {
                final AttributeImpl attribute = AttributeGetterSetter.getAttribute(attributeName, attributeList);
                logger.debug("{}:{}", attributeName, attribute.getProperties());
                result[i++] = TangoIDLAttributeUtil.toAttributeConfig5(attribute);
            }
        }
        xlogger.exit();
        return result;
    }