Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Use constant for Strings
Browse files Browse the repository at this point in the history
  • Loading branch information
sameerawickramasekara committed Sep 22, 2017
1 parent 5394524 commit 57bea59
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.apimgt.annotations.api.Scopes;

import ${groupId}.${rootArtifactId}.plugin.constants.DeviceTypeConstants;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Path;
import javax.ws.rs.Consumes;
Expand All @@ -51,22 +52,22 @@
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name", value = "${deviceType}"),
@ExtensionProperty(name = "context", value = "/${deviceType}"),
@ExtensionProperty(name = "name", value = DeviceTypeConstants.DEVICE_TYPE),
@ExtensionProperty(name = "context", value = "/"+DeviceTypeConstants.DEVICE_TYPE),
})
}
),
tags = {
@Tag(name = "${deviceType},device_management", description = "")
@Tag(name = DeviceTypeConstants.DEVICE_TYPE+",device_management", description = "")
}
)
@Scopes(
scopes = {
@Scope(
name = "Enroll device",
description = "",
key = "perm:${deviceType}:enroll",
permissions = {"/device-mgt/devices/enroll/${deviceType}"}
key = "perm:" + DeviceTypeConstants.DEVICE_TYPE + ":enroll",
permissions = {"/device-mgt/devices/enroll/" + DeviceTypeConstants.DEVICE_TYPE }
)
}
)
Expand All @@ -86,10 +87,10 @@ public interface DeviceTypeService {
value = "Switch Status",
notes = "",
response = Response.class,
tags = "${deviceType}",
tags = DeviceTypeConstants.DEVICE_TYPE ,
extensions = {
@Extension(properties = {
@ExtensionProperty(name = SCOPE, value = "perm:${deviceType}:enroll")
@ExtensionProperty(name = SCOPE, value = "perm:" + DeviceTypeConstants.DEVICE_TYPE + ":enroll")
})
}
)
Expand All @@ -115,10 +116,10 @@ Response changeStatus(@PathParam("deviceId") String deviceId,
value = "Sensor Stats",
notes = "",
response = Response.class,
tags = "${deviceType}",
tags = DeviceTypeConstants.DEVICE_TYPE,
extensions = {
@Extension(properties = {
@ExtensionProperty(name = SCOPE, value = "perm:${deviceType}:enroll")
@ExtensionProperty(name = SCOPE, value = "perm:" + DeviceTypeConstants.DEVICE_TYPE + ":enroll")
})
}
)
Expand All @@ -141,10 +142,10 @@ Response getSensorStats(@PathParam("deviceId") String deviceId, @QueryParam("fro
value = "Download agent",
notes = "",
response = Response.class,
tags = "${deviceType}",
tags = DeviceTypeConstants.DEVICE_TYPE ,
extensions = {
@Extension(properties = {
@ExtensionProperty(name = SCOPE, value = "perm:${deviceType}:enroll")
@ExtensionProperty(name = SCOPE, value = "perm:" + DeviceTypeConstants.DEVICE_TYPE + ":enroll")
})
}
)
Expand Down

0 comments on commit 57bea59

Please sign in to comment.