Building Controls Virtual Test Bed
bacnet.util.BACnetDeviceManager Class Reference

This is the driver class in BACnet. More...

Classes

enum  BacnetApplicationTag
 enumeration object, contains all the BACnet application tags specified in BACnet Standard used in writing property to BACnet device More...
 
enum  BacObjectType
 Enumeration object, contains all the object names specified in BACnet Standard, including BACnet Device Object and non-Device BACnet objects. More...
 
enum  BacProperty
 BACnet property enumeration object, contains major properties specified in BACnet Standard, including BACnet Device propety and non Device BACnet Object property. More...
 

Public Member Functions

String getReadPropertyBinaryPath ()
 Returns the bacrp binary file path. More...
 
String getWritePropertyBinaryPath ()
 Returns the bacwp binary file path. More...
 
String getGlobalwiBinaryPath ()
 Returns the globalwi binary file path. More...
 
ArrayList< Integer > findDevice () throws IllegalActionException
 Find BACnet devices in the network and return an integer list with their instance number. More...
 
ArrayList< BACnetObjectTypeparseBACnetObjectType (final String s) throws ParserConfigurationException, SAXException, IOException
 Parse the configuration file and generate an ArrayList that contains the xml content as specified in the configuration file, it is called in readXMLConfigurationFile (see bacnet.util.BACnet). More...
 
ArrayList< Integer > readDeviceArray (final ArrayList< BACnetObjectType > bot_arr) throws NumberFormatException
 Read device instance from parsed ArrayList. More...
 
ArrayList< BACnetObjectreadObjectList (final ArrayList< BACnetObjectType > bot_arr, final int dev_inst) throws NumberFormatException
 Read a subset of all objects associated with a device from ArrayList. More...
 
ArrayList< BACnetCompletePropertyreadDevicePropertyList (final ArrayList< BACnetObjectType > bot_arr, final int dev_inst) throws NumberFormatException
 Get an arraylist with elements of BACnetCompleteProerty, one for each property of BACnet device and BACnet objects. More...
 
ArrayList< BACnetCompletePropertyreadCompleteObjectPropertyList (final ArrayList< BACnetObjectType > bot_arr, final int dev_inst, final String obj_type, final int obj_inst)
 Read complete object property list from BACnetObjectype. More...
 
ArrayList< ProcessBuilder > getProcesses (ArrayList< BACnetCompleteProperty > prop_arr)
 Prepare the process to be executed. More...
 
void validateApplicationTag (final String s) throws IllegalArgumentException
 Application tag validaton. More...
 
void validatePropertyName (final String s) throws IllegalArgumentException
 Property name validation. More...
 
void validateObjectType (final String s) throws IllegalArgumentException
 object type validation. More...
 
void validateXMLFile (final String xmlfile, final Schema schema) throws SAXException, FileNotFoundException,IOException
 XMLfile validation. More...
 
Schema loadSchema (final String name) throws SAXException
 Load schema. More...
 

Static Protected Member Functions

static String toString (String arg) throws IllegalArgumentException
 Gets a string representation of the enumeration. More...
 

Static Private Attributes

static final String bcvtbhome = System.getenv("BCVTB_HOME")
 String that points to root directory of the BCVTB. More...
 
static final String LS = System.getProperty("line.separator")
 System-dependent line separator. More...
 
static final String FS = System.getProperty("file.separator")
 System-dependent file separator. More...
 
static final String osName = System.getProperty("os.name")
 Name of the operating system. More...
 

Detailed Description

This is the driver class in BACnet.

It is used mainly by BACnet.java. It is used to process BACnetObjectType read from configuration file, and to translate them to processes, to be executed by BACnet-stack command.

This class is called by BACnet(seebacnet.util.BACnet ) to get reading and writing processes, BACnetReader(see bacnet.actor.BACnetReader) to get processes to read property from BACnet device, and by BACnetWrtier (see bacnet.actor.BACnetWriter) to to get processes to write property to BACnet device.

Author
Zhengwei Li
Version
1.0
Since
bcvtb 0.5.0

Definition at line 123 of file BACnetDeviceManager.java.

Member Function Documentation

ArrayList<Integer> bacnet.util.BACnetDeviceManager.findDevice ( ) throws IllegalActionException
inline

Find BACnet devices in the network and return an integer list with their instance number.

It is called in checkConnection() (see bacnet.util.BACnet).

Returns
interger arraylist with the elements of device instance number of those devices found in the network
Exceptions
IllegalActionExceptionif an error occurs.

Definition at line 462 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.getGlobalwiBinaryPath(), and bacnet.util.BACnetDeviceManager.LS.

String bacnet.util.BACnetDeviceManager.getGlobalwiBinaryPath ( )
inline

Returns the globalwi binary file path.

It is called in findDevice, (see bacnet.util.BACnetDeviceManager).

