public abstract class AbstractRecordProvider extends Object implements RecordProvider
DataProvider
and SubscriptionProvider
APIs
to RecordProvider
API. All you have to do is to implement
getMode()
and retrieve(RecordSink)
methods and optionally override
setRecordListener(RecordListener)
method,
while all the methods of DataProvider
and SubscriptionProvider
interfaces are
already implemented and invoke the above method implementations.VOID
Constructor and Description |
---|
AbstractRecordProvider() |
Modifier and Type | Method and Description |
---|---|
abstract RecordMode |
getMode()
Returns record mode at which the records are provided
by
retrieve method. |
abstract boolean |
retrieve(RecordSink sink)
Retrieves accumulated records into the specified record sink
while the sink
has capacity . |
boolean |
retrieveData(DataVisitor visitor)
Deprecated.
|
boolean |
retrieveSubscription(SubscriptionVisitor visitor)
Deprecated.
|
void |
setDataListener(DataListener listener)
Deprecated.
|
void |
setRecordListener(RecordListener listener)
Sets new record listener to receive notifications about available records.
|
void |
setSubscriptionListener(SubscriptionListener listener)
Deprecated.
|
public abstract RecordMode getMode()
retrieve
method.getMode
in interface RecordProvider
public abstract boolean retrieve(RecordSink sink)
has capacity
.
Returns true
if some records still remains in the provider
or false
if all accumulated records were retrieved.retrieve
in interface RecordProvider
sink
- the sink.true
if some records still remains in the provider,
false
if all accumulated records were retrieved.public void setRecordListener(RecordListener listener)
null
to set empty data listener (no notifications).
NOTE: if there are accumulated data available, then specified listener will be notified by this method.
This implementation throws UnsupportedOperationException
.
setRecordListener
in interface RecordProvider
listener
- the listener.public final boolean retrieveData(DataVisitor visitor)
retrieve(RecordSink)
true
if some data still remains in the provider
or false
if all accumulated data were retrieved.retrieveData
in interface DataProvider
retrieveData
in interface RecordProvider
public final boolean retrieveSubscription(SubscriptionVisitor visitor)
retrieve(RecordSink)
true
if some subscription still remains in the provider
or false
if all accumulated subscription were retrieved.retrieveSubscription
in interface RecordProvider
retrieveSubscription
in interface SubscriptionProvider
public final void setDataListener(DataListener listener)
setRecordListener(RecordListener)
null
to set empty data listener (no notifications).
NOTE: if there is accumulated data available, then specified listener will be notified by this method.
setDataListener
in interface DataProvider
setDataListener
in interface RecordProvider
public final void setSubscriptionListener(SubscriptionListener listener)
setRecordListener(RecordListener)
null
to set empty subscription listener (no notifications).
NOTE: if there is accumulated subscription available, then specified listener will be notified by this method.
setSubscriptionListener
in interface RecordProvider
setSubscriptionListener
in interface SubscriptionProvider
Copyright © 2002–2025 Devexperts LLC. All rights reserved.