PIN_PASSWORD (1 << 4),
- ASYMMETRIC_ENCRYPTION_KEY (1 << 5),
-
- ;
+ ASYMMETRIC_ENCRYPTION_KEY (1 << 5);
private int value;
private CredType(int value) {
public static DeviceStatus convertDeviceStatus(int value) {
- if (1 == value)
- {
+ if (1 == value) {
return DeviceStatus.ON;
}
- else if (2 == value)
- {
+ else if (2 == value) {
return DeviceStatus.OFF;
}
- else
- {
+ else {
return DeviceStatus.INVALID;
}
}
JNI_EXCEPTION("JNI_EXCEPTION", "Generic Java binder error"),
JNI_NO_NATIVE_OBJECT("JNI_NO_NATIVE_OBJECT", ""),
JNI_INVALID_VALUE("JNI_INVALID_VALUE", ""),
- INVALID_CLASS_CAST("INVALID_CLASS_CAST", ""),;
+ INVALID_CLASS_CAST("INVALID_CLASS_CAST", "");
private String error;
private String description;
package org.iotivity.base;
public enum KeySize {
- OWNER_PSK_LENGTH_128 (128/8),
- OWNER_PSK_LENGTH_256 (256/8),;
+ OWNER_PSK_LENGTH_128 (128 / 8),
+ OWNER_PSK_LENGTH_256 (256 / 8);
private int value;
public enum MVJustWorksOptionMask {
NOT_APPLICABLE (0x0),
DISPLAY_MUTUAL_VERIF_NUM (0x1 << 0),
- CONFIRM_MUTUAL_VERIF_NUM (0x1 << 1),
- ;
+ CONFIRM_MUTUAL_VERIF_NUM (0x1 << 1);
private int value;
/**
* Client/Server mode along with Routing capabilities.
*/
- GATEWAY(3),;
+ GATEWAY(3);
private int value;
public enum ObserveAction {
REGISTER(0),
- UNREGISTER(1),;
+ UNREGISTER(1);
private int value;
public enum ObserveType {
OBSERVE(0),
- OBSERVE_ALL(1),;
+ OBSERVE_ALL(1);
private int value;
* Event listeners are notified asynchronously
*/
public interface OnPostListener {
- public void onPostCompleted(List<OcHeaderOption> headerOptionList,
- OcRepresentation ocRepresentation);
+ public void onPostCompleted(List<OcHeaderOption> headerOptionList,
+ OcRepresentation ocRepresentation);
- public void onPostFailed(Throwable ex);
+ public void onPostFailed(Throwable ex);
}
/**
public void getAclIdByDeviceListener(int result, String aclId);
}
- public interface CreateAclIdListener {
+ public interface CreateAclIdListener {
public void createAclIdListener(int result, String aclId);
}
public native void getIndividualAclInfo(String aclId,
GetIndividualAclInfoListener cloudAclIndividualGetInfoHandler) throws OcException;
- /**
+ /**
* Method to update Individual ACL info
* @param aclId ACL ID
* @param cloudAces List of cloud Aces for updation.
CT_SCOPE_ORG (0x8),
/** IPv6 Global scope.*/
- CT_SCOPE_GLOBAL (0xE),
- ;
+ CT_SCOPE_GLOBAL (0xE);
private int value;
this.mNativeHandle = nativeHandle;
}
- public OcDirectPairDevice(String deviceID)
- {
+ public OcDirectPairDevice(String deviceID) {
this.mdeviceID = deviceID;
}
- public String getDevId()
- {
+ public String getDevId() {
return this.mdeviceID;
}
public List<Integer> getPairingMethodList() {
int [] intList = this.getPairingMethods();
List<Integer> prmList = new ArrayList<Integer>();
- for (int i = 0; i < intList.length; i++)
- {
+ for (int i = 0; i < intList.length; i++) {
prmList.add(intList[i]);
}
return prmList;
public enum OcPlatformStatus {
UP(0),
- DOWN(1),;
+ DOWN(1);
private int value;
}\r
\r
public static OcPrmType convertOcPrmType(int value) {\r
- switch (value)\r
- {\r
+ switch (value) {\r
case 0:\r
return OcPrmType.DP_NOT_ALLOWED;\r
case 1:\r
*
* @param type OxmType ownership transfer type.
* @param pinCallbackListener Pin callback Listener.
- *
+ * @deprecated use {@link #setOwnershipTransferCBdata} instead.
* @throws OcException Indicate failure registering ownership transfer.
* Use OcException.GetErrorCode() for more details.
*/
public static void SetownershipTransferCBdata(OxmType type,
- PinCallbackListener pinCallbackListener) throws OcException
- {
+ PinCallbackListener pinCallbackListener) throws OcException {
OcProvisioning.ownershipTransferCBdata(type.getValue(), pinCallbackListener);
}
+ /**
+ * API for registering Ownership transfer methods for a particular
+ * transfer Type
+ *
+ * @param type OxmType ownership transfer type.
+ * @param pinCallbackListener Pin callback Listener.
+ *
+ * @throws OcException Indicate failure registering ownership transfer.
+ * Use OcException.GetErrorCode() for more details.
+ */
+ public static void setOwnershipTransferCBdata(OxmType type,
+ PinCallbackListener pinCallbackListener) throws OcException {
+ OcProvisioning.ownershipTransferCBdata(type.getValue(), pinCallbackListener);
+ }
private static native void ownershipTransferCBdata(int oxmType, PinCallbackListener pinCallbackListener);
public static interface PinCallbackListener {
*/
public static List<OcSecureResource> discoverMOTEnabledDevices(int timeout)
throws OcException {
- return Arrays.asList(OcProvisioning.discoverMOTEnabledDevices1(timeout));
- }
+ return Arrays.asList(OcProvisioning.discoverMOTEnabledDevices1(timeout));
+ }
private static native OcSecureResource[] discoverMOTEnabledDevices1(int timeout)
throws OcException;
*/
public static List<OcSecureResource> discoverMOTEnabledOwnedDevices(int timeout)
throws OcException {
- return Arrays.asList(OcProvisioning.discoverMOTEnabledOwnedDevices1(timeout));
- }
+ return Arrays.asList(OcProvisioning.discoverMOTEnabledOwnedDevices1(timeout));
+ }
private static native OcSecureResource[] discoverMOTEnabledOwnedDevices1(int timeout)
throws OcException;
* Use OcException.GetErrorCode() for more details.
*/
public static int saveTrustCertChain(byte[] trustCertChain, EncodingType encodingType) throws OcException {
- return saveTrustCertChain1(trustCertChain,encodingType.getValue());
+ return saveTrustCertChain1(trustCertChain, encodingType.getValue());
}
private static native int saveTrustCertChain1(byte[] trustCertChain, int encodingType)
throws OcException;
public final class OcRDClient {
private static QualityOfService sPlatformQualityOfService = QualityOfService.NA;
- private OcRDClient()
- {
+ private OcRDClient() {
}
/**
* API to publish resource to remote resource-directory.
* @param host Host Address of a service to publish resource.
* @param connectivityTypeSet Set of types of connectivity. Example: IP
* @param ocResourceHandleList reference to list of resource handles to be published.
- * @param onDeleteResourceListener Handles events, success states and failure states.
+ * @param onDeleteResourceListener Handles events, success states and failure states.
* @throws OcException if failure
*/
public static void deleteResourceFromRD(
* @return New host Address.
* Not observable.
*/
- public native String setHost(String host);
+ public native String setHost(String host);
/**
* Method to get the list of resource types
boolean edp , ProvisionDirectPairingListener provisionDirectPairingListener)
throws OcException {
- int[] typeArray = new int[type.size()];
- int i = 0;
- for (OcPrmType ocPrmType:type) {
- typeArray[i++] = ocPrmType.getValue();
- }
-
- this.provisionDirectPairing(pin, pdacls, typeArray, (edp?1:0),
- provisionDirectPairingListener);
+ int[] typeArray = new int[type.size()];
+ int i = 0;
+ for (OcPrmType ocPrmType:type) {
+ typeArray[i++] = ocPrmType.getValue();
}
+ this.provisionDirectPairing(pin, pdacls, typeArray, (edp ? 1: 0), provisionDirectPairingListener);
+ }
+
private native void provisionDirectPairing(String pin, OicSecPdAcl[] pdacls, int[] type,
int edp , ProvisionDirectPairingListener provisionDirectPairingListener)
throws OcException;
int hasError);
}
- /**
+ /**
* provisionTrustCertChainListener can be registered with ProvisionTrustCertChainListener
* call.
* Listener notified asynchronously.
*
* @return Sring List List of device id's of linked devices.
*/
- public native List<String> getLinkedDevices();
+ public native List<String> getLinkedDevices();
/**
* Method to get IP address of sercure discovered device.
import java.util.List;
public class OicSecAce {
- private String subjectID;
- private int permission;
- private List<OicSecResr> resources;
- private List<OicSecValidity> validities;
+ private String subjectID;
+ private int permission;
+ private List<OicSecResr> resources;
+ private List<OicSecValidity> validities;
- public OicSecAce(String subjectID, int permission,
- List<OicSecResr> resources, List<OicSecValidity> validities) {
- super();
- this.subjectID = subjectID;
- this.permission = permission;
- this.resources = resources;
- this.validities = validities;
- }
+ public OicSecAce(String subjectID, int permission,
+ List<OicSecResr> resources, List<OicSecValidity> validities) {
+ super();
+ this.subjectID = subjectID;
+ this.permission = permission;
+ this.resources = resources;
+ this.validities = validities;
+ }
- public String getSubjectID() {
- return subjectID;
- }
+ public String getSubjectID() {
+ return subjectID;
+ }
- public void setSubjectID(String subjectID) {
- this.subjectID = subjectID;
- }
+ public void setSubjectID(String subjectID) {
+ this.subjectID = subjectID;
+ }
- public int getPermission() {
- return permission;
- }
+ public int getPermission() {
+ return permission;
+ }
- public void setPermission(int permission) {
- this.permission = permission;
- }
+ public void setPermission(int permission) {
+ this.permission = permission;
+ }
- public List<OicSecResr> getResourcesList() {
- return resources;
- }
+ public List<OicSecResr> getResourcesList() {
+ return resources;
+ }
- public OicSecResr[] getResources() {
- return resources.toArray(new OicSecResr[resources.size()]);
- }
- public void setResources(List<OicSecResr> resources) {
- this.resources = resources;
- }
+ public OicSecResr[] getResources() {
+ return resources.toArray(new OicSecResr[resources.size()]);
+ }
+ public void setResources(List<OicSecResr> resources) {
+ this.resources = resources;
+ }
- public List<OicSecValidity> getValiditiesList() {
- return validities;
- }
+ public List<OicSecValidity> getValiditiesList() {
+ return validities;
+ }
- public OicSecValidity[] getValidities() {
- return validities.toArray(new OicSecValidity[validities.size()]);
- }
+ public OicSecValidity[] getValidities() {
+ return validities.toArray(new OicSecValidity[validities.size()]);
+ }
- public void setValidities(List<OicSecValidity> validities) {
- this.validities = validities;
- }
+ public void setValidities(List<OicSecValidity> validities) {
+ this.validities = validities;
+ }
}
private String rownerID;\r
private List<OicSecAce> oicSecAces;\r
\r
- public OicSecAcl (String rownerID, List<OicSecAce> oicSecAces) {\r
- super();\r
- this.rownerID = rownerID;\r
- this.oicSecAces = oicSecAces;\r
- }\r
+ public OicSecAcl (String rownerID, List<OicSecAce> oicSecAces) {\r
+ super();\r
+ this.rownerID = rownerID;\r
+ this.oicSecAces = oicSecAces;\r
+ }\r
public String getRownerID() {\r
return rownerID;\r
}\r
import java.util.List;
public class OicSecCloudAce {
- private String aclID;
- private String subjectID;
- private int stype;
- private int permission;
- private List<OicSecResr> resources;
- private List<OicSecValidity> validities;
-
- public OicSecCloudAce(String aclID, String subjectID, int stype, int permission,
- List<OicSecResr> resources, List<OicSecValidity> validities) {
- super();
- this.subjectID = subjectID;
- this.permission = permission;
- this.resources = resources;
- this.validities = validities;
- }
-
- public String getAclID() {
- return aclID;
- }
-
- public String getSubjectID() {
- return subjectID;
- }
-
- public void setAclID(String aclID) {
- this.aclID = aclID;
- }
-
- public void setSubjectID(String subjectID) {
- this.subjectID = subjectID;
- }
-
- public int getStype() {
- return stype;
- }
-
- public void setStype(int stype) {
- this.stype = stype;
- }
-
-
- public int getPermission() {
- return permission;
- }
-
- public void setPermission(int permission) {
- this.permission = permission;
- }
-
- public List<OicSecResr> getResourcesList() {
- return resources;
- }
-
- public OicSecResr[] getResources() {
- return resources.toArray(new OicSecResr[resources.size()]);
- }
- public void setResources(List<OicSecResr> resources) {
- this.resources = resources;
- }
-
- public List<OicSecValidity> getValiditiesList() {
- return validities;
- }
-
- public OicSecValidity[] getValidities() {
- return validities.toArray(new OicSecValidity[validities.size()]);
- }
-
- public void setValidities(List<OicSecValidity> validities) {
- this.validities = validities;
- }
+ private String aclID;
+ private String subjectID;
+ private int stype;
+ private int permission;
+ private List<OicSecResr> resources;
+ private List<OicSecValidity> validities;
+
+ public OicSecCloudAce(String aclID, String subjectID, int stype, int permission,
+ List<OicSecResr> resources, List<OicSecValidity> validities) {
+ super();
+ this.subjectID = subjectID;
+ this.permission = permission;
+ this.resources = resources;
+ this.validities = validities;
+ }
+
+ public String getAclID() {
+ return aclID;
+ }
+
+ public String getSubjectID() {
+ return subjectID;
+ }
+
+ public void setAclID(String aclID) {
+ this.aclID = aclID;
+ }
+
+ public void setSubjectID(String subjectID) {
+ this.subjectID = subjectID;
+ }
+
+ public int getStype() {
+ return stype;
+ }
+
+ public void setStype(int stype) {
+ this.stype = stype;
+ }
+
+
+ public int getPermission() {
+ return permission;
+ }
+
+ public void setPermission(int permission) {
+ this.permission = permission;
+ }
+
+ public List<OicSecResr> getResourcesList() {
+ return resources;
+ }
+
+ public OicSecResr[] getResources() {
+ return resources.toArray(new OicSecResr[resources.size()]);
+ }
+ public void setResources(List<OicSecResr> resources) {
+ this.resources = resources;
+ }
+
+ public List<OicSecValidity> getValiditiesList() {
+ return validities;
+ }
+
+ public OicSecValidity[] getValidities() {
+ return validities.toArray(new OicSecValidity[validities.size()]);
+ }
+
+ public void setValidities(List<OicSecValidity> validities) {
+ this.validities = validities;
+ }
}
import java.util.List;
public class OicSecResr {
- private String href;
- private String rel;
- private List<String> types;
- private int typeLen;
- private List<String> interfaces;
- private int interfaceLen;
-
- public OicSecResr(String href, String rel, List<String> types, int typeLen,
- List<String> interfaces, int interfaceLen) {
- super();
- this.href = href;
- this.rel = rel;
- this.types = types;
- this.typeLen = typeLen;
- this.interfaces = interfaces;
- this.interfaceLen = interfaceLen;
- }
-
- public String getHref() {
- return href;
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
- public String getRel() {
- return rel;
- }
-
- public void setRel(String rel) {
- this.rel = rel;
- }
-
- public List<String> getTypesList() {
- return types;
- }
-
- public void setTypes(List<String> types) {
- this.types = types;
- }
-
- public int getTypeLen() {
- return typeLen;
- }
-
- public void setTypeLen(int typeLen) {
- this.typeLen = typeLen;
- }
-
- public List<String> getInterfacesList() {
- return interfaces;
- }
-
- public String getInterfaces(int i) {
- return this.interfaces.get(i);
- }
-
- public String getTypes(int i) {
- return this.types.get(i);
- }
-
- public void setInterfaces(List<String> interfaces) {
- this.interfaces = interfaces;
- }
-
- public int getInterfaceLen() {
- return interfaceLen;
- }
-
- public void setInterfaceLen(int interfaceLen) {
- this.interfaceLen = interfaceLen;
- }
+ private String href;
+ private String rel;
+ private List<String> types;
+ private int typeLen;
+ private List<String> interfaces;
+ private int interfaceLen;
+
+ public OicSecResr(String href, String rel, List<String> types, int typeLen,
+ List<String> interfaces, int interfaceLen) {
+ super();
+ this.href = href;
+ this.rel = rel;
+ this.types = types;
+ this.typeLen = typeLen;
+ this.interfaces = interfaces;
+ this.interfaceLen = interfaceLen;
+ }
+
+ public String getHref() {
+ return href;
+ }
+
+ public void setHref(String href) {
+ this.href = href;
+ }
+
+ public String getRel() {
+ return rel;
+ }
+
+ public void setRel(String rel) {
+ this.rel = rel;
+ }
+
+ public List<String> getTypesList() {
+ return types;
+ }
+
+ public void setTypes(List<String> types) {
+ this.types = types;
+ }
+
+ public int getTypeLen() {
+ return typeLen;
+ }
+
+ public void setTypeLen(int typeLen) {
+ this.typeLen = typeLen;
+ }
+
+ public List<String> getInterfacesList() {
+ return interfaces;
+ }
+
+ public String getInterfaces(int i) {
+ return this.interfaces.get(i);
+ }
+
+ public String getTypes(int i) {
+ return this.types.get(i);
+ }
+
+ public void setInterfaces(List<String> interfaces) {
+ this.interfaces = interfaces;
+ }
+
+ public int getInterfaceLen() {
+ return interfaceLen;
+ }
+
+ public void setInterfaceLen(int interfaceLen) {
+ this.interfaceLen = interfaceLen;
+ }
}
import java.util.List;
public class OicSecValidity {
- private String period;
- private List<String> recurrences;
- private int recurrenceLen;
+ private String period;
+ private List<String> recurrences;
+ private int recurrenceLen;
- public OicSecValidity(String period, List<String> recurrences,
- int recurrenceLen) {
- super();
- this.period = period;
- this.recurrences = recurrences;
- this.recurrenceLen = recurrenceLen;
- }
+ public OicSecValidity(String period, List<String> recurrences,
+ int recurrenceLen) {
+ super();
+ this.period = period;
+ this.recurrences = recurrences;
+ this.recurrenceLen = recurrenceLen;
+ }
- public String getPeriod() {
- return period;
- }
+ public String getPeriod() {
+ return period;
+ }
- public void setPeriod(String period) {
- this.period = period;
- }
+ public void setPeriod(String period) {
+ this.period = period;
+ }
- public List<String> getRecurrencesList() {
- return recurrences;
- }
+ public List<String> getRecurrencesList() {
+ return recurrences;
+ }
- public String getRecurrences(int i) {
- return this.recurrences.get(i);
- }
+ public String getRecurrences(int i) {
+ return this.recurrences.get(i);
+ }
- public void setRecurrences(List<String> recurrences) {
- this.recurrences = recurrences;
- }
+ public void setRecurrences(List<String> recurrences) {
+ this.recurrences = recurrences;
+ }
- public int getRecurrenceLen() {
- return recurrenceLen;
- }
+ public int getRecurrenceLen() {
+ return recurrenceLen;
+ }
- public void setRecurrenceLen(int recurrenceLen) {
- this.recurrenceLen = recurrenceLen;
- }
+ public void setRecurrenceLen(int recurrenceLen) {
+ this.recurrenceLen = recurrenceLen;
+ }
}
public static OwnedStatus convertOwnedStatus(int value) {
- if (0 == value)
- {
+ if (0 == value) {
return OwnedStatus.UNOWNED;
}
- else if (1 == value)
- {
+ else if (1 == value) {
return OwnedStatus.OWNED;
}
- else
- {
+ else {
return OwnedStatus.INVALID;
}
}
public enum PinType {
NUM_PIN (0x1 << 0),
UPPERCASE_CHAR_PIN (0x1 << 1),
- LOWERCASE_CHAR_PIN (0x1 << 2),
- ;
+ LOWERCASE_CHAR_PIN (0x1 << 2);
private int value;
private String mDeviceId;
private int mResult;
- public ProvisionResult(String deviceId, int result)
- {
+ public ProvisionResult(String deviceId, int result) {
this.mDeviceId = deviceId;
this.mResult = result;
}
- public String getDevId()
- {
+ public String getDevId() {
return this.mDeviceId;
}
- public int getResult()
- {
+ public int getResult() {
return this.mResult;
}
}
public enum RequestHandlerFlag {
INIT(1 << 0),
REQUEST(1 << 1),
- OBSERVER(1 << 2),;
+ OBSERVER(1 << 2);
private int value;
GET("GET"),
PUT("PUT"),
POST("POST"),
- DELETE("DELETE"),;
+ DELETE("DELETE");
private String value;
private RequestType(String value) {
* if discovery request contains an explicit querystring.
* Ex: GET /oic/res?rt=oic.sec.acl
*/
- EXPLICIT_DISCOVERABLE(1 << 5),;
+ EXPLICIT_DISCOVERABLE(1 << 5);
private int value;
public enum ServiceType {
IN_PROC(0),
- OUT_OF_PROC(1),;
+ OUT_OF_PROC(1);
private int value;