Package org.red5.io.object
Class RecordSet
java.lang.Object
org.red5.io.object.RecordSet
Read only RecordSet object that might be received through remoting calls. There are 3 types of data fetching:
- On demand (used by default)
- Fetch all at once
- Page-by-page fetching
For last mode, use page size property to specify maximum number of rows on one page
- Author:
- The Red5 Project, Joachim Bauch (jojo@struktur.de)
-
Field Summary
Modifier and TypeFieldDescriptionprivate IRemotingClient
Remoting client that fetches dataRecordset column names setprivate int
Recordset cursorRecordset dataprivate Object
Recordset idprivate String
Fetching mode, on demand by defaultprivate static final String
Fetch all at once fetching modeprivate static final String
On demand fetching modeprivate static final String
Page-by-page fetching modeprivate int
Page sizeprivate String
Name of serviceprivate int
Total number of pagesprivate int
Recordset version -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
ensureAvailable
(int index) Make sure the passed item has been fetched from the server.Return a list containing the names of the columns in the recordset.getItemAt
(int index) Return a specified item from the recordset.int
Get the total number of items.int
Get the number of items already received from the server.boolean
Check if all items are available on the client.Return Map that can be serialized as result.void
setDeliveryMode
(String mode) Set the mode for fetching paged results.void
setDeliveryMode
(String mode, int pageSize) Set the mode for fetching paged results with given max page size.void
setDeliveryMode
(String mode, int pageSize, int prefetchCount) Set the mode for fetching paged results with given max page size and number of prefetched pages.void
setRemotingClient
(IRemotingClient client) Set the remoting client to use for retrieving of paged results.
-
Field Details
-
MODE_ONDEMAND
On demand fetching mode- See Also:
-
MODE_FETCHALL
Fetch all at once fetching mode- See Also:
-
MODE_PAGE
Page-by-page fetching mode- See Also:
-
totalCount
private int totalCountTotal number of pages -
data
Recordset data -
cursor
private int cursorRecordset cursor -
serviceName
Name of service -
columns
Recordset column names set -
version
private int versionRecordset version -
id
Recordset id -
client
Remoting client that fetches data -
mode
Fetching mode, on demand by default -
pageSize
private int pageSizePage size
-
-
Constructor Details
-
RecordSet
Creates recordset from Input object- Parameters:
input
- input
-
-
Method Details
-
setRemotingClient
Set the remoting client to use for retrieving of paged results.- Parameters:
client
- Remoting client that works with this Recordset
-
setDeliveryMode
Set the mode for fetching paged results.- Parameters:
mode
- Mode for fetching of results
-
setDeliveryMode
Set the mode for fetching paged results with given max page size.- Parameters:
mode
- Mode for fetching of resultspageSize
- Max page size
-
setDeliveryMode
Set the mode for fetching paged results with given max page size and number of prefetched pages.- Parameters:
mode
- Mode for fetching of resultspageSize
- Max page sizeprefetchCount
- Number of prefetched pages (not implemented yet)
-
getColumnNames
Return a list containing the names of the columns in the recordset.- Returns:
- Column names set
-
ensureAvailable
private void ensureAvailable(int index) Make sure the passed item has been fetched from the server.- Parameters:
index
- Item index
-
getItemAt
Return a specified item from the recordset. If the item is not available yet, it will be received from the server.- Parameters:
index
- Item index- Returns:
- Item from recordset
-
getLength
public int getLength()Get the total number of items.- Returns:
- Number of items
-
getNumberAvailable
public int getNumberAvailable()Get the number of items already received from the server.- Returns:
- Nsumber of received items
-
isFullyPopulated
public boolean isFullyPopulated()Check if all items are available on the client.- Returns:
- number of available items
-
serialize
Return Map that can be serialized as result.- Returns:
- serializable informations
-