Create device property {@link DeviceProperty}

@param clazz
@param field
@param device
@param businessObject
@throws DevFailed
777100
public void build(final Class<?> clazz, final Field field, final DeviceImpl device, final Object businessObject)
            throws DevFailed {
        xlogger.entry();
        try {
            // Inject each device property
            final DeviceProperty annot = field.getAnnotation(DeviceProperty.class);
            final String fieldName = field.getName();
            String propName;
            if (annot.name().equals("")) {
                propName = fieldName;
            } else {
                propName = annot.name();
            }
            logger.debug("Has a DeviceProperty : {}", propName);
            BuilderUtils.checkStatic(field);
            String setterName = BuilderUtils.SET + fieldName.substring(0, 1).toUpperCase(Locale.ENGLISH)
                    + fieldName.substring(1);
            Method setter = null;
            try {
                setter = businessObject.getClass().getMethod(setterName, field.getType());
            } catch (final NoSuchMethodException e) {
                if (fieldName.startsWith(BuilderUtils.IS)) {
                    setterName = BuilderUtils.SET + fieldName.substring(2);
                    try {
                        setter = businessObject.getClass().getMethod(setterName, field.getType());
                    } catch (final NoSuchMethodException e1) {
                        throw DevFailedUtils.newDevFailed(e);
                    }
                } else {
                    throw DevFailedUtils.newDevFailed(e);
                }
            }
            final DevicePropertyImpl property = new DevicePropertyImpl(propName, annot.description(), setter,
                    businessObject, device.getName(), device.getClassName(), annot.isMandatory(), annot.defaultValue());
            device.addDeviceProperty(property);
        } catch (final IllegalArgumentException e) {
            throw DevFailedUtils.newDevFailed(e);
        }
        xlogger.exit();
    }
215248
@Command(name = "QueryWizardClassProperty", inTypeDesc = "Class name", outTypeDesc = "Class property list (name - description and default value)")
    public String[] queryClassProp(final String className) throws DevFailed {
        xlogger.entry();
        final List<String> names = new ArrayList<String>();
        for (final DeviceClassBuilder deviceClass : classList) {
            if (deviceClass.getClassName().equalsIgnoreCase(className)) {
                final List<DeviceImpl> devices = deviceClass.getDeviceImplList();
                if (devices.size() > 0) {
                    final DeviceImpl dev = devices.get(0);
                    final List<ClassPropertyImpl> props = dev.getClassPropertyList();
                    for (final ClassPropertyImpl prop : props) {
                        names.add(prop.getName());
                        names.add(prop.getDescription());
                        names.add("");// default value
                    }
                }
                break;
            }
        }
        xlogger.exit();
        return names.toArray(new String[names.size()]);
    }
47228
public void deleteDevicePipeProperty(String deviceName,
                                         String pipeName, String propertyName) throws DevFailed {
        ArrayList<String>   list = new ArrayList<String>(1);
        list.add(propertyName);
        databaseDAO.deleteDevicePipeProperties(this, deviceName, pipeName, list);
    }
646065
public DbDatum get_device_property(String name, String propname) throws DevFailed {
		return databaseDAO.get_device_property(this, name, propname);
	}
1000705
public void put_device_attribute_property(Database database, String deviceName, DbAttribute[] attr)
            throws DevFailed {
        if (!database.isAccess_checked()) checkAccess(database);

        DeviceData argIn = new DeviceData();
        try {
            //	value is an array
            argIn.insert(ApiUtil.toStringArray(deviceName, attr, 2));
            command_inout(database, "DbPutDeviceAttributeProperty2", argIn);
        } catch (DevFailed e) {
            if (e.errors[0].reason.equals("API_CommandNotFound")) {
                //	Value is just one element
                argIn.insert(ApiUtil.toStringArray(deviceName, attr, 1));
                command_inout(database, "DbPutDeviceAttributeProperty", argIn);
            } else
                throw e;
        }
    }
898997
public void delete_property(final DeviceProxy deviceProxy,
                                final String[] propertyNames) throws DevFailed {
        checkIfUseDb(deviceProxy, "delete_property()");

        if (deviceProxy.getDb_dev() == null) {
            deviceProxy.setDb_dev(new DbDevice(deviceProxy.devname, deviceProxy.url.host,
                deviceProxy.url.strPort));
        }
        checkIfTango(deviceProxy, "delete_property");
        deviceProxy.getDb_dev().delete_property(propertyNames);
    }
