Get an attribute's properties from tango db

@param attributeName
@return The properties
@throws DevFailed
421582
private Map<String, String> getAttributePropertiesFromDBSingle(final String attributeName) throws DevFailed {
        xlogger.entry(attributeName);
        final Map<String, String> result = new CaseInsensitiveMap<String>();
        final Map<String, String[]> prop = DatabaseFactory.getDatabase().getAttributeProperties(deviceName,
                attributeName);
        for (final Entry<String, String[]> entry : prop.entrySet()) {
            final String name = entry.getKey();
            final String[] value = entry.getValue();
            if (value.length > 0) {
                result.put(name, value[0]);
            } else {
                result.put(name, "");
            }
        }
        xlogger.exit();
        return result;
    }
949951
@Override
    public Map<String, String[]> getClassProperties(final String name, final String... propertyNames) throws DevFailed {
        Map<String, String[]> map;
        if (propertyNames.length == 0) {
            map = getProperties(PropertyType.Class, name);
        } else {
            map = getProperty(PropertyType.Class, name, propertyNames);
        }
        return map;
    }
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;
    }
712968
public DbDatum get_class_property(String name, String propname) throws DevFailed {
		return databaseDAO.get_class_property(this, name, propname);
	}
278968
public DbDatum get_property(Database database, String name, String propname, boolean forced)
            throws DevFailed {
        int tmp_access = database.access;
        if (forced)
            database.access = TangoConst.ACCESS_WRITE;
        DbDatum datum;
        try {
            //	Format input parameters as string array
            //--------------------------------------------
            String[] array;
            array = new String[2];
            array[0] = name;
            array[1] = propname;

            //	Read Database
            //---------------------
            DeviceData argIn = new DeviceData();
            argIn.insert(array);
            DeviceData argOut = command_inout(database, "DbGetProperty", argIn);
            String[] result = argOut.extractStringArray();

            //	And convert to DbDatum array before returning
            datum = stringArray2DbDatum(result)[0];
            database.access = tmp_access;
        } catch (DevFailed e) {
            database.access = tmp_access;
            throw e;
        }
        return datum;
    }
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);
    }
650759
public DbPipe getClassPipeProperties(Database database, String className, String pipeName) throws DevFailed {

        DeviceData argIn = new DeviceData();
        argIn.insert(new String[]{className, pipeName});
        DeviceData argOut = database.command_inout("DbGetClassPipeProperty", argIn);
        return ApiUtil.toDbPipe(pipeName, argOut.extractStringArray());
    }
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);
	}
867154
public String[] get_device_property_list(Database database, String deviceName, String wildcard)
            throws DevFailed {
        if (!database.isAccess_checked()) checkAccess(database);

        String[] array = new String[2];
        array[0] = deviceName;
        array[1] = wildcard;
        DeviceData argIn = new DeviceData();
        argIn.insert(array);
        DeviceData argOut = command_inout(database, "DbGetDevicePropertyList", argIn);
        return argOut.extractStringArray();
    }
1008664
public String[] get_class_property_list(String classname, String wildcard) throws DevFailed {
		return databaseDAO.get_class_property_list(this, classname, wildcard);
	}
979872
public void setAttributeProperties(final String attributeName, final AttributePropertiesImpl properties)
            throws DevFailed {
        final AttributeImpl attr = AttributeGetterSetter.getAttribute(attributeName, device.getAttributeList());
        attr.setProperties(properties);
    }
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);
	}
