Merge pull request #285 from hasuniea/master

add windows feature
revert-dabc3590
Hasunie 9 years ago
commit f91dc2ee60

@ -21,7 +21,6 @@ package org.wso2.carbon.mdm.services.android.services.event;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.wso2.carbon.mdm.services.android.bean.DeviceState; import org.wso2.carbon.mdm.services.android.bean.DeviceState;
import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper; import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper;
import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException;
import javax.ws.rs.*; import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
@ -49,7 +48,8 @@ public interface EventService {
@HeaderParam(ACCEPT) String acceptHeader, @HeaderParam(ACCEPT) String acceptHeader,
@ApiParam(name = "eventBeanWrapper", @ApiParam(name = "eventBeanWrapper",
value = "Information of the agent event to be published on DAS.") value = "Information of the agent event to be published on DAS.")
EventBeanWrapper eventBeanWrapper) throws AndroidAgentException; EventBeanWrapper eventBeanWrapper);
@GET @GET
@Path("{deviceId}") @Path("{deviceId}")
@Produces("application/json") @Produces("application/json")
@ -70,7 +70,7 @@ public interface EventService {
Response retrieveAlert(@ApiParam(name = "acceptHeader", value = "Accept Header.") Response retrieveAlert(@ApiParam(name = "acceptHeader", value = "Accept Header.")
@HeaderParam(ACCEPT) String acceptHeader, @HeaderParam(ACCEPT) String acceptHeader,
@ApiParam(name = "deviceId", value = "DeviceId which need to retrieve published events.") @ApiParam(name = "deviceId", value = "DeviceId which need to retrieve published events.")
@PathParam("deviceId") String deviceId) throws AndroidAgentException; @PathParam("deviceId") String deviceId);
@GET @GET
@Path("{deviceId}/date") @Path("{deviceId}/date")
@ -97,7 +97,7 @@ public interface EventService {
@ApiParam(name = "from", value = "From Date.") @ApiParam(name = "from", value = "From Date.")
@QueryParam("from") long from, @QueryParam("from") long from,
@ApiParam(name = "to", value = "To Date.") @ApiParam(name = "to", value = "To Date.")
@QueryParam("to") long to) throws AndroidAgentException; @QueryParam("to") long to);
@GET @GET
@Path("{deviceId}/type/{type}") @Path("{deviceId}/type/{type}")
@ -120,5 +120,5 @@ public interface EventService {
@ApiParam(name = "deviceId", value = "Device Identifier to be need to retrieve events.") @ApiParam(name = "deviceId", value = "Device Identifier to be need to retrieve events.")
@PathParam("deviceId") String deviceId, @PathParam("deviceId") String deviceId,
@ApiParam(name = "type", value = "Type of the Alert to be need to retrieve events.") @ApiParam(name = "type", value = "Type of the Alert to be need to retrieve events.")
@PathParam("type") String type) throws AndroidAgentException; @PathParam("type") String type);
} }

