celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rlenfer...@apache.org
Subject [celix] branch develop updated: Added check for service.imported.config and service.exported configs to RSA
Date Thu, 27 Jun 2019 18:38:23 GMT
This is an automated email from the ASF dual-hosted git repository.

rlenferink pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/develop by this push:
     new bef78e1  Added check for service.imported.config and service.exported configs to
RSA
bef78e1 is described below

commit bef78e1906f493506346321081ab3a01f529fc7e
Author: Roy Lenferink <lenferinkroy@gmail.com>
AuthorDate: Thu Jun 27 09:38:43 2019 +0200

    Added check for service.imported.config and service.exported configs to RSA
---
 bundles/remote_services/examples/CMakeLists.txt    |   4 +-
 .../calculator_service/src/calculator_activator.c  |   1 +
 .../src/remote_service_admin_dfi.c                 | 210 +++++++++++++--------
 .../test/src/rsa_tests.cpp                         |  11 +-
 .../remote_services_api/include/remote_constants.h |   1 +
 .../rsa_spi/include/remote_constants.h             |   1 +
 .../topology_manager/tms_tst/tms_tests.cpp         |  56 +++---
 7 files changed, 176 insertions(+), 108 deletions(-)

diff --git a/bundles/remote_services/examples/CMakeLists.txt b/bundles/remote_services/examples/CMakeLists.txt
index c4a029a..b0c9a5c 100644
--- a/bundles/remote_services/examples/CMakeLists.txt
+++ b/bundles/remote_services/examples/CMakeLists.txt
@@ -57,7 +57,7 @@ if (RSA_EXAMPLES)
                 Celix::log_service
                 Celix::log_writer_stdout
             PROPERTIES
-                RSA_PORT=8888
+                RSA_PORT=18888
         )
 
         add_celix_container(remote-services-dfi-client
@@ -72,7 +72,7 @@ if (RSA_EXAMPLES)
                 calculator_shell
                 Celix::rsa_discovery_etcd
             PROPERTIES
-                RSA_PORT=8889
+                RSA_PORT=28888
         )
     endif ()
 endif (RSA_EXAMPLES)
diff --git a/bundles/remote_services/examples/calculator_service/src/calculator_activator.c
b/bundles/remote_services/examples/calculator_service/src/calculator_activator.c
index 64b44fd..541162f 100644
--- a/bundles/remote_services/examples/calculator_service/src/calculator_activator.c
+++ b/bundles/remote_services/examples/calculator_service/src/calculator_activator.c
@@ -72,6 +72,7 @@ celix_status_t bundleActivator_start(void * userData, bundle_context_pt
context)
 
 			celix_properties_t *properties = celix_properties_create();
 			celix_properties_set(properties, OSGI_RSA_SERVICE_EXPORTED_INTERFACES, CALCULATOR_SERVICE);
+			celix_properties_set(properties, OSGI_RSA_SERVICE_EXPORTED_CONFIGS, CALCULATOR_CONFIGURATION_TYPE);
 			bundleContext_registerService(context, CALCULATOR_SERVICE, activator->service, properties,
&activator->calculatorReg);
 		}
 	}
diff --git a/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
index 68096fc..04de351 100644
--- a/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
+++ b/bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
@@ -29,6 +29,7 @@
 
 #include <jansson.h>
 #include "json_serializer.h"
+#include "utils.h"
 
 #include "import_registration_dfi.h"
 #include "export_registration_dfi.h"
@@ -341,7 +342,7 @@ static int remoteServiceAdmin_callback(struct mg_connection *conn) {
                 free(data);
             } else {
                 result = 0;
-                RSA_LOG_WARNING(rsa, "NO export registration found for service id %lu", serviceId);
+                RSA_LOG_WARNING(rsa, "No export registration found for service id %lu", serviceId);
             }
 
             celixThreadMutex_unlock(&rsa->exportedServicesLock);
