Check if event criteria are set for specified attribute

@param attribute the specified attribute
@throws DevFailed if no event criteria is set for specified attribute.
176677
public static void checkEventCriteria(final AttributeImpl attribute) throws DevFailed {
        // Check if value is not numerical (always true for State and String)
        if (attribute.isState() || attribute.isString()) {
            return;
        }
        // Else check criteria
        final EventProperties props = attribute.getProperties().getEventProp();
        if (props.arch_event.period.equals(Constants.NOT_SPECIFIED)
                && props.arch_event.abs_change.equals(Constants.NOT_SPECIFIED)
                && props.arch_event.rel_change.equals(Constants.NOT_SPECIFIED)) {
            throw DevFailedUtils.newDevFailed(ExceptionMessages.EVENT_CRITERIA_NOT_SET,
                    "Archive event properties (archive_abs_change or "
                            + "archive_rel_change or archive_period) for attribute " + attribute.getName()
                            + " are not set");
        }
    }
234352
public void removeAttributeProperties(final String attributeName) throws DevFailed {
        final AttributeImpl attr = AttributeGetterSetter.getAttribute(attributeName, device.getAttributeList());
        attr.removeProperties();
    }
629702
public void delete_attribute_property(String attname, String propname) throws DevFailed {
        database.delete_device_attribute_property(deviceName, attname, propname);
    }
160098
public void loadAttributeConfigFromDb(final String attributeName) throws DevFailed {
        final AttributeImpl toConfigure = dynamicAttributes.get(attributeName.toLowerCase(Locale.ENGLISH));
        if (toConfigure != null) {
            toConfigure.lock();
            try {
                toConfigure.loadTangoDbConfig();
            }finally {
                toConfigure.unlock();
            }
        }
    }
874727
public void pushAttributeDataReadyEvent(final String deviceName, final String attributeName, final int counter)
            throws DevFailed {
        xlogger.entry();
        final String fullName = EventUtilities.buildEventName(deviceName, attributeName, EventType.DATA_READY_EVENT);
        final EventImpl eventImpl = getEventImpl(fullName);
        if (eventImpl != null) {
            for (ZMQ.Socket eventSocket : eventEndpoints.values()) {
                eventImpl.pushAttributeDataReadyEvent(counter, eventSocket);
            }
        }
        xlogger.exit();
    }
1273490
public static IEventTrigger createEventTrigger(final EventType eventType, final AttributeImpl attribute)
            throws DevFailed {
        LOGGER.debug("create event trigger for attribute {} of type {}", attribute.getName(), eventType);
        final EventProperties props = attribute.getProperties().getEventProp();
        IEventTrigger eventTrigger;
        switch (eventType) {
            case PERIODIC_EVENT:
                final long period = Long.parseLong(props.per_event.period);
                eventTrigger = new PeriodicEventTrigger(period, attribute);
                break;
            case CHANGE_EVENT:
                eventTrigger = new ChangeEventTrigger(attribute, props.ch_event.abs_change, props.ch_event.rel_change);
                break;
            case ARCHIVE_EVENT:
                long periodA;
                try {
                    // Check if specified and a number
                    periodA = Long.parseLong(props.arch_event.period);
                } catch (final NumberFormatException e) {
                    periodA = -1;
                }
                eventTrigger = new ArchiveEventTrigger(periodA, props.arch_event.abs_change,
                        props.arch_event.rel_change, attribute);
                break;
            case ATT_CONF_EVENT:
            case DATA_READY_EVENT:
            case USER_EVENT:
            case INTERFACE_CHANGE_EVENT:
            case PIPE_EVENT:
            default:
                eventTrigger = new DefaultEventTrigger();
                break;

        }
        return eventTrigger;
    }
937397
public void pushDataReadyEvent(final String attributeName, final int counter) throws DevFailed {
        EventManager.getInstance().pushAttributeDataReadyEvent(name, attributeName, counter);
    }
1328354
public void addTangoPeriodicListener(ITangoPeriodicListener listener, String attrName, String[] filters)
            throws DevFailed {
        addTangoPeriodicListener(listener, attrName, filters, false);
    }
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);
    }
