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
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21
22 /**
23  * @file
24  * This file contains RCSBundleInfo class, which provides APIs related to Bundle information.
25  */
26 package org.iotivity.service.resourcecontainer;
27
28 /**
29  * This class provides APIs for getting and setting the Bundle Information
30  */
31 public class RcsBundleInfo {
32     private final String mId;
33     private final String mPath;
34     private final String mActivatorName;
35     private final String mLibraryPath;
36     private final String mVersion;
37     private boolean mActivated; // not final since it might be modified for Android-specific bundles
38
39     private RcsBundleInfo(String id, String path, String activatorName,
40             String libraryPath, String version) {
41         mId = id;
42         mPath = path;
43         mActivatorName = activatorName;
44         mLibraryPath = libraryPath;
45         mVersion = version;
46         mActivated = false;
47     }
48
49     private RcsBundleInfo(String id, String path, String activatorName,
50             String libraryPath, String version, boolean activated) {
51         mId = id;
52         mPath = path;
53         mActivatorName = activatorName;
54         mLibraryPath = libraryPath;
55         mVersion = version;
56         mActivated = activated;
57     }
58
59     /**
60      * API for getting the Id of the bundle
61      *
62      * @return string - Id of the bundle
63      *
64      */
65     public String getID() {
66         return mId;
67     }
68
69     /**
70      * API for getting the path of the bundle
71      *
72      * @return path - path of the bundle
73      *
74      */
75     public String getPath() {
76         return mPath;
77     }
78
79     /**
80      * API for setting the Activator name for the bundle
81      *
82      * @return string - Name of the activator
83      *
84      */
85     public String getActivatorName() {
86         return mActivatorName;
87     }
88
89     /**
90      * API for getting the library path for the bundle
91      *
92      * @return string - Library path in string form
93      *
94      */
95     public String getLibraryPath() {
96         return mLibraryPath;
97     }
98
99     /**
100      * API for getting the version of the bundle
101      *
102      * @return string - version of the bundle
103      *
104      */
105     public String getVersion() {
106         return mVersion;
107     }
108     
109     /**
110      * Returns the current activation status of the bundle
111      *
112      * @return boolean - bundle has been successfully loaded and started
113      *
114      */
115     public boolean isActivated() {
116         return mActivated;
117     }
118
119     /**
120      * Set the current activation status of the bundle
121      *
122      * @return boolean - bundle has been successfully loaded and started
123      *
124      */
125     protected void setActivated(boolean activated) {
126         mActivated = activated;
127     }
128 }