public interface CepApi
Modifier and Type | Method and Description |
---|---|
CepModuleRepresentation |
create(InputStream content)
Deprecated.
|
CepModuleRepresentation |
create(String content)
Creates an cep module in the platform.
|
void |
delete(CepModuleRepresentation module)
Deletes the cep module from the platform.
|
void |
delete(String id)
Deletes the cep module from the platform.
|
CepModuleRepresentation |
get(String id)
Gets an cep module by id
|
CepCustomNotificationsSubscriber |
getCustomNotificationsSubscriber()
Gets the notifications subscriber, which allows to receive notifications sent from cep.
|
CepModuleCollection |
getModules()
Gets all cep modules from the platform
|
String |
getText(String id)
Gets a cep module text by id
|
<T> T |
health(Class<T> clazz)
Checks state of cep microservice.
|
CepModuleRepresentation |
update(CepModuleRepresentation module) |
CepModuleRepresentation |
update(String id,
InputStream content)
Updates an cep module in the platform.
|
CepModuleRepresentation |
update(String id,
String content) |
CepCustomNotificationsSubscriber getCustomNotificationsSubscriber()
Example:
Subscriber<String, Object> subscriber = deviceControlApi.getNotificationsSubscriber();
subscriber.subscribe( "channelId" , new SubscriptionListener<String, Object>() {
@Override
public void onNotification(Subscription<GId> subscription, Object operation) {
//process notification from cep module
}
@Override
public void onError(Subscription<GId> subscription, Throwable ex) {
// handle subscribe error
}
});
SDKException
- when subscriber creation failCepModuleRepresentation get(String id)
id
- of the cep module to search forSDKException
- if the cep module is not found or if the query failedString getText(String id)
id
- of the cep module to search forSDKException
- if the cep module is not found or if the query failed@Deprecated CepModuleRepresentation create(InputStream content)
content
- input stream to resource with cep module definitionSDKException
- if the cep module could not be createdCepModuleRepresentation create(String content)
content
- of cep module definitionSDKException
- if the cep module could not be createdCepModuleRepresentation update(String id, InputStream content)
id
- of cep module to updatecontent
- input stream to resource with cep module definitionSDKException
- if the cep module could not be updatedCepModuleRepresentation update(String id, String content)
CepModuleRepresentation update(CepModuleRepresentation module)
CepModuleCollection getModules()
SDKException
- if the query failedvoid delete(CepModuleRepresentation module)
module
- cep module to deleteSDKException
- when delete of cep module failvoid delete(String id)
id
- identifier of cep module to deleteSDKException
- when delete of cep module fail<T> T health(Class<T> clazz)
T
- generic type of class resultclazz
- expected class resultCopyright © 2020 (C) Cumulocity GmbH. All rights reserved.