Esempio n. 1
0
  protected TransportContext buildTransportContext(
      KaaClientProperties properties, KaaClientState kaaClientState) {
    BootstrapTransport bootstrapTransport = buildBootstrapTransport(properties, kaaClientState);
    ProfileTransport profileTransport = buildProfileTransport();
    EventTransport eventTransport = buildEventTransport(kaaClientState);
    NotificationTransport notificationTransport = buildNotificationTransport();
    ConfigurationTransport configurationTransport = buildConfigurationTransport();
    UserTransport userTransport = buildUserTransport();
    RedirectionTransport redirectionTransport = buildRedirectionTransport();
    LogTransport logTransport = buildLogTransport();

    EndpointObjectHash publicKeyHash =
        EndpointObjectHash.fromSHA1(kaaClientState.getPublicKey().getEncoded());
    MetaDataTransport mdTransport = new DefaultMetaDataTransport();
    mdTransport.setClientProperties(properties);
    mdTransport.setClientState(kaaClientState);
    mdTransport.setEndpointPublicKeyhash(publicKeyHash);
    mdTransport.setTimeout(LONG_POLL_TIMEOUT);

    return new TransportContext(
        mdTransport,
        bootstrapTransport,
        profileTransport,
        eventTransport,
        notificationTransport,
        configurationTransport,
        userTransport,
        redirectionTransport,
        logTransport);
  }
Esempio n. 2
0
 @Override
 public boolean isAttachedToUser() {
   return kaaClientState.isAttachedToUser();
 }
Esempio n. 3
0
 @Override
 public String getEndpointAccessToken() {
   return kaaClientState.getEndpointAccessToken();
 }
Esempio n. 4
0
 @Override
 public String getEndpointKeyHash() {
   return kaaClientState.getEndpointKeyHash().getKeyHash();
 }
Esempio n. 5
0
 @Override
 public PrivateKey getClientPrivateKey() {
   return kaaClientState.getPrivateKey();
 }
Esempio n. 6
0
 @Override
 public PublicKey getClientPublicKey() {
   return kaaClientState.getPublicKey();
 }