当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationManagementException类代码示例

本文整理汇总了Java中org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException的典型用法代码示例。如果您正苦于以下问题:Java ApplicationManagementException类的具体用法?Java ApplicationManagementException怎么用?Java ApplicationManagementException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ApplicationManagementException类属于org.wso2.carbon.device.mgt.common.app.mgt包,在下文中一共展示了ApplicationManagementException类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInstalledApplications

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@GET
@Path("/{type}/{id}/applications")
@Override
public Response getInstalledApplications(
        @PathParam("type") @Size(max = 45) String type,
        @PathParam("id") @Size(max = 45) String id,
        @HeaderParam("If-Modified-Since") String ifModifiedSince,
        @QueryParam("offset") int offset,
        @QueryParam("limit") int limit) {
    List<Application> applications;
    ApplicationManagementProviderService amc;
    try {
        RequestValidationUtil.validateDeviceIdentifier(type, id);

        amc = DeviceMgtAPIUtils.getAppManagementService();
        applications = amc.getApplicationListForDevice(new DeviceIdentifier(id, type));
        return Response.status(Response.Status.OK).entity(applications).build();
    } catch (ApplicationManagementException e) {
        String msg = "Error occurred while fetching the apps of the '" + type + "' device, which carries " +
                "the id '" + id + "'";
        log.error(msg, e);
        return Response.serverError().entity(
                new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
    }
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:26,代码来源:DeviceManagementServiceImpl.java

示例2: initConfig

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
public synchronized void initConfig() throws ApplicationManagementException {
	try {
		File appManagementConfig =
				new File(AppManagementConfigurationManager.APP_MANAGER_CONFIG_PATH);
		Document doc = DeviceManagerUtil.convertToDocument(appManagementConfig);

           /* Un-marshaling App Management configuration */
		JAXBContext cdmContext = JAXBContext.newInstance(AppManagementConfig.class);
		Unmarshaller unmarshaller = cdmContext.createUnmarshaller();
		this.appManagementConfig = (AppManagementConfig) unmarshaller.unmarshal(doc);
	} catch (Exception e) {
	    /* Catches generic exception as there's no specific task to be carried out catching a particular
           exception */
		throw new ApplicationManagementException(
				"Error occurred while initializing application management Configurations", e);
	}
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:18,代码来源:AppManagementConfigurationManager.java

示例3: testGetInstalledApplicationsException

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@Test(description = "Testing getting installed applications of a device when unable to fetch applications")
public void testGetInstalledApplicationsException() throws ApplicationManagementException {
    ApplicationManagementProviderService applicationManagementProviderService = Mockito
            .mock(ApplicationManagementProviderService.class, Mockito.RETURNS_MOCKS);
    PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getAppManagementService"))
            .toReturn(applicationManagementProviderService);
    Mockito.when(
            applicationManagementProviderService.getApplicationListForDevice(Mockito.any(DeviceIdentifier.class)))
            .thenThrow(new ApplicationManagementException());
    Response response = this.deviceManagementService
            .getInstalledApplications(TEST_DEVICE_TYPE, UUID.randomUUID().toString(), "", 10, 5);
    Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),
            "Expects HTTP 500 when an exception occurred while retrieving application list of the device");
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:15,代码来源:DeviceManagementServiceImplTest.java

示例4: authenticate

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
public void authenticate(ServiceClient client) throws ApplicationManagementException {
    Options option = client.getOptions();
    HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
    auth.setUsername(username);
    auth.setPassword(password);
    auth.setPreemptiveAuthentication(true);
    option.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, auth);
    option.setManageSession(true);
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:10,代码来源:ServiceAuthenticator.java

示例5: getApplications

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@Override
public Application[] getApplications(String domain, int pageNumber, int size)
        throws ApplicationManagementException {
    return new Application[0];
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:6,代码来源:ApplicationManagerProviderServiceImpl.java

示例6: updateApplicationStatus

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@Override
public void updateApplicationStatus(DeviceIdentifier deviceId, Application application,
                                    String status) throws ApplicationManagementException {

}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:6,代码来源:ApplicationManagerProviderServiceImpl.java

示例7: getApplicationStatus

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@Override
public String getApplicationStatus(DeviceIdentifier deviceId,
                                   Application application) throws ApplicationManagementException {
    return null;
}
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:6,代码来源:ApplicationManagerProviderServiceImpl.java

示例8: updateApplicationListInstalledInDevice

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
void updateApplicationListInstalledInDevice(DeviceIdentifier deviceIdentifier,
List<Application> applications) throws ApplicationManagementException;
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:3,代码来源:ApplicationManagementProviderService.java

示例9: getApplicationListForDevice

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
List<Application> getApplicationListForDevice(DeviceIdentifier deviceIdentifier)
throws ApplicationManagementException;
 
开发者ID:wso2,项目名称:carbon-device-mgt,代码行数:3,代码来源:ApplicationManagementProviderService.java

示例10: getApplications

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@Override
public Application[] getApplications(String domain, int pageNumber, int size)
		throws ApplicationManagementException {
	return new Application[0];
}
 
开发者ID:wso2-incubator,项目名称:iot-server-appliances,代码行数:6,代码来源:FireAlarmManagerService.java

示例11: updateApplicationStatus

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@Override
public void updateApplicationStatus(DeviceIdentifier deviceId, Application application,
									String status) throws ApplicationManagementException {

}
 
开发者ID:wso2-incubator,项目名称:iot-server-appliances,代码行数:6,代码来源:FireAlarmManagerService.java

示例12: getApplicationStatus

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@Override
public String getApplicationStatus(DeviceIdentifier deviceId, Application application)
		throws ApplicationManagementException {
	return null;
}
 
开发者ID:wso2-incubator,项目名称:iot-server-appliances,代码行数:6,代码来源:FireAlarmManagerService.java

示例13: installApplication

import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@Override
public void installApplication(Operation operation, List<DeviceIdentifier> deviceIdentifiers)
		throws ApplicationManagementException {

}
 
开发者ID:wso2-incubator,项目名称:iot-server-appliances,代码行数:6,代码来源:FireAlarmManagerService.java


注:本文中的org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。