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


Java EnhancedApnsNotification.MAXIMUM_EXPIRY属性代码示例

本文整理汇总了Java中com.notnoop.apns.EnhancedApnsNotification.MAXIMUM_EXPIRY属性的典型用法代码示例。如果您正苦于以下问题:Java EnhancedApnsNotification.MAXIMUM_EXPIRY属性的具体用法?Java EnhancedApnsNotification.MAXIMUM_EXPIRY怎么用?Java EnhancedApnsNotification.MAXIMUM_EXPIRY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.notnoop.apns.EnhancedApnsNotification的用法示例。


在下文中一共展示了EnhancedApnsNotification.MAXIMUM_EXPIRY属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testProducerWithoutTokenHeader

@Test(timeout = 5000)
public void testProducerWithoutTokenHeader() throws Exception {
    String message = "Hello World";
    String messagePayload = APNS.newPayload().alertBody(message).build();

    EnhancedApnsNotification apnsNotification = new EnhancedApnsNotification(1, EnhancedApnsNotification.MAXIMUM_EXPIRY, FAKE_TOKEN, messagePayload);
    server.stopAt(apnsNotification.length());

    template.sendBody("direct:test", message);

    server.getMessages().acquire();
    assertArrayEquals(apnsNotification.marshall(), server.getReceived().toByteArray());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:ApnsProducerWithoutTokensHeaderTest.java

示例2: testProducer

@Test(timeout = 5000)
public void testProducer() throws Exception {
    String message = "Hello World";
    String messagePayload = APNS.newPayload().alertBody(message).build();

    EnhancedApnsNotification apnsNotification = new EnhancedApnsNotification(1, EnhancedApnsNotification.MAXIMUM_EXPIRY, FAKE_TOKEN, messagePayload);
    server.stopAt(apnsNotification.length());

    template.sendBody("direct:test", message);

    server.getMessages().acquire();
    assertArrayEquals(apnsNotification.marshall(), server.getReceived().toByteArray());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:13,代码来源:ApnsProducerTest.java

示例3: testProducerWithApnsNotification

@Test(timeout = 5000)
public void testProducerWithApnsNotification() throws InterruptedException {
    String message = "Hello World";
    String messagePayload = APNS.newPayload().alertBody(message).build();

    final EnhancedApnsNotification apnsNotification =
            new EnhancedApnsNotification(14, EnhancedApnsNotification.MAXIMUM_EXPIRY, FAKE_TOKEN, messagePayload);
    server.stopAt(apnsNotification.length());

    template.sendBody("direct:testWithApnsNotification", apnsNotification);

    server.getMessages().acquire();
    assertArrayEquals(apnsNotification.marshall(), server.getReceived().toByteArray());

}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:ApnsProducerTest.java

示例4: push

public Collection<EnhancedApnsNotification> push(Collection<String> deviceTokens, String payload) throws NetworkIOException {
    byte[] messageBytes = Utilities.toUTF8Bytes(payload);
    List<EnhancedApnsNotification> notifications = new ArrayList<EnhancedApnsNotification>(deviceTokens.size());
    for (String deviceToken : deviceTokens) {
        byte[] dtbytes = Utilities.decodeHex(deviceToken);
        EnhancedApnsNotification notification =
            new EnhancedApnsNotification(c.incrementAndGet(), EnhancedApnsNotification.MAXIMUM_EXPIRY, dtbytes, messageBytes);
        notifications.add(notification);
        push(notification);
    }
    return notifications;
}
 
开发者ID:East196,项目名称:maker,代码行数:12,代码来源:AbstractApnsService.java

示例5: push

public Collection<EnhancedApnsNotification> push(Collection<String> deviceTokens, String payload) throws NetworkIOException {
    byte[] messageBytes = Utilities.toUTF8Bytes(payload);
    List<EnhancedApnsNotification> notifications = new ArrayList<EnhancedApnsNotification>(deviceTokens.size());
    for (String deviceToken : deviceTokens) {
        byte[] dtBytes = Utilities.decodeHex(deviceToken);
        EnhancedApnsNotification notification =
            new EnhancedApnsNotification(c.incrementAndGet(), EnhancedApnsNotification.MAXIMUM_EXPIRY, dtBytes, messageBytes);
        notifications.add(notification);
        push(notification);
    }
    return notifications;
}
 
开发者ID:dzh,项目名称:jframe,代码行数:12,代码来源:AbstractApnsService.java

示例6: testApnsProducer

@Test
public void testApnsProducer() throws Exception {
    CamelContext camelctx = new DefaultCamelContext();
    camelctx.addRoutes(new RouteBuilder() {
        @Override
        public void configure() throws Exception {
            from("direct:start")
            .setHeader(HEADER_TOKENS, constant(FAKE_TOKEN))
            .to("apns:notify");
        }
    });

    int gatewayPort = getPortNumber("apns-feedback-port.txt");
    int feedbackPort = getPortNumber("apns-gateway-port.txt");

    ApnsServiceFactory apnsServiceFactory = ApnsUtils.createDefaultTestConfiguration(camelctx);
    apnsServiceFactory.setFeedbackHost("localhost");
    apnsServiceFactory.setFeedbackPort(gatewayPort);
    apnsServiceFactory.setGatewayHost("localhost");
    apnsServiceFactory.setGatewayPort(feedbackPort);

    ApnsService apnsService = apnsServiceFactory.getApnsService();
    ApnsComponent apnsComponent = new ApnsComponent(apnsService);
    camelctx.addComponent("apns", apnsComponent);

    camelctx.start();
    try {
        String message = "Hello World";
        String messagePayload = APNS.newPayload().alertBody(message).build();

        EnhancedApnsNotification apnsNotification = new EnhancedApnsNotification(1, EnhancedApnsNotification.MAXIMUM_EXPIRY, FAKE_TOKEN, messagePayload);
        server.stopAt(apnsNotification.length());

        ProducerTemplate template = camelctx.createProducerTemplate();
        template.sendBody("direct:start", message);

        server.getMessages().acquire();
        Assert.assertArrayEquals(apnsNotification.marshall(), server.getReceived().toByteArray());
    } finally {
        camelctx.stop();
    }
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:42,代码来源:ApnsIntegrationTest.java


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