Merge pull request #92 from charithag/master

Fix issues
merge-requests/1/head
Charitha Goonetilleke 9 years ago
commit 898634e01e

@ -1,8 +1,7 @@
{
"deviceType": {
"label": "Smart Meeter",
"category": "virtual"
"category": "iot"
},
"analyticStreams": [
{

@ -224,10 +224,5 @@
<artifactId>org.wso2.carbon.user.core</artifactId>
<version>4.4.3</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.user.core</artifactId>
<version>4.4.3</version>
</dependency>
</dependencies>
</project>

@ -58,16 +58,17 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.*;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@API(name = "doormanager", version = "1.0.0", context = "/doormanager")
@DeviceType(value = "doormanager")
public class DoorManagerControllerService {
private static final DoorManagerDAO DOOR_MANAGER_DAO = new DoorManagerDAO();
@Context //injected response proxy supporting multiple thread
private static Log log = LogFactory.getLog(DoorManagerControllerService.class);
private HttpServletResponse response;
@ -76,6 +77,8 @@ public class DoorManagerControllerService {
private PrivilegedCarbonContext ctx;
@Context //injected response proxy supporting multiple thread
private UserStoreManager getUserStoreManager() throws UserStoreException {
String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
PrivilegedCarbonContext.startTenantFlow();
@ -163,6 +166,7 @@ public class DoorManagerControllerService {
claims.put("http://wso2.org/claims/lock/cardnumber", cardNumber);
userStoreManager.setUserClaimValues(userName, claims, null);
//TODO: Add content to dto
response.setStatus(Response.Status.OK.getStatusCode());
} else {
response.setStatus(Response.Status.NOT_FOUND.getStatusCode());
}
@ -170,8 +174,7 @@ public class DoorManagerControllerService {
response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
log.error(e);
}
}
else {
} else {
response.setStatus(Response.Status.BAD_REQUEST.getStatusCode());
}

@ -57,7 +57,6 @@ public class DoorManagerDAOImpl {
stmt = conn.prepareStatement(selectDBQuery);
stmt.setString(1, deviceId);
resultSet = stmt.executeQuery();
if (resultSet.next()) {
automaticDoorLockerDevice = new Device();
automaticDoorLockerDevice.setName(resultSet.getString(

Loading…
Cancel
Save