Returns
file path of globalwi binary

Definition at line 442 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.bcvtbhome, bacnet.util.BACnetDeviceManager.FS, and bacnet.util.BACnetDeviceManager.osName.

Referenced by bacnet.util.BACnetDeviceManager.findDevice().

ArrayList<ProcessBuilder> bacnet.util.BACnetDeviceManager.getProcesses ( ArrayList< BACnetCompleteProperty prop_arr)
inline

Prepare the process to be executed.

Parameters
prop_arrarraylist with elements of BACnetCompleteProperty
Returns
arraylist with elements of ProcessBuilder for writing property to device

Definition at line 796 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.getReadPropertyBinaryPath(), bacnet.util.BACnetDeviceManager.getWritePropertyBinaryPath(), and i.

String bacnet.util.BACnetDeviceManager.getReadPropertyBinaryPath ( )
inline

Returns the bacrp binary file path.

This function is called in prepareProcesses, (see bacnet.util.BACnetDeviceManager)

Returns
file path of read property binary in BACnet-stack

Definition at line 403 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.bcvtbhome, bacnet.util.BACnetDeviceManager.FS, and bacnet.util.BACnetDeviceManager.osName.

Referenced by bacnet.util.BACnetDeviceManager.getProcesses().

String bacnet.util.BACnetDeviceManager.getWritePropertyBinaryPath ( )
inline

Returns the bacwp binary file path.

This function is called in prepareProcesses, (see bacnet.util.BACnetDeviceManager).

Returns
file path of write property in BACnet-stack

Definition at line 423 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.bcvtbhome, bacnet.util.BACnetDeviceManager.FS, and bacnet.util.BACnetDeviceManager.osName.

Referenced by bacnet.util.BACnetDeviceManager.getProcesses().

Schema bacnet.util.BACnetDeviceManager.loadSchema ( final String  name) throws SAXException
inline

Load schema.

It is called in validateSyntax(), (see bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter).

Parameters
namefile name of the schema file
Returns
schema the Schema object
Exceptions
SAXExceptionif error occurs in schema loading process

Definition at line 1009 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.LS.

ArrayList<BACnetObjectType> bacnet.util.BACnetDeviceManager.parseBACnetObjectType ( final String  s) throws ParserConfigurationException, SAXException, IOException
inline

Parse the configuration file and generate an ArrayList that contains the xml content as specified in the configuration file, it is called in readXMLConfigurationFile (see bacnet.util.BACnet).

Parameters
spath of configuration file
Returns
ArrayList containing BACnetObjectTypes
Exceptions
ParserConfigurationExceptionif errors occur in configuring parser
SAXExceptionif errors occur in parsing configuration file
IOExceptionif I/O exception occurs in parsing configuration file

Definition at line 546 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.LS.

ArrayList<BACnetCompleteProperty> bacnet.util.BACnetDeviceManager.readCompleteObjectPropertyList ( final ArrayList< BACnetObjectType bot_arr,
final int  dev_inst,
final String  obj_type,
final int  obj_inst 
)
inline

Read complete object property list from BACnetObjectype.

It is called in readDevicePropertyList, (see bacnet.util.BACnetDeviceManager).

Parameters
bot_arrBACnetObjecttype cotaining xml content
dev_instdevice instance number
obj_typeobject name
obj_instobject instance
Returns
property_array arraylist with elements of BACnetCompleteProperty

Definition at line 755 of file BACnetDeviceManager.java.

References bacnet.util.BACnetObjectType.getBOTInst(), bacnet.util.BACnetObjectType.getBOTName(), and i.

Referenced by bacnet.util.BACnetDeviceManager.readDevicePropertyList().

ArrayList<Integer> bacnet.util.BACnetDeviceManager.readDeviceArray ( final ArrayList< BACnetObjectType bot_arr) throws NumberFormatException
inline

Read device instance from parsed ArrayList.

It is called in readDeviceArray, (see bacnet.util.BACnet).

Parameters
bot_arrArrayList containing xml configuration file content
Returns
ArrayList with elements of device instance number
Exceptions
NumberFormatExceptionif error occurs while converting instance number from string to integer

Definition at line 584 of file BACnetDeviceManager.java.

References bacnet.util.BACnetObjectType.getBOTName(), i, and bacnet.util.BACnetDeviceManager.LS.

ArrayList<BACnetCompleteProperty> bacnet.util.BACnetDeviceManager.readDevicePropertyList ( final ArrayList< BACnetObjectType bot_arr,
final int  dev_inst 
) throws NumberFormatException
inline

Get an arraylist with elements of BACnetCompleteProerty, one for each property of BACnet device and BACnet objects.

It is called in readDevicePropertyArray, (see bacnet.util.BACnet).

