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); }
@Override public boolean isAttachedToUser() { return kaaClientState.isAttachedToUser(); }
@Override public String getEndpointAccessToken() { return kaaClientState.getEndpointAccessToken(); }
@Override public String getEndpointKeyHash() { return kaaClientState.getEndpointKeyHash().getKeyHash(); }
@Override public PrivateKey getClientPrivateKey() { return kaaClientState.getPrivateKey(); }
@Override public PublicKey getClientPublicKey() { return kaaClientState.getPublicKey(); }