Merge branch 'wso2-application-mgt' into application-mgt

merge-requests/7/head
sinthuja 7 years ago
commit 6374b5d9c1

@ -29,6 +29,7 @@ import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorage
import org.wso2.carbon.device.application.mgt.common.services.LifecycleStateManager; import org.wso2.carbon.device.application.mgt.common.services.LifecycleStateManager;
import org.wso2.carbon.device.application.mgt.common.services.PlatformManager; import org.wso2.carbon.device.application.mgt.common.services.PlatformManager;
import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;

@ -195,7 +195,12 @@ public interface ApplicationManagementAPI {
name = "uuid", name = "uuid",
value = "UUID of the application", value = "UUID of the application",
required = true) required = true)
@PathParam("uuid") String uuid @PathParam("uuid") String uuid,
@ApiParam(
name = "isWithImages",
value = "Whether to return application with images",
required = false)
@QueryParam("isWithImages") Boolean IsWithImages
); );
@PUT @PUT
@ -272,7 +277,7 @@ public interface ApplicationManagementAPI {
@Valid Application application); @Valid Application application);
@POST @POST
@Path("upload-artifacts/{uuid}") @Path("/upload-artifacts/{uuid}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.MULTIPART_FORM_DATA) @Consumes(MediaType.MULTIPART_FORM_DATA)
@ApiOperation( @ApiOperation(
@ -309,7 +314,7 @@ public interface ApplicationManagementAPI {
@Multipart(value = "screenshot") List<Attachment> screenshots); @Multipart(value = "screenshot") List<Attachment> screenshots);
@PUT @PUT
@Path("upload-artifacts/{uuid}") @Path("/upload-artifacts/{uuid}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.MULTIPART_FORM_DATA) @Consumes(MediaType.MULTIPART_FORM_DATA)
@ApiOperation( @ApiOperation(

@ -134,10 +134,12 @@ public interface PlatformManagementAPI {
+ "- ENABLED: The platforms that are currently enabled for the tenant\n" + "- ENABLED: The platforms that are currently enabled for the tenant\n"
+ "- DISABLED: The platforms that can be used by the tenant but disabled " + "- DISABLED: The platforms that can be used by the tenant but disabled "
+ "to be used for tenant\n" + "to be used for tenant\n"
+ "- ALL: All the list of platforms that can be used by the tenant", required = false) + "- ALL: All the list of platforms that can be used by the tenant")
@QueryParam("status") @QueryParam("status")
@Size(max = 45) @Size(max = 45)
String status String status,
@ApiParam(name = "tag", defaultValue = "Tag value that we need to search the platform for")
@QueryParam("tag") String tag
); );
@GET @GET
@ -340,4 +342,38 @@ public interface PlatformManagementAPI {
String status String status
); );
@GET
@Path("tags")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@ApiOperation(
consumes = MediaType.APPLICATION_JSON,
produces = MediaType.APPLICATION_JSON,
httpMethod = "GET",
value = "get platform tags that starts with the given character sequence",
notes = "This will get all platform tags that has the given character sequence ",
tags = "Platform Management",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = SCOPE, value = "perm:platform:add")
})
}
)
@ApiResponses(
value = {
@ApiResponse(
code = 200,
message = "OK. \n Successfully retrieved platform tags.",
response = Platform.class,
responseContainer = "List"),
@ApiResponse(
code = 500,
message = "Internal Server Error. \n Error occurred while getting the platform tags.",
response = ErrorResponse.class)
})
Response getPlatformTags(
@ApiParam(name = "name", value ="The initial part of the name of platform tags that we need to retrieve",
required = true)
@QueryParam("name") @Size(min = 3) String name
);
} }