Parameters
bot_arrArrayList containing configuration file content
dev_instdevice instance number
Returns
arraylist with elements of BACnetCompleteProperty
Exceptions
NumberFormatExceptionif object/device instance number is not integer

Definition at line 685 of file BACnetDeviceManager.java.

References bacnet.util.BACnetObjectType.getBOTInst(), bacnet.util.BACnetObjectType.getBOTName(), bacnet.util.BACnetObject.getObjectType(), i, bacnet.util.BACnetDeviceManager.LS, bacnet.util.BACnetDeviceManager.readCompleteObjectPropertyList(), and bacnet.util.BACnetDeviceManager.readObjectList().

ArrayList<BACnetObject> bacnet.util.BACnetDeviceManager.readObjectList ( final ArrayList< BACnetObjectType bot_arr,
final int  dev_inst 
) throws NumberFormatException
inline

Read a subset of all objects associated with a device from ArrayList.

It is called in readDevicePropertyList, (see bacnet.util.BACnetDeviceManager).

Parameters
bot_arrArrayList containing XML configuration file
dev_instdevice instance number
Returns
object_array ArrayList with elements of BACnetObject
Exceptions
NumberFormatExceptionif error occurs while trying to convert object instance number from string to integer

Definition at line 621 of file BACnetDeviceManager.java.

References bacnet.util.BACnetObjectType.getBOTInst(), bacnet.util.BACnetObjectType.getBOTName(), i, bacnet.util.BACnetDeviceManager.LS, and bacnet.util.BACnetDeviceManager.toString().

Referenced by bacnet.util.BACnetDeviceManager.readDevicePropertyList().

static String bacnet.util.BACnetDeviceManager.toString ( String  arg) throws IllegalArgumentException
inlinestaticprotected

Gets a string representation of the enumeration.

Parameters
argenumeration to be converted to string
Returns
the string representation of the enumeration
Exceptions
IllegalArgumentExceptionif the argument is not BacnetApplicationTag, BacProperty or BacObjectType

Definition at line 848 of file BACnetDeviceManager.java.

References i, bacnet.util.BACnetDeviceManager.LS, r, and strLen.

Referenced by bacnet.util.BACnetDeviceManager.readObjectList(), bacnet.util.BACnetDeviceManager.validateApplicationTag(), bacnet.util.BACnetDeviceManager.validateObjectType(), and bacnet.util.BACnetDeviceManager.validatePropertyName().

void bacnet.util.BACnetDeviceManager.validateApplicationTag ( final String  s) throws IllegalArgumentException
inline

Application tag validaton.

It is called in validateAttributes(), (see bacnet.util.BACnet).

Parameters
sstring read from configuration file
Exceptions
IllegalArgumentExceptionif s is not part of BacnetApplicationTag enum type

Definition at line 906 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.LS, and bacnet.util.BACnetDeviceManager.toString().

void bacnet.util.BACnetDeviceManager.validateObjectType ( final String  s) throws IllegalArgumentException
inline

object type validation.

It is called in validateObjectType(), (see bacnet.util.BACnet).

Parameters
sstring read from xml configration file
Exceptions
IllegalArgumentExceptionif s is not part of the BacProperty enum type

Definition at line 949 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.LS, and bacnet.util.BACnetDeviceManager.toString().

void bacnet.util.BACnetDeviceManager.validatePropertyName ( final String  s) throws IllegalArgumentException
inline

Property name validation.

It is called in validatePropertyName(), (see bacnet.util.BACnet).

Parameters
sstring read from xml configration file
Exceptions
IllegalArgumentExceptionif s is not part of the BacProperty enum type

Definition at line 928 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.LS, and bacnet.util.BACnetDeviceManager.toString().

void bacnet.util.BACnetDeviceManager.validateXMLFile ( final String  xmlfile,
final Schema  schema 
) throws SAXException, FileNotFoundException,IOException
inline

XMLfile validation.

It is called in validateSyntax(), (see bacnet.actor.BACnetReader and bacnet.actor.BACnetWriter).

Parameters
xmlfilefile name of the xmlfile
schemaschema used to validate the xmlfile
Exceptions
FileNotFoundExceptionif either xmlfile or schema couldn't be found
SAXExceptionif xmlfile is not properly written
IOExceptionif error occurs when reading xmlfile or schema

Definition at line 974 of file BACnetDeviceManager.java.

References bacnet.util.BACnetDeviceManager.LS, and source.

Member Data Documentation

final String bacnet.util.BACnetDeviceManager.bcvtbhome = System.getenv("BCVTB_HOME")
staticprivate
final String bacnet.util.BACnetDeviceManager.FS = System.getProperty("file.separator")
staticprivate
final String bacnet.util.BACnetDeviceManager.osName = System.getProperty("os.name")
staticprivate

The documentation for this class was generated from the following file: