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, Variant object)
           
 int addAll(int accId, int index, Variant array)
          add objects to array
 int addListener(int accId, InterestSet interestSet, AccessorReference 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, Variant key)
           
 boolean containsValue(int accId, Variant value)
           
 Variant getArrayElement(int accId, int index)
          Get array element value
 Variant getCeilingKey(int accId, Variant key)
           
 Variant getFirstKey(int accId)
           
 Variant getFloorKey(int accId, Variant key)
           
 Variant getHigherKey(int accId, Variant key)
           
 Variant getLastKey(int accId)
           
 Variant getLowerKey(int accId, Variant key)
           
 Variant getMapKeys(int accId)
          Get map keys as array
 Variant getMapValue(int accId, Variant key)
          Get map entry value
 Variant getMapValues(int accId)
          Get map values as array
 int getTag(int accId)
          Get tag index of a Union node
 Variant getValue(int accId)
          Read the value as whole.
 boolean hasValue(int accId)
          Get value status of an Optional node
 IWireServer.AccessorInfo openAccessor(AccessorReference 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(AccessorReference 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

Variant 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,
                AccessorReference 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,
                    Variant key)
                    throws WireException
Throws:
WireException

containsValue

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

getFirstKey

Variant getFirstKey(int accId)
                    throws WireException
Throws:
WireException

getLastKey

Variant getLastKey(int accId)
                   throws WireException
Throws:
WireException

getLowerKey

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

getFloorKey

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

getCeilingKey

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

getHigherKey

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

getMapValue

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

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

getMapValues

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

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

getMapKeys

Variant 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,
           Variant 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,
        Variant object)
        throws WireException
Parameters:
accId -
index - insert pos, -1 = at the end
object -
Returns:
actual insert pos
Throws:
WireException

getArrayElement

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

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