951827
public void put_property(Database database, String name, DbDatum[] properties)
            throws DevFailed {
        if (!database.isAccess_checked()) checkAccess(database);

        String[] array = dbdatum2StringArray(name, properties);
        DeviceData argIn = new DeviceData();
        argIn.insert(array);
        command_inout(database, "DbPutProperty", argIn);
    }
928535
private void createDevice(final Connection connection, final String corba_str) throws DevFailed {
		try {
	    	// Build corba object
	    	final ORB orb = ApiUtil.get_orb();
	    	connection.setObj(orb.string_to_object(corba_str));
		}
        catch (final RuntimeException e) {
	    	Except.throw_connection_failed("TangoApi_TANGO_HOST_NOT_VALID", e.toString().substring(
		    	e.toString().indexOf(":") + 2), "Connection.createDevice()");
		}
		// Get default timeout from env or fix it if not set
		String strTimeout;
		if ((strTimeout = ApiUtil.getStrDefaultTimeout()) == null) {
	    	strTimeout = "3000";
		}
		try {
	    	connection.setDev_timeout(Integer.parseInt(strTimeout));
		}
        catch (final Exception e) {
	    	ApiUtilDAODefaultImpl.removePendingRepliesOfDevice(connection);
	    	e.printStackTrace();
		}
		set_obj_timeout(connection, connection.getDev_timeout());

		// Construct the Object
		if (connection.getObj()._is_a("IDL:Tango/Device_5:1.0")) {
	    	//System.out.println(connection.devname + " Device is a Tango/Device_5:1.0 !!!!!!!!!");
	    	connection.device_5 = Device_5Helper.narrow(connection.getObj());
	    	connection.device_4 = connection.device_5;
	    	connection.device_3 = connection.device_5;
	    	connection.device_2 = connection.device_5;
	    	connection.device = connection.device_5;
	    	connection.idl_version = 5;
        }
        else if (connection.getObj()._is_a("IDL:Tango/Device_4:1.0")) {
	    	// System.out.println("Device is a Tango/Device_4:1.0 !!!!!!!!!");
            connection.device_5 = null;
	    	connection.device_4 = Device_4Helper.narrow(connection.getObj());
	    	connection.device_3 = connection.device_4;
	    	connection.device_2 = connection.device_4;
	    	connection.device = connection.device_4;
	    	connection.idl_version = 4;
		}
        else if (connection.getObj()._is_a("IDL:Tango/Device_3:1.0")) {
	    	// System.out.println("Device is a Tango/Device_3:1.0 !!!!!!!!!");
            connection.device_5 = null;
	    	connection.device_4 = null;
	    	connection.device_3 = Device_3Helper.narrow(connection.getObj());
	    	connection.device_2 = connection.device_3;
	    	connection.device = connection.device_3;
	    	connection.idl_version = 3;
		}
        else if (connection.getObj()._is_a("IDL:Tango/Device_2:1.0")) {
	    	System.err.println("Device " + connection.get_name() + " is a Tango/Device_2:1.0 !!!!!!!!!");
            connection.device_5 = null;
	    	connection.device_4 = null;
	    	connection.device_3 = null;
	    	connection.device_2 = Device_2Helper.narrow(connection.getObj());
	    	connection.device = connection.device_2;
	    	connection.idl_version = 2;
		}
        else if (connection.getObj()._is_a("IDL:Tango/Device:1.0")) {
	    	System.err.println("Device " + connection.get_name() + " is a Tango/Device:1.0 !!!!!!!!!");
            connection.device_5 = null;
	    	connection.device_4 = null;
	    	connection.device_3 = null;
	    	connection.device_2 = null;
	    	connection.device = DeviceHelper.narrow(connection.getObj());
	    	connection.idl_version = 1;
		}
        else {
	    	System.err.println("TangoApi_DEVICE_IDL_UNKNOWN!");
	    	Except.throw_non_supported_exception("TangoApi_DEVICE_IDL_UNKNOWN", connection.devname
		    	+ " has an IDL revision not supported !", "Connection.createDevice("
		    	+ connection.devname + ")");
		}

		// Force a network is_a() here for error
		// management of build_connection()
		// We do not use ping() as it can be serialized
		// at the server level

		connection.getObj()._is_a("Dummy");
    }
