Skip to content

Commit 4b27119

Browse files
committed
chore(java): update java-side glue
1 parent 2a7a3b8 commit 4b27119

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

dist/java/src/mp/code/Workspace.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
import java.util.function.Consumer;
44

5-
import mp.code.proto.UserInfo;
6-
import mp.code.proto.BufferNode;
5+
import mp.code.proto.*;
76
import mp.code.exceptions.ConnectionException;
87
import mp.code.exceptions.ConnectionRemoteException;
98
import mp.code.exceptions.ControllerException;
10-
import mp.code.proto.WorkspaceEvent;
11-
import mp.code.proto.WorkspaceIdentifier;
129

1310
/**
1411
* Represents a CodeMP workspace, which broadly speaking is a collection
@@ -90,16 +87,16 @@ public UserInfo[] userList() {
9087
return user_list(this.ptr);
9188
}
9289

93-
private static native void create_buffer(long self, String path, boolean ephemeral) throws ConnectionRemoteException;
90+
private static native void create_buffer(long self, String path, BufferAttributes attributes) throws ConnectionRemoteException;
9491

9592
/**
9693
* Creates a buffer with the given path.
9794
* @param path the new buffer's path
98-
* @param ephemeral whether the buffer should be ephemeral
95+
* @param attributes the buffer's attributes (will use defaults if null)
9996
* @throws ConnectionRemoteException if an error occurs in communicating with the server
10097
*/
101-
public void createBuffer(String path, boolean ephemeral) throws ConnectionRemoteException {
102-
create_buffer(this.ptr, path, ephemeral);
98+
public void createBuffer(String path, BufferAttributes attributes) throws ConnectionRemoteException {
99+
create_buffer(this.ptr, path, attributes);
103100
}
104101

105102
private static native void pin_buffer(long self, String path) throws ConnectionRemoteException;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package mp.code.proto;
2+
3+
import lombok.EqualsAndHashCode;
4+
import lombok.RequiredArgsConstructor;
5+
import lombok.ToString;
6+
7+
/**
8+
* The attributes of a buffer.
9+
*/
10+
@ToString
11+
@EqualsAndHashCode
12+
@RequiredArgsConstructor
13+
public class BufferAttributes {
14+
/**
15+
* Whether this buffer gets auto-deleted once all users leave.
16+
*/
17+
public final boolean ephemeral;
18+
}

dist/java/src/mp/code/proto/BufferNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class BufferNode {
1717
public final String path;
1818

1919
/**
20-
* Whether this buffer gets auto-deleted once all users leave.
20+
* The attributes of this buffer.
2121
*/
22-
public final boolean ephemeral;
22+
public final BufferAttributes attributes;
2323
}

dist/java/src/mp/code/proto/WorkspaceEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public class WorkspaceEvent {
2828
public final String path;
2929

3030
/**
31-
* Whether the buffer is ephemeral, or null.
31+
* The attributes of the buffer, or null.
3232
*/
33-
public final Boolean ephemeral;
33+
public final BufferAttributes attributes;
3434

3535
/**
3636
* The new path of the buffer after the rename, or null.

dist/java/src/mp/code/proto/WorkspaceEventKind.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,9 @@ public final class WorkspaceEventKind {
3636
* Event that occurs when a user leaves a buffer.
3737
*/
3838
public static final int USER_LEAVE_BUFFER = 7;
39+
40+
/**
41+
* Event that occurs when a buffer has one of its attributes changed.
42+
*/
43+
public static final int FILE_ATTRS_UPDATED = 8;
3944
}

0 commit comments

Comments
 (0)