mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +01:00
Transport properties client. #229
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package org.briarproject.api.properties;
|
||||
|
||||
import org.briarproject.api.StringMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TransportProperties extends StringMap {
|
||||
|
||||
private static final long serialVersionUID = 7533739534204953625L;
|
||||
|
||||
public TransportProperties(Map<String, String> m) {
|
||||
super(m);
|
||||
}
|
||||
|
||||
public TransportProperties() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.briarproject.api.properties;
|
||||
|
||||
public interface TransportPropertyConstants {
|
||||
|
||||
/** The maximum number of properties per transport. */
|
||||
int MAX_PROPERTIES_PER_TRANSPORT = 100;
|
||||
|
||||
/** The maximum length of a property's key or value in UTF-8 bytes. */
|
||||
int MAX_PROPERTY_LENGTH = 100;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.briarproject.api.properties;
|
||||
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.db.DbException;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface TransportPropertyManager {
|
||||
|
||||
/** Returns the local transport properties for all transports. */
|
||||
Map<TransportId, TransportProperties> getLocalProperties()
|
||||
throws DbException;
|
||||
|
||||
/** Returns the local transport properties for the given transport. */
|
||||
TransportProperties getLocalProperties(TransportId t) throws DbException;
|
||||
|
||||
/** Returns all remote transport properties for the given transport. */
|
||||
Map<ContactId, TransportProperties> getRemoteProperties(TransportId t)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
* Merges the given properties with the existing local properties for the
|
||||
* given transport.
|
||||
*/
|
||||
void mergeLocalProperties(TransportId t, TransportProperties p)
|
||||
throws DbException;
|
||||
}
|
||||
Reference in New Issue
Block a user