當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。