예제 #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);
  }
예제 #2
0
 @Override
 public boolean isAttachedToUser() {
   return kaaClientState.isAttachedToUser();
 }
예제 #3
0
 @Override
 public String getEndpointAccessToken() {
   return kaaClientState.getEndpointAccessToken();
 }
예제 #4
0
 @Override
 public String getEndpointKeyHash() {
   return kaaClientState.getEndpointKeyHash().getKeyHash();
 }
예제 #5
0
 @Override
 public PrivateKey getClientPrivateKey() {
   return kaaClientState.getPrivateKey();
 }
예제 #6
0
 @Override
 public PublicKey getClientPublicKey() {
   return kaaClientState.getPublicKey();
 }