Write some attributes. IDL 1 version

@param values a container for attribute values.
@throws DevFailed
483861
@Override
    public void write_attributes(final AttributeValue[] values) throws DevFailed {
        MDC.setContextMap(contextMap);
        xlogger.entry();
        checkInitialization();
        deviceMonitoring.startRequest("write_attributes");
        clientIdentity.set(null);
        final String[] names = new String[values.length];
        for (int i = 0; i < names.length; i++) {
            names[i] = values[i].name;
            logger.debug("writing {}", names[i]);
        }
        final Object lock = deviceLock.getAttributeLock();
        try {
            synchronized (lock != null ? lock : new Object()) {
                AttributeGetterSetter.setAttributeValue(values, attributeList, stateImpl, aroundInvokeImpl, null);
            }
        } catch (final Exception e) {
            deviceMonitoring.addError();
            if (e instanceof DevFailed) {
                throw (DevFailed) e;
            } else {
                // with CORBA, the stack trace is not visible by the client if
                // not inserted in DevFailed.
                throw DevFailedUtils.newDevFailed(e);
            }
        }
        xlogger.exit();
    }
1054730
public void addTangoInterfaceChangeListener(ITangoInterfaceChangeListener listener, String attrName)
            throws DevFailed {
        addTangoInterfaceChangeListener(listener, attrName, false);
    }
209778
public void put_property(DbDatum[] properties)
            throws DevFailed {
        DbAttribute db_att = new DbAttribute(deviceName);
        Collections.addAll(db_att, properties);
        dev.put_attribute_property(db_att);
    }
915939
public void setProperties(final AttributePropertiesImpl properties) throws DevFailed {
        if (isMemorized()) {
            Object memorizedValue = getMemorizedValue();
            if (memorizedValue != null && memorizedValue.getClass().isAssignableFrom(Number.class)) {
                final double memoValue = Double.parseDouble(memorizedValue.toString());
                if (properties.getMaxValueDouble() < memoValue || properties.getMinValueDouble() > memoValue) {
                    throw DevFailedUtils.newDevFailed("min or max value not possible for current memorized value");
                }
            }
        }
        config.setAttributeProperties(properties);
        if (isFwdAttribute) {
            // set config on forwarded attribute
            final ForwardedAttribute fwdAttr = (ForwardedAttribute) behavior;
            properties.setRootAttribute(fwdAttr.getRootName());
            fwdAttr.setAttributeConfiguration(config);
        }
        config.persist(deviceName);
        EventManager.getInstance().pushAttributeConfigEvent(deviceName, name);
    }
98822
public void add(final String p) throws DevFailed {
	synchronized (this) {

	    final Vector v = factory.instanciate(p);
	    final Iterator it = v.iterator();
	    while (it.hasNext()) {
		add_i((GroupElement) it.next());
	    }

	}
    }
394281
public void addTangoArchiveListener(ITangoArchiveListener listener, String attrName, String[] filters)
            throws DevFailed {
        addTangoArchiveListener(listener, attrName, filters, false);
    }
1278437
public static void insertFromDevVarLongStringArray(final DevVarLongStringArray value,
	    final DeviceData deviceDataArgin, final int dataType) throws DevFailed {
	if (dataType == TangoConst.Tango_DEVVAR_LONGSTRINGARRAY) {
	    deviceDataArgin.insert(value);
	} else {
	    Except
		    .throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
			    + deviceDataArgin.getType() + " not supported",
			    "CommandHelper.insertFromDevVarLongStringArray(DevVarLongStringArray value,deviceDataArgin)");
	}
    }
1204948
public void putInDatabase(String tangoHost) throws  DevFailed {
        Database    database = ApiUtil.get_db_obj(tangoHost);
        createTheServer(database);
        putProperties(database);
    }
549664
public void insert(final Object... value) throws DevFailed {
        if (value.length == 1) {
            for (int i = 0; i < group.get_size(true); i++) {
                final int arginType = group.get_device(i + 1).command_query(commandName).in_type;
                InsertExtractUtils.insert(inData[i], arginType, value);
            }
        } else {
            if (value.length != group.get_size(true)) {
                throw DevFailedUtils.newDevFailed(TANGO_WRONG_DATA_ERROR, group.get_size(true) + " values must be provided");
            }
            for (int i = 0; i < group.get_size(true); i++) {
                final int arginType = group.get_device(i + 1).command_query(commandName).in_type;
                InsertExtractUtils.insert(inData[i], arginType, value[i]);
            }
        }
    }
93600
public void setAttributeValue(final IDeviceAttributeDAO devatt)
	    throws DevFailed {

	attrval.name = devatt.getName();
	attrval.quality = devatt.getQuality();
	attrval.time = devatt.getTimeVal();
	attrval.r_dim = devatt.getReadAttributeDim();
	attrval.w_dim = devatt.getWriteAttributeDim();
	attrval.r_dim.dim_x = devatt.getReadAttributeDim().dim_x;
	attrval.r_dim.dim_y = devatt.getReadAttributeDim().dim_y;

	if (devatt.getWriteAttributeDim() != null) {
	    attrval.w_dim.dim_x = devatt.getWriteAttributeDim().dim_x;
	    attrval.w_dim.dim_y = devatt.getWriteAttributeDim().dim_y;
	} else {
	    attrval.w_dim = devatt.getReadAttributeDim();// write as read
	}

	attrval.err_list = null;
	// Get the value from Union object
	attrval.value = ApiUtil.get_orb().create_any();
	// GA
	// devatt.setValueAsAny(this);
	((DeviceAttributeDAODefaultImpl) devatt).setValueAsAny(this);
    }
115563
public void write(byte... values) {
        if (count >= content.length - values.length) {
            byte[] ns = new byte[content.length + values.length];
            System.arraycopy(content, 0, ns, 0, count);
            this.content = ns;
        }
        System.arraycopy(values, 0, content, count, values.length);
        count += values.length;
    }
