Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
briar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Julian Dehm
briar
Commits
61b216f5
Verified
Commit
61b216f5
authored
Apr 23, 2018
by
Torsten Grote
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy over Introduction API messages and events from old client
parent
d57102ed
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
240 additions
and
0 deletions
+240
-0
briar-api/src/main/java/org/briarproject/briar/api/introduction2/IntroductionMessage.java
...rproject/briar/api/introduction2/IntroductionMessage.java
+43
-0
briar-api/src/main/java/org/briarproject/briar/api/introduction2/IntroductionRequest.java
...rproject/briar/api/introduction2/IntroductionRequest.java
+44
-0
briar-api/src/main/java/org/briarproject/briar/api/introduction2/IntroductionResponse.java
...project/briar/api/introduction2/IntroductionResponse.java
+35
-0
briar-api/src/main/java/org/briarproject/briar/api/introduction2/event/IntroductionAbortedEvent.java
...iar/api/introduction2/event/IntroductionAbortedEvent.java
+32
-0
briar-api/src/main/java/org/briarproject/briar/api/introduction2/event/IntroductionRequestReceivedEvent.java
...introduction2/event/IntroductionRequestReceivedEvent.java
+32
-0
briar-api/src/main/java/org/briarproject/briar/api/introduction2/event/IntroductionResponseReceivedEvent.java
...ntroduction2/event/IntroductionResponseReceivedEvent.java
+31
-0
briar-api/src/main/java/org/briarproject/briar/api/introduction2/event/IntroductionSucceededEvent.java
...r/api/introduction2/event/IntroductionSucceededEvent.java
+23
-0
No files found.
briar-api/src/main/java/org/briarproject/briar/api/introduction2/IntroductionMessage.java
0 → 100644
View file @
61b216f5
package
org.briarproject.briar.api.introduction2
;
import
org.briarproject.bramble.api.nullsafety.NotNullByDefault
;
import
org.briarproject.bramble.api.sync.GroupId
;
import
org.briarproject.bramble.api.sync.MessageId
;
import
org.briarproject.briar.api.client.BaseMessageHeader
;
import
org.briarproject.briar.api.client.SessionId
;
import
javax.annotation.concurrent.Immutable
;
import
static
org
.
briarproject
.
briar
.
api
.
introduction2
.
Role
.
INTRODUCER
;
@Immutable
@NotNullByDefault
public
class
IntroductionMessage
extends
BaseMessageHeader
{
private
final
SessionId
sessionId
;
private
final
MessageId
messageId
;
private
final
Role
role
;
IntroductionMessage
(
SessionId
sessionId
,
MessageId
messageId
,
GroupId
groupId
,
Role
role
,
long
time
,
boolean
local
,
boolean
sent
,
boolean
seen
,
boolean
read
)
{
super
(
messageId
,
groupId
,
time
,
local
,
sent
,
seen
,
read
);
this
.
sessionId
=
sessionId
;
this
.
messageId
=
messageId
;
this
.
role
=
role
;
}
public
SessionId
getSessionId
()
{
return
sessionId
;
}
public
MessageId
getMessageId
()
{
return
messageId
;
}
public
boolean
isIntroducer
()
{
return
role
==
INTRODUCER
;
}
}
briar-api/src/main/java/org/briarproject/briar/api/introduction2/IntroductionRequest.java
0 → 100644
View file @
61b216f5
package
org.briarproject.briar.api.introduction2
;
import
org.briarproject.bramble.api.nullsafety.NotNullByDefault
;
import
org.briarproject.bramble.api.sync.GroupId
;
import
org.briarproject.bramble.api.sync.MessageId
;
import
org.briarproject.briar.api.client.SessionId
;
import
javax.annotation.Nullable
;
import
javax.annotation.concurrent.Immutable
;
@Immutable
@NotNullByDefault
public
class
IntroductionRequest
extends
IntroductionResponse
{
@Nullable
private
final
String
message
;
private
final
boolean
answered
,
exists
;
public
IntroductionRequest
(
SessionId
sessionId
,
MessageId
messageId
,
GroupId
groupId
,
Role
role
,
long
time
,
boolean
local
,
boolean
sent
,
boolean
seen
,
boolean
read
,
String
name
,
boolean
accepted
,
@Nullable
String
message
,
boolean
answered
,
boolean
exists
)
{
super
(
sessionId
,
messageId
,
groupId
,
role
,
time
,
local
,
sent
,
seen
,
read
,
name
,
accepted
);
this
.
message
=
message
;
this
.
answered
=
answered
;
this
.
exists
=
exists
;
}
@Nullable
public
String
getMessage
()
{
return
message
;
}
public
boolean
wasAnswered
()
{
return
answered
;
}
public
boolean
contactExists
()
{
return
exists
;
}
}
briar-api/src/main/java/org/briarproject/briar/api/introduction2/IntroductionResponse.java
0 → 100644
View file @
61b216f5
package
org.briarproject.briar.api.introduction2
;
import
org.briarproject.bramble.api.nullsafety.NotNullByDefault
;
import
org.briarproject.bramble.api.sync.GroupId
;
import
org.briarproject.bramble.api.sync.MessageId
;
import
org.briarproject.briar.api.client.SessionId
;
import
javax.annotation.concurrent.Immutable
;
@Immutable
@NotNullByDefault
public
class
IntroductionResponse
extends
IntroductionMessage
{
private
final
String
name
;
private
final
boolean
accepted
;
public
IntroductionResponse
(
SessionId
sessionId
,
MessageId
messageId
,
GroupId
groupId
,
Role
role
,
long
time
,
boolean
local
,
boolean
sent
,
boolean
seen
,
boolean
read
,
String
name
,
boolean
accepted
)
{
super
(
sessionId
,
messageId
,
groupId
,
role
,
time
,
local
,
sent
,
seen
,
read
);
this
.
name
=
name
;
this
.
accepted
=
accepted
;
}
public
String
getName
()
{
return
name
;
}
public
boolean
wasAccepted
()
{
return
accepted
;
}
}
briar-api/src/main/java/org/briarproject/briar/api/introduction2/event/IntroductionAbortedEvent.java
0 → 100644
View file @
61b216f5
package
org.briarproject.briar.api.introduction2.event
;
import
org.briarproject.bramble.api.event.Event
;
import
org.briarproject.bramble.api.identity.AuthorId
;
import
org.briarproject.bramble.api.nullsafety.NotNullByDefault
;
import
org.briarproject.briar.api.client.SessionId
;
import
javax.annotation.concurrent.Immutable
;
@Immutable
@NotNullByDefault
// TODO still needed?
public
class
IntroductionAbortedEvent
extends
Event
{
private
final
AuthorId
remoteAuthorId
;
private
final
SessionId
sessionId
;
public
IntroductionAbortedEvent
(
AuthorId
remoteAuthorId
,
SessionId
sessionId
)
{
this
.
remoteAuthorId
=
remoteAuthorId
;
this
.
sessionId
=
sessionId
;
}
public
AuthorId
getRemoteAuthorId
()
{
return
remoteAuthorId
;
}
public
SessionId
getSessionId
()
{
return
sessionId
;
}
}
briar-api/src/main/java/org/briarproject/briar/api/introduction2/event/IntroductionRequestReceivedEvent.java
0 → 100644
View file @
61b216f5
package
org.briarproject.briar.api.introduction2.event
;
import
org.briarproject.bramble.api.contact.ContactId
;
import
org.briarproject.bramble.api.event.Event
;
import
org.briarproject.bramble.api.nullsafety.NotNullByDefault
;
import
org.briarproject.briar.api.introduction2.IntroductionRequest
;
import
javax.annotation.concurrent.Immutable
;
@Immutable
@NotNullByDefault
public
class
IntroductionRequestReceivedEvent
extends
Event
{
private
final
ContactId
contactId
;
private
final
IntroductionRequest
introductionRequest
;
public
IntroductionRequestReceivedEvent
(
ContactId
contactId
,
IntroductionRequest
introductionRequest
)
{
this
.
contactId
=
contactId
;
this
.
introductionRequest
=
introductionRequest
;
}
public
ContactId
getContactId
()
{
return
contactId
;
}
public
IntroductionRequest
getIntroductionRequest
()
{
return
introductionRequest
;
}
}
briar-api/src/main/java/org/briarproject/briar/api/introduction2/event/IntroductionResponseReceivedEvent.java
0 → 100644
View file @
61b216f5
package
org.briarproject.briar.api.introduction2.event
;
import
org.briarproject.bramble.api.contact.ContactId
;
import
org.briarproject.bramble.api.event.Event
;
import
org.briarproject.bramble.api.nullsafety.NotNullByDefault
;
import
org.briarproject.briar.api.introduction2.IntroductionResponse
;
import
javax.annotation.concurrent.Immutable
;
@Immutable
@NotNullByDefault
public
class
IntroductionResponseReceivedEvent
extends
Event
{
private
final
ContactId
contactId
;
private
final
IntroductionResponse
introductionResponse
;
public
IntroductionResponseReceivedEvent
(
ContactId
contactId
,
IntroductionResponse
introductionResponse
)
{
this
.
contactId
=
contactId
;
this
.
introductionResponse
=
introductionResponse
;
}
public
ContactId
getContactId
()
{
return
contactId
;
}
public
IntroductionResponse
getIntroductionResponse
()
{
return
introductionResponse
;
}
}
briar-api/src/main/java/org/briarproject/briar/api/introduction2/event/IntroductionSucceededEvent.java
0 → 100644
View file @
61b216f5
package
org.briarproject.briar.api.introduction2.event
;
import
org.briarproject.bramble.api.contact.Contact
;
import
org.briarproject.bramble.api.event.Event
;
import
org.briarproject.bramble.api.nullsafety.NotNullByDefault
;
import
javax.annotation.concurrent.Immutable
;
@Immutable
@NotNullByDefault
// TODO still needed?
public
class
IntroductionSucceededEvent
extends
Event
{
private
final
Contact
contact
;
public
IntroductionSucceededEvent
(
Contact
contact
)
{
this
.
contact
=
contact
;
}
public
Contact
getContact
()
{
return
contact
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment