==========================================================================
776595
public DbDatum[] get_property(String name, DbDatum[] properties) throws DevFailed {
		return databaseDAO.get_property(this, name, properties);
	}
53774
public function process()
    {
        parent::process();

        try {
            $value = $this->getNumericValue($this->value);
        } catch (SwatIntegerOverflowException $e) {
            $value = null;
        }

        if ($value !== null) {
            if (
                $this->minimum_value !== null &&
                $value < $this->minimum_value
            ) {
                $message = $this->getValidationMessage('below-minimum');
                $minimum_value = str_replace(
                    '%',
                    '%%',
                    $this->getDisplayValue($this->minimum_value)
                );

                $message->primary_content = sprintf(
                    $message->primary_content,
                    $minimum_value
                );

                $this->addMessage($message);
            }
            if (
                $this->maximum_value !== null &&
                $value > $this->maximum_value
            ) {
                $message = $this->getValidationMessage('above-maximum');
                $maximum_value = str_replace(
                    '%',
                    '%%',
                    $this->getDisplayValue($this->maximum_value)
                );

                $message->primary_content = sprintf(
                    $message->primary_content,
                    $maximum_value
                );

                $this->addMessage($message);
            }
        }
    }
1104726
public function init() {

		parent::init();

		$this->tabStatus	= [ 'basic' => self::STATUS_BASIC, 'media' => self::STATUS_MEDIA, 'attributes' => self::STATUS_ATTRIBUTES, 'settings' => self::STATUS_SETTINGS, 'review' => self::STATUS_REVIEW ];

		$this->nextStatus	= [ self::STATUS_BASIC => self::STATUS_MEDIA, self::STATUS_MEDIA => self::STATUS_ATTRIBUTES, self::STATUS_ATTRIBUTES => self::STATUS_SETTINGS, self::STATUS_SETTINGS => self::STATUS_REVIEW ];

		$this->previousTab	= [ 'media' => 'basic', 'attributes' => 'media', 'settings' => 'attributes', 'review' => 'settings' ];

		$this->nextTab		= [ 'basic' => 'media', 'media' => 'attributes', 'attributes' => 'settings', 'settings' => 'review' ];
	}
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);
            }
        }
    }
295508
public function init()
    {
        if (!isset($this->options['id'])) {
            $this->options['id'] = $this->getId();
        }

        if (!isset($this->options['data-success-class'])) {
            $this->options['data-success-class'] = $this->successCssClass;
        }

        if (!isset($this->options['data-error-class'])) {
            $this->options['data-error-class'] = $this->errorCssClass;
        }

        if ($this->enableClientValidation) {
            $this->registerAfterValidateHandler();
        }

        parent::init();
    }
1373143
public static void initPoolConf() throws DevFailed {
        polledDevices.clear();
        final Map<String, String[]> prop = PropertiesUtils.getDeviceProperties(ServerManager.getInstance()
                .getAdminDeviceName());
        if (prop.containsKey(POLLING_THREADS_POOL_CONF)) {
            final String[] pollingThreadsPoolConf = prop.get(POLLING_THREADS_POOL_CONF);
            for (int i = 0; i < pollingThreadsPoolConf.length; i++) {
                if (cacheList.containsKey(pollingThreadsPoolConf[i]) && !pollingThreadsPoolConf[i].isEmpty()
                        && !polledDevices.contains(pollingThreadsPoolConf[i])) {
                    polledDevices.add(pollingThreadsPoolConf[i]);
                }
            }
        }
    }
29630
public void putDevicePipeProperty(Database database, String deviceName, DbPipe dbPipe) throws DevFailed {
        DeviceData argIn = new DeviceData();
        String[]    array = ApiUtil.toStringArray(deviceName, dbPipe);
        argIn.insert(array);
        database.command_inout("DbPutDevicePipeProperty", argIn);
    }
863380
private synchronized void checkInitialization() throws DevFailed {
        if (initImpl != null) {
            isInitializing = initImpl.isInitInProgress();
        } else {
            isInitializing = false;
        }
        if (isInitializing) {
            throw DevFailedUtils.newDevFailed("CONCURRENT_ERROR", name + " in Init command ");
        }
    }
877638
@Override
    int read_attribute_asynch_i(final String a, final boolean fwd, final int rid) throws DevFailed {
	synchronized (this) {
	    final Iterator it = elements.iterator();
	    while (it.hasNext()) {
		final GroupElement e = (GroupElement) it.next();
		if (e instanceof GroupDeviceElement || fwd) {
		    e.read_attribute_asynch_i(a, fwd, rid);
		}
	    }
	    return rid;
	}
    }
885885
public function validateResolved()
    {
        $this->prepareForValidation();

        if (! $this->passesAuthorization()) {
            $this->failedAuthorization();
        }

        $instance = $this->getValidatorInstance();

        if ($instance->fails()) {
            $this->failedValidation($instance);
        }
    }
671462
public void init(final Connection connection, final DbDevImportInfo info) throws DevFailed {
		connection.url = new TangoUrl(info.name);
		connection.setDevice_is_dbase(false);
		connection.devname = connection.url.devname;

		// Check if connection is possible
		if (connection.url.protocol == TANGO && connection.url.use_db) {
	    	connection.ior = info.ior;
		}
		connection.classname = info.classname;
		
		try {
			initCtrlAccess(connection);
		}
		catch(DevFailed e) {
			System.err.println(e.errors[0].desc);
		}
    }
134845
public function init()
    {
        $this->sets([
            'isPc' => false,
            'isMobile' => false,

            'os' => 'Unknown',
            'browser' => 'Unknown',

            'isUnix' => false,
            'isLinux' => false,
            'isWin' => false,
            'isMac' => false,
            'isAndroid' => false,

            'ip' => 0,
            'addr' => Server::value('REMOTE_ADDR'),
            'port' => Server::value('REMOTE_PORT'),
        ]);

        $this->getHeaders();

        // Parse the HTTP_ACCEPT.
        if ($accept = $this->getHeader('accept')) {
            $this->set('accepts', $this->_handleInfo($accept));
        }

        // Parse the accepted encodings.
        if ($acceptEncoding = $this->getHeader('acceptEncoding')) {
            $this->set('encodings', $this->_handleInfo($acceptEncoding));
        }

        if ($acceptLang = $this->get('acceptLang')) {
            $this->set('langs', $this->_handleInfo($acceptLang));
        }

        // $this->data['isSslConnect'] = $this->isSSLConnection();
        $this->set('ip', $this->getIp());

        $this->_userAgentCheck();
    }
476781
@Override
    int command_inout_asynch_i(final String c, final boolean fgt, final boolean fwd, final int rid) throws DevFailed {
	synchronized (this) {
	    final Iterator it = elements.iterator();
	    while (it.hasNext()) {
		final GroupElement e = (GroupElement) it.next();
		if (e instanceof GroupDeviceElement || fwd) {
		    e.command_inout_asynch_i(c, fgt, fwd, rid);
		}
	    }
	    return rid;
	}
    }
1174745
public function onBeforeWrite()
    {
        if (!$this->isInDB()) {
            $this->CreatorID = Member::currentUserID();
        }

        if (!$this->VersionNumber) {
            $versions = DataObject::get(
                'FileVersion', sprintf('"FileID" = %d', $this->FileID)
            );

            if ($versions) {
                $this->VersionNumber = $versions->Count() + 1;
            } else {
                $this->VersionNumber = 1;
            }
        }

        if (!$this->Filename) {
            $this->Filename = $this->saveCurrentVersion();
        }

        parent::onBeforeWrite();
    }
454812
@Override
    public void setDeviceProperties(final String deviceName, final Map<String, String[]> properties) throws DevFailed {
        final List<String> args = getArray(properties, deviceName);
        final DeviceData argin = new DeviceData();
        argin.insert(args.toArray(new String[args.size()]));
        database.command_inout("DbPutDeviceProperty", argin);
    }