1272627
private AttributeValue[] buildAttributeValue(final String[] real_names) throws DevFailed {
	// Allocate memory for the AttributeValue structures
	AttributeValue[] back = new AttributeValue[0];
	// noinspection ErrorNotRethrown
	try {
	    back = new AttributeValue[real_names.length];
	    for (int i = 0; i < real_names.length; i++) {
		back[i] = new AttributeValue();
	    }
	} catch (final OutOfMemoryError ex) {
	    Except.throw_exception("API_MemoryAllocation", "Can't allocate memory in server",
		    "DeviceImpl.read_attributes");
	}

	// Build the sequence returned to caller for readable attributes and
	// check
	// that all the wanted attributes set value has been updated
	for (int i = 0; i < real_names.length; i++) {
	    final Attribute att = dev_attr.get_attr_by_name(real_names[i]);
	    if (att.get_value_flag()) {
		final AttrWriteType w_type = att.get_writable();
		if (w_type == AttrWriteType.READ || w_type == AttrWriteType.READ_WRITE
			|| w_type == AttrWriteType.READ_WITH_WRITE) {
		    if (w_type == AttrWriteType.READ_WRITE
			    || w_type == AttrWriteType.READ_WITH_WRITE) {
			dev_attr.add_write_value(att);
		    }

		    if (att.is_alarmed() == true
			    && att.get_quality().value() != AttrQuality._ATTR_INVALID) {
			att.check_alarm();
		    }
		}
		back[i].time = att.get_when();
		back[i].quality = att.get_quality();
		back[i].name = att.get_name();
		back[i].dim_x = att.get_x();
		back[i].dim_y = att.get_y();

		final Util tg = Util.instance();
		back[i].value = tg.get_orb().create_any();

		switch (att.get_data_type()) {
		case Tango_DEV_BOOLEAN:
		    DevVarBooleanArrayHelper.insert(back[i].value, att.get_boolean_value());
		    break;

		case Tango_DEV_SHORT:
		    DevVarShortArrayHelper.insert(back[i].value, att.get_short_value());
		    break;

		case Tango_DEV_USHORT:
		    DevVarUShortArrayHelper.insert(back[i].value, att.get_short_value());
		    break;

		case Tango_DEV_LONG:
		    DevVarLongArrayHelper.insert(back[i].value, att.get_long_value());
		    break;

		case Tango_DEV_ULONG:
		    DevVarULongArrayHelper.insert(back[i].value, att.get_long_value());
		    break;

		case Tango_DEV_LONG64:
		    DevVarLong64ArrayHelper.insert(back[i].value, att.get_long64_value());
		    break;

		case Tango_DEV_ULONG64:
		    DevVarULong64ArrayHelper.insert(back[i].value, att.get_long64_value());
		    break;

		case Tango_DEV_DOUBLE:
		    DevVarDoubleArrayHelper.insert(back[i].value, att.get_double_value());
		    break;

		case Tango_DEV_STRING:
		    DevVarStringArrayHelper.insert(back[i].value, att.get_string_value());
		    break;
		case Tango_DEV_STATE:
		    DevVarStateArrayHelper.insert(back[i].value, att.get_state_value());
		    break;

		/*
		 * //======================================================== //
		 * Not possible (DevEncoded type is not transfered inside an
		 * any)
		 * //========================================================
		 * case Tango_DEV_ENCODED :
		 * DevEncodedHelper.insert(back[i].value,att.get_enc_value());
		 * break;
		 */
		default:
		    Except.throw_exception("API_DatTypeNotSupported", "Attribute " + att.get_name()
			    + " data type not supported !", "Device_2Impl.read_attributes()");
		}
	    } else {
		Except.throw_exception("API_AttrValueNotSet", "Read value for attribute "
			+ att.get_name() + " has not been updated", "DeviceImpl.read_attributes");
	    }
	} // End of for ( ; ; )
	return back;
    }
707201
public void setPipeConfig(PipeInfo[] pipeInfoList) throws DevFailed {
        ArrayList<PipeInfo> infoList = new ArrayList<PipeInfo>(pipeInfoList.length);
        Collections.addAll(infoList, pipeInfoList);
        setPipeConfig(infoList);
    }
1180047
public void put_property(String name, DbDatum[] properties) throws DevFailed {
		databaseDAO.put_property(this, name, properties);
	}
795702
private void setFromEnv() throws DevFailed {
        String env = TangoEnv.getTangoHost();
        assert env != null;
        if (!env.contains(":"))
            Except.throw_connection_failed("TangoApi_TANGO_HOST_NOT_SET",
                    "Unknown \"TANGO_HOST\" property " + env,
                    "TangoUrl.setFromEnv()");
        String[] array = ApiUtil.parseTangoHost(env);
        host = array[0];
        strPort = array[1];
        port = Integer.parseInt(strPort);
        envRead = true;
        fromEnv = true;
    }
340427
public void delete_attribute_property(String attributeName, String[] propertyNames) throws DevFailed {
        database.delete_class_attribute_property(className, attributeName, propertyNames);
    }
1123996
@Override
    public void setAttributeProperties(final String deviceName, final String attributeName,
            final Map<String, String[]> properties) throws DevFailed {
        final DeviceData argin = new DeviceData();
        final List<String> args = new ArrayList<String>();
        args.add(deviceName);
        args.add(Integer.toString(1)); // attribute number
        args.add(attributeName);
        args.add(Integer.toString(properties.size())); // property number
        for (final Map.Entry<String, String[]> entry : properties.entrySet()) {
            args.add(entry.getKey());
            final String[] propValues = entry.getValue();
            args.add(Integer.toString(propValues.length));
            for (final String propValue : propValues) {
                args.add(propValue);
            }
        }
        argin.insert(args.toArray(new String[args.size()]));
        database.command_inout("DbPutDeviceAttributeProperty2", argin);
    }