1 package org.iotivity.service.ssm;
5 public class CoreController {
8 String workingPath = System.getProperty("user.dir");
10 // for android: not complete method
11 if (System.getProperty("os.name").toLowerCase().equals("linux")) {
12 // System.out.println("System load Android library");
13 System.loadLibrary("oc_logger");
14 System.loadLibrary("coap");
15 System.loadLibrary("octbstack");
16 System.loadLibrary("oc");
17 System.loadLibrary("SSMCore");
19 // System.out.println("System load 32bit library");
20 System.load(workingPath + "SSMCore_Windows.dll");
22 } catch (UnsatisfiedLinkError e) {
23 System.out.println(e.getMessage());
27 static private CoreController coreController;
29 public static CoreController getInstance() {
30 if (coreController == null)
31 coreController = new CoreController();
33 return coreController;
36 public native void InitializeSSMCore(String xmlDescription)
39 public native void StartSSMCore() throws Exception;
41 public native void StopSSMCore() throws Exception;
43 public native void TerminateSSMCore() throws Exception;
45 public native QueryEngine CreateQueryEngine() throws Exception;
47 public native int ReleaseQueryEngine(QueryEngine queryEngine);
50 public native int ExecuteContextQuery(int pQueryEngineInstance,
51 String contextQuery) throws Exception;
53 public native void RegisterQueryEvent(int pQueryEngineInstance,
54 IQueryEngineEvent queryEngineEvent);
56 public native void KillContextQuery(int pQueryEngineInstance, int cqid)
59 // public native void UnregiterQueryEvent(int pQueryEngineInstance,
60 // IQueryEngineEvent queryEngineEvent);
63 public native int GetDataId(int pIModelDataInstance);
65 public native int GetPropertyCount(int pIModelDataInstance);
67 public native String GetPropertyName(int pIModelDataInstance,
70 public native String GetPropertyValue(int pIModelDataInstance,
74 public native List<String> GetAffectedModels(int pDataReaderInstance);
76 public native int GetModelDataCount(int pDataReaderInstance,
77 String modelName) throws Exception;
79 public native ModelData GetModelData(int pDataReaderInstance,
80 String modelName, int dataIndex) throws Exception;
82 public native void RegisterReportReceiver(IReportReceiver reportReceiver);