Package com.illumon.iris.db.util.config
Class RemoteMutableInputTable
java.lang.Object
com.illumon.iris.db.util.config.RemoteMutableInputTable
- All Implemented Interfaces:
InputTableEnumGetter
,InputTableRowSetter
,MutableInputTable
public class RemoteMutableInputTable extends Object implements MutableInputTable
The RemoteMutableInputTable is a client side object that has enough information about the definition of the input
table to answer definitional questions locally; and a handle to the remote Table. Editing operations are applied
as remote queries to the handle on the server.
-
Method Summary
Modifier and Type Method Description void
add(Table newData)
Write newData to this table.void
addRows(Map<String,Object>[] valueArray, boolean allowEdits, InputTableStatusListener listener)
Add the specified rows to the table, optionally overwriting existing keys.boolean
canEdit(Database database, com.fishlib.auth.UserContext userContext)
Queries whether the given user may edit this MutableInputTable.void
delete(Table table)
Delete the keys contained in the parameter table from this input table.void
delete(Table table, Index index)
Delete the keys contained in the parameter table from this input table.com.illumon.iris.web.shared.data.InputTableDefinition
getDefinition()
Get the key and value columns names for this table.String
getDescription()
Return a user-readable description of this MutableInputTable.Object[]
getEnumsForColumn(String columnName)
FieldEntry<?>
getFieldEntry(Object defaultValue, boolean isEdit, String columnName)
Create a proper FieldEntry for the specified column in the Deephaven Swing UI.Table
getTable()
Returns a Deephaven table that contains the current data for this MutableInputTable.TableDefinition
getTableDefinition()
Get the underlying Table definition (which includes the names and types of all of the columns).void
setRows(Table table, int[] rowArray, Map<String,Object>[] valueArray, InputTableStatusListener listener)
Set the values of the columns specified by the input, filling in missing data using the parameter 'table' as the previous value source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.util.config.InputTableRowSetter
addRow, addRow, addRows, addRows, setRow, setRows
Methods inherited from interface com.illumon.iris.db.util.config.MutableInputTable
getDatabase, getKeyNames, hasColumn, isKey
-
Method Details
-
getTable
Description copied from interface:MutableInputTable
Returns a Deephaven table that contains the current data for this MutableInputTable.- Specified by:
getTable
in interfaceMutableInputTable
- Returns:
- the current data in this MutableInputTable.
-
getFieldEntry
Description copied from interface:MutableInputTable
Create a proper FieldEntry for the specified column in the Deephaven Swing UI.- Specified by:
getFieldEntry
in interfaceMutableInputTable
- Parameters:
defaultValue
- the default value of the fieldisEdit
- is this an edit (vs. an addition)columnName
- the name of the column.- Returns:
- a FieldEntry object for use in the swing UI
-
getDefinition
public com.illumon.iris.web.shared.data.InputTableDefinition getDefinition()Description copied from interface:MutableInputTable
Get the key and value columns names for this table.- Specified by:
getDefinition
in interfaceMutableInputTable
- Returns:
- the InputTableDefinition.
-
getTableDefinition
Description copied from interface:MutableInputTable
Get the underlying Table definition (which includes the names and types of all of the columns).- Specified by:
getTableDefinition
in interfaceMutableInputTable
- Returns:
- the TableDefinition for our user-visible table
-
add
Description copied from interface:MutableInputTable
Write newData to this table.- Specified by:
add
in interfaceMutableInputTable
- Parameters:
newData
- the data to write to this table- Throws:
IOException
- if there is an error writing the data
-
delete
Description copied from interface:MutableInputTable
Delete the keys contained in the parameter table from this input table. This method will block until rows are deleted.- Specified by:
delete
in interfaceMutableInputTable
- Parameters:
table
- The rows to delete.- Throws:
IOException
- If a problem occurred while deleting the rows.
-
delete
Description copied from interface:MutableInputTable
Delete the keys contained in the parameter table from this input table. This method will block until rows are deleted.- Specified by:
delete
in interfaceMutableInputTable
- Parameters:
table
- The rows to delete.- Throws:
IOException
- If a problem occurred while deleting the rows.
-
getDescription
Description copied from interface:MutableInputTable
Return a user-readable description of this MutableInputTable.- Specified by:
getDescription
in interfaceMutableInputTable
- Returns:
- a description of this input table
-
setRows
public void setRows(Table table, int[] rowArray, Map<String,Object>[] valueArray, InputTableStatusListener listener)Description copied from interface:InputTableRowSetter
Set the values of the columns specified by the input, filling in missing data using the parameter 'table' as the previous value source. This method will be invoked asynchronously. The input listener will be notified on success/failure- Specified by:
setRows
in interfaceInputTableRowSetter
- Parameters:
table
- The table to use as the previous value sourcerowArray
- The row indices to update.valueArray
- The new values.listener
- The listener to notify on asynchronous results.
-
addRows
public void addRows(Map<String,Object>[] valueArray, boolean allowEdits, InputTableStatusListener listener)Description copied from interface:InputTableRowSetter
Add the specified rows to the table, optionally overwriting existing keys. This method will execute asynchronously, the input listener will be notified on success/failure.- Specified by:
addRows
in interfaceInputTableRowSetter
- Parameters:
valueArray
- The values to write.allowEdits
- Should pre-existing keys be overwritten?listener
- The listener to report asynchronous results to.
-
getEnumsForColumn
- Specified by:
getEnumsForColumn
in interfaceInputTableEnumGetter
-
canEdit
Description copied from interface:MutableInputTable
Queries whether the given user may edit this MutableInputTable.- Specified by:
canEdit
in interfaceMutableInputTable
- Parameters:
database
- the Database object for this MutableInputTableuserContext
- the UserContext representing the user that would edit the table- Returns:
- true if the specified user may edit this MutableInputTable, false otherwise
-