|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectcom.amazonaws.mobileconnectors.kinesis.kinesisrecorder.KinesisRecorder
public class KinesisRecorder
The KinesisRecorder is a high level client meant for storing PutRecordRequests on the users Android device. This allows developers to retain requests when the device is offline. It can also increase performance and battery efficiency since the wi-fi or cell network does not need to be woken up as frequently. Note: KinesisRecorder uses all synchronous calls regardless of the AmazonKinesisClient passed in. Therefore you should not call KinesisRecorder methods on the main thread. To use KinesisRecorder create an AmazonKinesisClient and an directory that is private to your application. The directory passed should be empty the first time you instantiate KinesisRecorder, and should only be used for KinesisRecorder to prevent collision. Additionally you may pass an instance of KinesisRecorderConfig in order to set parameters on KinesisRecorder (Such as the maximum amount of storage KinesisRecorder may use). Warning: You should not create multiple KinesisRecorders given the same directory. Doing so is an error and behavior is undefined. Note: KinesisRecorder stores the requests in plain-text, and does not perform additional security measures outside of what the Android OS offers by default. Therefore it is recommended you pass a directory that is only visible to your application, and additionally do not store highly sensitive information using Kinesis Recorder.
| Constructor Summary | |
|---|---|
KinesisRecorder(java.io.File directory,
Regions region,
AWSCredentialsProvider credentialsProvider)
Constructs a new Kinesis Recorder specifying a directory that Kinesis Recorder has exclusive access to for storing requests. |
|
KinesisRecorder(java.io.File directory,
Regions region,
AWSCredentialsProvider credentialsProvider,
KinesisRecorderConfig config)
Constructs a new Kinesis Recorder specifying a directory that Kinesis Recorder has exclusive access to for storing requests. |
|
| Method Summary | |
|---|---|
void |
deleteAllRecords()
Removes all requests saved to disk in the directory provided this KinesisRecorder |
long |
getDiskByteLimit()
Returns the max number of bytes that this Kinesis Recorder will store on disk. |
long |
getDiskBytesUsed()
Returns the number of bytes KinesisRecorder currently has stored in the directory passed in the constructor |
KinesisRecorderConfig |
getKinesisRecorderConfig()
Returns the KinesisRecorderConfig this Kinesis Recorder is using. |
void |
saveRecord(byte[] data,
java.lang.String streamName)
Saves a record to local storage to be sent later. |
void |
submitAllRecords()
Submits all requests saved to Amazon Kinesis. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KinesisRecorder(java.io.File directory,
Regions region,
AWSCredentialsProvider credentialsProvider)
credentialsProvider - The credentials provider to use when making requests to AWSregion - The region of Amazon Kinesis this Recorder should save and
send requests to.directory - An empty directory KinesisRecorder can use for storing
requests.
public KinesisRecorder(java.io.File directory,
Regions region,
AWSCredentialsProvider credentialsProvider,
KinesisRecorderConfig config)
credentialsProvider - The credentials provider to use when making requests to AWSregion - The region of Amazon Kinesis this Recorder should save and
send requests to.directory - An empty directory KinesisRecorder can use for storing
requests.config - Allows configuring various parameters of the recorder| Method Detail |
|---|
public void saveRecord(byte[] data,
java.lang.String streamName)
data - The data to submit to the streamstreamName - The stream to submit the data to.public void submitAllRecords()
AmazonClientException - Thrown if there was an unrecoverable error during submission. Note: If the request
appears to be invalid, the record will be deleted. If the request appears to be valid, it will be kept.public void deleteAllRecords()
public long getDiskBytesUsed()
public long getDiskByteLimit()
public KinesisRecorderConfig getKinesisRecorderConfig()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||