|
eWON JTK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ewon.ewonitf.SysControlBlock
public class SysControlBlock
This class is used to read and edit configurations and status blocks.
The configuration blocks are one of: SYS, COM, TAG, USER
The status block is the INF block.
When an instance of the SysControlBlock
is created, its block type
must be specified and the content is loaded. The content on any field in the block
can be read or written and it can be applied back to the system at any time using the
saveBlock()
command.
Field Summary | |
---|---|
static byte |
BY_ID
ReferenceType for SysControlBlock(int,int,int) indicating if that the refence to the
object (User or Tag) is its ID. |
static byte |
BY_NDX
ReferenceType for SysControlBlock(int,int,int) indicating if that the refence to the
object (User or Tag) is its index (starting at 0). |
static byte |
COM
Type for SysControlBlock(int) indicating that this object will
manage the comcfg.txt configuration. |
static byte |
INF
Type for SysControlBlock(int) indicating that this object will
manage the estat.htm or $dtSS information block. |
static byte |
SYS
Type for SysControlBlock(int) indicating that this object will
manage the config.txt data. |
static byte |
TAG
Type for SysControlBlock(int) indicating that this object will
manage the information about a given tag. |
static byte |
USER
Type for SysControlBlock(int) indicating that this object will
manage the information about a given user. |
static byte |
WIZ
Type for SysControlBlock(int) indicating that this object will
manage the wizard or $dtWZ block. |
Constructor Summary | |
---|---|
SysControlBlock(int BlockType)
Creates a new instance of SysControlBlock |
|
SysControlBlock(int BlockType,
int RecordId)
Creates a new instance of SysControlBlock. |
|
SysControlBlock(int BlockType,
int RecordRefType,
int RecordRef)
Creates a new instance of SysControlBlock. |
|
SysControlBlock(int BlockType,
String RecordName)
Creates a new instance of SysControlBlock. |
Method Summary | |
---|---|
protected void |
finalize()
|
String |
getItem(String itemName)
Read one item of the current block by its name. |
void |
reloadBlock()
This function will reload the data from the Control block When data are loaded in the block, they may change in the system. |
void |
saveBlock()
Make the currently edited block content active in the eWON REM: The modification made is effective but volatile. |
void |
saveBlock(boolean saveToFlash)
Make the currently edited block content active in the eWON The modification is also saved permanently in the eWON flash memory. |
void |
saveBlockById()
Make the currently edited block content active in the eWON Compared to saveBlock() , this function will update an existing item
based on its "Id" and not based on its "Name". |
void |
saveBlockById(boolean saveToFlash)
Make the currently edited block content active in the eWON Compared to saveBlock() , this function will update an existing item
based on its "Id" and not based on its "Name". |
void |
setItem(String itemName,
String itemValue)
Read one item of the current block by its name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte BY_NDX
SysControlBlock(int,int,int)
indicating if that the refence to the
object (User or Tag) is its index (starting at 0).
public static final byte BY_ID
SysControlBlock(int,int,int)
indicating if that the refence to the
object (User or Tag) is its ID.
public static final byte SYS
SysControlBlock(int)
indicating that this object will
manage the config.txt data.
public static final byte TAG
SysControlBlock(int)
indicating that this object will
manage the information about a given tag.
public static final byte USER
SysControlBlock(int)
indicating that this object will
manage the information about a given user.
public static final byte COM
SysControlBlock(int)
indicating that this object will
manage the comcfg.txt configuration.
public static final byte INF
SysControlBlock(int)
indicating that this object will
manage the estat.htm or $dtSS information block.
public static final byte WIZ
SysControlBlock(int)
indicating that this object will
manage the wizard or $dtWZ block.
Constructor Detail |
---|
public SysControlBlock(int BlockType, int RecordId) throws EWException
BlockType
- The type of block this object will contain (either TAG, USER).RecordId
- This is the ID of the the Tag or User (depending on BlockType
).
EWException
- In case the operation fails.public SysControlBlock(int BlockType, int RecordRefType, int RecordRef) throws EWException
BlockType
- The type of block this object will contain (either TAG, USER).RecordRefType
- This field defines the type of reference passed (either BY_NDX, BY_ID)RecordRef
- This is an ID or an index according to RecordRefType
EWException
- In case the operation fails.public SysControlBlock(int BlockType, String RecordName) throws EWException
BlockType
- The type of block this object will contain (either TAG, USER).RecordName
- The tag's name or the user's to edit. If the given name does not exists, the element
will be created.
EWException
- In case the operation fails.public SysControlBlock(int BlockType) throws EWException
BlockType
- The type of block this object will contain (either SYS, TAG, USER, COM, INF).
EWException
- In case the operation fails.Method Detail |
---|
public void reloadBlock() throws EWException
EWException
public void saveBlock() throws EWException
EWException
public void saveBlock(boolean saveToFlash) throws EWException
saveBlock()
followed by StorageControl.saveConfig()
saveToFlash
- if true to modification is also saved to flash.
EWException
public void saveBlockById() throws EWException
saveBlock()
, this function will update an existing item
based on its "Id" and not based on its "Name". This is usefull if you want to
change a user's name or a tag's name, because the default function would
create a new user or tag with the new name otherwise.saveBlock()
.
EWException
public void saveBlockById(boolean saveToFlash) throws EWException
saveBlock()
, this function will update an existing item
based on its "Id" and not based on its "Name". This is usefull if you want to
change a user's name or a tag's name, because the default function would
create a new user or tag with the new name otherwise.saveBlock()
.saveBlock()
followed by StorageControl.saveConfig()
saveToFlash
- if true to modification is also saved to flash.
EWException
public String getItem(String itemName) throws EWException
itemName
- Name of the item to read. The name is not case sensitive.
EWException
- In case the operation fails (for example if the item requested does not exists).public void setItem(String itemName, String itemValue) throws EWException
itemName
- Name of the item to set. The name is not case sensitive.itemValue
- The value to set to the item. The operation is neither verified or applied until the
saveBlock()
function is called.
EWException
- In case the operation fails (for example if the item requested does not exists).protected void finalize()
|
eWON JTK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |