org.tango.server.device
Class DeviceManager

java.lang.Object
  extended by org.tango.server.device.DeviceManager

public final class DeviceManager
extends java.lang.Object

Global info and tool for a device. Injected with DeviceManagement

Author:
ABEILLE

Constructor Summary
DeviceManager(DeviceImpl device)
          Ctr
 
Method Summary
 java.lang.String getAdminName()
           
 AttributePropertiesImpl getAttributeProperties(java.lang.String attributeName)
          Get an attribute's properties
 java.lang.String getClassName()
           
 java.lang.String getClientHostName()
          Get the client host name of the current request
 fr.esrf.Tango.ClntIdent getClientIdentity()
          Get the client identity of the current request.
 java.lang.String getName()
           
 int getPollingPeriod(java.lang.String polledObject)
          Get polling period of an attribute or a command
 boolean isPolled(java.lang.String polledObject)
          Check if an attribute or an command is polled
 void pushDataReadyEvent(java.lang.String attributeName, int counter)
          Push a DATA_READY event if some client had registered it
 void pushEvent(java.lang.String attributeName, AttributeValue value, EventType eventType)
          Push an event if some client had register it.
 void pushEvent(java.lang.String attributeName, EventType eventType)
          Push an event if some client had register it.
 void removeAttributeProperties(java.lang.String attributeName)
          Remove an attribute's properties
 void setAttributeProperties(java.lang.String attributeName, AttributePropertiesImpl properties)
          Configure an attribute's properties
 void startPolling(java.lang.String polledObject, int pollingPeriod)
          Configure polling of an attribute or a command and start it
 void stopPolling(java.lang.String polledObject)
           
 java.lang.String toString()
           
 void triggerPolling(java.lang.String polledObject)
          Update polling cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeviceManager

public DeviceManager(DeviceImpl device)
Ctr

Parameters:
device -
Method Detail

getName

public java.lang.String getName()
Returns:
name of the device

getClassName

public java.lang.String getClassName()
Returns:
class of the device, as defined in tango db

getAdminName

public java.lang.String getAdminName()
Returns:
admin device name

getAttributeProperties

public AttributePropertiesImpl getAttributeProperties(java.lang.String attributeName)
                                               throws fr.esrf.Tango.DevFailed
Get an attribute's properties

Parameters:
attributeName - the attribute name
Returns:
its properties
Throws:
fr.esrf.Tango.DevFailed

setAttributeProperties

public void setAttributeProperties(java.lang.String attributeName,
                                   AttributePropertiesImpl properties)
                            throws fr.esrf.Tango.DevFailed
Configure an attribute's properties

Parameters:
attributeName - the attribute name
properties - its properties
Throws:
fr.esrf.Tango.DevFailed

removeAttributeProperties

public void removeAttributeProperties(java.lang.String attributeName)
                               throws fr.esrf.Tango.DevFailed
Remove an attribute's properties

Parameters:
attributeName - the attribute name
Throws:
fr.esrf.Tango.DevFailed

isPolled

public boolean isPolled(java.lang.String polledObject)
                 throws fr.esrf.Tango.DevFailed
Check if an attribute or an command is polled

Parameters:
polledObject - The name of the polled object (attribute or command)
Returns:
true if polled
Throws:
fr.esrf.Tango.DevFailed

getPollingPeriod

public int getPollingPeriod(java.lang.String polledObject)
                     throws fr.esrf.Tango.DevFailed
Get polling period of an attribute or a command

Parameters:
polledObject - The name of the polled object (attribute or command)
Returns:
The polling period
Throws:
fr.esrf.Tango.DevFailed

startPolling

public void startPolling(java.lang.String polledObject,
                         int pollingPeriod)
                  throws fr.esrf.Tango.DevFailed
Configure polling of an attribute or a command and start it

Parameters:
polledObject - The name of the polled object (attribute or command)
pollingPeriod - The polling period
Throws:
fr.esrf.Tango.DevFailed

stopPolling

public void stopPolling(java.lang.String polledObject)
                 throws fr.esrf.Tango.DevFailed
Throws:
fr.esrf.Tango.DevFailed

triggerPolling

public void triggerPolling(java.lang.String polledObject)
                    throws fr.esrf.Tango.DevFailed
Update polling cache. Works only if polling period is zero.

Parameters:
polledObject - The name of the polled object (attribute or command)
Throws:
fr.esrf.Tango.DevFailed

pushEvent

public void pushEvent(java.lang.String attributeName,
                      EventType eventType)
               throws fr.esrf.Tango.DevFailed
Push an event if some client had register it. The method will perform a read on the requested attribute before sending the event

Parameters:
attributeName - The attribute name
eventType - The type of event to fire
Throws:
fr.esrf.Tango.DevFailed

pushEvent

public void pushEvent(java.lang.String attributeName,
                      AttributeValue value,
                      EventType eventType)
               throws fr.esrf.Tango.DevFailed
Push an event if some client had register it.

Parameters:
attributeName - The attribute name
eventType - The type of event to fire
Throws:
fr.esrf.Tango.DevFailed

pushDataReadyEvent

public void pushDataReadyEvent(java.lang.String attributeName,
                               int counter)
                        throws fr.esrf.Tango.DevFailed
Push a DATA_READY event if some client had registered it

Parameters:
attributeName - The attribute name
Throws:
fr.esrf.Tango.DevFailed

getClientIdentity

public fr.esrf.Tango.ClntIdent getClientIdentity()
Get the client identity of the current request. WARNING: works only if the client is of version IDL4 and for these requests: read_attribute(s), write_attribute(s), write_read_attribute(s), command_inout.

Returns:
the client identity

getClientHostName

public java.lang.String getClientHostName()
Get the client host name of the current request

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2012-2014. All Rights Reserved.