@@ -353,74 +354,101 @@ static int remoteServiceAdmin_callback(struct mg_connection *conn)
{
 }
 
 celix_status_t remoteServiceAdmin_exportService(remote_service_admin_pt admin, char *serviceId,
celix_properties_t *properties, array_list_pt *registrations) {
-    celix_status_t status;
-
-    arrayList_create(registrations);
-    array_list_pt references = NULL;
-    service_reference_pt reference = NULL;
-    char filter [256];
+    celix_status_t status = CELIX_SUCCESS;
 
-    snprintf(filter, 256, "(%s=%s)", (char *)OSGI_FRAMEWORK_SERVICE_ID, serviceId);
+    bool export = false;
+    const char *exportConfigs = celix_properties_get(properties, OSGI_RSA_SERVICE_EXPORTED_CONFIGS,
RSA_DFI_CONFIGURATION_TYPE);
+    if (exportConfigs != NULL) {
+        // See if the EXPORT_CONFIGS matches this RSA. If so, try to export.
 
-    status = bundleContext_getServiceReferences(admin->context, NULL, filter, &references);
+        char *ecCopy = strndup(exportConfigs, strlen(exportConfigs));
+        const char delimiter[2] = ",";
+        char *token, *savePtr;
 
-    logHelper_log(admin->loghelper, OSGI_LOGSERVICE_DEBUG, "RSA: exportService called
for serviceId %s", serviceId);
+        token = strtok_r(ecCopy, delimiter, &savePtr);
+        while (token != NULL) {
+            if (strncmp(utils_stringTrim(token), RSA_DFI_CONFIGURATION_TYPE, 1024) == 0)
{
+                export = true;
+                break;
+            }
 
-    int i;
-    int size = arrayList_size(references);
-    for (i = 0; i < size; i += 1) {
-        if (i == 0) {
-            reference = arrayList_get(references, i);
-        } else {
-            bundleContext_ungetServiceReference(admin->context, arrayList_get(references,
i));
+            token = strtok_r(NULL, delimiter, &savePtr);
         }
-    }
-    arrayList_destroy(references);
 
-    if (reference == NULL) {
-        logHelper_log(admin->loghelper, OSGI_LOGSERVICE_ERROR, "ERROR: expected a reference
for service id %s.", serviceId);
-        status = CELIX_ILLEGAL_STATE;
+        free(ecCopy);
+    } else {
+        export = true;
     }
 
-    const char *exports = NULL;
-    const char *provided = NULL;
-    if (status == CELIX_SUCCESS) {
-        serviceReference_getProperty(reference, (char *) OSGI_RSA_SERVICE_EXPORTED_INTERFACES,
&exports);
-        serviceReference_getProperty(reference, (char *) OSGI_FRAMEWORK_OBJECTCLASS, &provided);
+    if (export) {
+        arrayList_create(registrations);
+        array_list_pt references = NULL;
+        service_reference_pt reference = NULL;
+        char filter[256];
+
+        snprintf(filter, 256, "(%s=%s)", (char *) OSGI_FRAMEWORK_SERVICE_ID, serviceId);
+
+        status = bundleContext_getServiceReferences(admin->context, NULL, filter, &references);
+
+        logHelper_log(admin->loghelper, OSGI_LOGSERVICE_DEBUG, "RSA: exportService called
for serviceId %s", serviceId);
 
-        if (exports == NULL || provided == NULL || strcmp(exports, provided) != 0) {
-            logHelper_log(admin->loghelper, OSGI_LOGSERVICE_WARNING, "RSA: No Services
to export.");
+        int i;
+        int size = arrayList_size(references);
+        for (i = 0; i < size; i += 1) {
+            if (i == 0) {
+                reference = arrayList_get(references, i);
+            } else {
+                bundleContext_ungetServiceReference(admin->context, arrayList_get(references,
i));
+            }
+        }
+        arrayList_destroy(references);
+
+        if (reference == NULL) {
+            logHelper_log(admin->loghelper, OSGI_LOGSERVICE_ERROR, "ERROR: expected a
reference for service id %s.",
+                          serviceId);
             status = CELIX_ILLEGAL_STATE;
-        } else {
-            logHelper_log(admin->loghelper, OSGI_LOGSERVICE_INFO, "RSA: Export service
(%s)", provided);
         }
-    }
 
-    if (status == CELIX_SUCCESS) {
-        const char *interface = provided;
-        endpoint_description_pt endpoint = NULL;
-        export_registration_pt registration = NULL;
+        const char *exports = NULL;
+        const char *provided = NULL;
+        if (status == CELIX_SUCCESS) {
+            serviceReference_getProperty(reference, (char *) OSGI_RSA_SERVICE_EXPORTED_INTERFACES,
&exports);
+            serviceReference_getProperty(reference, (char *) OSGI_FRAMEWORK_OBJECTCLASS,
&provided);
+
+            if (exports == NULL || provided == NULL || strcmp(exports, provided) != 0) {
+                logHelper_log(admin->loghelper, OSGI_LOGSERVICE_WARNING, "RSA: No Services
to export.");
+                status = CELIX_ILLEGAL_STATE;
+            } else {
+                logHelper_log(admin->loghelper, OSGI_LOGSERVICE_INFO, "RSA: Export service
(%s)", provided);
+            }
+        }
 
-        remoteServiceAdmin_createEndpointDescription(admin, reference, properties, (char*)interface,
&endpoint);
-        //TODO precheck if descriptor exists
-        status = exportRegistration_create(admin->loghelper, reference, endpoint, admin->context,
admin->logFile, &registration);
         if (status == CELIX_SUCCESS) {
-            status = exportRegistration_start(registration);
+            const char *interface = provided;
+            endpoint_description_pt endpoint = NULL;
+            export_registration_pt registration = NULL;
+
+            remoteServiceAdmin_createEndpointDescription(admin, reference, properties, (char
*) interface, &endpoint);
+            //TODO precheck if descriptor exists
+            status = exportRegistration_create(admin->loghelper, reference, endpoint,
admin->context, admin->logFile,
+                                               &registration);
             if (status == CELIX_SUCCESS) {
-                arrayList_add(*registrations, registration);
+                status = exportRegistration_start(registration);
+                if (status == CELIX_SUCCESS) {
+                    arrayList_add(*registrations, registration);
+                }
             }
         }
-    }
 
 
-    if (status == CELIX_SUCCESS) {
-        celixThreadMutex_lock(&admin->exportedServicesLock);
-        hashMap_put(admin->exportedServices, reference, *registrations);
-        celixThreadMutex_unlock(&admin->exportedServicesLock);
-    }
-    else{
-        arrayList_destroy(*registrations);
-        *registrations = NULL;
+        if (status == CELIX_SUCCESS) {
+            celixThreadMutex_lock(&admin->exportedServicesLock);
+            hashMap_put(admin->exportedServices, reference, *registrations);
+            celixThreadMutex_unlock(&admin->exportedServicesLock);
+        } else {
+            arrayList_destroy(*registrations);
+            *registrations = NULL;
+        }
     }
 
     return status;
@@ -473,6 +501,7 @@ static celix_status_t remoteServiceAdmin_createEndpointDescription(remote_servic
 
         if (serviceReference_getProperty(reference, key, &value) == CELIX_SUCCESS
             && strcmp(key, (char*) OSGI_RSA_SERVICE_EXPORTED_INTERFACES) != 0
+            && strcmp(key, (char*) OSGI_RSA_SERVICE_EXPORTED_CONFIGS) != 0
             && strcmp(key, (char*) OSGI_FRAMEWORK_OBJECTCLASS) != 0) {
             celix_properties_set(endpointProperties, key, value);
         }
@@ -496,13 +525,13 @@ static celix_status_t remoteServiceAdmin_createEndpointDescription(remote_servic
     uuid_unparse_lower(endpoint_uid, endpoint_uuid);
 
     bundleContext_getProperty(admin->context, OSGI_FRAMEWORK_FRAMEWORK_UUID, &uuid);
-    celix_properties_set(endpointProperties, (char*) OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
-    celix_properties_set(endpointProperties, (char*) OSGI_FRAMEWORK_OBJECTCLASS, interface);
-    celix_properties_set(endpointProperties, (char*) OSGI_RSA_ENDPOINT_SERVICE_ID, serviceId);
-    celix_properties_set(endpointProperties, (char*) OSGI_RSA_ENDPOINT_ID, endpoint_uuid);
-    celix_properties_set(endpointProperties, (char*) OSGI_RSA_SERVICE_IMPORTED, "true");
-    celix_properties_set(endpointProperties, (char*) OSGI_RSA_SERVICE_IMPORTED_CONFIGS, (char*)
RSA_DFI_CONFIGURATION_TYPE);
-    celix_properties_set(endpointProperties, (char*) RSA_DFI_ENDPOINT_URL, url);
+    celix_properties_set(endpointProperties, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
+    celix_properties_set(endpointProperties, OSGI_FRAMEWORK_OBJECTCLASS, interface);
+    celix_properties_set(endpointProperties, OSGI_RSA_ENDPOINT_SERVICE_ID, serviceId);
+    celix_properties_set(endpointProperties, OSGI_RSA_ENDPOINT_ID, endpoint_uuid);
+    celix_properties_set(endpointProperties, OSGI_RSA_SERVICE_IMPORTED, "true");
+    celix_properties_set(endpointProperties, OSGI_RSA_SERVICE_IMPORTED_CONFIGS, (char*) RSA_DFI_CONFIGURATION_TYPE);
+    celix_properties_set(endpointProperties, RSA_DFI_ENDPOINT_URL, url);
 
     if (props != NULL) {
         hash_map_iterator_pt propIter = hashMapIterator_create(props);
@@ -589,31 +618,60 @@ celix_status_t remoteServiceAdmin_getImportedEndpoints(remote_service_admin_pt
a
 
 celix_status_t remoteServiceAdmin_importService(remote_service_admin_pt admin, endpoint_description_pt
endpointDescription, import_registration_pt *out) {
     celix_status_t status = CELIX_SUCCESS;
-    import_registration_pt import = NULL;
 
-    const char *objectClass = properties_get(endpointDescription->properties, "objectClass");
-    const char *serviceVersion = properties_get(endpointDescription->properties, (char*)
CELIX_FRAMEWORK_SERVICE_VERSION);
+    bool importService = false;
+    const char *importConfigs = celix_properties_get(endpointDescription->properties,
OSGI_RSA_SERVICE_IMPORTED_CONFIGS, NULL);
+    if (importConfigs != NULL) {
+        // Check whether this RSA must be imported
+        char *ecCopy = strndup(importConfigs, strlen(importConfigs));
+        const char delimiter[2] = ",";
+        char *token, *savePtr;
+
+        token = strtok_r(ecCopy, delimiter, &savePtr);
+        while (token != NULL) {
+            if (strncmp(utils_stringTrim(token), RSA_DFI_CONFIGURATION_TYPE, 1024) == 0)
{
+                importService = true;
+                break;
+            }
 
-    logHelper_log(admin->loghelper, OSGI_LOGSERVICE_INFO, "RSA: Import service %s", endpointDescription->service);
-    logHelper_log(admin->loghelper, OSGI_LOGSERVICE_INFO, "Registering service factory
(proxy) for service '%s'\n", objectClass);
+            token = strtok_r(NULL, delimiter, &savePtr);
+        }
 
-    if (objectClass != NULL) {
-        status = importRegistration_create(admin->context, endpointDescription, objectClass,
serviceVersion, admin->logFile, &import);
-    }
-    if (status == CELIX_SUCCESS && import != NULL) {
-        importRegistration_setSendFn(import, (send_func_type) remoteServiceAdmin_send, admin);
+        free(ecCopy);
+    } else {
+        logHelper_log(admin->loghelper, OSGI_LOGSERVICE_WARNING, "Mandatory %s element
missing from endpoint description",
+                OSGI_RSA_SERVICE_IMPORTED_CONFIGS);
     }
 
-    if (status == CELIX_SUCCESS && import != NULL) {
-        status = importRegistration_start(import);
-    }
+    if (importService) {
+        import_registration_pt import = NULL;
 
-    celixThreadMutex_lock(&admin->importedServicesLock);
-    arrayList_add(admin->importedServices, import);
-    celixThreadMutex_unlock(&admin->importedServicesLock);
+        const char *objectClass = celix_properties_get(endpointDescription->properties,
"objectClass", NULL);
+        const char *serviceVersion = celix_properties_get(endpointDescription->properties,
CELIX_FRAMEWORK_SERVICE_VERSION, NULL);
+
+        logHelper_log(admin->loghelper, OSGI_LOGSERVICE_INFO, "RSA: Import service %s",
endpointDescription->service);
+        logHelper_log(admin->loghelper, OSGI_LOGSERVICE_INFO, "Registering service factory
(proxy) for service '%s'\n",
+                      objectClass);
+
+        if (objectClass != NULL) {
+            status = importRegistration_create(admin->context, endpointDescription, objectClass,
serviceVersion,
+                                               admin->logFile, &import);
+        }
+        if (status == CELIX_SUCCESS && import != NULL) {
+            importRegistration_setSendFn(import, (send_func_type) remoteServiceAdmin_send,
admin);
+        }
+
+        if (status == CELIX_SUCCESS && import != NULL) {
+            status = importRegistration_start(import);
+        }
 
-    if (status == CELIX_SUCCESS) {
-        *out = import;
+        celixThreadMutex_lock(&admin->importedServicesLock);
+        arrayList_add(admin->importedServices, import);
+        celixThreadMutex_unlock(&admin->importedServicesLock);
+
+        if (status == CELIX_SUCCESS) {
+            *out = import;
+        }
     }
 
     return status;
@@ -653,7 +711,7 @@ static celix_status_t remoteServiceAdmin_send(void *handle, endpoint_description
     get.size = 0;
     get.writeptr = malloc(1);
 
-    char *serviceUrl = (char*)properties_get(endpointDescription->properties, (char*)
RSA_DFI_ENDPOINT_URL);
+    const char *serviceUrl = celix_properties_get(endpointDescription->properties, (char*)
RSA_DFI_ENDPOINT_URL, NULL);
     char url[256];
     snprintf(url, 256, "%s", serviceUrl);
 
diff --git a/bundles/remote_services/remote_service_admin_dfi/test/src/rsa_tests.cpp b/bundles/remote_services/remote_service_admin_dfi/test/src/rsa_tests.cpp
index 6ae0b41..8c4afa2 100644
--- a/bundles/remote_services/remote_service_admin_dfi/test/src/rsa_tests.cpp
+++ b/bundles/remote_services/remote_service_admin_dfi/test/src/rsa_tests.cpp
@@ -36,6 +36,7 @@ extern "C" {
 #include "remote_service_admin.h"
 #include "calculator_service.h"
 
+#define TST_CONFIGURATION_TYPE "org.amdatu.remote.admin.http"
 
     static framework_pt framework = NULL;
     static bundle_context_pt context = NULL;
@@ -148,11 +149,11 @@ extern "C" {
         endpoint_description_pt endpoint = NULL;
 
         celix_properties_t *props = celix_properties_create();
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_SERVICE_ID, (char *)"42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_ID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42-42");
-        celix_properties_set(props, (char *)OSGI_FRAMEWORK_OBJECTCLASS,(char *)"org.apache.celix.Example");
-        celix_properties_set(props, (char *)"service.version",(char *)"1.0.0"); //TODO find
out standard in osgi spec
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_SERVICE_ID, "42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, "eec5404d-51d0-47ef-8d86-c825a8beda42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_ID, "eec5404d-51d0-47ef-8d86-c825a8beda42-42");
+        celix_properties_set(props, OSGI_RSA_SERVICE_IMPORTED_CONFIGS, TST_CONFIGURATION_TYPE);
+        celix_properties_set(props, OSGI_FRAMEWORK_OBJECTCLASS, "org.apache.celix.Example");
 
         rc = endpointDescription_create(props, &endpoint);
         CHECK_EQUAL(CELIX_SUCCESS, rc);
diff --git a/bundles/remote_services/remote_services_api/include/remote_constants.h b/bundles/remote_services/remote_services_api/include/remote_constants.h
index 277f837..71b15e9 100644
--- a/bundles/remote_services/remote_services_api/include/remote_constants.h
+++ b/bundles/remote_services/remote_services_api/include/remote_constants.h
@@ -26,6 +26,7 @@ static const char * const OSGI_RSA_ENDPOINT_SERVICE_ID = "endpoint.service.id";
 static const char * const OSGI_RSA_ENDPOINT_ID = "endpoint.id";
 static const char * const OSGI_RSA_SERVICE_IMPORTED = "service.imported";
 static const char * const OSGI_RSA_SERVICE_IMPORTED_CONFIGS = "service.imported.configs";
+static const char * const OSGI_RSA_SERVICE_EXPORTED_CONFIGS = "service.exported.configs";
 static const char * const OSGI_RSA_SERVICE_LOCATION = "service.location";
 
 #endif /* REMOTE_CONSTANTS_H_ */
diff --git a/bundles/remote_services/rsa_spi/include/remote_constants.h b/bundles/remote_services/rsa_spi/include/remote_constants.h
index 0736685..2b2422a 100644
--- a/bundles/remote_services/rsa_spi/include/remote_constants.h
+++ b/bundles/remote_services/rsa_spi/include/remote_constants.h
@@ -33,6 +33,7 @@ static const char * const OSGI_RSA_ENDPOINT_SERVICE_ID = "endpoint.service.id";
 static const char * const OSGI_RSA_ENDPOINT_ID = "endpoint.id";
 static const char * const OSGI_RSA_SERVICE_IMPORTED = "service.imported";
 static const char * const OSGI_RSA_SERVICE_IMPORTED_CONFIGS = "service.imported.configs";
+static const char * const OSGI_RSA_SERVICE_EXPORTED_CONFIGS = "service.exported.configs";
 static const char * const OSGI_RSA_SERVICE_LOCATION = "service.location";
 
 #endif /* REMOTE_CONSTANTS_H_ */
diff --git a/bundles/remote_services/topology_manager/tms_tst/tms_tests.cpp b/bundles/remote_services/topology_manager/tms_tst/tms_tests.cpp
index 623bb32..c0001aa 100644
--- a/bundles/remote_services/topology_manager/tms_tst/tms_tests.cpp
+++ b/bundles/remote_services/topology_manager/tms_tst/tms_tests.cpp
@@ -62,6 +62,8 @@ extern "C" {
 #define JSON_SERVICE_KEY1     "key1"
 #define JSON_SERVICE_KEY2     "key2"
 
+#define TST_CONFIGURATION_TYPE "org.amdatu.remote.admin.http"
+
     static framework_pt framework = NULL;
     static bundle_context_pt context = NULL;
 
@@ -322,7 +324,7 @@ extern "C" {
                             json_t* js_key1 = json_object_get(js_service, JSON_SERVICE_KEY1);
                             json_t* js_key2 = json_object_get(js_service, JSON_SERVICE_KEY2);
 
-                            properties=properties_create();
+                            properties = celix_properties_create();
                             if (js_serviceZone != NULL) {
                                 celix_properties_set(properties, (char*)JSON_SERVICE_ZONE,
                                                                  (char*)json_string_value(js_serviceZone));
@@ -507,12 +509,13 @@ extern "C" {
         endpoint_description_pt endpoint = NULL;
 
         celix_properties_t *props = celix_properties_create();
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_SERVICE_ID, (char *)"42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_ID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42-42");
-        celix_properties_set(props, (char *)OSGI_FRAMEWORK_OBJECTCLASS,(char *)"org.apache.celix.test.MyBundle");
-        celix_properties_set(props, (char *)"service.version",(char *)"1.0.0"); //TODO find
out standard in osgi spec
-        celix_properties_set(props, (char *)"zone", (char *)"thales");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_SERVICE_ID, "42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, "eec5404d-51d0-47ef-8d86-c825a8beda42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_ID, "eec5404d-51d0-47ef-8d86-c825a8beda42-42");
+        celix_properties_set(props, OSGI_RSA_SERVICE_IMPORTED_CONFIGS, TST_CONFIGURATION_TYPE);
+        celix_properties_set(props, OSGI_FRAMEWORK_OBJECTCLASS, "org.apache.celix.test.MyBundle");
+        celix_properties_set(props, "service.version", "1.0.0"); //TODO find out standard
in osgi spec
+        celix_properties_set(props, "zone", "thales");
 
         rc = endpointDescription_create(props, &endpoint);
         CHECK_EQUAL(CELIX_SUCCESS, rc);
@@ -549,12 +552,13 @@ extern "C" {
         endpoint_description_pt endpoint = NULL;
 
         celix_properties_t *props = celix_properties_create();
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_SERVICE_ID, (char *)"42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_ID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42-42");
-        celix_properties_set(props, (char *)OSGI_FRAMEWORK_OBJECTCLASS,(char *)"org.apache.celix.test.MyBundle");
-        celix_properties_set(props, (char *)"service.version",(char *)"1.0.0"); //TODO find
out standard in osgi spec
-        celix_properties_set(props, (char *)"zone", (char *)"thales");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_SERVICE_ID, "42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, "eec5404d-51d0-47ef-8d86-c825a8beda42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_ID, "eec5404d-51d0-47ef-8d86-c825a8beda42-42");
+        celix_properties_set(props, OSGI_RSA_SERVICE_IMPORTED_CONFIGS, TST_CONFIGURATION_TYPE);
+        celix_properties_set(props, OSGI_FRAMEWORK_OBJECTCLASS, "org.apache.celix.test.MyBundle");
+        celix_properties_set(props, "service.version", "1.0.0"); //TODO find out standard
in osgi spec
+        celix_properties_set(props, "zone", "thales");
 
         rc = endpointDescription_create(props, &endpoint);
         CHECK_EQUAL(CELIX_SUCCESS, rc);
@@ -590,12 +594,13 @@ extern "C" {
         endpoint_description_pt endpoint = NULL;
 
         celix_properties_t *props = celix_properties_create();
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_SERVICE_ID, (char *)"42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_ID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42-42");
-        celix_properties_set(props, (char *)OSGI_FRAMEWORK_OBJECTCLASS,(char *)"org.apache.celix.test.MyBundle");
-        celix_properties_set(props, (char *)"service.version",(char *)"1.0.0"); //TODO find
out standard in osgi spec
-        celix_properties_set(props, (char *)"zone", (char *)"thales");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_SERVICE_ID, "42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, "eec5404d-51d0-47ef-8d86-c825a8beda42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_ID, "eec5404d-51d0-47ef-8d86-c825a8beda42-42");
+        celix_properties_set(props, OSGI_RSA_SERVICE_IMPORTED_CONFIGS, TST_CONFIGURATION_TYPE);
+        celix_properties_set(props, OSGI_FRAMEWORK_OBJECTCLASS, "org.apache.celix.test.MyBundle");
+        celix_properties_set(props, "service.version", "1.0.0"); //TODO find out standard
in osgi spec
+        celix_properties_set(props, "zone", "thales");
 
         rc = endpointDescription_create(props, &endpoint);
         CHECK_EQUAL(CELIX_SUCCESS, rc);
@@ -631,12 +636,13 @@ extern "C" {
         endpoint_description_pt endpoint = NULL;
 
         celix_properties_t *props = celix_properties_create();
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_SERVICE_ID, (char *)"42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42");
-        celix_properties_set(props, (char *)OSGI_RSA_ENDPOINT_ID, (char *)"eec5404d-51d0-47ef-8d86-c825a8beda42-42");
-        celix_properties_set(props, (char *)OSGI_FRAMEWORK_OBJECTCLASS,(char *)"org.apache.celix.test.MyBundle");
-        celix_properties_set(props, (char *)"service.version",(char *)"1.0.0"); //TODO find
out standard in osgi spec
-        celix_properties_set(props, (char *)"zone", (char *)"thales");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_SERVICE_ID, "42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, "eec5404d-51d0-47ef-8d86-c825a8beda42");
+        celix_properties_set(props, OSGI_RSA_ENDPOINT_ID, "eec5404d-51d0-47ef-8d86-c825a8beda42-42");
+        celix_properties_set(props, OSGI_RSA_SERVICE_IMPORTED_CONFIGS, TST_CONFIGURATION_TYPE);
+        celix_properties_set(props, OSGI_FRAMEWORK_OBJECTCLASS, "org.apache.celix.test.MyBundle");
+        celix_properties_set(props, "service.version", "1.0.0"); //TODO find out standard
in osgi spec
+        celix_properties_set(props, "zone", "thales");
 
         rc = endpointDescription_create(props, &endpoint);
         CHECK_EQUAL(CELIX_SUCCESS, rc);


Mime
View raw message