@ -42,7 +42,7 @@ public class EventServiceImpl implements EventService {
@POST @POST
public Response publishEvents(@HeaderParam(ACCEPT) String acceptHeader, public Response publishEvents(@HeaderParam(ACCEPT) String acceptHeader,
EventBeanWrapper eventBeanWrapper) throws AndroidAgentException { EventBeanWrapper eventBeanWrapper) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Invoking Android device even logging."); log.debug("Invoking Android device even logging.");
@ -73,7 +73,7 @@ public class EventServiceImpl implements EventService {
@Produces("application/json") @Produces("application/json")
@GET @GET
public Response retrieveAlert(@HeaderParam(ACCEPT) String acceptHeader, public Response retrieveAlert(@HeaderParam(ACCEPT) String acceptHeader,
@PathParam("deviceId") String deviceId) throws AndroidAgentException { @PathParam("deviceId") String deviceId) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Retrieving events for given device Identifier."); log.debug("Retrieving events for given device Identifier.");
@ -104,7 +104,7 @@ public class EventServiceImpl implements EventService {
@GET @GET
public Response retrieveAlertFromDate(@HeaderParam(ACCEPT) String acceptHeader, public Response retrieveAlertFromDate(@HeaderParam(ACCEPT) String acceptHeader,
@PathParam("deviceId") String deviceId, @QueryParam("from") long from, @PathParam("deviceId") String deviceId, @QueryParam("from") long from,
@QueryParam("to") long to) throws AndroidAgentException { @QueryParam("to") long to) {
String fromDate = String.valueOf(from); String fromDate = String.valueOf(from);
String toDate = String.valueOf(to); String toDate = String.valueOf(to);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
@ -136,8 +136,7 @@ public class EventServiceImpl implements EventService {
@Path("{deviceId}/type/{type}") @Path("{deviceId}/type/{type}")
@GET @GET
public Response retrieveAlertType(@HeaderParam(ACCEPT) String acceptHeader, public Response retrieveAlertType(@HeaderParam(ACCEPT) String acceptHeader,
@PathParam("deviceId") String deviceId, @PathParam("type") String type) @PathParam("deviceId") String deviceId, @PathParam("type") String type) {
throws AndroidAgentException {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Retrieving events for given device identifier and type."); log.debug("Retrieving events for given device identifier and type.");
@ -149,8 +148,8 @@ public class EventServiceImpl implements EventService {
try { try {
deviceStates = AndroidAPIUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query); deviceStates = AndroidAPIUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query);
if (deviceStates == null) { if (deviceStates == null) {
message.setResponseCode("No any alerts are published for given Device: " + message.setResponseCode("No any alerts are published for given Device: "
"" + deviceId + " on specific date."); + deviceId + " on specific date.");
return Response.status(Response.Status.OK).entity(message).build(); return Response.status(Response.Status.OK).entity(message).build();
} else { } else {

@ -3,7 +3,7 @@
~ ~
~ WSO2 Inc. licenses this file to you under the Apache License, ~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except ~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License. ~ in compliance with the License.a
~ You may obtain a copy of the License at ~ You may obtain a copy of the License at
~ ~
~ http://www.apache.org/licenses/LICENSE-2.0 ~ http://www.apache.org/licenses/LICENSE-2.0
@ -129,6 +129,12 @@
<dependency> <dependency>
<groupId>org.apache.cxf</groupId> <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-http</artifactId> <artifactId>cxf-rt-bindings-http</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.ws.security</groupId> <groupId>org.apache.ws.security</groupId>
@ -263,6 +269,12 @@
<groupId>org.wso2.carbon.identity</groupId> <groupId>org.wso2.carbon.identity</groupId>
<artifactId>org.wso2.carbon.identity.oauth</artifactId> <artifactId>org.wso2.carbon.identity.oauth</artifactId>
<scope>provided</scope> <scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.cache</groupId> <groupId>javax.cache</groupId>
@ -306,7 +318,6 @@
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

@ -18,6 +18,7 @@
package org.wso2.carbon.mdm.mobileservices.windows.services.authbst; package org.wso2.carbon.mdm.mobileservices.windows.services.authbst;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
@ -33,6 +34,7 @@ import javax.ws.rs.core.Response;
/** /**
* Interface for handling authentication request comes via MDM login page. * Interface for handling authentication request comes via MDM login page.
*/ */
@Api(value = "BSTProvider", description = "Windows Device Management REST-API implementation.")
@Path("/bst") @Path("/bst")
public interface BSTProvider { public interface BSTProvider {

@ -18,6 +18,7 @@
package org.wso2.carbon.mdm.mobileservices.windows.services.configurationmgtservice; package org.wso2.carbon.mdm.mobileservices.windows.services.configurationmgtservice;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
@ -36,6 +37,7 @@ import javax.ws.rs.core.MediaType;
@WebService @WebService
@Produces({"application/json", "application/xml"}) @Produces({"application/json", "application/xml"})
@Consumes({"application/json", "application/xml"}) @Consumes({"application/json", "application/xml"})
@Api(value = "ConfigurationMgtService", description = "Windows Device Management REST-API implementation.")
public interface ConfigurationMgtService { public interface ConfigurationMgtService {
/** /**

@ -27,7 +27,6 @@ import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException; import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message; import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message;
import javax.jws.WebService;
import javax.ws.rs.*; import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.util.List; import java.util.List;
@ -37,7 +36,6 @@ import java.util.List;
* All end points supports JSON, XMl with content negotiation. * All end points supports JSON, XMl with content negotiation.
*/ */
@Api(value = "DeviceManagementService", description = "Windows Device Management REST-API implementation.") @Api(value = "DeviceManagementService", description = "Windows Device Management REST-API implementation.")
@WebService
@Produces({"application/json", "application/xml"}) @Produces({"application/json", "application/xml"})
@Consumes({"application/json", "application/xml"}) @Consumes({"application/json", "application/xml"})
public interface DeviceManagementService { public interface DeviceManagementService {

@ -18,6 +18,7 @@
package org.wso2.carbon.mdm.mobileservices.windows.services.discovery; package org.wso2.carbon.mdm.mobileservices.windows.services.discovery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
@ -43,6 +44,7 @@ import javax.xml.ws.soap.SOAPBinding;
@WebService(targetNamespace = PluginConstants.DISCOVERY_SERVICE_TARGET_NAMESPACE, @WebService(targetNamespace = PluginConstants.DISCOVERY_SERVICE_TARGET_NAMESPACE,
name = "IDiscoveryService") name = "IDiscoveryService")
@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING) @BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
@Api(value = "DiscoveryService", description = "Windows Device Management REST-API implementation.")
public interface DiscoveryService { public interface DiscoveryService {
@POST @POST

@ -22,18 +22,15 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException; import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message; import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message;
import javax.jws.WebService;
import javax.ws.rs.*; import javax.ws.rs.*;
/** /**
* Endpoint for Enforce Effective Policy. * Endpoint for Enforce Effective Policy.
*/ */
@Api(value = "PolicyMgtService", description = "Windows Device Management REST-API implementation.") @Api(value = "PolicyMgtService", description = "Windows Device Management REST-API implementation.")
@WebService
@Produces({"application/json", "application/xml"}) @Produces({"application/json", "application/xml"})
@Consumes({"application/json", "application/xml"}) @Consumes({"application/json", "application/xml"})
public interface PolicyMgtService { public interface PolicyMgtService {

@ -197,11 +197,11 @@
class="org.wso2.carbon.mdm.mobileservices.windows.services.wstep.util.MessageHandler"/> class="org.wso2.carbon.mdm.mobileservices.windows.services.wstep.util.MessageHandler"/>
<bean id="jsonProvider" class="org.wso2.carbon.mdm.mobileservices.windows.common.util.GsonMessageBodyHandler"/> <bean id="jsonProvider" class="org.wso2.carbon.mdm.mobileservices.windows.common.util.GsonMessageBodyHandler"/>
<bean id="configurationServiceBean" <bean id="configurationServiceBean"
class="org.wso2.carbon.mdm.mobileservices.windows.services.configurationmgtservice.ConfigurationMgtServiceImpl"/> class="org.wso2.carbon.mdm.mobileservices.windows.services.configurationmgtservice.impl.ConfigurationMgtServiceImpl"/>
<bean id="policyServiceBean" <bean id="policyServiceBean"
class="org.wso2.carbon.mdm.mobileservices.windows.services.policymgtservice.PolicyMgtServiceImpl"/> class="org.wso2.carbon.mdm.mobileservices.windows.services.policymgtservice.impl.PolicyMgtServiceImpl"/>
<bean id="errorHandler" class="org.wso2.carbon.mdm.mobileservices.windows.common.util.ErrorHandler"/> <bean id="errorHandler" class="org.wso2.carbon.mdm.mobileservices.windows.common.util.ErrorHandler"/>
<bean id="deviceMgtServiceBean" <bean id="deviceMgtServiceBean"
class="org.wso2.carbon.mdm.mobileservices.windows.services.devicemgtservice.DeviceManagementServiceImpl"/> class="org.wso2.carbon.mdm.mobileservices.windows.services.devicemgtservice.impl.DeviceManagementServiceImpl"/>
</beans> </beans>

@ -1,7 +1,6 @@
instructions.configure = \ instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/webapps/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/webapps/,target:${installFolder}/../../deployment/server/webapps/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/webapps/mdm-windows-agent.war,target:${installFolder}/../../deployment/server/webapps/mdm-windows-agent.war,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/windows,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/windows,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.windows_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\

Loading…
Cancel
Save