774507
public function init()
    {
        self::$plugin = $this;

        // ignore console requests
        if ($this->isInstalled && !\Craft::$app->request->getIsConsoleRequest()) {
            $this->setComponents(
                [
                    'htmlcacheService' => HtmlcacheService::class,
                ]
            );
            // first check if there is a cache to serve
            $this->htmlcacheService->checkForCacheFile();

            // after request send try and create the cache file
            Event::on(Response::class, Response::EVENT_AFTER_SEND, function (Event $event) {
                $this->htmlcacheService->createCacheFile();
            });

            // on every update of an element clear the caches related to the element
            Event::on(Elements::class, Elements::EVENT_AFTER_SAVE_ELEMENT, function (Event $event) {
                $this->htmlcacheService->clearCacheFile($event->element->id);
            });

            // on populated element put to relation table
            Event::on(ElementQuery::class, ElementQuery::EVENT_AFTER_POPULATE_ELEMENT, function ($event) {
                // procceed only if it should be created
                if ($this->htmlcacheService->canCreateCacheFile()) {
                    $elementClass = get_class($event->element);
                    if (!in_array($elementClass, [User::class, GlobalSet::class])) {
                        $uri = \Craft::$app->request->getParam('p', '');
                        $siteId = \Craft::$app->getSites()->getCurrentSite()->id;
                        $elementId = $event->element->id;
                        
                        // check if cache entry already exits otherwise create it
                        $cacheEntry = HtmlCacheCache::findOne(['uri' => $uri, 'siteId' => $siteId]);
                        if (!$cacheEntry) {
                            $cacheEntry = new HtmlCacheCache();
                            $cacheEntry->id = null;
                            $cacheEntry->uri = $uri;
                            $cacheEntry->siteId = $siteId;
                            $cacheEntry->save();
                        }
                        // check if relation element is already added or create it
                        $cacheElement = HtmlCacheElement::findOne(['elementId' => $elementId, 'cacheId' => $cacheEntry->id]);
                        if (!$cacheElement) {
                            $cacheElement = new HtmlCacheElement();
                            $cacheElement->elementId = $elementId;
                            $cacheElement->cacheId = $cacheEntry->id;
                            $cacheElement->save();
                        }
                    }
                }
            });

            // always reset purge cache value
            Event::on(Plugin::class, Plugin::EVENT_BEFORE_SAVE_SETTINGS, function ($event) {
                if ($event->sender === $this) {
                    $settings = $event->sender->getSettings();
                    if ($settings->purgeCache === '1') {
                        $this->htmlcacheService->clearCacheFiles();
                    }
                    // always reset value for purge cache
                    $event->sender->setSettings(['purgeCache' => '']);
                }
            });
        }
        
        // After install create the temp folder
        Event::on(
            Plugins::class,
            Plugins::EVENT_AFTER_INSTALL_PLUGIN,
            function (PluginEvent $event) {
                if ($event->plugin === $this) {
                    // create cache directory
                    $path = \Craft::$app->path->getStoragePath() . DIRECTORY_SEPARATOR . 'runtime' . DIRECTORY_SEPARATOR . 'htmlcache' . DIRECTORY_SEPARATOR;
                    FileHelper::createDirectory($path);
                }
            }
        );

        // Before uninstall clear all cache
        Event::on(
            Plugins::class,
            Plugins::EVENT_BEFORE_UNINSTALL_PLUGIN,
            function (PluginEvent $event) {
                if ($event->plugin === $this) {
                    // clear all files
                    $this->htmlcacheService->clearCacheFiles();
                }
            }
        );

        // After uninstall remove the cache dir
        Event::on(
            Plugins::class,
            Plugins::EVENT_AFTER_UNINSTALL_PLUGIN,
            function (PluginEvent $event) {
                if ($event->plugin === $this) {
                    // remove htmlcache dir
                    $path = \Craft::$app->path->getStoragePath() . DIRECTORY_SEPARATOR . 'runtime' . DIRECTORY_SEPARATOR . 'htmlcache' . DIRECTORY_SEPARATOR;
                    FileHelper::removeDirectory($path);
                }
            }
        );
        parent::init();
    }
730228
@Override
    int write_attribute_asynch_i(final DeviceAttribute da, final boolean fwd, final int rid) throws DevFailed {
	synchronized (this) {
	    final Iterator it = elements.iterator();
	    while (it.hasNext()) {
		final GroupElement e = (GroupElement) it.next();
		if (e instanceof GroupDeviceElement || fwd) {
		    e.write_attribute_asynch_i(da, fwd, rid);
		}
	    }
	    return rid;
	}
    }