-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KAA-343: Updated java sdk generation and added notification deseriali…
…zer template.
- Loading branch information
Igor Khanenko
committed
Feb 10, 2015
1 parent
2dd77a9
commit 7451408
Showing
5 changed files
with
87 additions
and
132 deletions.
There are no files selected for viewing
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
40 changes: 0 additions & 40 deletions
40
server/control/src/main/resources/sdk/java/AbstractNotificationListener.java.template
This file was deleted.
Oops, something went wrong.
84 changes: 0 additions & 84 deletions
84
server/control/src/main/resources/sdk/java/AbstractProfileContainer.java.template
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
server/control/src/main/resources/sdk/java/nf/NotificationDeserializer.java.template
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,23 @@ | ||
package org.kaaproject.kaa.client.notification; | ||
|
||
import java.io.IOException; | ||
import org.kaaproject.kaa.common.avro.AvroByteArrayConverter; | ||
import ${notification_class_package}.${notification_class}; | ||
|
||
/** | ||
* This class deserialize binary data to notification object. | ||
* | ||
* This implementation is auto-generated. Please modify corresponding template file. | ||
* | ||
* @author Andrew Shvayka | ||
* | ||
*/ | ||
public class NotificationDeserializer { | ||
|
||
private final AvroByteArrayConverter<${notification_class}> converter = new AvroByteArrayConverter<${notification_class}>(${notification_class}.class); | ||
|
||
${notification_class} fromByteArray(byte[] data) throws IOException{ | ||
return converter.fromByteArray(data); | ||
} | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
server/control/src/main/resources/sdk/java/nf/NotificationListener.java.template
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,38 @@ | ||
/* | ||
* Copyright 2014 CyberVision, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.kaaproject.kaa.client.notification; | ||
|
||
import ${notification_class_package}.${notification_class}; | ||
|
||
/** | ||
* The listener to notifications. | ||
* | ||
* @author Andrew Shvayka | ||
* | ||
*/ | ||
public interface NotificationListener { | ||
|
||
/** | ||
* Called on each new notification. | ||
* | ||
* @param topicId the topic's id. | ||
* @param notification the notification object. | ||
* | ||
*/ | ||
void onNotification(String topicId, ${notification_class} notification); | ||
|
||
} |