Package org.openscada.opc.lib.da
Class Group
java.lang.Object
org.openscada.opc.lib.da.Group
-
Method Summary
Modifier and TypeMethodDescriptionAdd a single item.Add new items to the groupattach(IOPCDataCallback dataCallback) protected voidcheckItems(Item[] items) voidclear()findItemByClientHandle(int clientHandle) protected ItemgetItemByOPCItemId(String opcItemId) getName()Get the group name from the serverintprotected Integer[]getServerHandles(Item[] items) booleanisActive()voidremove()remove the group from the servervoidremoveItem(String opcItemId) voidsetActive(boolean state) voidvoidChange the group namevalidateItems(String... items) Validate item ids and get additional information to them.write(WriteRequest... requests)
-
Method Details
-
setActive
public void setActive(boolean state) throws org.jinterop.dcom.common.JIException - Throws:
org.jinterop.dcom.common.JIException
-
remove
public void remove() throws org.jinterop.dcom.common.JIExceptionremove the group from the server- Throws:
org.jinterop.dcom.common.JIException
-
isActive
public boolean isActive() throws org.jinterop.dcom.common.JIException- Throws:
org.jinterop.dcom.common.JIException
-
getName
Get the group name from the server- Returns:
- The group name fetched from the server
- Throws:
org.jinterop.dcom.common.JIException
-
setName
Change the group name- Parameters:
name- the new name of the group- Throws:
org.jinterop.dcom.common.JIException
-
addItem
Add a single item. Actually callsaddItems(String[])with only one paraemter- Parameters:
item- The item to add- Returns:
- The added item
- Throws:
org.jinterop.dcom.common.JIException- The add operation failedAddFailedException- The item was not added due to an error
-
validateItems
public Map<String,Result<OPCITEMRESULT>> validateItems(String... items) throws org.jinterop.dcom.common.JIException Validate item ids and get additional information to them.
According to the OPC specification you should first validate the items and the add them. The spec also says that when a server lets the item pass validation it must also let them pass the add operation.- Parameters:
items- The items to validate- Returns:
- A result map of item id to result information (including error code).
- Throws:
org.jinterop.dcom.common.JIException
-
addItems
public Map<String,Item> addItems(String... items) throws org.jinterop.dcom.common.JIException, AddFailedException Add new items to the group- Parameters:
items- The items (by string id) to add- Returns:
- A result map of id to item object
- Throws:
org.jinterop.dcom.common.JIException- The add operation completely failed. No item was added.AddFailedException- If one or more item could not be added. Item without error where added.
-
getItemByOPCItemId
-
checkItems
-
setActive
- Throws:
org.jinterop.dcom.common.JIException
-
getServerHandles
-
write
public Map<Item,Integer> write(WriteRequest... requests) throws org.jinterop.dcom.common.JIException - Throws:
org.jinterop.dcom.common.JIException
-
read
public Map<Item,ItemState> read(boolean device, Item... items) throws org.jinterop.dcom.common.JIException - Throws:
org.jinterop.dcom.common.JIException
-
getServer
-
clear
public void clear() throws org.jinterop.dcom.common.JIException- Throws:
org.jinterop.dcom.common.JIException
-
getAsyncIO20
-
attach
public EventHandler attach(IOPCDataCallback dataCallback) throws org.jinterop.dcom.common.JIException - Throws:
org.jinterop.dcom.common.JIException
-
findItemByClientHandle
-
getServerHandle
public int getServerHandle() -
removeItem
public void removeItem(String opcItemId) throws IllegalArgumentException, UnknownHostException, org.jinterop.dcom.common.JIException - Throws:
IllegalArgumentExceptionUnknownHostExceptionorg.jinterop.dcom.common.JIException
-