本文整理汇总了Java中org.whispersystems.jobqueue.JobManager类的典型用法代码示例。如果您正苦于以下问题:Java JobManager类的具体用法?Java JobManager怎么用?Java JobManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JobManager类属于org.whispersystems.jobqueue包,在下文中一共展示了JobManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMessage
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private void handleMessage(SignalServiceEnvelope envelope, boolean sendExplicitReceipt) {
Recipients recipients = RecipientFactory.getRecipientsFromString(context, envelope.getSource(), false);
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
if (!recipients.isBlocked()) {
long messageId = DatabaseFactory.getPushDatabase(context).insert(envelope);
jobManager.add(new PushDecryptJob(context, messageId, envelope.getSource()));
} else {
Log.w(TAG, "*** Received blocked push message, ignoring...");
}
if (sendExplicitReceipt) {
jobManager.add(new DeliveryReceiptJob(context, envelope.getSource(),
envelope.getTimestamp(),
envelope.getRelay()));
}
}
示例2: handleMessage
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private void handleMessage(TextSecureEnvelope envelope, boolean sendExplicitReceipt) {
Recipients recipients = RecipientFactory.getRecipientsFromString(context, envelope.getSource(), false);
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
if (!recipients.isBlocked()) {
long messageId = DatabaseFactory.getPushDatabase(context).insert(envelope);
jobManager.add(new PushDecryptJob(context, messageId, envelope.getSource()));
} else {
Log.w(TAG, "*** Received blocked push message, ignoring...");
}
if (sendExplicitReceipt) {
jobManager.add(new DeliveryReceiptJob(context, envelope.getSource(),
envelope.getTimestamp(),
envelope.getRelay()));
}
}
示例3: initializeJobManager
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private void initializeJobManager() {
this.jobManager = JobManager.newBuilder(this)
.withName("TextSecureJobs")
.withDependencyInjector(this)
.withJobSerializer(new EncryptingJobSerializer())
.withRequirementProviders(new MasterSecretRequirementProvider(this),
new ServiceRequirementProvider(this),
new NetworkRequirementProvider(this),
mediaNetworkRequirementProvider)
.withConsumerThreads(5)
.build();
}
示例4: onReceive
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
long messageId = intent.getLongExtra("message_id", -1);
switch (intent.getAction()) {
case SENT_SMS_ACTION:
int result = getResultCode();
jobManager.add(new SmsSentJob(context, messageId, SENT_SMS_ACTION, result));
break;
case DELIVERED_SMS_ACTION:
byte[] pdu = intent.getByteArrayExtra("pdu");
if (pdu == null) {
Log.w(TAG, "No PDU in delivery receipt!");
break;
}
SmsMessage message = SmsMessage.createFromPdu(pdu);
if (message == null) {
Log.w(TAG, "Delivery receipt failed to parse!");
break;
}
jobManager.add(new SmsSentJob(context, messageId, DELIVERED_SMS_ACTION, message.getStatus()));
break;
default:
Log.w(TAG, "Unknown action: " + intent.getAction());
}
}
示例5: initializeJobManager
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private void initializeJobManager() {
this.jobManager = JobManager.newBuilder(this)
.withName("TextSecureJobs")
.withDependencyInjector(this)
.withJobSerializer(new EncryptingJobSerializer())
.withRequirementProviders(new MasterSecretRequirementProvider(this),
new ServiceRequirementProvider(this),
new NetworkRequirementProvider(this))
.withConsumerThreads(5)
.build();
}
示例6: handleMessage
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private void handleMessage(TextSecureEnvelope envelope) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
long messageId = DatabaseFactory.getPushDatabase(context).insert(envelope);
jobManager.add(new DeliveryReceiptJob(context, envelope.getSource(),
envelope.getTimestamp(),
envelope.getRelay()));
jobManager.add(new PushDecryptJob(context, messageId));
}
示例7: sendSMPPush
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private static void sendSMPPush(Context context, Recipients recipients, long messageId)
{
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
jobManager.add(new PushSMPSendJob(context, messageId, recipients.getPrimaryRecipient()
.getNumber()));
Log.d(TAG, "PushSMPSendJob added");
}
示例8: initializeJobManager
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private void initializeJobManager() {
this.jobManager = JobManager.newBuilder(this)
.withName("SilenceJobs")
.withDependencyInjector(this)
.withJobSerializer(new EncryptingJobSerializer())
.withRequirementProviders(new MasterSecretRequirementProvider(this),
new ServiceRequirementProvider(this),
new NetworkRequirementProvider(this),
mediaNetworkRequirementProvider)
.withConsumerThreads(5)
.build();
}
示例9: getJobManager
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
public JobManager getJobManager() {
return jobManager;
}
示例10: sendTextPush
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private static void sendTextPush(Context context, Recipients recipients, long messageId) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
jobManager.add(new PushTextSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber()));
}
示例11: sendMediaPush
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private static void sendMediaPush(Context context, Recipients recipients, long messageId) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
jobManager.add(new PushMediaSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber()));
}
示例12: sendGroupPush
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private static void sendGroupPush(Context context, Recipients recipients, long messageId, long filterRecipientId, Recipients destRecipients) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
jobManager.add(new PushGroupSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber(), filterRecipientId, destRecipients));
}
示例13: sendSms
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private static void sendSms(Context context, Recipients recipients, long messageId) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
jobManager.add(new SmsSendJob(context, messageId, recipients.getPrimaryRecipient().getName()));
}
示例14: sendMms
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private static void sendMms(Context context, long messageId) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
jobManager.add(new MmsSendJob(context, messageId));
}
示例15: sendGroupPush
import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
private static void sendGroupPush(Context context, Recipients recipients, long messageId, long filterRecipientId) {
JobManager jobManager = ApplicationContext.getInstance(context).getJobManager();
jobManager.add(new PushGroupSendJob(context, messageId, recipients.getPrimaryRecipient().getNumber(), filterRecipientId));
}