当前位置: 首页>>代码示例>>Java>>正文


Java JobManager类代码示例

本文整理汇总了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()));
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:18,代码来源:PushReceivedJob.java

示例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()));
  }
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:18,代码来源:PushReceivedJob.java

示例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();
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:13,代码来源:ApplicationContext.java

示例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());
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:33,代码来源:SmsDeliveryListener.java

示例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();
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:12,代码来源:ApplicationContext.java

示例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));
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:11,代码来源:PushReceiveJob.java

示例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");
}
 
开发者ID:Agilitum,项目名称:TextSecureSMP,代码行数:8,代码来源:MessageSender.java

示例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();
}
 
开发者ID:SilenceIM,项目名称:Silence,代码行数:13,代码来源:ApplicationContext.java

示例9: getJobManager

import org.whispersystems.jobqueue.JobManager; //导入依赖的package包/类
public JobManager getJobManager() {
  return jobManager;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:ApplicationContext.java

示例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()));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例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()));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例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));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例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()));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例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));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:MessageSender.java

示例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));
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:5,代码来源:MessageSender.java


注:本文中的org.whispersystems.jobqueue.JobManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。