1183618
public DeviceAttribute[] read_attribute(final DeviceProxy deviceProxy, final String[] attributeNames)
	    throws DevFailed {
	DeviceAttribute[] attr;

	build_connection(deviceProxy);

	// Read attributes on device server
	AttributeValue[] attributeValues = new AttributeValue[0];
	AttributeValue_3[] attributeValues_3 = new AttributeValue_3[0];
	AttributeValue_4[] attributeValues_4 = new AttributeValue_4[0];
	AttributeValue_5[] attributeValues_5 = new AttributeValue_5[0];
	if (deviceProxy.url.protocol == TANGO) {
	    // try 2 times for reconnection if requested
	    boolean done = false;
	    final int retries = deviceProxy.transparent_reconnection ? 2 : 1;
	    for (int i = 0; i < retries && !done; i++) {
            try {
                if (deviceProxy.device_5 != null) {
                    attributeValues_5 = deviceProxy.device_5.read_attributes_5(
                            attributeNames, deviceProxy.dev_src,
                            DevLockManager.getInstance().getClntIdent());
                }
                else if (deviceProxy.device_4 != null) {
                    attributeValues_4 = deviceProxy.device_4.read_attributes_4(
                            attributeNames, deviceProxy.dev_src,
                            DevLockManager.getInstance().getClntIdent());
                }
                else if (deviceProxy.device_3 != null) {
                    attributeValues_3 = deviceProxy.device_3.read_attributes_3(
                            attributeNames, deviceProxy.dev_src);
                }
                else if (deviceProxy.device_2 != null) {
                    attributeValues = deviceProxy.device_2.read_attributes_2(
                            attributeNames, deviceProxy.dev_src);
                }
                else {
                    attributeValues = deviceProxy.device.read_attributes(attributeNames);
                }
                done = true;
            } catch (final DevFailed e) {
                // Except.print_exception(e);
                final StringBuilder sb = new StringBuilder(attributeNames[0]);
                for (int j = 1; j < attributeNames.length; j++) {
                    sb.append(", ").append(attributeNames[j]);
                }
                Except.throw_connection_failed(e, "TangoApi_CANNOT_READ_ATTRIBUTE",
                    "Cannot read attribute(s):   " + sb.toString(),
                        deviceProxy.getFull_class_name() + ".read_attribute()");
            } catch (final Exception e) {
                manageExceptionReconnection(deviceProxy,
                        retries, i, e, this.getClass() + ".read_attribute");
            }
	    }
	    // Build a Device Attribute Object
	    // Depends on Device_impl version
	    if (deviceProxy.device_5 != null) {
            attr = new DeviceAttribute[attributeValues_5.length];
            for (int i = 0; i < attributeValues_5.length; i++) {
                attr[i] = new DeviceAttribute(attributeValues_5[i]);
            }
	    } else if (deviceProxy.device_4 != null) {
            attr = new DeviceAttribute[attributeValues_4.length];
            for (int i = 0; i < attributeValues_4.length; i++) {
                attr[i] = new DeviceAttribute(attributeValues_4[i]);
            }
	    } else if (deviceProxy.device_3 != null) {
            attr = new DeviceAttribute[attributeValues_3.length];
            for (int i = 0; i < attributeValues_3.length; i++) {
                attr[i] = new DeviceAttribute(attributeValues_3[i]);
            }
	    } else {
            attr = new DeviceAttribute[attributeValues.length];
            for (int i = 0; i < attributeValues.length; i++) {
                attr[i] = new DeviceAttribute(attributeValues[i]);
            }
	    }
	} else {
	    attr = deviceProxy.taco_device.read_attribute(attributeNames);
	}
	return attr;
    }
140364
public DbDatum[] get_class_property(Database database, String name, String[] propnames)
            throws DevFailed {
        String type = "Class";    //	class object type
        return get_obj_property(database, name, type, propnames);
    }
654962
public AttributeConfig[] get_attribute_config(TacoTangoDevice tacoDevice, String[] attrnames) throws DevFailed {
        Except.throw_exception("Api_TacoFailed",
                "Taco protocol not supported",
                "TacoTangoDeviceDAODefaultImpl.command_inout()");
        return null;
    }
1060124
public Database get_db_obj(final String host, final String port) throws DevFailed {
        if (ApiUtil.getOrb() == null) {
            create_orb();
        }

        // If first time, create vector
        if (db_list == null) {
            db_list = new ArrayList<Database>();
        }

        // Build tango_host string
        final String tango_host = host + ":" + port;

        // Search if database object already created for this host and port
        if (defaultDatabase != null) {
            if (defaultDatabase.get_tango_host().equals(tango_host)) {
                return defaultDatabase;
            }
        }

        for (final Database dbase : db_list) {
            if (dbase.get_tango_host().equals(tango_host)) {
                return dbase;
            }
        }

        // Else, create a new database object
        final Database dbase = new Database(host, port);
        db_list.add(dbase);
        return dbase;
    }
40460
public AttributeInfo get_attribute_info(final DeviceProxy deviceProxy, final String attname)
	    throws DevFailed {
        final String[] attnames = ApiUtil.toStringArray(attname);
        final AttributeInfo[] ac = get_attribute_info(deviceProxy, attnames);
        return ac[0];
    }