-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
095f428
commit b19a575
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
at_client/src/main/java/org/atsign/client/api/impl/clients/NotificationServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package org.atsign.client.api.impl.clients; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
|
||
import org.atsign.client.api.AtClient; | ||
import org.atsign.client.api.notification.AtNotification; | ||
import org.atsign.client.api.notification.NotificationParams; | ||
import org.atsign.client.api.notification.NotificationResult; | ||
import org.atsign.client.api.notification.NotificationService; | ||
import org.atsign.client.util.AtClientValidation; | ||
import org.atsign.common.AtSign; | ||
import org.atsign.common.NotificationStatus; | ||
|
||
public class NotificationServiceImpl implements NotificationService { | ||
|
||
private final AtClient atClient; | ||
|
||
public NotificationServiceImpl(AtClient atClient) { | ||
this.atClient = atClient; | ||
} | ||
|
||
@Override | ||
public CompletableFuture<Object> subscribe(String regex, boolean shouldDecrypt) { | ||
throw new IllegalCallerException("Not implemented yet"); | ||
} | ||
|
||
@Override | ||
|
||
public CompletableFuture<NotificationResult> notify(NotificationParams params) { | ||
|
||
return CompletableFuture.supplyAsync(() -> { | ||
NotificationResult result = new NotificationResult(params.getNotificationId(), params.getAtKey(), NotificationStatus.undelivered); | ||
if(params.getAtKey().sharedBy == null) { | ||
params.getAtKey().sharedBy = atClient.getAtSign(); | ||
} | ||
|
||
return result; | ||
}); | ||
|
||
|
||
} | ||
|
||
@Override | ||
public CompletableFuture<NotificationResult> getStatus(String notificationId) { | ||
throw new IllegalCallerException("Not implemented yet"); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<List<AtNotification>> notifyList() { | ||
throw new IllegalCallerException("Not implemented yet"); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<NotificationResult> notifyDelete(String notificationId) { | ||
throw new IllegalCallerException("Not implemented yet"); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<NotificationResult> notifyDeleteAll() { | ||
throw new IllegalCallerException("Not implemented yet"); | ||
} | ||
|
||
} |