Package com.android.identity
Class DataTransportHttp
- java.lang.Object
-
- com.android.identity.DataTransport
-
- com.android.identity.DataTransportHttp
-
public class DataTransportHttp extends DataTransport
HTTP data transport. TODO: Maybe make it possible for the application to check the TLS root certificate via DataTransportOptions
-
-
Field Summary
-
Fields inherited from class com.android.identity.DataTransport
mContext, mOptions, mRole, ROLE_MDOC, ROLE_MDOC_READER
-
-
Constructor Summary
Constructors Constructor Description DataTransportHttp(android.content.Context context, int role, ConnectionMethodHttp connectionMethod, DataTransportOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectionMethod
getConnectionMethod()
Returns aConnectionMethod
instance that can be used to connect to this transport.java.lang.String
getHost()
java.lang.String
getPath()
int
getPort()
boolean
getUseTls()
void
setHost(java.lang.String host)
void
setPath(java.lang.String path)
void
setPort(int port)
void
setUseTls(boolean useTls)
-
Methods inherited from class com.android.identity.DataTransport
getMessage, inhibitCallbacks, reportConnected, reportConnecting, reportConnectionMethodReady, reportDisconnected, reportError, reportMessageProgress, reportMessageReceived, reportTransportSpecificSessionTermination
-
-
-
-
Constructor Detail
-
DataTransportHttp
public DataTransportHttp(@NonNull android.content.Context context, int role, @NonNull ConnectionMethodHttp connectionMethod, @NonNull DataTransportOptions options)
-
-
Method Detail
-
getHost
@NonNull public java.lang.String getHost()
-
getPort
public int getPort()
-
getPath
@NonNull public java.lang.String getPath()
-
getUseTls
public boolean getUseTls()
-
setHost
public void setHost(@NonNull java.lang.String host)
-
setPort
public void setPort(int port)
-
setPath
public void setPath(@NonNull java.lang.String path)
-
setUseTls
public void setUseTls(boolean useTls)
-
getConnectionMethod
@NonNull public ConnectionMethod getConnectionMethod()
Description copied from class:DataTransport
Returns aConnectionMethod
instance that can be used to connect to this transport.This is used for listening transports where the address to listen on is not known until the connection has been set up for example if dynamic TCP port assignments are used or cloud relays.
For most data transports this will return the same
ConnectionMethod
instance that was passed at construction time. However for some transports where the address to listen on is not known until the connection have been set up (for example dynamic TCP listening port assignments or when a cloud relay is in use) it will differ.This cannot be called until the
DataTransport.Listener.onConnectionMethodReady()
callback has been fired.- Specified by:
getConnectionMethod
in classDataTransport
- Returns:
- A
ConnectionMethod
-derived instance.
-
-