org.simantics.databoard.accessor.wire
Interface IWireServer

All Known Implementing Classes:
WireServer

public interface IWireServer


Nested Class Summary
static class IWireServer.AccessorInfo
           
static class IWireServer.ApplyResult
           
 
Method Summary
 int add(int accId, int index, MutableVariant object)
           
 int addAll(int accId, int index, MutableVariant array)
          add objects to array
 int addListener(int accId, InterestSet interestSet, ChildReference pathPrefix)
          Create listener
 IWireServer.ApplyResult apply(int accId, Event[] changeSet, boolean rollback)
          Apply a list of changes to the node.
 int clear(int accId)
          Remove all array or map elements
 int closeAccessors(java.lang.Integer[] accIds)
          Close a group of accessor handles.
 boolean containsKey(int accId, MutableVariant key)
           
 boolean containsValue(int accId, MutableVariant value)
           
 MutableVariant getArrayElement(int accId, int index)
          Get array element value
 MutableVariant getCeilingKey(int accId, MutableVariant key)
           
 MutableVariant getFirstKey(int accId)
           
 MutableVariant getFloorKey(int accId, MutableVariant key)
           
 MutableVariant getHigherKey(int accId, MutableVariant key)
           
 MutableVariant getLastKey(int accId)
           
 MutableVariant getLowerKey(int accId, MutableVariant key)
           
 MutableVariant getMapKeys(int accId)
          Get map keys as array
 MutableVariant getMapValue(int accId, MutableVariant key)
          Get map entry value
 MutableVariant getMapValues(int accId)
          Get map values as array
 int getTag(int accId)
          Get tag index of a Union node
 MutableVariant getValue(int accId)
          Read the value as whole.
 boolean hasValue(int accId)
          Get value status of an Optional node
 IWireServer.AccessorInfo openAccessor(ChildReference ref)
          Open a handle to an accessor.
 int removeListener(int lisId)
          Remove listener
 int size(int accId)
          Get size of an array, map, record or union
 

Method Detail

openAccessor

IWireServer.AccessorInfo openAccessor(ChildReference ref)
                                      throws WireException
Open a handle to an accessor.

Parameters:
ref - accessor refence or null for root
Returns:
accessor info
Throws:
WireException

closeAccessors

int closeAccessors(java.lang.Integer[] accIds)
                   throws WireException
Close a group of accessor handles. Open listener and lock handles are released.

Parameters:
accIds - accessor ids
Throws:
WireException

getValue

MutableVariant getValue(int accId)
                        throws WireException
Read the value as whole. If accessor is locked, read operation delays until lock is released.

Parameters:
accId -
Returns:
value
Throws:
WireException

apply

IWireServer.ApplyResult apply(int accId,
                              Event[] changeSet,
                              boolean rollback)
Apply a list of changes to the node. If rollback is true, a rollback log is returned. Rollback log is a list of events that revert modifications if applied.

In case of error rollback log is filled with events that counter modification that were already applied before the error occured.

Parameters:
accId -
changeSet -
rollback -
Returns:
apply result

addListener

int addListener(int accId,
                InterestSet interestSet,
                ChildReference pathPrefix)
                throws WireException
Create listener

Parameters:
accId -
interestSet -
pathPrefix -
Returns:
lisId
Throws:
WireException

removeListener

int removeListener(int lisId)
                   throws WireException
Remove listener

Parameters:
lisId -
Throws:
WireException

size

int size(int accId)
         throws WireException
Get size of an array, map, record or union

Parameters:
accId -
Throws:
WireException

clear

int clear(int accId)
          throws WireException
Remove all array or map elements

Parameters:
accId -
Throws:
WireException

containsKey

boolean containsKey(int accId,
                    MutableVariant key)
                    throws WireException
Throws:
WireException

containsValue

boolean containsValue(int accId,
                      MutableVariant value)
                      throws WireException
Throws:
WireException

getFirstKey

MutableVariant getFirstKey(int accId)
                           throws WireException
Throws:
WireException

getLastKey

MutableVariant getLastKey(int accId)
                          throws WireException
Throws:
WireException

getLowerKey

MutableVariant getLowerKey(int accId,
                           MutableVariant key)
                           throws WireException
Throws:
WireException

getFloorKey

MutableVariant getFloorKey(int accId,
                           MutableVariant key)
                           throws WireException
Throws:
WireException

getCeilingKey

MutableVariant getCeilingKey(int accId,
                             MutableVariant key)
                             throws WireException
Throws:
WireException

getHigherKey

MutableVariant getHigherKey(int accId,
                            MutableVariant key)
                            throws WireException
Throws:
WireException

getMapValue

MutableVariant getMapValue(int accId,
                           MutableVariant key)
                           throws WireException
Get map entry value

Parameters:
accId -
key -
Returns:
value
Throws:
WireException

getMapValues

MutableVariant getMapValues(int accId)
                            throws WireException
Get map values as array

Parameters:
accId -
Returns:
values in array inside a variant
Throws:
WireException

getMapKeys

MutableVariant getMapKeys(int accId)
                          throws WireException
Get map keys as array

Parameters:
accId -
Returns:
keys in array inside a variant
Throws:
WireException

hasValue

boolean hasValue(int accId)
                 throws WireException
Get value status of an Optional node

Parameters:
accId -
Returns:
true if there is value in the node
Throws:
WireException

getTag

int getTag(int accId)
           throws WireException
Get tag index of a Union node

Parameters:
accId -
Returns:
tag index
Throws:
WireException

addAll

int addAll(int accId,
           int index,
           MutableVariant array)
           throws WireException
add objects to array

Parameters:
accId -
index - insert pos, -1 = at the end
array -
Returns:
actual insert pos
Throws:
WireException

add

int add(int accId,
        int index,
        MutableVariant object)
        throws WireException
Parameters:
accId -
index - insert pos, -1 = at the end
object -
Returns:
actual insert pos
Throws:
WireException

getArrayElement

MutableVariant getArrayElement(int accId,
                               int index)
                               throws WireException
Get array element value

Parameters:
accId -
index -
Returns:
value
Throws:
WireException