Skip to content

Commit 6529949

Browse files
authored
Merge pull request #16 from cryptlex/muneeb/Get-FloatingClient-LeaseExpiryDate
feat: Add GetFloatingClientLeaseExpiryDate() method
2 parents 78ec5e1 + d46559a commit 6529949

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/main/java/com/cryptlex/lexfloatclient/LexFloatClient.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,24 @@ public static void SetFloatingClientMetadata(String key, String value) throws Le
113113
}
114114
}
115115

116+
/**
117+
* Gets the lease expiry date timestamp of the floating client.
118+
*
119+
* @return Returns the timestamp
120+
* @throws LexFloatClientException
121+
*/
122+
public static int GetFloatingClientLeaseExpiryDate() throws LexFloatClientException {
123+
int status;
124+
IntByReference expiryDate = new IntByReference(0);
125+
status = LexFloatClientNative.GetFloatingClientLeaseExpiryDate(expiryDate);
126+
switch (status) {
127+
case LF_OK:
128+
return expiryDate.getValue();
129+
default:
130+
throw new LexFloatClientException(status);
131+
}
132+
}
133+
116134
/**
117135
* Gets the version of this library.
118136
*

src/main/java/com/cryptlex/lexfloatclient/LexFloatClientNative.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public interface CallbackType extends Callback {
3535

3636
public static native int SetFloatingClientMetadata(WString key, WString value);
3737

38+
public static native int GetFloatingClientLeaseExpiryDate(IntByReference expiryDate);
39+
3840
public static native int GetFloatingClientLibraryVersion(ByteBuffer libraryVersion, int length);
3941

4042
public static native int GetFloatingClientLibraryVersion(CharBuffer libraryVersion, int length);

0 commit comments

Comments
 (0)