insert a value per command

@param value
The values to insert. Size must be equals to the number of commands
@throws DevFailed
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]);
            }
        }
    }
864251
public StrBuilder insert(int index, final boolean value) {
        validateIndex(index);
        if (value) {
            ensureCapacity(size + 4);
            System.arraycopy(buffer, index, buffer, index + 4, size - index);
            buffer[index++] = 't';
            buffer[index++] = 'r';
            buffer[index++] = 'u';
            buffer[index] = 'e';
            size += 4;
        } else {
            ensureCapacity(size + 5);
            System.arraycopy(buffer, index, buffer, index + 5, size - index);
            buffer[index++] = 'f';
            buffer[index++] = 'a';
            buffer[index++] = 'l';
            buffer[index++] = 's';
            buffer[index] = 'e';
            size += 5;
        }
        return this;
    }
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());
	    }

	}
    }
438862
protected void addValidValue(String value)
	{
		if(value!=null && !value.isEmpty())
			validValues.add(value.toLowerCase());
	}
1178928
public void addValue(
                    final Object value
                    )
    {
        if (value == null) {
            setNullContained( true );
        } else {
            _values.add( String.valueOf( value ) );
        }
    }
618871
public void put(Double value) {
		if (value == null) {
			this.compiledStatement.bindNull(compiledStatementBindIndex++);
		} else {
			this.compiledStatement.bindDouble(compiledStatementBindIndex++, value);
		}
	}
955092
public static void insertFromDevState(final DevState devStateValue,
	    final DeviceData deviceDataArgin, final int dataType) throws DevFailed {

	final Integer integerValue = Integer.valueOf(devStateValue.value());
	switch (deviceDataArgin.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    deviceDataArgin.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    deviceDataArgin.insert_us(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_CHAR not supported",
		    "CommandHelper.insertFromDevState(DevState value,deviceDataArgin)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    deviceDataArgin.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_LONG:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    deviceDataArgin.insert_ul(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    deviceDataArgin.insert_u64(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_INT:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    deviceDataArgin.insert(integerValue.floatValue());
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    deviceDataArgin.insert(integerValue.doubleValue());
	    break;
	case TangoConst.Tango_DEV_STRING:
	    deviceDataArgin.insert(integerValue.toString());
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    if (integerValue.doubleValue() == 1) {
		deviceDataArgin.insert(true);
	    } else {
		deviceDataArgin.insert(false);
	    }
	    break;
	case TangoConst.Tango_DEV_STATE:
	    deviceDataArgin.insert(devStateValue);
	    break;
	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
		    + deviceDataArgin.getType() + " not supported",
		    "CommandHelper.insertFromDevState(DevState value,deviceDataArgin)");
	    break;
	}
    }
1119014
DeviceData command_inout(String command, DeviceData argin) throws DevFailed {
        return tacoDevice.command_inout(this, command, argin);
    }
720511
public final void push(int value)
  {

    int ff = m_firstFree;

    if ((ff + 1) >= m_mapSize)
    {
      if (null == m_map)
      {
        m_map = new int[m_blocksize];
        m_mapSize = m_blocksize;
      }
      else
      {
        m_mapSize += m_blocksize;

        int newMap[] = new int[m_mapSize];

        System.arraycopy(m_map, 0, newMap, 0, ff + 1);

        m_map = newMap;
      }
    }

    m_map[ff] = value;

    ff++;

    m_firstFree = ff;
  }
519370
public void add(final String[] pl) throws DevFailed {
	synchronized (this) {
	    for (final String element : pl) {
		if (element != null) {
		    final Vector v = factory.instanciate(element);
		    final Iterator it = v.iterator();
		    while (it.hasNext()) {
			add_i((GroupElement) it.next());
		    }
		}
	    }
	}
    }
329846
public static void insertFromInteger(final Integer integerValue,
	    final DeviceAttribute deviceAttributeWritten) throws DevFailed {

	switch (deviceAttributeWritten.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    deviceAttributeWritten.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    deviceAttributeWritten.insert_us(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_CHAR not supported",
		    "AttributeHelper.insertFromInteger(Integer value,deviceAttributeWritten)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    deviceAttributeWritten.insert_uc(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_LONG:
	    deviceAttributeWritten.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    deviceAttributeWritten.insert_ul(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_LONG64 not supported",
		    "AttributeHelper.insertFromInteger(Integer value,deviceAttributeWritten)");
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    deviceAttributeWritten.insert_u64(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_INT:
	    deviceAttributeWritten.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    deviceAttributeWritten.insert(integerValue.floatValue());
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    deviceAttributeWritten.insert(integerValue.doubleValue());
	    break;
	case TangoConst.Tango_DEV_STRING:
	    deviceAttributeWritten.insert(integerValue.toString());
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    if (integerValue.doubleValue() == 1) {
		deviceAttributeWritten.insert(true);
	    } else {
		deviceAttributeWritten.insert(false);
	    }
	    break;
	case TangoConst.Tango_DEV_STATE:
	    try {
		deviceAttributeWritten.insert(DevState.from_int(integerValue.intValue()));
	    } catch (final org.omg.CORBA.BAD_PARAM badParam) {
		Except.throw_exception("TANGO_WRONG_DATA_ERROR", "Cannot sent"
			+ integerValue.intValue() + "for input Tango_DEV_STATE type",
			"AttributeHelper.insertFromInteger(Integer value,deviceAttributeWritten)");
	    }
	    break;
	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
		    + deviceAttributeWritten.getType() + " not supported",
		    "AttributeHelper.insertFromInteger(Integer value,deviceAttributeWritten)");
	    break;
	}
    }
405614
@Override
    public DevCmdInfo[] command_list_query() throws DevFailed {
        MDC.setContextMap(contextMap);
        xlogger.entry();
        // checkInitialization();
        deviceMonitoring.startRequest("command_list_query");
        // Retrieve number of command and allocate memory to send back info
        final List<CommandImpl> cmdList = getCommandList();
        Collections.sort(cmdList);
        final DevCmdInfo[] back = new DevCmdInfo[commandList.size()];
        int i = 0;
        for (final CommandImpl cmd : cmdList) {
            final DevCmdInfo tmp = new DevCmdInfo();
            tmp.cmd_name = cmd.getName();
            tmp.cmd_tag = cmd.getTag();
            tmp.in_type = cmd.getInType().getTangoIDLType();
            tmp.out_type = cmd.getOutType().getTangoIDLType();
            tmp.in_type_desc = cmd.getInTypeDesc();
            tmp.out_type_desc = cmd.getOutTypeDesc();
            back[i++] = tmp;
        }
        xlogger.exit();
        return back;
    }
212105
@Override
    public Object execute(final Object arg) throws DevFailed {
        errorReportMap.clear();
        String tmpReplyName = "";
        boolean hasFailed = false;
        final List<DevError[]> errors = new ArrayList<DevError[]>();
        int size = 0;
        final DeviceData argin = new DeviceData();
        InsertExtractUtils.insert(argin, config.getInTangoType(), arg);
        final GroupCmdReplyList tmpReplyList = group.command_inout(name, argin, true);

        for (final Object tmpReply : tmpReplyList) {
            tmpReplyName = ((GroupReply) tmpReply).dev_name();
            LOGGER.debug("getting answer for {}", tmpReplyName);
            try {
                ((GroupCmdReply) tmpReply).get_data();
            } catch (final DevFailed e) {
                LOGGER.error("command failed on {}/{} - {}",
                        new Object[] { tmpReplyName, name, DevFailedUtils.toString(e) });
                hasFailed = true;
                errors.add(e.errors);
                size = +e.errors.length;
                errorReportMap.put(tmpReplyName, dateFormat.format(new Date()) + " : " + name + " result "
                        + DevFailedUtils.toString(e));

            }
        }

        if (hasFailed) {
            final DevError[] totalErrors = new DevError[errors.size() * size + 1];
            totalErrors[0] = new DevError("CONNECTION_ERROR", ErrSeverity.ERR, "cannot execute command ", this
                    .getClass().getCanonicalName() + ".executeCommand(" + name + ")");
            int i = 1;
            for (final DevError[] devErrors : errors) {
                for (final DevError devError : devErrors) {
                    totalErrors[i++] = devError;
                }
            }
            throw new DevFailed(totalErrors);
        }
        return null;
    }
162063
public static void insertFromBoolean(final Boolean booleanValue,
	    final DeviceData deviceDataArgin, final int dataType) throws DevFailed {

	Integer integerValue = 0;
	if (booleanValue.booleanValue()) {
	    integerValue = 1;
	}

	switch (dataType) {
	case TangoConst.Tango_DEV_SHORT:
	    deviceDataArgin.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    deviceDataArgin.insert_us(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_CHAR not supported",
		    "CommandHelper.insertFromBoolean(Boolean value,deviceDataArgin)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    deviceDataArgin.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_LONG:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    deviceDataArgin.insert_ul(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    deviceDataArgin.insert_ul(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    deviceDataArgin.insert_u64(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_INT:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    deviceDataArgin.insert(integerValue.floatValue());
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    deviceDataArgin.insert(integerValue.doubleValue());
	    break;
	case TangoConst.Tango_DEV_STRING:
	    deviceDataArgin.insert(Boolean.toString(booleanValue.booleanValue()));
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    deviceDataArgin.insert(booleanValue.booleanValue());
	    break;
	case TangoConst.Tango_DEV_STATE:
	    deviceDataArgin.insert(DevState.from_int(integerValue.intValue()));
	    break;
	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
		    + deviceDataArgin.getType() + " not supported",
		    "CommandHelper.insertFromBoolean(Boolean value,deviceDataArgin)");
	    break;
	}
    }
105237
public void put(String value) {
		if (value == null) {
			this.compiledStatement.bindNull(compiledStatementBindIndex++);
		} else {
			compiledStatement.bindString(compiledStatementBindIndex++, value);
		}

	}
1257192
@Override
    public void setValue(final Object value, final long time) throws DevFailed {
        this.setValue(value);
        this.setTime(time);
    }
165973
public synchronized void startCommandPolling(final CommandImpl command) throws DevFailed {
        addCommandPolling(command);
        LOGGER.debug("starting command {} for polling on device {}", command.getName(), deviceName);
        if (command.getPollingPeriod() != 0) {
            commandCacheMap.get(command).startRefresh(POLLING_POOL);
        }
    }