本文整理汇总了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();
}
}
示例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);
}
}
示例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");
}
示例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);
}
示例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];
}
示例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 {
}
示例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;
}
示例8: updateApplicationListInstalledInDevice
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
void updateApplicationListInstalledInDevice(DeviceIdentifier deviceIdentifier,
List<Application> applications) throws ApplicationManagementException;
示例9: getApplicationListForDevice
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
List<Application> getApplicationListForDevice(DeviceIdentifier deviceIdentifier)
throws ApplicationManagementException;
示例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];
}
示例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 {
}
示例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;
}
示例13: installApplication
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; //导入依赖的package包/类
@Override
public void installApplication(Operation operation, List<DeviceIdentifier> deviceIdentifiers)
throws ApplicationManagementException {
}