Package com.smeup.kokos.sdk.caller
Class KokosService
java.lang.Object
com.smeup.kokos.sdk.caller.KokosService
- Direct Known Subclasses:
KokosCallableProgram,KokosFallbackService,KokosInputPanelService,KokosUpdateDataTableService,SDKToolService
- Author:
- mattia.bonardi StreamingService contains all methods to produce SmeupDataStrucutures
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(Fun fun, ExecutionContext context, OutputStream out, SmeupDataStructurePrinter printer) Execute method of service.voidwriteAction(SmeupAction... actions) Append action or actions at the end of the streamvoidwriteButtons(List<SmeupDataNode> buttons) Return a buttonsvoidwriteCursor(SmeupCursor cursor) Attach pagination cursor metadata to the response.voidwriteDataColumn(SmeupDataColumn column) Write single SmeupDataTable column.voidwriteDataColumns(List<SmeupDataColumn> columns) Write SmeupDataTable columns.voidwriteDataNode(SmeupDataNode node, boolean hasChildren) Write a single SmeupDataNode data structure.voidUse this method to top the writer from writing child nodes.voidwriteDataRow(SmeupDataRow row) Write single SmeupDataDataset row.voidwriteLayout(SmeupLayout lay) Write SmeupLayout data structure (LAY)voidwriteMessage(SmeupMessage... message) Write a SmeupMessage.voidwriteRawData(String xml) Write SmeupRawData data structure.voidWrite SmeupSch data structure (SCH)voidwriteSetup(SmeupSetup setup) Append setup data at the end of the streamvoidwriteVariable(SmeupVariable... variable) Write variable or variables at the end of the stream
-
Field Details
-
printer
-
out
-
-
Constructor Details
-
KokosService
public KokosService()
-
-
Method Details
-
execute
public void execute(Fun fun, ExecutionContext context, OutputStream out, SmeupDataStructurePrinter printer) throws Throwable Execute method of service. Call the relative method declared into FUN.- Parameters:
fun- funcontext- contextout- stream- Throws:
Throwable- Exception
-
writeDataNode
Write a single SmeupDataNode data structure. If the following SmeupDataNode are children you set hasChildren to true.- Parameters:
node- nodehasChildren- children flag- Throws:
Exception- Exception
-
writeDataNodeClosure
Use this method to top the writer from writing child nodes.- Throws:
Exception- Exception
-
writeDataColumns
Write SmeupDataTable columns. This method must be invoked before writing the lines.- Parameters:
columns- columns- Throws:
Exception- Exception
-
writeDataColumn
Write single SmeupDataTable column. Columns must be returned before writing the lines. You can return also all columns as list: writeColumns()- Parameters:
column- column- Throws:
Exception- Exception
-
writeDataRow
Write single SmeupDataDataset row. Rows must be returned after writing the columns.- Parameters:
row- row- Throws:
Exception- Exception
-
writeMessage
Write a SmeupMessage. Messages cannot be returned between writing columns rows and nodes.- Parameters:
message- message- Throws:
Exception- Exception
-
writeRawData
Write SmeupRawData data structure. Return a plain data.- Parameters:
xml- xml- Throws:
Exception- Exception
-
writeButtons
Return a buttons- Parameters:
buttons- buttons- Throws:
Exception- Exception
-
writeSch
Write SmeupSch data structure (SCH)- Parameters:
sch- sch
-
writeLayout
Write SmeupLayout data structure (LAY)- Parameters:
lay- lay
-
writeAction
Append action or actions at the end of the stream- Parameters:
actions- single or list of actions
-
writeSetup
Append setup data at the end of the stream- Parameters:
setup- data setup
-
writeCursor
Attach pagination cursor metadata to the response.- Parameters:
cursor- cursor metadata
-
writeVariable
Write variable or variables at the end of the stream- Parameters:
variable- single or list of variables
-