RC android: load bundle classes from library
[platform/upstream/iotivity.git] / service / resource-container / android / resource-container / src / main / java / org / iotivity / service / resourcecontainer / RcsBundleInfo.java
index 11e3112..5d2964f 100644 (file)
@@ -34,6 +34,7 @@ public class RcsBundleInfo {
     private final String mActivatorName;
     private final String mLibraryPath;
     private final String mVersion;
+    private boolean mActivated; // not final since it might be modified for Android-specific bundles
 
     private RcsBundleInfo(String id, String path, String activatorName,
             String libraryPath, String version) {
@@ -42,13 +43,24 @@ public class RcsBundleInfo {
         mActivatorName = activatorName;
         mLibraryPath = libraryPath;
         mVersion = version;
+        mActivated = false;
+    }
+
+    private RcsBundleInfo(String id, String path, String activatorName,
+            String libraryPath, String version, boolean activated) {
+        mId = id;
+        mPath = path;
+        mActivatorName = activatorName;
+        mLibraryPath = libraryPath;
+        mVersion = version;
+        mActivated = activated;
     }
 
     /**
      * API for getting the Id of the bundle
-     * 
+     *
      * @return string - Id of the bundle
-     * 
+     *
      */
     public String getID() {
         return mId;
@@ -56,9 +68,9 @@ public class RcsBundleInfo {
 
     /**
      * API for getting the path of the bundle
-     * 
+     *
      * @return path - path of the bundle
-     * 
+     *
      */
     public String getPath() {
         return mPath;
@@ -66,9 +78,9 @@ public class RcsBundleInfo {
 
     /**
      * API for setting the Activator name for the bundle
-     * 
+     *
      * @return string - Name of the activator
-     * 
+     *
      */
     public String getActivatorName() {
         return mActivatorName;
@@ -76,9 +88,9 @@ public class RcsBundleInfo {
 
     /**
      * API for getting the library path for the bundle
-     * 
+     *
      * @return string - Library path in string form
-     * 
+     *
      */
     public String getLibraryPath() {
         return mLibraryPath;
@@ -86,12 +98,31 @@ public class RcsBundleInfo {
 
     /**
      * API for getting the version of the bundle
-     * 
+     *
      * @return string - version of the bundle
-     * 
+     *
      */
     public String getVersion() {
         return mVersion;
     }
+    
+    /**
+     * Returns the current activation status of the bundle
+     *
+     * @return boolean - bundle has been successfully loaded and started
+     *
+     */
+    public boolean isActivated() {
+        return mActivated;
+    }
 
+    /**
+     * Set the current activation status of the bundle
+     *
+     * @return boolean - bundle has been successfully loaded and started
+     *
+     */
+    protected void setActivated(boolean activated) {
+        mActivated = activated;
+    }
 }