Package org.jboss.aerogear.simplepush.server

Examples of org.jboss.aerogear.simplepush.server.DefaultChannel


        };
        final ChannelDTO dto = jpaExecutor.execute(findChannel);
        if (dto == null) {
            throw new ChannelNotFoundException("No Channel for [" + channelId + "] was found", channelId);
        }
        return new DefaultChannel(dto.getUserAgent().getUaid(), dto.getChannelId(), dto.getVersion(), dto.getEndpointToken());
    }
View Full Code Here


    private Channel newChannel2(final String uaid) {
        final String channelId = UUID.randomUUID().toString();
        final byte[] salt = "some salt for the server private".getBytes();
        final String endpointToken = CryptoUtil.endpointToken(uaid, channelId, CryptoUtil.secretKey("testKey", salt));
        return new DefaultChannel(uaid, channelId, endpointToken);
    }
View Full Code Here

    }

    private Channel newChannel(final String uaid, final String channelId, final long version) {
        final byte[] keySalt = "some string as a salt".getBytes();
        final String endpointToken = CryptoUtil.endpointToken(uaid, channelId, CryptoUtil.secretKey("testKey", keySalt));
        return new DefaultChannel(uaid, channelId, version, endpointToken);
    }
View Full Code Here

        ups.addAll(Arrays.asList(updates));
        return ups;
    }

    private Channel newChannel(final String uaid, final String channelId, final long version) {
        return new DefaultChannel(uaid, channelId, version, "endpointToken");
    }
View Full Code Here

                final String endpointToken = endpointTokenAndUaid.get(0);
                final String uaid = endpointTokenAndUaid.get(1);
                if (endpointToken == null || uaid == null) {
                    throw channelNotFoundException(channelId);
                }
                return new DefaultChannel(uaid, channelId, Long.valueOf(jedis.get(endpointToken)), endpointToken);
            }
            throw channelNotFoundException(channelId);
        } finally {
            jedisPool.returnResource(jedis);
        }
View Full Code Here

        return rows.get(0).getValueAsNode();
    }

    private Channel channelFromJson(final JsonNode node) {
        final JsonNode doc = node.get("doc");
        return new DefaultChannel(doc.get(UAID_FIELD).asText(),
                doc.get(CHID_FIELD).asText(),
                doc.get(VERSION_FIELD).asLong(),
                doc.get(TOKEN_FIELD).asText());
    }
View Full Code Here

    public void saveChannelWithIdContainingUnderscore() {
        final String uaid = UUIDUtil.newUAID();
        final String channelId = UUID.randomUUID().toString();
        final byte[] keySalt = "some string as a salt".getBytes();
        final String endpointToken = CryptoUtil.endpointToken(uaid, channelId, CryptoUtil.secretKey("testKey", keySalt));
        final Channel channel = new DefaultChannel(uaid, channelId, "_" + endpointToken);
        final boolean saved = datastore.saveChannel(channel);
        assertThat(saved, is(true));
    }
View Full Code Here

    }

    private Channel newChannel(final String uaid, final String channelId, final long version) {
        final byte[] keySalt = "some string as a salt".getBytes();
        final String endpointToken = CryptoUtil.endpointToken(uaid, channelId, CryptoUtil.secretKey("testKey", keySalt));
        return new DefaultChannel(uaid, channelId, version, endpointToken);
    }
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.simplepush.server.DefaultChannel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.