1072260
@Override
    int write_attribute_asynch_i(final DeviceAttribute da, final boolean fwd, final int rid) throws DevFailed {
	try {
	    final int actual_rid = proxy.write_attribute_asynch(da);
	    arp.put(new Integer(rid), new AsynchRequest(actual_rid, da.getName()));
	} catch (final DevFailed df) {
	    arp.put(new Integer(rid), new AsynchRequest(-1, da.getName(), df));
	} catch (final Exception e) {
	    final DevError[] errors = new DevError[1];
	    errors[0] = new DevError();
	    errors[0].severity = ErrSeverity.ERR;
	    errors[0].reason = "unknown exception caught";
	    errors[0].desc = "unknown error";
	    errors[0].origin = "GroupDeviceElemnt.write_attribute";
	    final DevFailed ex = new DevFailed(errors);
	    arp.put(new Integer(rid), new AsynchRequest(-1, da.getName(), ex));
	}
	return rid;
    }
137162
public synchronized void removeAttributePolling(final AttributeImpl attr) throws DevFailed {
        if (attributeCacheMap.containsKey(attr)) {
            final AttributeCache cache = attributeCacheMap.get(attr);
            cache.stopRefresh();
            attributeCacheMap.remove(attr);
        } else if (extTrigAttributeCacheMap.containsKey(attr)) {
            extTrigAttributeCacheMap.remove(attr);
        } else if (attr.getName().equalsIgnoreCase(DeviceImpl.STATE_NAME) && stateCache != null) {
            stateCache.stopRefresh();
            stateCache = null;
        } else if (attr.getName().equalsIgnoreCase(DeviceImpl.STATUS_NAME) && statusCache != null) {
            statusCache.stopRefresh();
            statusCache = null;
        }
    }
257719
public void removeAttribute(final String attributeName) throws DevFailed {
        final AttributeImpl toRemove = dynamicAttributes.get(attributeName.toLowerCase(Locale.ENGLISH));
        if (toRemove == null)
            throw DevFailedUtils.newDevFailed("API_AttributeNotFound", "Attribute \'" + attributeName + "\' not found");
        if (toRemove.getBehavior() instanceof ForwardedAttribute) {
            final ForwardedAttribute att = (ForwardedAttribute) toRemove.getBehavior();
            final String lower = att.getRootName().toLowerCase(Locale.ENGLISH);
            forwardedAttributes.remove(lower);
        }
        deviceImpl.removeAttribute(toRemove);
        dynamicAttributes.remove(attributeName);
        deviceImpl.pushInterfaceChangeEvent(false);
    }
1365507
public int write_attribute_asynch(final DeviceProxy deviceProxy, final DeviceAttribute attr,
            final boolean forget) throws DevFailed {
        final DeviceAttribute[] attribs = new DeviceAttribute[1];
        attribs[0] = attr;
        return write_attribute_asynch(deviceProxy, attribs);
        }
806931
protected int subscribe_pipe_event(String attr_name, String[] filters, boolean stateless)
            throws DevFailed {
        return event_supplier.subscribe_event(attr_name,
                PIPE_EVENT, this, filters, stateless);
    }
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();
    }
333819
public synchronized void removeAttribute(final AttributeImpl attribute) throws DevFailed {
        if (attribute.getName().equalsIgnoreCase(STATUS_NAME) || attribute.getName().equalsIgnoreCase(STATE_NAME)) {
            return;
        }
        pollingManager.removeAttributePolling(attribute.getName());
        statusImpl.removeAttributeAlarm(attribute.getName());
        stateImpl.removeAttributeAlarm(attribute.getName());
        attributeList.remove(attribute);
    }
112322
void check_type() throws DevFailed
	{
		boolean unsuported = true;
		if (type == Tango_DEV_SHORT)
			unsuported = false;
		else if (type == Tango_DEV_USHORT)
			unsuported = false;
		else if (type == Tango_DEV_LONG)
			unsuported = false;
		else if (type == Tango_DEV_LONG64)
			unsuported = false;
		else if (type == Tango_DEV_ULONG)
			unsuported = false;
		else if (type == Tango_DEV_ULONG64)
			unsuported = false;
		else if (type == Tango_DEV_BOOLEAN)
			unsuported = false;
		else if (type == Tango_DEV_FLOAT)
			unsuported = false;
		else if (type == Tango_DEV_DOUBLE)
			unsuported = false;
		else if (type == Tango_DEV_STRING)
			unsuported = false;
		else if (type == Tango_DEV_STATE)
			unsuported = false;
		else if (type == Tango_DEV_ENCODED)
			unsuported = false;

		if (unsuported == true)
		{
			Util.out3.println("Attr.check_type throwing exception");
		
			StringBuffer o = new StringBuffer("Attribute : ");
			o.append(name).append(": Data type is not supported");
			Except.throw_exception("API_AttrWrongDefined",
				    o.toString(),
					"Attr.check_type");
		}
	}