@ -72,6 +72,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
public Response getApplications(@QueryParam("offset") int offset, @QueryParam("limit") int limit, public Response getApplications(@QueryParam("offset") int offset, @QueryParam("limit") int limit,
@QueryParam("query") String searchQuery) { @QueryParam("query") String searchQuery) {
ApplicationManager applicationManager = APIUtil.getApplicationManager(); ApplicationManager applicationManager = APIUtil.getApplicationManager();
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
try { try {
if (limit == 0) { if (limit == 0) {
limit = DEFAULT_LIMIT; limit = DEFAULT_LIMIT;
@ -82,6 +84,12 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
filter.setSearchQuery(searchQuery); filter.setSearchQuery(searchQuery);
ApplicationList applications = applicationManager.getApplications(filter); ApplicationList applications = applicationManager.getApplications(filter);
for (Application application : applications.getApplications()) {
ImageArtifact imageArtifact = applicationStorageManager.getImageArtifact(application.getUuid(),
Constants.IMAGE_ARTIFACTS[0], 0);
application.setIcon(imageArtifact);
}
return Response.status(Response.Status.OK).entity(applications).build(); return Response.status(Response.Status.OK).entity(applications).build();
} catch (NotFoundException e) { } catch (NotFoundException e) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
@ -95,14 +103,29 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
@GET @GET
@Consumes("application/json") @Consumes("application/json")
@Path("/{uuid}") @Path("/{uuid}")
public Response getApplication(@PathParam("uuid") String uuid) { public Response getApplication(@PathParam("uuid") String uuid, @QueryParam("isWithImages") Boolean isWithImages) {
ApplicationManager applicationManager = APIUtil.getApplicationManager(); ApplicationManager applicationManager = APIUtil.getApplicationManager();
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
try { try {
Application application = applicationManager.getApplication(uuid); Application application = applicationManager.getApplication(uuid);
if (application == null) { if (application == null) {
return Response.status(Response.Status.NOT_FOUND) return Response.status(Response.Status.NOT_FOUND)
.entity("Application with UUID " + uuid + " not found").build(); .entity("Application with UUID " + uuid + " not found").build();
} }
if (isWithImages != null && isWithImages) {
ImageArtifact icon = applicationStorageManager.getImageArtifact(uuid, Constants.IMAGE_ARTIFACTS[0], 0);
ImageArtifact banner = applicationStorageManager.getImageArtifact(uuid, Constants.IMAGE_ARTIFACTS[1],
0);
int screenShotCount = application.getScreenShotCount();
for (int count = 1; count < screenShotCount; count++) {
ImageArtifact screenShot = applicationStorageManager.getImageArtifact(uuid, Constants
.IMAGE_ARTIFACTS[2], count);
application.addScreenShot(screenShot);
}
application.setIcon(icon);
application.setBanner(banner);
}
return Response.status(Response.Status.OK).entity(application).build(); return Response.status(Response.Status.OK).entity(application).build();
} catch (NotFoundException e) { } catch (NotFoundException e) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
@ -184,7 +207,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
@Override @Override
@POST @POST
@Path("upload-image-artifacts/{uuid}") @Path("/upload-image-artifacts/{uuid}")
public Response uploadApplicationArtifacts(@PathParam("uuid") String applicationUUID, public Response uploadApplicationArtifacts(@PathParam("uuid") String applicationUUID,
@Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart @Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart
("screenshot") List<Attachment> attachmentList) { ("screenshot") List<Attachment> attachmentList) {
@ -234,7 +257,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
@Override @Override
@PUT @PUT
@Path("upload-image-artifacts/{uuid}") @Path("/upload-image-artifacts/{uuid}")
public Response updateApplicationArtifacts(@PathParam("uuid") String applicationUUID, public Response updateApplicationArtifacts(@PathParam("uuid") String applicationUUID,
@Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart @Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart
("screenshot") List<Attachment> attachmentList) { ("screenshot") List<Attachment> attachmentList) {

@ -52,7 +52,7 @@ public class PlatformManagementAPIImpl implements PlatformManagementAPI {
@GET @GET
@Override @Override
public Response getPlatforms(@QueryParam("status") String status) { public Response getPlatforms(@QueryParam("status") String status, @QueryParam("tag") String tag) {
int tenantID = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantID = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
@ -61,6 +61,7 @@ public class PlatformManagementAPIImpl implements PlatformManagementAPI {
try { try {
List<Platform> platforms = APIUtil.getPlatformManager().getPlatforms(tenantID); List<Platform> platforms = APIUtil.getPlatformManager().getPlatforms(tenantID);
List<Platform> results; List<Platform> results;
List<Platform> filteredPlatforms = new ArrayList<>();
if (status != null) { if (status != null) {
if (status.contentEquals(ALL_STATUS)) { if (status.contentEquals(ALL_STATUS)) {
results = platforms; results = platforms;
@ -84,10 +85,22 @@ public class PlatformManagementAPIImpl implements PlatformManagementAPI {
} else { } else {
results = platforms; results = platforms;
} }
if (tag != null) {
if (results != null) {
for (Platform platform : results) {
if (platform.getTags() != null && platform.getTags().contains(tag)) {
filteredPlatforms.add(platform);
}
}
}
} else {
filteredPlatforms = results;
}
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Number of platforms with the status " + status + " : " + results.size()); log.debug("Number of platforms with the status " + status + " : " + results.size());
} }
return Response.status(Response.Status.OK).entity(results).build(); return Response.status(Response.Status.OK).entity(filteredPlatforms).build();
} catch (PlatformManagementException e) { } catch (PlatformManagementException e) {
log.error("Error while getting the platforms for tenant - " + tenantID, e); log.error("Error while getting the platforms for tenant - " + tenantID, e);
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR); return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
@ -190,4 +203,22 @@ public class PlatformManagementAPIImpl implements PlatformManagementAPI {
return APIUtil.getResponse(e, Response.Status.NOT_FOUND); return APIUtil.getResponse(e, Response.Status.NOT_FOUND);
} }
} }
@GET
@Path("tags")
@Override
public Response getPlatformTags(@QueryParam("name") String name) {
if (name == null || name.isEmpty() || name.length() < 3) {
return APIUtil.getResponse("In order to get platform tags, it is required to pass the first 3 "
+ "characters of the platform tag name", Response.Status.INTERNAL_SERVER_ERROR);
}
try {
List<String> platformTags = APIUtil.getPlatformManager().getPlatformTags(name);
return Response.status(Response.Status.OK).entity(platformTags).build();
} catch (PlatformManagementException e) {
log.error("Platform Management Exception while trying to get the platform tags with starting character "
+ "sequence " + name, e);
return APIUtil.getResponse(e, Response.Status.INTERNAL_SERVER_ERROR);
}
}
} }

@ -28,6 +28,7 @@ import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManage
import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager;
import javax.validation.Valid; import javax.validation.Valid;
import javax.ws.rs.POST;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
@ -44,21 +45,24 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{
private static Log log = LogFactory.getLog(SubscriptionManagementAPIImpl.class); private static Log log = LogFactory.getLog(SubscriptionManagementAPIImpl.class);
@Override @Override
@POST
@Path("/install-application")
public Response installApplication(@ApiParam(name = "installationDetails", value = "The application ID and list" + public Response installApplication(@ApiParam(name = "installationDetails", value = "The application ID and list" +
" the devices/users/roles", required = true) @Valid InstallationDetails installationDetails) { " the devices/users/roles", required = true) @Valid InstallationDetails installationDetails) {
Object result; Object result;
SubscriptionManager subscriptionManager = APIUtil.getSubscriptionManager(); SubscriptionManager subscriptionManager = APIUtil.getSubscriptionManager();
try { try {
String applicationUUID = installationDetails.getApplicationUUID(); String applicationUUTD = installationDetails.getApplicationUUID();
String versionName = installationDetails.getVersionName();
if (!installationDetails.getDeviceIdentifiers().isEmpty()) { if (!installationDetails.getDeviceIdentifiers().isEmpty()) {
List<DeviceIdentifier> deviceList = installationDetails.getDeviceIdentifiers(); List<DeviceIdentifier> deviceList = installationDetails.getDeviceIdentifiers();
result = subscriptionManager.installApplicationForDevices(applicationUUID, deviceList); result = subscriptionManager.installApplicationForDevices(applicationUUTD, versionName, deviceList);
} else if (!installationDetails.getUserNameList().isEmpty()) { } else if (!installationDetails.getUserNameList().isEmpty()) {
List<String> userList = installationDetails.getUserNameList(); List<String> userList = installationDetails.getUserNameList();
result = subscriptionManager.installApplicationForUsers(applicationUUID, userList); result = subscriptionManager.installApplicationForUsers(applicationUUTD, userList);
} else if (!installationDetails.getRoleNameList().isEmpty()) { } else if (!installationDetails.getRoleNameList().isEmpty()) {
List<String> roleList = installationDetails.getRoleNameList(); List<String> roleList = installationDetails.getRoleNameList();
result = subscriptionManager.installApplicationForRoles(applicationUUID, roleList); result = subscriptionManager.installApplicationForRoles(applicationUUTD, roleList);
} else { } else {
result = "Missing request data!"; result = "Missing request data!";
return Response.status(Response.Status.BAD_REQUEST).entity(result).build(); return Response.status(Response.Status.BAD_REQUEST).entity(result).build();

@ -21,6 +21,8 @@ package org.wso2.carbon.device.application.mgt.common;
import org.wso2.carbon.device.application.mgt.common.jaxrs.Exclude; import org.wso2.carbon.device.application.mgt.common.jaxrs.Exclude;
import java.awt.*;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -69,6 +71,12 @@ public class Application {
private User user; private User user;
private ImageArtifact icon;
private ImageArtifact banner;
private List<ImageArtifact> screenShots = new ArrayList<>();
public int getId() { public int getId() {
return id; return id;
} }
@ -221,6 +229,18 @@ public class Application {
return screenShotCount; return screenShotCount;
} }
public void setIcon(ImageArtifact icon) {
this.icon = icon;
}
public void setBanner(ImageArtifact banner) {
this.banner = banner;
}
public void addScreenShot(ImageArtifact screenShot) {
this.screenShots.add(screenShot);
}
@Override @Override
public String toString() { public String toString() {
String app = "UUID : " + uuid + "\tName : " + name + "\tShort Description : " String app = "UUID : " + uuid + "\tName : " + name + "\tShort Description : "

@ -27,6 +27,11 @@ public class InstallationDetails {
value = "Application ID", value = "Application ID",
required = true) required = true)
private String applicationUUID; private String applicationUUID;
@ApiModelProperty(
name = "versionName",
value = "Version name",
required = true)
private String versionName;
@ApiModelProperty( @ApiModelProperty(
name = "userNameList", name = "userNameList",
value = "List of user names.", value = "List of user names.",
@ -54,6 +59,14 @@ public class InstallationDetails {
this.applicationUUID = applicationUUID; this.applicationUUID = applicationUUID;
} }
public String getVersionName() {
return versionName;
}
public void setVersionName(String versionName) {
this.versionName = versionName;
}
public List<String> getUserNameList() { public List<String> getUserNameList() {
return userNameList; return userNameList;
} }

@ -133,4 +133,12 @@ public interface PlatformManager {
*/ */
public void removePlatforms(int tenantId) throws PlatformManagementException; public void removePlatforms(int tenantId) throws PlatformManagementException;
/**
* To get the platform tags.
*
* @param name Starting character sequence of the platform name.
* @return list of the platform tags that start with the character sequence.
* @throws PlatformManagementException PlatformManagement Exception
*/
public List<String> getPlatformTags(String name) throws PlatformManagementException;
} }

@ -34,7 +34,7 @@ public interface SubscriptionManager {
* @return Failed Device List which the application was unable to install * @return Failed Device List which the application was unable to install
* @throws ApplicationManagementException Application Management Exception * @throws ApplicationManagementException Application Management Exception
*/ */
List<DeviceIdentifier> installApplicationForDevices(String applicationUUID, List<DeviceIdentifier> installApplicationForDevices(String applicationUUID, String versionName,
List<DeviceIdentifier> deviceList) List<DeviceIdentifier> deviceList)
throws ApplicationManagementException; throws ApplicationManagementException;

@ -53,15 +53,6 @@ public class Configuration {
public void setExtensions(List<Extension> extensions) { public void setExtensions(List<Extension> extensions) {
this.extensions = extensions; this.extensions = extensions;
} }
@XmlElement(name = "Artifacts")
public Artifacts getArtifacts() {
return artifacts;
}
public void setArtifacts(Artifacts artifacts) {
this.artifacts = artifacts;
}
} }

@ -80,7 +80,6 @@ public class Extension {
public enum Name { public enum Name {
ApplicationManager, ApplicationManager,
ApplicationReleaseManager, ApplicationReleaseManager,
ApplicationUploadManager,
CategoryManager, CategoryManager,
CommentsManager, CommentsManager,
LifecycleStateManager, LifecycleStateManager,

@ -54,4 +54,6 @@ public interface PlatformDAO {
int getMultiTenantPlatforms(String identifier) throws PlatformManagementDAOException; int getMultiTenantPlatforms(String identifier) throws PlatformManagementDAOException;
List<String> getPlatformTags(String name) throws PlatformManagementDAOException;
} }

@ -666,6 +666,39 @@ public class GenericPlatformDAOImpl extends AbstractDAOImpl implements PlatformD
} catch (SQLException e) { } catch (SQLException e) {
throw new PlatformManagementDAOException("SQL exception while executing the query " + sql + " to get the" throw new PlatformManagementDAOException("SQL exception while executing the query " + sql + " to get the"
+ " tenants which has the platform with the platform identifier : " + identifier, e); + " tenants which has the platform with the platform identifier : " + identifier, e);
} finally {
Util.cleanupResources(stmt, rs);
}
}
@Override
public List<String> getPlatformTags(String name) throws PlatformManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
String sql = "";
List<String> tagList = new ArrayList<>();
try {
conn = this.getDBConnection();
sql = "SELECT NAME FROM APPM_PLATFORM_TAG WHERE NAME LIKE ?";
stmt = conn.prepareStatement(sql);
stmt.setString(1, name + "%");
rs = stmt.executeQuery();
if (rs.next()) {
tagList.add(rs.getString("NAME"));
}
return tagList;
} catch (DBConnectionException e) {
throw new PlatformManagementDAOException("Database Connection exception while trying to get the platform "
+ "tags that are starting with " + name, e);
} catch (SQLException e) {
throw new PlatformManagementDAOException("SQL exception while executing the query " + sql + " to get the"
+ " platform tags that are starting with " + name, e);
} finally {
Util.cleanupResources(stmt, rs);
} }
} }
} }

@ -54,13 +54,26 @@ import java.util.List;
*/ */
public class ApplicationStorageManagerImpl implements ApplicationStorageManager { public class ApplicationStorageManagerImpl implements ApplicationStorageManager {
private static final Log log = LogFactory.getLog(ApplicationStorageManagerImpl.class); private static final Log log = LogFactory.getLog(ApplicationStorageManagerImpl.class);
private String storagePath;
private int screenShotMaxCount;
/**
* Create a new ApplicationStorageManager Instance
*
* @param storagePath Storage Path to save the binary and image files.
* @param screenShotMaxCount Maximum Screen-shots count
*/
public ApplicationStorageManagerImpl(String storagePath, String screenShotMaxCount) {
this.storagePath = storagePath;
this.screenShotMaxCount = Integer.parseInt(screenShotMaxCount);
}
@Override @Override
public void uploadImageArtifacts(String applicationUUID, InputStream iconFileStream, InputStream bannerFileStream, public void uploadImageArtifacts(String applicationUUID, InputStream iconFileStream, InputStream bannerFileStream,
List<InputStream> screenShotStreams) throws ApplicationStorageManagementException { List<InputStream> screenShotStreams) throws ApplicationStorageManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
Application application = validateApplication(applicationUUID); Application application = validateApplication(applicationUUID);
String artifactDirectoryPath = Constants.artifactPath + application.getId(); String artifactDirectoryPath = storagePath + application.getId();
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Artifact Directory Path for saving the artifacts related with application " + applicationUUID log.debug("Artifact Directory Path for saving the artifacts related with application " + applicationUUID
+ " is " + artifactDirectoryPath); + " is " + artifactDirectoryPath);
@ -86,12 +99,29 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
} }
if (screenShotStreams != null) { if (screenShotStreams != null) {
int count = application.getScreenShotCount() + 1; int count = application.getScreenShotCount() + 1;
boolean maxCountReached = false;
if (count > screenShotMaxCount) {
log.error("Maximum limit for the screen-shot is " + screenShotMaxCount
+ " Cannot upload another screenshot for the application with the UUID " + applicationUUID);
maxCountReached = true;
}
String screenshotName; String screenshotName;
if (maxCountReached) {
return;
}
for (InputStream screenshotStream : screenShotStreams) { for (InputStream screenshotStream : screenShotStreams) {
try { try {
screenshotName = Constants.IMAGE_ARTIFACTS[2] + count; screenshotName = Constants.IMAGE_ARTIFACTS[2] + count;
saveFile(screenshotStream, artifactDirectoryPath + File.separator + screenshotName); saveFile(screenshotStream, artifactDirectoryPath + File.separator + screenshotName);
count++; count++;
if (count > screenShotMaxCount) {
log.error("Maximum limit for the screen-shot is " + screenShotMaxCount
+ " Cannot upload another screenshot for the application with the UUID "
+ applicationUUID);
break;
}
} catch (IOException e) { } catch (IOException e) {
throw new ApplicationStorageManagementException( throw new ApplicationStorageManagementException(
"IO Exception while saving the screens hots for the " + "application " + applicationUUID, "IO Exception while saving the screens hots for the " + "application " + applicationUUID,
@ -127,7 +157,7 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
public void uploadReleaseArtifacts(String applicationUUID, String versionName, InputStream binaryFile) public void uploadReleaseArtifacts(String applicationUUID, String versionName, InputStream binaryFile)
throws ApplicationStorageManagementException { throws ApplicationStorageManagementException {
Application application = validateApplication(applicationUUID); Application application = validateApplication(applicationUUID);
String artifactDirectoryPath = Constants.artifactPath + application.getId(); String artifactDirectoryPath = storagePath + application.getId();
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Artifact Directory Path for saving the application release related artifacts related with " log.debug("Artifact Directory Path for saving the application release related artifacts related with "
+ "application " + applicationUUID + " is " + artifactDirectoryPath); + "application " + applicationUUID + " is " + artifactDirectoryPath);
@ -150,7 +180,7 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
public InputStream getReleasedArtifacts(String applicationUUID, String versionName) public InputStream getReleasedArtifacts(String applicationUUID, String versionName)
throws ApplicationStorageManagementException { throws ApplicationStorageManagementException {
Application application = validateApplication(applicationUUID); Application application = validateApplication(applicationUUID);
String artifactPath = Constants.artifactPath + application.getId() + File.separator + versionName; String artifactPath = storagePath + application.getId() + File.separator + versionName;
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("ApplicationRelease artifacts are searched in the location " + artifactPath); log.debug("ApplicationRelease artifacts are searched in the location " + artifactPath);
@ -173,7 +203,7 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
@Override @Override
public void deleteApplicationArtifacts(String applicationUUID) throws ApplicationStorageManagementException { public void deleteApplicationArtifacts(String applicationUUID) throws ApplicationStorageManagementException {
Application application = validateApplication(applicationUUID); Application application = validateApplication(applicationUUID);
String artifactDirectoryPath = Constants.artifactPath + application.getId(); String artifactDirectoryPath = storagePath + application.getId();
File artifactDirectory = new File(artifactDirectoryPath); File artifactDirectory = new File(artifactDirectoryPath);
if (artifactDirectory.exists()) { if (artifactDirectory.exists()) {
@ -185,7 +215,7 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
public void deleteApplicationReleaseArtifacts(String applicationUUID, String version) public void deleteApplicationReleaseArtifacts(String applicationUUID, String version)
throws ApplicationStorageManagementException { throws ApplicationStorageManagementException {
Application application = validateApplication(applicationUUID); Application application = validateApplication(applicationUUID);
String artifactPath = Constants.artifactPath + application.getId() + File.separator + version; String artifactPath = storagePath + application.getId() + File.separator + version;
File artifact = new File(artifactPath); File artifact = new File(artifactPath);
if (artifact.exists()) { if (artifact.exists()) {
@ -215,7 +245,7 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
ApplicationStorageManagementException { ApplicationStorageManagementException {
Application application = validateApplication(applicationUUID); Application application = validateApplication(applicationUUID);
validateImageArtifactNames(name); validateImageArtifactNames(name);
String imageArtifactPath = Constants.artifactPath + application.getId() + File.separator + name.toLowerCase(); String imageArtifactPath = storagePath + application.getId() + File.separator + name.toLowerCase();
if (name.equalsIgnoreCase(Constants.IMAGE_ARTIFACTS[2])) { if (name.equalsIgnoreCase(Constants.IMAGE_ARTIFACTS[2])) {
imageArtifactPath += count; imageArtifactPath += count;

@ -419,6 +419,19 @@ public class PlatformManagerImpl implements PlatformManager {
} }
} }
@Override
public List<String> getPlatformTags(String name) throws PlatformManagementException {
try {
ConnectionManagerUtil.openDBConnection();
return DAOFactory.getPlatformDAO().getPlatformTags(name);
} catch (DBConnectionException e) {
throw new PlatformManagementException("Database Connection Exception while getting the platform tags that"
+ " are starting with the character sequence " + name, e);
} finally {
ConnectionManagerUtil.closeDBConnection();
}
}
/** /**
* To share the super-tenant platform with other tenants * To share the super-tenant platform with other tenants
* @param platformIdentifier Identifier of the platform * @param platformIdentifier Identifier of the platform

@ -25,14 +25,23 @@ import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManage
import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager;
import org.wso2.carbon.device.application.mgt.core.dao.common.DAOFactory; import org.wso2.carbon.device.application.mgt.core.dao.common.DAOFactory;
import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; import org.wso2.carbon.device.application.mgt.core.internal.DataHolder;
import org.wso2.carbon.device.application.mgt.core.util.HelperUtil;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.InvalidDeviceException;
import org.wso2.carbon.device.mgt.common.app.mgt.DeviceApplicationMapping;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.operation.mgt.ProfileOperation;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* This is the default implementation for the Subscription Manager. * This is the default implementation for the Subscription Manager.
@ -42,12 +51,58 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
private static final Log log = LogFactory.getLog(SubscriptionManagerImpl.class); private static final Log log = LogFactory.getLog(SubscriptionManagerImpl.class);
@Override @Override
public List<DeviceIdentifier> installApplicationForDevices(String applicationUUID, public List<DeviceIdentifier> installApplicationForDevices(String applicationUUID, String versionName,
List<DeviceIdentifier> deviceList) List<DeviceIdentifier> deviceList)
throws ApplicationManagementException { throws ApplicationManagementException {
// Todo: try whether we can optimise this by sending bulk inserts to db
// Todo: atomicity is not maintained as deveice managment provider service uses separate db connection. fix this??
log.info("Install application: " + applicationUUID + " to: " + deviceList.size() + " devices."); log.info("Install application: " + applicationUUID + " to: " + deviceList.size() + " devices.");
List<DeviceIdentifier> failedDevices = installApplication(applicationUUID, deviceList); List<DeviceIdentifier> failedDeviceList = new ArrayList<>(deviceList);
return failedDevices; for (DeviceIdentifier device : deviceList) {
org.wso2.carbon.device.mgt.common.DeviceIdentifier deviceIdentifier = new org.wso2.carbon.device.mgt
.common.DeviceIdentifier(device.getId(), device.getType());
try {
DeviceManagementDAOFactory.openConnection();
// todo: replace this with boolean:deviceExsits(deviceId) operation
Map<Integer, Device> currentDevices = DeviceManagementDAOFactory.getDeviceDAO().getDevice(deviceIdentifier);
DeviceManagementDAOFactory.closeConnection();
if (currentDevices.isEmpty()) {
log.error("Device with ID: " + device.getId() + " not found to install the application.");
} else {
if (log.isDebugEnabled()) {
log.debug("Installing application to : " + device.getId());
}
//Todo: generating one time download link for the application and put install operation to device.
// put app install operation to the device
ProfileOperation operation = new ProfileOperation();
operation.setCode("INSTALL_APPLICATION");
operation.setType(Operation.Type.PROFILE);
operation.setPayLoad("{'type':'enterprise', 'url':'http://10.100.5.76:8000/app-debug.apk', 'app':'" + applicationUUID + "'}");
List<org.wso2.carbon.device.mgt.common.DeviceIdentifier> deviceIdentifiers = new ArrayList<>();
deviceIdentifiers.add(deviceIdentifier);
DeviceManagementProviderService deviceManagementProviderService = HelperUtil.getDeviceManagementProviderService();
deviceManagementProviderService.addOperation(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID,
operation, deviceIdentifiers);
DeviceApplicationMapping deviceApp = new DeviceApplicationMapping();
deviceApp.setDeviceIdentifier(device.getId());
deviceApp.setApplicationUUID(applicationUUID);
deviceApp.setVersionName(versionName);
deviceApp.setInstalled(false);
deviceManagementProviderService.addDeviceApplicationMapping(deviceApp);
// DAOFactory.getSubscriptionDAO().addDeviceApplicationMapping(device.getId(), applicationUUID, false);
failedDeviceList.remove(device);
}
} catch (DeviceManagementException | DeviceManagementDAOException | OperationManagementException | InvalidDeviceException | SQLException e) {
throw new ApplicationManagementException("Failed to install application " + applicationUUID + " on device " + deviceIdentifier, e);
} finally {
DeviceManagementDAOFactory.closeConnection();
}
}
return failedDeviceList;
} }
@Override @Override

@ -77,8 +77,6 @@ public class ServiceComponent {
String datasourceName = ConfigurationManager.getInstance().getConfiguration().getDatasourceName(); String datasourceName = ConfigurationManager.getInstance().getConfiguration().getDatasourceName();
DAOFactory.init(datasourceName); DAOFactory.init(datasourceName);
Constants.artifactPath = ConfigurationManager.getInstance().getConfiguration().getArtifacts()
.getBinaryLocation();
ApplicationManager applicationManager = ApplicationManagementUtil.getApplicationManagerInstance(); ApplicationManager applicationManager = ApplicationManagementUtil.getApplicationManagerInstance();
DataHolder.getInstance().setApplicationManager(applicationManager); DataHolder.getInstance().setApplicationManager(applicationManager);
bundleContext.registerService(ApplicationManager.class.getName(), applicationManager, null); bundleContext.registerService(ApplicationManager.class.getName(), applicationManager, null);

@ -54,10 +54,6 @@ public class Constants {
public static final String[] LIFE_CYCLES = {"CREATED", "IN REVIEW", "APPROVED", "REJECTED", "PUBLISHED", public static final String[] LIFE_CYCLES = {"CREATED", "IN REVIEW", "APPROVED", "REJECTED", "PUBLISHED",
"UNPUBLISHED", "RETIRED"}; "UNPUBLISHED", "RETIRED"};
/**
* Path to save the Application related artifacts.
*/
public static String artifactPath = "";
/** /**
* Name of the image artifacts that are saved in the file system. * Name of the image artifacts that are saved in the file system.

@ -18,6 +18,11 @@
*/ */
package org.wso2.carbon.device.application.mgt.core.util; package org.wso2.carbon.device.application.mgt.core.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import java.util.UUID; import java.util.UUID;
/** /**
@ -25,8 +30,30 @@ import java.util.UUID;
*/ */
public class HelperUtil { public class HelperUtil {
private static Log log = LogFactory.getLog(HelperUtil.class);
private static DeviceManagementProviderService deviceManagementProviderService;
public static String generateApplicationUuid() { public static String generateApplicationUuid() {
return UUID.randomUUID().toString(); return UUID.randomUUID().toString();
} }
public static DeviceManagementProviderService getDeviceManagementProviderService() {
if (deviceManagementProviderService == null) {
synchronized (HelperUtil.class) {
if (deviceManagementProviderService == null) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
deviceManagementProviderService = (DeviceManagementProviderService) ctx
.getOSGiService(DeviceManagementProviderService.class, null);
if (deviceManagementProviderService == null) {
String msg = "Device management provider service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
}
}
}
return deviceManagementProviderService;
}
} }

@ -46,6 +46,7 @@
"mocha": "^3.4.1", "mocha": "^3.4.1",
"mock-local-storage": "^1.0.2", "mock-local-storage": "^1.0.2",
"node-sass": "^4.5.3", "node-sass": "^4.5.3",
"react-intl": "^2.4.0",
"sass-loader": "^6.0.6", "sass-loader": "^6.0.6",
"style-loader": "^0.18.1", "style-loader": "^0.18.1",
"webpack": "^2.7.0" "webpack": "^2.7.0"

@ -0,0 +1,41 @@
{
"Title" : "Title",
"Description" : "Description",
"Category" : "Category",
"Visibility" : "Visibility",
"Devices" : "Devices",
"Roles" : "Roles",
"Groups" : "Groups",
"Tags" : "Tags",
"Platform" : "Platform",
"Platforms" : "Platfomrs",
"No.Platform" : "No Platforms",
"Screenshots" : "Screenshots",
"Icon" : "Icon",
"Banner" : "Banner",
"Create.Application" : "Create Application",
"Back" : "Back",
"Cancel" : "Cancel",
"Finish" : "Finish",
"Continue" : "Continue",
"Application.Name" : "Application Name",
"General" : "General",
"App.Releases" : "Application Releases",
"Package.Manager" : "Package Manager",
"Save" : "Save",
"Create.Release" : "Create Release",
"Release" : "Release",
"New.Release.For" : "New Release for",
"Upload.Package.File" : "Upload Package File",
"Upload" : "Upload",
"Select.from.package.library" : "Select from package library",
"Release.Name" : "Release Name",
"Release.Notes" : "Release Notes",
"Send.for.Review" : "Send for Review",
"Production.Releases" : "Production Releases",
"Beta.Releases" : "Beta Releases",
"Alpha.Releases" : "Alpha Releases",
"Version" : "Version",
"Status" : "Status",
"App.Publisher" : "Application Publisher"
}

@ -43,5 +43,13 @@ export default class Constants {
REFRESH_TOKEN_URL: "", REFRESH_TOKEN_URL: "",
WSO2_USER: 'wso2_user', WSO2_USER: 'wso2_user',
PARTIAL_TOKEN: 'WSO2_IOT_TOKEN' PARTIAL_TOKEN: 'WSO2_IOT_TOKEN'
};
static hostConstants = {
baseURL : window.location.origin,
appContext : window.location.pathname.split("/")[1]
} }
static defaultLocale = "en";
} }

@ -23,6 +23,7 @@ import AuthHandler from "../../api/authHandler";
import ApplicationCreate from '../Application/Create/ApplicationCreate'; import ApplicationCreate from '../Application/Create/ApplicationCreate';
import {Col, Container, Input, Row,} from 'reactstrap'; import {Col, Container, Input, Row,} from 'reactstrap';
import FloatingButton from "../UIComponents/FloatingButton/FloatingButton"; import FloatingButton from "../UIComponents/FloatingButton/FloatingButton";
import {FormattedMessage} from 'react-intl';
/** /**
* Base Layout: * Base Layout:
@ -75,7 +76,7 @@ class BaseLayout extends Component {
<div id="header-content"> <div id="header-content">
<div id="header"> <div id="header">
<span id="header-text"> <span id="header-text">
WSO2 IoT App Publisher WSO2 IoT <FormattedMessage id="App.Publisher" defaultMessage="Application Publisher"/>
</span> </span>
<div id="header-btn-container"> <div id="header-btn-container">
<i className="fw fw-notification btn-header"></i> <i className="fw fw-notification btn-header"></i>

@ -21,6 +21,7 @@ import {withRouter} from 'react-router-dom';
import {Button, Col, Row, Table} from 'reactstrap'; import {Button, Col, Row, Table} from 'reactstrap';
import Drawer from '../UIComponents/Drawer/Drawer'; import Drawer from '../UIComponents/Drawer/Drawer';
import ApplicationView from './View/ApplicationView'; import ApplicationView from './View/ApplicationView';
import {FormattedMessage} from 'react-intl';
/** /**
* The App Create Component. * The App Create Component.
@ -242,7 +243,9 @@ class ApplicationListing extends Component {
<Row> <Row>
<Col xs="3 offset-9"> <Col xs="3 offset-9">
<div className="platform-link-placeholder"> <div className="platform-link-placeholder">
<Button><i className="fw fw-settings"></i> Platforms</Button> <Button><i className="fw fw-settings"></i>
<FormattedMessage id="Platforms" defaultMessage="Platforms"/>
</Button>
</div> </div>
</Col> </Col>
</Row> </Row>
@ -255,11 +258,12 @@ class ApplicationListing extends Component {
{/* TODO: Remove console.log and add sort method. */} {/* TODO: Remove console.log and add sort method. */}
<th onClick={() => { <th onClick={() => {
console.log("sort") console.log("sort")
}}>Application Name }}>
<FormattedMessage id="Application.Name" defaultMessage="Application Name"/>
</th> </th>
<th>Category</th> <th><FormattedMessage id="Category" defaultMessage="Category"/></th>
<th>Platform</th> <th><FormattedMessage id="Platform" defaultMessage="Platform"/></th>
<th>Status</th> <th><FormattedMessage id="Status" defaultMessage="Status"/></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>

@ -22,6 +22,7 @@ import AuthHandler from "../../../api/authHandler";
import {Step1, Step2, Step3, Step4} from './CreateSteps/index'; import {Step1, Step2, Step3, Step4} from './CreateSteps/index';
import ApplicationMgtApi from '../../../api/applicationMgtApi'; import ApplicationMgtApi from '../../../api/applicationMgtApi';
import {Button, Col, Modal, ModalBody, ModalFooter, ModalHeader, Row} from 'reactstrap'; import {Button, Col, Modal, ModalBody, ModalFooter, ModalHeader, Row} from 'reactstrap';
import {FormattedMessage} from 'react-intl';
/** /**
* The App Create Component. * The App Create Component.
@ -210,7 +211,9 @@ class ApplicationCreate extends Component {
<div id="create-application-modal"> <div id="create-application-modal">
<Modal isOpen={this.state.open} toggle={this.toggle} id="app-create-modal" <Modal isOpen={this.state.open} toggle={this.toggle} id="app-create-modal"
backdrop={'static'}> backdrop={'static'}>
<ModalHeader toggle={this.toggle}>Create Application</ModalHeader> <ModalHeader toggle={this.toggle}>
<FormattedMessage id="Create.Application" defaultMessage="Create Application"/>
</ModalHeader>
<ModalBody id="modal-body-content"> <ModalBody id="modal-body-content">
<Row> <Row>
<Col> <Col>
@ -227,11 +230,19 @@ class ApplicationCreate extends Component {
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
{stepIndex === 0 ? <div/> : {stepIndex === 0 ? <div/> :
<Button color="primary" onClick={this.onPrevClick}>Back</Button>} <Button color="primary" onClick={this.onPrevClick}>
<Button color="secondary" onClick={this.onClose}>Cancel</Button> <FormattedMessage id="Back" defaultMessage="Back"/>
</Button>}
<Button color="secondary" onClick={this.onClose}>
<FormattedMessage id="Cancel" defaultMessage="Cancel"/>
</Button>
{finished ? {finished ?
<Button color="primary" onClick={this.onSubmit}>Finish</Button> : <Button color="primary" onClick={this.onSubmit}>
<Button color="primary" onClick={this.onNextClick}>Continue</Button>} <FormattedMessage id="Finish" defaultMessage="Finish" />
</Button> :
<Button color="primary" onClick={this.onNextClick}>
<FormattedMessage id="Continue" defaultMessage="Continue"/>
</Button>}
</ModalFooter> </ModalFooter>
</Modal> </Modal>
</div>); </div>);

@ -19,6 +19,7 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Badge, FormGroup, Input, Label} from 'reactstrap'; import {Badge, FormGroup, Input, Label} from 'reactstrap';
import {FormattedMessage} from 'react-intl';
/** /**
* The Second step of application create wizard. * The Second step of application create wizard.
@ -131,47 +132,37 @@ class Step1 extends Component {
<div> <div>
<div> <div>
<FormGroup> <FormGroup>
<Label for="app-title">Title*</Label> <Label for="app-title">
<Input <FormattedMessage id='Title' defaultMessage='Title'/>*
required </Label>
type="text" <Input required type="text" name="appName" id="app-title"/>
name="appName"
id="app-title"
/>
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label for="app-description">Description*</Label> <Label for="app-description">
<Input <FormattedMessage id='Description' defaultMessage='Description'/>*
required </Label>
type="textarea" <Input required type="textarea" name="appDescription" id="app-description"/>
name="appDescription"
id="app-description"
/>
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label for="app-category">Category</Label> <Label for="app-category">
<Input <FormattedMessage id='Category' defaultMessage='Category'/>
type="select" </Label>
name="category" <Input type="select" name="category" id="app-category">
id="app-category"
>
<option>Business</option> <option>Business</option>
</Input> </Input>
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label for="app-visibility">Visibility</Label> <Label for="app-visibility">
<Input <FormattedMessage id='Visibility' defaultMessage='Visibility'/>
type="select" </Label>
name="visibility" <Input type="select" name="visibility" id="app-visibility">
id="app-visibility" <option><FormattedMessage id='Devices' defaultMessage='Devices'/></option>
> <option><FormattedMessage id='Roles' defaultMessage='Roles'/></option>
<option>Devices</option> <option><FormattedMessage id='Groups' defaultMessage='Groups'/></option>
<option>Roles</option>
<option>Groups</option>
</Input> </Input>
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label for="app-tags">Tags*</Label> <Label for="app-tags"><FormattedMessage id='Tags' defaultMessage='Tags'/>*</Label>
<Input <Input
required required
type="text" type="text"

@ -21,6 +21,7 @@ import React, {Component} from 'react';
import AuthHandler from "../../../../api/authHandler"; import AuthHandler from "../../../../api/authHandler";
import PlatformMgtApi from "../../../../api/platformMgtApi"; import PlatformMgtApi from "../../../../api/platformMgtApi";
import {FormGroup, Input, Label} from 'reactstrap'; import {FormGroup, Input, Label} from 'reactstrap';
import {FormattedMessage} from 'react-intl';
/** /**
* The first step of the application creation wizard. * The first step of the application creation wizard.
@ -114,30 +115,21 @@ class Step2 extends Component {
<FormGroup> <FormGroup>
<Label for="store">Store Type</Label> <Label for="store">Store Type</Label>
<Input <Input type="select" name="store" className="input-custom" onChange={this.onChangeStore.bind(this)}>
type="select"
name="store"
className="input-custom"
onChange={this.onChangeStore.bind(this)}
>
<option>Enterprise</option> <option>Enterprise</option>
<option>Public</option> <option>Public</option>
</Input> </Input>
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label for="store">Platform</Label> <Label for="store"><FormattedMessage id='Platform' defaultMessage='Platform'/></Label>
<Input <Input type="select" name="store" onChange={this.onChangePlatform.bind(this)}>
type="select"
name="store"
onChange={this.onChangePlatform.bind(this)}
>
{this.state.platforms.length > 0 ? this.state.platforms.map(platform => { {this.state.platforms.length > 0 ? this.state.platforms.map(platform => {
return ( return (
<option value={platform.identifier}> <option value={platform.identifier}>
{platform.name} {platform.name}
</option> </option>
) )
}) : <option>No Platforms</option>} }) : <option><FormattedMessage id='No.Platform' defaultMessage='No Platforms'/></option>}
</Input> </Input>
</FormGroup> </FormGroup>
</div> </div>

@ -17,13 +17,11 @@
*/ */
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Chip from 'material-ui/Chip';
import Dropzone from 'react-dropzone'; import Dropzone from 'react-dropzone';
import React, {Component} from 'react'; import React, {Component} from 'react';
import MenuItem from 'material-ui/MenuItem';
import SelectField from 'material-ui/SelectField';
import {FormGroup, Label} from 'reactstrap'; import {FormGroup, Label} from 'reactstrap';
import AppImage from "../../../UIComponents/AppImage/AppImage"; import AppImage from "../../../UIComponents/AppImage/AppImage";
import {FormattedMessage} from 'react-intl';
/** /**
* The Third step of application create wizard. * The Third step of application create wizard.
@ -111,7 +109,9 @@ class Step3 extends Component {
<div className="createStep2Content"> <div className="createStep2Content">
<div> <div>
<FormGroup> <FormGroup>
<Label for="app-screenshots">Screenshots*</Label> <Label for="app-screenshots">
<FormattedMessage id='Screenshots' defaultMessage='Screenshots'/>*
</Label>
<span className="image-sub-title"> (600 X 800 32 bit PNG)</span> <span className="image-sub-title"> (600 X 800 32 bit PNG)</span>
<div id="screenshot-container"> <div id="screenshot-container">
{this.state.screenshots.map((tile) => ( {this.state.screenshots.map((tile) => (
@ -140,7 +140,9 @@ class Step3 extends Component {
<div style={{display: 'flex'}}> <div style={{display: 'flex'}}>
<div style={{float: 'left', marginRight: '15px'}}> <div style={{float: 'left', marginRight: '15px'}}>
<FormGroup> <FormGroup>
<Label for="app-icon">Icon*</Label> <Label for="app-icon">
<FormattedMessage id='Screenshots' defaultMessage='Screenshots'/>*
</Label>
<span className="image-sub-title"> (512 X 512 32 bit PNG)</span> <span className="image-sub-title"> (512 X 512 32 bit PNG)</span>
<div id="app-icon-container"> <div id="app-icon-container">
{this.state.icon.map((tile) => ( {this.state.icon.map((tile) => (
@ -164,7 +166,9 @@ class Step3 extends Component {
</div> </div>
<div style={{marginLeft: '15px'}}> <div style={{marginLeft: '15px'}}>
<FormGroup> <FormGroup>
<Label for="app-banner">Banner*</Label> <Label for="app-banner">
<FormattedMessage id='Icon' defaultMessage='Icon'/>*
</Label>
<span className="image-sub-title"> (1000 X 400 32 bit PNG)</span> <span className="image-sub-title"> (1000 X 400 32 bit PNG)</span>
<div id="app-banner-container"> <div id="app-banner-container">
{this.state.banner.map((tile) => ( {this.state.banner.map((tile) => (

@ -20,6 +20,7 @@ import {Col, Row} from "reactstrap";
import React, {Component} from 'react'; import React, {Component} from 'react';
import GeneralInfo from "../GenenralInfo/GeneralInfo"; import GeneralInfo from "../GenenralInfo/GeneralInfo";
import ReleaseManager from '../../Release/ReleaseMgtBase/ReleaseManager'; import ReleaseManager from '../../Release/ReleaseMgtBase/ReleaseManager';
import {FormattedMessage} from 'react-intl';
class ApplicationEdit extends Component { class ApplicationEdit extends Component {
@ -85,21 +86,20 @@ class ApplicationEdit extends Component {
</a> </a>
</Col> </Col>
<Col> <Col>
Application Name <FormattedMessage id="Application.Name" defaultMessage="Application Name"/>
</Col> </Col>
</Row> </Row>
<Row id="application-edit-main-container"> <Row id="application-edit-main-container">
<Col xs="3"> <Col xs="3">
<div className="tab"> <div className="tab">
<button className={this.state.general} value={1} onClick={this.handleTabClick.bind(this)}> <button className={this.state.general} value={1} onClick={this.handleTabClick.bind(this)}>
General <FormattedMessage id="General" defaultMessage="General"/>
</button> </button>
<button className={this.state.release} value={2} onClick={this.handleTabClick.bind(this)}> <button className={this.state.release} value={2} onClick={this.handleTabClick.bind(this)}>
App <FormattedMessage id="App.Releases" defaultMessage="Application Releases"/>
Releases
</button> </button>
<button className={this.state.pkgmgt} value={3} onClick={this.handleTabClick.bind(this)}> <button className={this.state.pkgmgt} value={3} onClick={this.handleTabClick.bind(this)}>
Package Manager <FormattedMessage id="Package.Manager" defaultMessage="Package Manager"/>
</button> </button>
</div> </div>
</Col> </Col>

@ -19,6 +19,7 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Badge, Button, FormGroup, Input, Label, Row} from 'reactstrap'; import {Badge, Button, FormGroup, Input, Label, Row} from 'reactstrap';
import Dropzone from 'react-dropzone'; import Dropzone from 'react-dropzone';
import {FormattedMessage} from 'react-intl';
class GeneralInfo extends Component { class GeneralInfo extends Component {
@ -40,7 +41,9 @@ class GeneralInfo extends Component {
<Row> <Row>
<form> <form>
<FormGroup> <FormGroup>
<Label for="app-title">Title*</Label> <Label for="app-title">
<FormattedMessage id="Title" defaultMessage="Title"/>*
</Label>
<Input <Input
required required
type="text" type="text"
@ -49,46 +52,34 @@ class GeneralInfo extends Component {
/> />
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label for="app-title">Description*</Label> <Label for="app-title">
<Input <FormattedMessage id="Description" defaultMessage="Description"/>*
required </Label>
type="textarea" <Input required type="textarea" multiline name="appName" id="app-title"/>
multiline
name="appName"
id="app-title"
/>
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label for="app-category">Category</Label> <Label for="app-category">
<Input <FormattedMessage id="Category" defaultMessage="Category"/>
type="select" </Label>
name="category" <Input type="select" name="category" id="app-category">
id="app-category"
>
<option>Business</option> <option>Business</option>
</Input> </Input>
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label for="app-visibility">Visibility</Label> <Label for="app-visibility">
<Input <FormattedMessage id="Visibility" defaultMessage="Visibility"/>
type="select" </Label>
name="visibility" <Input type="select" name="visibility" id="app-visibility">
id="app-visibility" <option><FormattedMessage id="Devices" defaultMessage="Devices"/></option>
> <option><FormattedMessage id="Roles" defaultMessage="Roles"/></option>
<option>Devices</option> <option><FormattedMessage id="Groups" defaultMessage="Groups"/></option>
<option>Roles</option>
<option>Groups</option>
</Input> </Input>
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label for="app-tags">Tags*</Label> <Label for="app-tags">
<Input <FormattedMessage id="Tags" defaultMessage="Tags"/>*
required </Label>
type="text" <Input required type="text" value={this.state.defValue} name="app-tags" id="app-tags"/>
value={this.state.defValue}
name="app-tags"
id="app-tags"
/>
<div id="batch-content"> <div id="batch-content">
{this.state.tags.map(tag => { {this.state.tags.map(tag => {
return ( return (
@ -105,7 +96,9 @@ class GeneralInfo extends Component {
</FormGroup> </FormGroup>
<div> <div>
<FormGroup> <FormGroup>
<Label for="app-screenshots">Screenshots*</Label> <Label for="app-screenshots">
<FormattedMessage id="Screenshots" defaultMessage="Screenshots"/>*
</Label>
<span className="image-sub-title"> (600 X 800 32 bit PNG)</span> <span className="image-sub-title"> (600 X 800 32 bit PNG)</span>
<div id="screenshot-container"> <div id="screenshot-container">
{this.state.screenshots.map((tile) => ( {this.state.screenshots.map((tile) => (
@ -138,7 +131,9 @@ class GeneralInfo extends Component {
<div style={{display: 'flex'}}> <div style={{display: 'flex'}}>
<div style={{float: 'left', marginRight: '15px'}}> <div style={{float: 'left', marginRight: '15px'}}>
<FormGroup> <FormGroup>
<Label for="app-icon">Icon*</Label> <Label for="app-icon">
<FormattedMessage id="Icon" defaultMessage="Icon"/>*
</Label>
<span className="image-sub-title"> (512 X 512 32 bit PNG)</span> <span className="image-sub-title"> (512 X 512 32 bit PNG)</span>
<div id="app-icon-container"> <div id="app-icon-container">
{this.state.icon.map((tile) => ( {this.state.icon.map((tile) => (
@ -163,7 +158,9 @@ class GeneralInfo extends Component {
</div> </div>
<div style={{marginLeft: '15px'}}> <div style={{marginLeft: '15px'}}>
<FormGroup> <FormGroup>
<Label for="app-banner">Banner*</Label> <Label for="app-banner">
<FormattedMessage id="Banner" defaultMessage="Banner"/>*
</Label>
<span className="image-sub-title"> (1000 X 400 32 bit PNG)</span> <span className="image-sub-title"> (1000 X 400 32 bit PNG)</span>
<div id="app-banner-container"> <div id="app-banner-container">
{this.state.banner.map((tile) => ( {this.state.banner.map((tile) => (
@ -189,7 +186,9 @@ class GeneralInfo extends Component {
</div> </div>
</div> </div>
<div className="save-info"> <div className="save-info">
<Button>Save</Button> <Button>
<FormattedMessage id="Save" defaultMessage="Save"/>
</Button>
</div> </div>
</form> </form>
</Row> </Row>

@ -20,6 +20,7 @@ import PropTypes from 'prop-types';
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Button, FormGroup, FormText, Input, Label, Row} from "reactstrap"; import {Button, FormGroup, FormText, Input, Label, Row} from "reactstrap";
import UploadPackage from "./UploadPackage"; import UploadPackage from "./UploadPackage";
import {FormattedMessage} from 'react-intl';
class CreateRelease extends Component { class CreateRelease extends Component {
constructor() { constructor() {
@ -74,7 +75,7 @@ class CreateRelease extends Component {
<div className="release-header"> <div className="release-header">
<a onClick={this.onBackClick}>{"<-"}</a> <a onClick={this.onBackClick}>{"<-"}</a>
<span id="create-release-header"> <span id="create-release-header">
<strong>{channel} Release</strong> <strong>{channel} <FormattedMessage id="Release" defaultMessage="Release"/></strong>
</span> </span>
</div> </div>
</Row> </Row>
@ -82,7 +83,7 @@ class CreateRelease extends Component {
<div className="release-create"> <div className="release-create">
<div> <div>
<span> <span>
<strong>Create Release</strong> <strong><FormattedMessage id="Create.Release" defaultMessage="Create Release"/></strong>
</span> </span>
<p> <p>
{channel === 'Production' ? "" : {channel === 'Production' ? "" :
@ -148,7 +149,9 @@ class CreateRelease extends Component {
</FormText> </FormText>
</FormGroup> </FormGroup>
<div> <div>
<Button className="form-btn">Save</Button> <Button className="form-btn">
<FormattedMessage id="Save" defaultMessage="Save"/>
</Button>
</div> </div>
</form> </form>
</div> </div>

@ -19,6 +19,7 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Button, Col, FormGroup, Input, Label, Row} from "reactstrap"; import {Button, Col, FormGroup, Input, Label, Row} from "reactstrap";
import {FormattedMessage} from 'react-intl';
class UploadPackage extends Component { class UploadPackage extends Component {
@ -39,44 +40,53 @@ class UploadPackage extends Component {
<div className="release-header"> <div className="release-header">
<a onClick={this.handleBack}>{"<-"}</a> <a onClick={this.handleBack}>{"<-"}</a>
<span id="create-release-header"> <span id="create-release-header">
<strong>New Release for {selectedChannel}</strong> <strong>
<FormattedMessage id="New.Release.For" defaultMessage="New Release For"/> {selectedChannel}
</strong>
</span> </span>
</div> </div>
</Row> </Row>
<Row> <Row>
<div className="release-header"> <div className="release-header">
<span id="create-release-header"> <span id="create-release-header">
<strong>Upload Package File</strong> <strong>
<FormattedMessage id="Upload.Package.File" defaultMessage="Upload Package File"/>
</strong>
</span> </span>
</div> </div>
</Row> </Row>
<Row> <Row>
<Col xs="3"> <Col xs="3">
<Button>Upload</Button> <Button>
<FormattedMessage id="Upload" defaultMessage="Upload"/>
</Button>
</Col> </Col>
<Col xs="3"> <Col xs="3">
<Button>Select from package library</Button> <Button>
<FormattedMessage id="Select.from.package.library"
defaultMessage="Select from package library"/>
</Button>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<div className="release-detail-content"> <div className="release-detail-content">
<form> <form>
<FormGroup> <FormGroup>
<Label>Release Name *</Label> <Label>
<Input <FormattedMessage id="Release.Name" defaultMessage="Release Name"/> *
required </Label>
type="text" <Input required type="text"/>
/>
</FormGroup> </FormGroup>
<FormGroup> <FormGroup>
<Label>Release Notes *</Label> <Label>
<Input <FormattedMessage id="Release.Notes" defaultMessage="Release Notes"/> *
required </Label>
type="textarea" <Input required type="textarea"/>
/>
</FormGroup> </FormGroup>
<div className="form-btn"> <div className="form-btn">
<Button>Send for Review</Button> <Button>
<FormattedMessage id="Send.for.Review" defaultMessage="Send for Review"/>
</Button>
</div> </div>
</form> </form>
</div> </div>

@ -16,10 +16,10 @@
* under the License. * under the License.
*/ */
import PropTypes from 'prop-types';
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Button, Col, Row} from "reactstrap"; import {Button, Col, Row} from "reactstrap";
import CreateRelease from "../Create/CreateRelease"; import CreateRelease from "../Create/CreateRelease";
import {FormattedMessage} from 'react-intl';
class ReleaseManager extends Component { class ReleaseManager extends Component {
@ -82,7 +82,7 @@ class ReleaseManager extends Component {
<Row> <Row>
<Col sm="12"> <Col sm="12">
<div className="release" id="production"> <div className="release" id="production">
<span>Production Releases</span> <FormattedMessage id="Production.Releases" defaultMessage="Production Releases"/>
<div className="release-content"> <div className="release-content">
<div className="release-inner"> <div className="release-inner">
{this.getNoReleaseContent("Production")} {this.getNoReleaseContent("Production")}
@ -94,7 +94,7 @@ class ReleaseManager extends Component {
<Row> <Row>
<Col sm="12"> <Col sm="12">
<div className="release" id="beta"> <div className="release" id="beta">
<span>Beta Releases</span> <FormattedMessage id="Beta.Releases" defaultMessage="Beta Releases"/>
<div className="release-content"> <div className="release-content">
<div className="release-inner"> <div className="release-inner">
{this.getNoReleaseContent("Beta")} {this.getNoReleaseContent("Beta")}
@ -106,7 +106,7 @@ class ReleaseManager extends Component {
<Row> <Row>
<Col sm="12"> <Col sm="12">
<div className="release" id="alpha"> <div className="release" id="alpha">
<span>Alpha Releases</span> <FormattedMessage id="Alpha.Releases" defaultMessage="Alpha Releases"/>
<div className="release-content"> <div className="release-content">
<div className="release-inner"> <div className="release-inner">
{this.getNoReleaseContent("Alpha")} {this.getNoReleaseContent("Alpha")}

@ -19,6 +19,7 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {withRouter} from 'react-router-dom'; import {withRouter} from 'react-router-dom';
import {Col, Row} from "reactstrap"; import {Col, Row} from "reactstrap";
import {FormattedMessage} from 'react-intl';
/** /**
* Application view component. * Application view component.
@ -90,7 +91,9 @@ class ApplicationView extends Component {
<div id="application-view-row"> <div id="application-view-row">
<Row> <Row>
<Col> <Col>
<span><strong>Description: </strong></span> <span><strong>
<FormattedMessage id="Description" defaultMessage="Description"/>:
</strong></span>
</Col> </Col>
<Col> <Col>
<p>sdfjlkdsjfsjdfjsdf sfjdslkjfdsflkjdsfslkdjfl j</p> <p>sdfjlkdsjfsjdfjsdf sfjdslkjfdsflkjdsfslkdjfl j</p>
@ -98,7 +101,9 @@ class ApplicationView extends Component {
</Row> </Row>
<Row> <Row>
<Col> <Col>
<span><strong>Tags: </strong></span> <span><strong>
<FormattedMessage id="Tags" defaultMessage="Tags"/>:
</strong></span>
</Col> </Col>
<Col> <Col>
<p>[list of tags...]</p> <p>[list of tags...]</p>
@ -106,7 +111,9 @@ class ApplicationView extends Component {
</Row> </Row>
<Row> <Row>
<Col> <Col>
<span><strong>Release: </strong></span> <span><strong>
<FormattedMessage id="Release" defaultMessage="Release"/>:
</strong></span>
</Col> </Col>
<Col> <Col>
<p>Production</p> <p>Production</p>
@ -114,7 +121,9 @@ class ApplicationView extends Component {
</Row> </Row>
<Row> <Row>
<Col> <Col>
<span><strong>Version: </strong></span> <span><strong>
<FormattedMessage id="Version" defaultMessage="Version"/>:
</strong></span>
</Col> </Col>
<Col> <Col>
<p>v1.0</p> <p>v1.0</p>

@ -21,9 +21,37 @@ import Publisher from './App';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import 'bootstrap/dist/css/bootstrap.css'; import 'bootstrap/dist/css/bootstrap.css';
import registerServiceWorker from './registerServiceWorker'; import registerServiceWorker from './registerServiceWorker';
import {IntlProvider, addLocaleData, defineMessages} from 'react-intl';
import Axios from 'axios';
import Constants from './common/constants';
const possibleLocale = navigator.language.split("-")[0];
let loadLocaleFile = Axios.create({
baseURL: Constants.hostConstants.baseURL + "/" + Constants.hostConstants.appContext + "/locales/"
+ possibleLocale + ".json"
}).get();
/** /**
* This is the base js file of the app. All the content will be rendered in the root element. * This is the base js file of the app. All the content will be rendered in the root element.
* */ * */
ReactDOM.render(<Publisher/>, document.getElementById('root')); loadLocaleFile.then(response => {
const messages = defineMessages(response.data);
addLocaleData(require('react-intl/locale-data/' + possibleLocale));
ReactDOM.render(<IntlProvider locale={possibleLocale}
messages={messages}><Publisher/></IntlProvider>, document.getElementById('root'));
registerServiceWorker();
}).catch(error => {
addLocaleData(require('react-intl/locale-data/' + Constants.defaultLocale));
let defaultLocale = axios.create({
baseURL: Constants.hostConstants.baseURL + "/" + Constants.hostConstants.appContext + "/locales"
+ Constants.defaultLocale + ".json"
}).get();
defaultLocale.then(response => {
const messages = defineMessages(response.data);
ReactDOM.render(<IntlProvider locale={possibleLocale}
messages={messages}><Publisher/></IntlProvider>, document.getElementById('root'));
registerServiceWorker(); registerServiceWorker();
}).catch(error => {
});
});

@ -64,7 +64,6 @@ const config = {
] ]
}, },
resolve: { resolve: {
// you can now require('file') instead of require('file.coffee')
extensions: ['.jsx', '.js', '.ttf', '.woff', '.woff2', '.svg'] extensions: ['.jsx', '.js', '.ttf', '.woff', '.woff2', '.svg']
} }

@ -0,0 +1,61 @@
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* you may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.device.mgt.common.app.mgt;
public class DeviceApplicationMapping {
private String deviceIdentifier;
private String applicationUUID;
private String versionName;
private boolean installed;
public String getDeviceIdentifier() {
return deviceIdentifier;
}
public void setDeviceIdentifier(String deviceIdentifier) {
this.deviceIdentifier = deviceIdentifier;
}
public String getApplicationUUID() {
return applicationUUID;
}
public void setApplicationUUID(String applicationUUID) {
this.applicationUUID = applicationUUID;
}
public String getVersionName() {
return versionName;
}
public void setVersionName(String versionName) {
this.versionName = versionName;
}
public boolean isInstalled() {
return installed;
}
public void setInstalled(boolean installed) {
this.installed = installed;
}
}

@ -28,6 +28,7 @@ import org.wso2.carbon.device.mgt.common.InvalidDeviceException;
import org.wso2.carbon.device.mgt.common.TransactionManagementException; import org.wso2.carbon.device.mgt.common.TransactionManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.DeviceApplicationMapping;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
@ -192,10 +193,85 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem
} }
} }
private boolean contains(DeviceApplicationMapping deviceApp, List<Application> installedApps) {
boolean installed = false;
for (Application app : installedApps) {
if (app.getApplicationIdentifier().equals(deviceApp.getApplicationUUID()) && app.getVersion().equals(deviceApp.getVersionName())) {
installed = true;
break;
}
}
return installed;
}
@Override @Override
public void updateApplicationListInstalledInDevice( public void updateApplicationListInstalledInDevice(
DeviceIdentifier deviceIdentifier, DeviceIdentifier deviceIdentifier,
List<Application> applications) throws ApplicationManagementException { List<Application> applications) throws ApplicationManagementException {
try {
DeviceManagementDAOFactory.beginTransaction();
List<DeviceApplicationMapping> installedDeviceApps = new ArrayList<>();
List<DeviceApplicationMapping> uninstalledDeviceApps = new ArrayList<>();
List<DeviceApplicationMapping> deviceApps = applicationMappingDAO.getApplicationsOfDevice(deviceIdentifier.getId(), false);
for (DeviceApplicationMapping deviceApp : deviceApps) {
if (contains(deviceApp, applications)) {
if (!deviceApp.isInstalled()) {
// device app mapping is recorded as not installed (i.e. install app operation has been sent to device)
// as the app list sent from the device contains this, app is now installed in the device
// so we can mark the device app mapping entry as installed.
deviceApp.setInstalled(true);
applicationMappingDAO.updateDeviceApplicationMapping(deviceApp);
}
} else {
if (deviceApp.isInstalled()) {
// we have a device-app mapping in the installed state in the db. but app is not installed in the device.
// which implies that a previously installed app has been uninstalled from the device. so we have to remove the device app mapping
applicationMappingDAO.removeApplicationMapping(deviceApp);
}
}
}
DeviceManagementDAOFactory.commitTransaction();
} catch (DeviceManagementDAOException | TransactionManagementException e) {
String msg = "Failed to update application list of the device " + deviceIdentifier;
throw new ApplicationManagementException(msg, e);
}
}
public void updateApplicationListInstalledInDeviceDep(
DeviceIdentifier deviceIdentifier,
List<Application> applications) throws ApplicationManagementException {
try {
DeviceManagementDAOFactory.beginTransaction();
List<DeviceApplicationMapping> installedDeviceApps = new ArrayList<>();
List<DeviceApplicationMapping> uninstalledDeviceApps = new ArrayList<>();
List<DeviceApplicationMapping> deviceApps = applicationMappingDAO.getApplicationsOfDevice(deviceIdentifier.getId(), false);
for (DeviceApplicationMapping deviceApp : deviceApps) {
if (contains(deviceApp, applications)) {
// if device app is pending mark device app as installed
if (!deviceApp.isInstalled()) {
deviceApp.setInstalled(true);
applicationMappingDAO.updateDeviceApplicationMapping(deviceApp);
}
} else {
if (deviceApp.isInstalled()) {
// this means we have a device-app mapping in the installed state in the db. but app is not installed in the device.
// which implies that a previously installed app has been uninstalled from the device. so we have to remove the device app mapping
applicationMappingDAO.removeApplicationMapping(deviceApp);
}
}
}
DeviceManagementDAOFactory.commitTransaction();
} catch (DeviceManagementDAOException | TransactionManagementException e) {
String msg = "Failed to update application list of the device " + deviceIdentifier;
throw new ApplicationManagementException(msg, e);
}
List<Application> installedAppList = getApplicationListForDevice(deviceIdentifier); List<Application> installedAppList = getApplicationListForDevice(deviceIdentifier);
try { try {
Device device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceIdentifier, Device device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceIdentifier,

@ -19,6 +19,7 @@
package org.wso2.carbon.device.mgt.core.dao; package org.wso2.carbon.device.mgt.core.dao;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.DeviceApplicationMapping;
import java.util.List; import java.util.List;
@ -31,4 +32,12 @@ public interface ApplicationMappingDAO {
void removeApplicationMapping(int deviceId, List<Integer> appIdList, int tenantId) void removeApplicationMapping(int deviceId, List<Integer> appIdList, int tenantId)
throws DeviceManagementDAOException; throws DeviceManagementDAOException;
int addDeviceApplicationMapping(DeviceApplicationMapping deviceApp) throws DeviceManagementDAOException;
void updateDeviceApplicationMapping(DeviceApplicationMapping deviceApp) throws DeviceManagementDAOException;
List<DeviceApplicationMapping> getApplicationsOfDevice(String deviceIdentifier, boolean installed) throws DeviceManagementDAOException;
void removeApplicationMapping(DeviceApplicationMapping deviceApp) throws DeviceManagementDAOException;
} }

@ -22,6 +22,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.app.mgt.Application; import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.DeviceApplicationMapping;
import org.wso2.carbon.device.mgt.core.dao.ApplicationMappingDAO; import org.wso2.carbon.device.mgt.core.dao.ApplicationMappingDAO;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
@ -38,6 +39,8 @@ import java.util.Properties;
public class ApplicationMappingDAOImpl implements ApplicationMappingDAO { public class ApplicationMappingDAOImpl implements ApplicationMappingDAO {
private static Log log = LogFactory.getLog(ApplicationMappingDAOImpl.class);
@Override @Override
public int addApplicationMapping(int deviceId, int applicationId, public int addApplicationMapping(int deviceId, int applicationId,
int tenantId) throws DeviceManagementDAOException { int tenantId) throws DeviceManagementDAOException {
@ -120,6 +123,128 @@ public class ApplicationMappingDAOImpl implements ApplicationMappingDAO {
} }
} }
@Override
public int addDeviceApplicationMapping(DeviceApplicationMapping deviceApp) throws
DeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
int mappingId = -1;
try {
conn = getConnection();
String sql = "SELECT ID FROM DM_DEVICE_APPLICATION_MAPPING WHERE DEVICE_IDENTIFIER = ? AND " +
"APPLICATION_UUID = ? AND VERSION_NAME = ?";
stmt = conn.prepareStatement(sql);
stmt.setString(1, deviceApp.getDeviceIdentifier());
stmt.setString(2, deviceApp.getApplicationUUID());
stmt.setString(3, deviceApp.getVersionName());
rs = stmt.executeQuery();
if (!rs.next()) {
sql = "INSERT INTO DM_DEVICE_APPLICATION_MAPPING (DEVICE_IDENTIFIER, APPLICATION_UUID, VERSION_NAME," +
"INSTALLED) VALUES (?, ?, ?, ?)";
stmt = conn.prepareStatement(sql, new String[]{"id"});
stmt.setString(1, deviceApp.getDeviceIdentifier());
stmt.setString(2, deviceApp.getApplicationUUID());
stmt.setString(3, deviceApp.getVersionName());
stmt.setBoolean(4, deviceApp.isInstalled());
stmt.executeUpdate();
rs = stmt.getGeneratedKeys();
if (rs.next()) {
mappingId = rs.getInt(1);
}
return mappingId;
} else {
log.warn("Device[" + deviceApp.getDeviceIdentifier() + "] application[" + deviceApp.getApplicationUUID() + "] mapping already " +
"exists in the DB");
return -1;
}
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while adding device application mapping to DB", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
}
}
@Override
public void updateDeviceApplicationMapping(DeviceApplicationMapping deviceApp) throws
DeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
conn = getConnection();
String sql = "UPDATE DM_DEVICE_APPLICATION_MAPPING " +
"SET INSTALLED = ? " +
"WHERE DEVICE_IDENTIFIER = ? AND APPLICATION_UUID = ? AND VERSION_NAME = ?";
stmt = conn.prepareStatement(sql);
stmt.setBoolean(1, deviceApp.isInstalled());
stmt.setString(2, deviceApp.getDeviceIdentifier());
stmt.setString(3, deviceApp.getApplicationUUID());
stmt.setString(3, deviceApp.getVersionName());
stmt.executeUpdate();
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while adding device application mapping to DB", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
}
}
@Override
public List<DeviceApplicationMapping> getApplicationsOfDevice(String deviceIdentifier, boolean installed) throws
DeviceManagementDAOException {
List<DeviceApplicationMapping> applications = new ArrayList<>();
Connection conn;
PreparedStatement stmt = null;
ResultSet rs = null;
int mappingId = -1;
try {
conn = getConnection();
String sql = "SELECT APPLICATION_UUID, VERSION_NAME FROM DM_DEVICE_APPLICATION_MAPPING WHERE DEVICE_IDENTIFIER = ? AND INSTALLED = ?";
stmt = conn.prepareStatement(sql);
stmt.setString(1, deviceIdentifier);
stmt.setBoolean(2, installed);
rs = stmt.executeQuery();
while (rs.next()) {
DeviceApplicationMapping deviceApp = new DeviceApplicationMapping();
deviceApp.setDeviceIdentifier(deviceIdentifier);
deviceApp.setApplicationUUID(rs.getString(1));
deviceApp.setVersionName(rs.getString(2));
deviceApp.setInstalled(true);
applications.add(deviceApp);
}
return applications;
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while adding device application mapping to DB", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
}
}
@Override
public void removeApplicationMapping(DeviceApplicationMapping deviceApp) throws DeviceManagementDAOException {
Connection conn;
PreparedStatement stmt = null;
try {
String sql = "DELETE FROM DM_DEVICE_APPLICATION_MAPPING WHERE DEVICE_IDENTIFIER = ? AND " +
"APPLICATION_UUID = ? AND VERSION_NAME = ?";
conn = this.getConnection();
stmt = conn.prepareStatement(sql);
stmt.setString(1, deviceApp.getDeviceIdentifier());
stmt.setString(2, deviceApp.getApplicationUUID());
stmt.setString(3, deviceApp.getVersionName());
stmt.executeUpdate();
} catch (SQLException e) {
throw new DeviceManagementDAOException("Error occurred while removing device application mapping", e);
} finally {
DeviceManagementDAOUtil.cleanupResources(stmt, null);
}
}
private Connection getConnection() throws SQLException { private Connection getConnection() throws SQLException {
return DeviceManagementDAOFactory.getConnection(); return DeviceManagementDAOFactory.getConnection();
} }

@ -26,6 +26,7 @@ import org.wso2.carbon.device.mgt.common.InvalidDeviceException;
import org.wso2.carbon.device.mgt.common.MonitoringOperation; import org.wso2.carbon.device.mgt.common.MonitoringOperation;
import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult; import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.mgt.common.app.mgt.DeviceApplicationMapping;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
@ -591,4 +592,6 @@ public interface DeviceManagementProviderService {
throws PullNotificationExecutionFailedException; throws PullNotificationExecutionFailedException;
List<Integer> getDeviceEnrolledTenants() throws DeviceManagementException; List<Integer> getDeviceEnrolledTenants() throws DeviceManagementException;
void addDeviceApplicationMapping(DeviceApplicationMapping deviceApp) throws DeviceManagementException;
} }

@ -28,8 +28,10 @@ import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager; import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.DeviceNotFoundException; import org.wso2.carbon.device.mgt.common.DeviceNotFoundException;
import org.wso2.carbon.device.mgt.common.app.mgt.DeviceApplicationMapping;
import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationExecutionFailedException; import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationExecutionFailedException;
import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationSubscriber; import org.wso2.carbon.device.mgt.common.pull.notification.PullNotificationSubscriber;
import org.wso2.carbon.device.mgt.core.dao.ApplicationMappingDAO;
import org.wso2.carbon.device.mgt.core.dto.DeviceTypeServiceIdentifier; import org.wso2.carbon.device.mgt.core.dto.DeviceTypeServiceIdentifier;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.FeatureManager; import org.wso2.carbon.device.mgt.common.FeatureManager;
@ -100,6 +102,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
private DeviceTypeDAO deviceTypeDAO; private DeviceTypeDAO deviceTypeDAO;
private EnrollmentDAO enrollmentDAO; private EnrollmentDAO enrollmentDAO;
private ApplicationDAO applicationDAO; private ApplicationDAO applicationDAO;
private ApplicationMappingDAO applicationMappingDAO;
private DeviceManagementPluginRepository pluginRepository; private DeviceManagementPluginRepository pluginRepository;
public DeviceManagementProviderServiceImpl() { public DeviceManagementProviderServiceImpl() {
@ -116,6 +119,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
this.applicationDAO = DeviceManagementDAOFactory.getApplicationDAO(); this.applicationDAO = DeviceManagementDAOFactory.getApplicationDAO();
this.deviceTypeDAO = DeviceManagementDAOFactory.getDeviceTypeDAO(); this.deviceTypeDAO = DeviceManagementDAOFactory.getDeviceTypeDAO();
this.enrollmentDAO = DeviceManagementDAOFactory.getEnrollmentDAO(); this.enrollmentDAO = DeviceManagementDAOFactory.getEnrollmentDAO();
this.applicationMappingDAO = DeviceManagementDAOFactory.getApplicationMappingDAO();
} }
@Override @Override
@ -1698,6 +1702,20 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
pullNotificationSubscriber.execute(deviceIdentifier, operation); pullNotificationSubscriber.execute(deviceIdentifier, operation);
} }
public void addDeviceApplicationMapping(DeviceApplicationMapping deviceApp) throws DeviceManagementException {
try {
DeviceManagementDAOFactory.openConnection();
applicationMappingDAO.addDeviceApplicationMapping(deviceApp);
} catch (DeviceManagementDAOException e) {
throw new DeviceManagementException("Error occurred while adding device application mapping for device "
+ deviceApp.getDeviceIdentifier() + " and application " + deviceApp.getApplicationUUID(), e);
} catch (SQLException e) {
throw new DeviceManagementException("Error occurred while opening a connection to the data source", e);
} finally {
DeviceManagementDAOFactory.closeConnection();
}
}
/** /**
* Returns all the device-info including location of the given device. * Returns all the device-info including location of the given device.
*/ */

@ -0,0 +1,19 @@
mvn clean install -Dmaven.test.skip=true -f components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml
mvn clean install -Dmaven.test.skip=true -f components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml
mvn clean install -Dmaven.test.skip=true -f components/application-mgt/org.wso2.carbon.device.application.mgt.api/pom.xml
rm ~/projects/wso2/iot/testing/appm/310appm/wso2iot-3.1.0-SNAPSHOT/patches/patch0101/ -r
mkdir ~/projects/wso2/iot/testing/appm/310appm/wso2iot-3.1.0-SNAPSHOT/patches/patch0101
cp components/application-mgt/org.wso2.carbon.device.application.mgt.common/target/org.wso2.carbon.device.application.mgt.common-*.jar ~/projects/wso2/iot/testing/appm/310appm/wso2iot-3.1.0-SNAPSHOT/patches/patch0101/
cp components/application-mgt/org.wso2.carbon.device.application.mgt.core/target/org.wso2.carbon.device.application.mgt.core-*.jar ~/projects/wso2/iot/testing/appm/310appm/wso2iot-3.1.0-SNAPSHOT/patches/patch0101/
rm ~/projects/wso2/iot/testing/appm/310appm/wso2iot-3.1.0-SNAPSHOT/repository/deployment/server/webapps/api#application-mgt#v1.0.war
rm ~/projects/wso2/iot/testing/appm/310appm/wso2iot-3.1.0-SNAPSHOT/repository/deployment/server/webapps/api#application-mgt#v1.0/ -r
cp components/application-mgt/org.wso2.carbon.device.application.mgt.api/target/api#application-mgt#v1.0.war ~/projects/wso2/iot/testing/appm/310appm/wso2iot-3.1.0-SNAPSHOT/repository/deployment/server/webapps/

@ -22,12 +22,6 @@
<DatasourceName>jdbc/APPM_DS</DatasourceName> <DatasourceName>jdbc/APPM_DS</DatasourceName>
<Extensions> <Extensions>
<Extension name="ApplicationUploadManager">
<ClassName>org.wso2.carbon.device.application.mgt.core.impl.ApplicationUploadManagerImpl</ClassName>
<Parameters>
<Parameter name="UploadPath">repository/resources/mobileapps</Parameter>
</Parameters>
</Extension>
<Extension name="ApplicationManager"> <Extension name="ApplicationManager">
<ClassName>org.wso2.carbon.device.application.mgt.core.impl.ApplicationManagerImpl</ClassName> <ClassName>org.wso2.carbon.device.application.mgt.core.impl.ApplicationManagerImpl</ClassName>
</Extension> </Extension>
@ -57,10 +51,10 @@
</Extension> </Extension>
<Extension name="ApplicationStorageManager"> <Extension name="ApplicationStorageManager">
<ClassName>org.wso2.carbon.device.application.mgt.core.impl.ApplicationStorageManagerImpl</ClassName> <ClassName>org.wso2.carbon.device.application.mgt.core.impl.ApplicationStorageManagerImpl</ClassName>
<Parameters>
<Parameter name="StoragePath">repository/resources/apps</Parameter>
<Parameter name="MaxScreenShotCount">6</Parameter>
</Parameters>
</Extension> </Extension>
</Extensions> </Extensions>
<Artifacts>
<BinaryLocation>repository/resources/mobileapps/</BinaryLocation>
</Artifacts>
</ApplicationManagementConfiguration> </ApplicationManagementConfiguration>

@ -286,7 +286,7 @@ CREATE INDEX FK_APPLICATION_COMMENTS_APPLICATION_RELEASE ON APPM_COMMENT(APPLICA
-- Table APPM_PLATFORM_TAG -- Table APPM_PLATFORM_TAG
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS APPM_PLATFORM_TAG ( CREATE TABLE IF NOT EXISTS APPM_PLATFORM_TAG (
name VARCHAR(100) NOT NULL, NAME VARCHAR(100) NOT NULL,
PLATFORM_ID INT NOT NULL, PLATFORM_ID INT NOT NULL,
PRIMARY KEY (PLATFORM_ID, name), PRIMARY KEY (PLATFORM_ID, name),
CONSTRAINT fk_APPM_SUPPORTED_PLATFORM_TAGS_APPM_SUPPORTED_PLATFORM1 CONSTRAINT fk_APPM_SUPPORTED_PLATFORM_TAGS_APPM_SUPPORTED_PLATFORM1

@ -393,17 +393,17 @@ CREATE TABLE IF NOT EXISTS `APPM_SUBSCRIPTION_PROPERTIES` (
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `APPM_DEVICE_APPLICATION_MAPPING` -- Table `APPM_DEVICE_APPLICATION_MAPPING`
-- ----------------------------------------------------- -- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `APPM_DEVICE_APPLICATION_MAPPING` ( -- CREATE TABLE IF NOT EXISTS `APPM_DEVICE_APPLICATION_MAPPING` (
`ID` INT AUTO_INCREMENT NOT NULL, -- `ID` INT AUTO_INCREMENT NOT NULL,
`DEVICE_IDENTIFIER` VARCHAR(255) NOT NULL, -- `DEVICE_IDENTIFIER` VARCHAR(255) NOT NULL,
`APPLICATION_UUID` VARCHAR(100) NOT NULL, -- `APPLICATION_UUID` VARCHAR(100) NOT NULL,
`INSTALLED` BOOLEAN NOT NULL, -- `INSTALLED` BOOLEAN NOT NULL,
`SENT_AT` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, -- `SENT_AT` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (ID), -- PRIMARY KEY (ID),
CONSTRAINT `fk_appm_application` FOREIGN KEY (`APPLICATION_UUID`) REFERENCES -- CONSTRAINT `fk_appm_application` FOREIGN KEY (`APPLICATION_UUID`) REFERENCES
APPM_APPLICATION (`UUID`) ON DELETE NO ACTION ON UPDATE NO ACTION, -- APPM_APPLICATION (`UUID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
UNIQUE KEY `device_app_mapping` (`DEVICE_IDENTIFIER`, `APPLICATION_UUID`) -- UNIQUE KEY `device_app_mapping` (`DEVICE_IDENTIFIER`, `APPLICATION_UUID`)
) ENGINE = InnoDB; -- ) ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE; SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;

@ -402,17 +402,17 @@ CREATE TABLE IF NOT EXISTS DM_APPLICATION (
)ENGINE = InnoDB; )ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS DM_DEVICE_APPLICATION_MAPPING ( -- CREATE TABLE IF NOT EXISTS DM_DEVICE_APPLICATION_MAPPING (
ID INTEGER AUTO_INCREMENT NOT NULL, -- ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INTEGER NOT NULL, -- DEVICE_ID INTEGER NOT NULL,
APPLICATION_ID INTEGER NOT NULL, -- APPLICATION_ID INTEGER NOT NULL,
TENANT_ID INTEGER NOT NULL, -- TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (ID), -- PRIMARY KEY (ID),
CONSTRAINT fk_dm_device FOREIGN KEY (DEVICE_ID) REFERENCES -- CONSTRAINT fk_dm_device FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, -- DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT fk_dm_application FOREIGN KEY (APPLICATION_ID) REFERENCES -- CONSTRAINT fk_dm_application FOREIGN KEY (APPLICATION_ID) REFERENCES
DM_APPLICATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION -- DM_APPLICATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE = InnoDB; -- )ENGINE = InnoDB;
-- END OF POLICY RELATED TABLES -- -- END OF POLICY RELATED TABLES --
@ -521,6 +521,20 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL (
ON UPDATE NO ACTION) ON UPDATE NO ACTION)
ENGINE = InnoDB; ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `APPM_DEVICE_APPLICATION_MAPPING`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `DM_DEVICE_APPLICATION_MAPPING` (
`ID` INT AUTO_INCREMENT NOT NULL,
`DEVICE_IDENTIFIER` VARCHAR(255) NOT NULL,
`APPLICATION_UUID` VARCHAR(100) NOT NULL,
`VERSION_NAME` VARCHAR(100) NOT NULL,
`INSTALLED` BOOLEAN NOT NULL,
`SENT_AT` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (ID),
UNIQUE KEY `device_app_mapping` (`DEVICE_IDENTIFIER`, `APPLICATION_UUID`)
) ENGINE = InnoDB;
-- DASHBOARD RELATED VIEWS -- -- DASHBOARD RELATED VIEWS --
CREATE VIEW DEVICE_INFO_VIEW AS CREATE VIEW DEVICE_INFO_VIEW AS

@ -0,0 +1,355 @@
2017-09-11 11:17:06,019 INFO o.a.j.u.JMeterUtils: Setting Locale to en_US
2017-09-11 11:17:06,029 INFO o.a.j.JMeter: Loading user properties from: /home/wso2/programs/jmeter/apache-jmeter-3.2/bin/user.properties
2017-09-11 11:17:06,030 INFO o.a.j.JMeter: Loading system properties from: /home/wso2/programs/jmeter/apache-jmeter-3.2/bin/system.properties
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: Copyright (c) 1998-2017 The Apache Software Foundation
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: Version 3.2 r1790748
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: java.version=1.8.0_131
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: os.name=Linux
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: os.arch=amd64
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: os.version=4.10.0-33-generic
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: file.encoding=UTF-8
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: Max memory =536870912
2017-09-11 11:17:06,036 INFO o.a.j.JMeter: Available Processors =4
2017-09-11 11:17:06,040 INFO o.a.j.JMeter: Default Locale=English (United States)
2017-09-11 11:17:06,041 INFO o.a.j.JMeter: JMeter Locale=English (United States)
2017-09-11 11:17:06,041 INFO o.a.j.JMeter: JMeterHome=/home/wso2/programs/jmeter/apache-jmeter-3.2
2017-09-11 11:17:06,041 INFO o.a.j.JMeter: user.dir =/home/wso2/projects/wso2/iot/chathura/device-mgt/carbon-device-mgt
2017-09-11 11:17:06,041 INFO o.a.j.JMeter: PWD =/home/wso2/projects/wso2/iot/chathura/device-mgt/carbon-device-mgt
2017-09-11 11:17:06,041 INFO o.a.j.JMeter: IP: 127.0.1.1 Name: laptop1 FullName: laptop1
2017-09-11 11:17:06,302 INFO o.a.j.g.a.LookAndFeelCommand: Using look and feel: javax.swing.plaf.metal.MetalLookAndFeel [Metal, CrossPlatform]
2017-09-11 11:17:06,305 INFO o.a.j.JMeter: Loaded icon properties from org/apache/jmeter/images/icon.properties
2017-09-11 11:17:06,714 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.'
2017-09-11 11:17:06,714 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.'
2017-09-11 11:17:07,644 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.assertions.BSFAssertion
2017-09-11 11:17:08,197 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.extractor.BSFPostProcessor
2017-09-11 11:17:08,237 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.modifiers.BSFPreProcessor
2017-09-11 11:17:08,271 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2017-09-11 11:17:08,271 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2017-09-11 11:17:08,271 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2017-09-11 11:17:08,272 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser
2017-09-11 11:17:08,272 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2017-09-11 11:17:08,272 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser
2017-09-11 11:17:08,616 INFO o.a.j.e.KeyToolUtils: keytool found at 'keytool'
2017-09-11 11:17:08,617 INFO o.a.j.p.h.p.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file /home/wso2/programs/jmeter/apache-jmeter-3.2/bin/proxyserver.jks
2017-09-11 11:17:08,755 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.protocol.java.sampler.BSFSampler
2017-09-11 11:17:08,797 INFO o.a.j.s.FileServer: Default base='/home/wso2/projects/wso2/iot/chathura/device-mgt/carbon-device-mgt'
2017-09-11 11:17:08,876 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.config.MongoSourceElement
2017-09-11 11:17:08,876 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler
2017-09-11 11:17:08,989 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.timers.BSFTimer
2017-09-11 11:17:09,023 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.visualizers.BSFListener
2017-09-11 11:17:09,177 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times
2017-09-11 11:17:09,178 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2017-09-11 11:17:09,178 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true
2017-09-11 11:17:09,178 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000
2017-09-11 11:17:16,343 INFO o.a.j.g.a.Load: Loading file: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/ApplicationManagementAPI.jmx
2017-09-11 11:17:16,344 INFO o.a.j.s.FileServer: Set new base='/home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts'
2017-09-11 11:17:16,441 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2017-09-11 11:17:16,456 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8
2017-09-11 11:17:16,458 INFO o.a.j.s.SaveService: Using SaveService properties version 3.2
2017-09-11 11:17:16,461 INFO o.a.j.s.SaveService: Loading file: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/ApplicationManagementAPI.jmx
2017-09-11 11:17:16,491 INFO o.a.j.p.h.c.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_
2017-09-11 11:17:16,491 INFO o.a.j.u.NameUpdater: Upgrading class org.apache.jmeter.protocol.http.sampler.SoapSampler to org.apache.jmeter.config.ConfigTestElement
2017-09-11 11:17:16,491 INFO o.a.j.u.NameUpdater: Upgrading class org.apache.jmeter.protocol.http.control.gui.SoapSamplerGui to org.apache.jmeter.config.gui.ObsoleteGui
2017-09-11 11:17:16,492 INFO o.a.j.u.NameUpdater: Upgrading class org.apache.jmeter.protocol.http.control.gui.SoapSamplerGui to org.apache.jmeter.config.gui.ObsoleteGui
2017-09-11 11:17:16,503 INFO o.a.j.u.NameUpdater: Upgrading class org.apache.jmeter.protocol.http.control.gui.SoapSamplerGui to org.apache.jmeter.config.gui.ObsoleteGui
2017-09-11 11:17:16,504 INFO o.a.j.u.NameUpdater: Upgrading class org.apache.jmeter.protocol.http.control.gui.SoapSamplerGui to org.apache.jmeter.config.gui.ObsoleteGui
2017-09-11 11:17:17,087 INFO o.a.j.s.FileServer: Set new base='/home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts'
2017-09-11 11:18:36,250 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 11:18:36,251 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 11:18:36,251 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 11:18:36,266 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 11:18:36,378 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 11:18:36,378 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 11:18:36,378 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 11:18:36,378 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 11:18:36,418 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 11:18:36,418 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 11:18:36,424 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 11:18:36,464 INFO o.a.j.p.h.s.HTTPHCAbstractImpl: Local host = laptop1
2017-09-11 11:18:36,467 INFO o.a.j.p.h.s.HTTPHC4Impl: HTTP request retry count = 0
2017-09-11 11:18:36,521 INFO o.a.j.p.h.s.LazySchemeSocketFactory: Setting up HTTPS TrustAll Socket Factory
2017-09-11 11:18:36,525 INFO o.a.j.u.JsseSSLManager: Using default SSL protocol: TLS
2017-09-11 11:18:36,525 INFO o.a.j.u.JsseSSLManager: SSL session context: per-thread
2017-09-11 11:18:36,705 INFO o.a.j.u.SSLManager: JmeterKeyStore Location: type JKS
2017-09-11 11:18:36,705 INFO o.a.j.u.SSLManager: KeyStore created OK
2017-09-11 11:18:36,705 WARN o.a.j.u.SSLManager: Keystore file not found, loading empty keystore
2017-09-11 11:18:40,414 INFO o.a.j.s.FileServer: Stored: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/image.png
2017-09-11 11:18:40,915 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 11:18:40,916 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 11:18:40,916 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 11:18:40,917 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 11:41:19,241 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 11:41:19,242 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 11:41:19,247 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 11:41:19,371 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 11:41:19,371 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 11:41:19,371 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 11:41:19,372 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 11:41:19,403 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 11:41:19,403 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 11:41:19,408 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 11:41:25,273 INFO o.a.j.s.FileServer: Stored: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/image.png
2017-09-11 11:41:26,162 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 11:41:26,163 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 11:41:26,163 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 11:41:26,163 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 11:46:37,551 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 11:46:37,551 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 11:46:37,555 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 11:46:37,677 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 11:46:37,677 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 11:46:37,677 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 11:46:37,678 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 11:46:37,703 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 11:46:37,703 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 11:46:37,704 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 11:46:40,303 INFO o.a.j.s.FileServer: Stored: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/image.png
2017-09-11 11:46:41,107 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 11:46:41,107 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 11:46:41,108 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 11:46:41,108 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 11:49:20,026 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 11:49:20,026 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 11:49:20,029 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 11:49:20,136 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 11:49:20,136 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 11:49:20,137 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 11:49:20,137 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 11:49:20,165 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 11:49:20,166 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 11:49:20,167 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 11:51:01,448 INFO o.a.j.s.FileServer: Stored: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/image.png
2017-09-11 11:53:08,769 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 11:53:08,769 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 11:53:08,770 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 11:53:08,771 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 11:57:09,607 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 11:57:09,609 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 11:57:09,613 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 11:57:09,736 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 11:57:09,736 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 11:57:09,736 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 11:57:09,736 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 11:57:09,761 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 11:57:09,761 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 11:57:09,762 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 11:57:19,936 INFO o.a.j.s.FileServer: Stored: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/image.png
2017-09-11 11:57:20,432 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 11:57:20,432 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 11:57:20,433 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 11:57:20,433 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 11:59:08,030 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 11:59:08,031 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 11:59:08,031 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 11:59:08,164 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 11:59:08,164 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 11:59:08,164 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 11:59:08,164 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 11:59:08,178 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 11:59:08,178 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 11:59:08,179 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 11:59:10,634 INFO o.a.j.s.FileServer: Stored: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/image.png
2017-09-11 11:59:10,712 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 11:59:10,712 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 11:59:10,713 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 11:59:10,713 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 12:01:02,024 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 12:01:02,024 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 12:01:02,026 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 12:01:02,140 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 12:01:02,140 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 12:01:02,140 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 12:01:02,140 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 12:01:02,156 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 12:01:02,156 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 12:01:02,156 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 12:01:04,482 INFO o.a.j.s.FileServer: Stored: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/image.png
2017-09-11 12:01:04,525 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 12:01:04,525 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 12:01:04,526 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 12:01:04,526 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 12:03:39,895 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 12:03:39,896 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 12:03:39,897 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 12:03:40,008 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 12:03:40,008 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 12:03:40,008 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 12:03:40,008 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 12:03:40,018 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 12:03:40,018 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 12:03:40,020 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 12:03:42,312 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 12:03:42,312 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 12:03:42,312 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 12:03:42,312 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 12:07:13,180 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 12:07:13,180 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 12:07:13,181 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 12:07:13,321 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 12:07:13,321 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 12:07:13,321 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 12:07:13,321 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 12:07:13,332 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 12:07:13,332 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 12:07:13,332 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 12:07:15,869 INFO o.a.j.s.FileServer: Stored: /home/wso2/projects/wso2/iot/chathura/product-iots/product-iots/modules/integration/tests-integration/src/test/resources/jmeter-scripts/image.png
2017-09-11 12:07:15,910 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 12:07:15,910 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 12:07:15,910 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 12:07:15,911 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 14:23:30,019 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 14:23:30,024 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 14:23:30,032 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 14:23:30,562 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 14:23:30,562 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 14:23:30,562 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 14:23:30,562 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 14:23:30,589 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 14:23:30,589 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 14:23:30,590 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 14:23:33,752 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 14:23:33,753 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 14:23:33,753 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 14:23:33,754 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 14:24:35,246 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 14:24:35,246 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 14:24:35,247 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 14:24:35,361 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 14:24:35,361 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 14:24:35,362 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 14:24:35,362 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 14:24:35,380 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 14:24:35,380 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 14:24:35,381 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 14:24:37,901 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 14:24:37,901 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 14:24:37,901 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 14:24:37,901 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 14:26:47,180 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 14:26:47,180 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 14:26:47,182 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 14:26:47,302 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 14:26:47,302 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 14:26:47,302 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 14:26:47,303 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 14:26:47,316 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 14:26:47,316 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 14:26:47,317 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 14:26:49,859 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 14:26:49,859 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 14:26:49,859 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 14:26:49,859 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 14:30:37,092 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 14:30:37,092 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 14:30:37,093 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 14:30:37,207 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Application Management - Super Tenant
2017-09-11 14:30:37,207 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Application Management - Super Tenant.
2017-09-11 14:30:37,207 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 14:30:37,207 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 14:30:37,220 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 14:30:37,220 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 14:30:37,221 INFO o.a.j.t.JMeterThread: Thread started: Application Management - Super Tenant 1-1
2017-09-11 14:30:39,716 INFO o.a.j.t.JMeterThread: Thread is done: Application Management - Super Tenant 1-1
2017-09-11 14:30:39,716 INFO o.a.j.t.JMeterThread: Thread finished: Application Management - Super Tenant 1-1
2017-09-11 14:30:39,717 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 14:30:39,717 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 14:43:17,010 INFO o.a.j.s.FileServer: Set new base='/home/wso2/projects/wso2/iot/testing/appm/scripts'
2017-09-11 14:51:18,349 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 14:51:18,351 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 14:51:18,352 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 14:51:18,479 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : TokenGen
2017-09-11 14:51:18,479 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group TokenGen.
2017-09-11 14:51:18,479 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 14:51:18,480 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 14:51:18,485 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 14:51:18,485 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 14:51:18,485 INFO o.a.j.t.JMeterThread: Thread started: TokenGen 1-1
2017-09-11 14:51:20,803 INFO o.a.j.t.JMeterThread: Thread is done: TokenGen 1-1
2017-09-11 14:51:20,803 INFO o.a.j.t.JMeterThread: Thread finished: TokenGen 1-1
2017-09-11 14:51:20,804 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 14:51:20,804 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 14:53:40,651 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 14:53:40,652 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 14:53:40,654 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 14:53:40,790 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : UnitTests
2017-09-11 14:53:40,790 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group UnitTests.
2017-09-11 14:53:40,790 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 14:53:40,791 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 14:53:40,791 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 14:53:40,791 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 14:53:40,791 INFO o.a.j.t.JMeterThread: Thread started: UnitTests 1-1
2017-09-11 14:53:41,079 INFO o.a.j.t.JMeterThread: Thread is done: UnitTests 1-1
2017-09-11 14:53:41,079 INFO o.a.j.t.JMeterThread: Thread finished: UnitTests 1-1
2017-09-11 14:53:41,081 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 14:53:41,081 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 14:54:28,012 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 14:54:28,012 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 14:54:28,013 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 14:54:28,123 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : UnitTests
2017-09-11 14:54:28,123 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group UnitTests.
2017-09-11 14:54:28,124 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 14:54:28,124 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 14:54:28,128 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 14:54:28,128 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 14:54:28,128 INFO o.a.j.t.JMeterThread: Thread started: UnitTests 1-1
2017-09-11 14:54:28,385 INFO o.a.j.t.JMeterThread: Thread is done: UnitTests 1-1
2017-09-11 14:54:28,385 INFO o.a.j.t.JMeterThread: Thread finished: UnitTests 1-1
2017-09-11 14:54:28,385 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 14:54:28,385 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 14:56:06,132 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 14:56:06,132 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 14:56:06,133 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 14:56:06,249 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : UnitTests
2017-09-11 14:56:06,249 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group UnitTests.
2017-09-11 14:56:06,249 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 14:56:06,249 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 14:56:06,254 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 14:56:06,254 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 14:56:06,254 INFO o.a.j.t.JMeterThread: Thread started: UnitTests 1-1
2017-09-11 14:56:06,349 INFO o.a.j.t.JMeterThread: Thread is done: UnitTests 1-1
2017-09-11 14:56:06,349 INFO o.a.j.t.JMeterThread: Thread finished: UnitTests 1-1
2017-09-11 14:56:06,350 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 14:56:06,350 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 15:05:21,190 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 15:05:21,191 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 15:05:21,192 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 15:05:21,335 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : UnitTests
2017-09-11 15:05:21,335 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group UnitTests.
2017-09-11 15:05:21,336 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 15:05:21,336 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 15:05:21,336 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 15:05:21,336 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 15:05:21,337 INFO o.a.j.t.JMeterThread: Thread started: UnitTests 1-1
2017-09-11 15:05:21,454 INFO o.a.j.t.JMeterThread: Thread is done: UnitTests 1-1
2017-09-11 15:05:21,454 INFO o.a.j.t.JMeterThread: Thread finished: UnitTests 1-1
2017-09-11 15:05:21,454 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 15:05:21,454 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 15:06:50,344 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 15:06:50,345 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 15:06:50,346 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 15:06:50,484 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : UnitTests
2017-09-11 15:06:50,485 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group UnitTests.
2017-09-11 15:06:50,485 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 15:06:50,485 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 15:06:50,485 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 15:06:50,485 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 15:06:50,486 INFO o.a.j.t.JMeterThread: Thread started: UnitTests 1-1
2017-09-11 15:06:50,581 INFO o.a.j.t.JMeterThread: Thread is done: UnitTests 1-1
2017-09-11 15:06:50,581 INFO o.a.j.t.JMeterThread: Thread finished: UnitTests 1-1
2017-09-11 15:06:50,581 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 15:06:50,581 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2017-09-11 15:07:27,565 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-09-11 15:07:27,567 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-09-11 15:07:27,567 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-09-11 15:07:27,681 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : UnitTests
2017-09-11 15:07:27,681 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group UnitTests.
2017-09-11 15:07:27,681 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-09-11 15:07:27,681 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-09-11 15:07:27,681 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-09-11 15:07:27,681 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-09-11 15:07:27,684 INFO o.a.j.t.JMeterThread: Thread started: UnitTests 1-1
2017-09-11 15:07:27,759 INFO o.a.j.t.JMeterThread: Thread is done: UnitTests 1-1
2017-09-11 15:07:27,759 INFO o.a.j.t.JMeterThread: Thread finished: UnitTests 1-1
2017-09-11 15:07:27,760 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-09-11 15:07:27,760 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
Loading…
Cancel
Save