1369413
public void add_device(Database database, DbDevInfo devinfo) throws DevFailed {
        if (!database.isAccess_checked()) checkAccess(database);

        DeviceData argIn = new DeviceData();
        argIn.insert(devinfo.toStringArray());
        command_inout(database, "DbAddDevice", argIn);
        //System.out.println(devinfo.name + " created");
    }
199893
@Override
    public Map<String, String[]> getDeviceProperties(final String name, final String... propertyNames) throws DevFailed {
        return cache.getDeviceProperties(name, propertyNames);
    }
126080
public void put_property(final DeviceProxy deviceProxy, final DbDatum prop) throws DevFailed {
        checkIfUseDb(deviceProxy, "put_property()");

        if (deviceProxy.getDb_dev() == null) {
            deviceProxy.setDb_dev(new DbDevice(deviceProxy.devname, deviceProxy.url.host,
                deviceProxy.url.strPort));
        }
        checkIfTango(deviceProxy, "put_property");

        final DbDatum[] properties = new DbDatum[1];
        properties[0] = prop;
        put_property(deviceProxy, properties);
    }
1213541
public DbPipe getDevicePipeProperties(Database database, String deviceName, String pipeName) throws DevFailed {

        DeviceData argIn = new DeviceData();
        argIn.insert(new String[]{deviceName, pipeName});
        DeviceData argOut = database.command_inout("DbGetDevicePipeProperty", argIn);
        return ApiUtil.toDbPipe(pipeName, argOut.extractStringArray());
    }
202967
@Override
    public void exportDevices() throws DevFailed {
        // load server class
        for (final Entry<String, Class<?>> entry : tangoClasses.entrySet()) {
            final String tangoClass = entry.getKey();
            final Class<?> deviceClass = entry.getValue();
            logger.debug("loading class {}", deviceClass.getCanonicalName());
            final DeviceClassBuilder deviceClassBuilder = new DeviceClassBuilder(deviceClass, tangoClass);
            deviceClassList.add(deviceClassBuilder);
            // export all its devices
            final String[] deviceList = DatabaseFactory.getDatabase().getDeviceList(serverName, tangoClass);
            logger.debug("devices found  {}", Arrays.toString(deviceList));
            // if (deviceList.length == 0) {
            // throw DevFailedUtils.newDevFailed(ExceptionMessages.DB_ACCESS, "No device defined in database for class "
            // + tangoClass);
            // }
            for (final String deviceName : deviceList) {
                buildDevice(deviceName, deviceClassBuilder);
            }
        }
    }
215604
private void createTheServer(Database database) throws DevFailed {
        ArrayList<DbDevInfo>    deviceInfoList =new ArrayList<DbDevInfo>();
        for (TangoClass clazz : classes) {
            for (TangoDevice device : clazz) {
                deviceInfoList.add(new DbDevInfo(device.name, clazz.name, serverName));
            }
        }
        DbDevInfo[] deviceInfoArray = new DbDevInfo[deviceInfoList.size()];
        for (int i=0 ; i<deviceInfoList.size() ; i++) {
            deviceInfoArray[i] = deviceInfoList.get(i);
        }
        database.add_server(serverName, deviceInfoArray);
    }
793470
public DbAttribute[] get_device_attribute_property(String devname, String[] attnames) throws DevFailed {
		return databaseDAO.get_device_attribute_property(this, devname, attnames);
	}
974944
public void put_property(DbDatum property)
            throws DevFailed {
        DbAttribute db_att = new DbAttribute(deviceName);
        db_att.add(property);
        dev.put_attribute_property(db_att);
    }
1118168
@Override
    public Map<String, String[]> getAttributeProperties(final String deviceName, final String attributeName)
            throws DevFailed {
        Map<String, String[]> map;
        final DeviceData argin = new DeviceData();
        final List<String> args = new ArrayList<String>();
        args.add(deviceName);
        args.add(attributeName);
        // value is an array
        argin.insert(args.toArray(new String[args.size()]));
        final DeviceData argout = database.command_inout("DbGetDeviceAttributeProperty2", argin);
        final String[] result = argout.extractStringArray();
        map = extractArgout(result, 4);
        return map;

    }