當前位置: 首頁>>代碼示例>>Java>>正文


Java EnforcementJobHelper.getEnforcements方法代碼示例

本文整理匯總了Java中eu.atos.sla.service.rest.helpers.EnforcementJobHelper.getEnforcements方法的典型用法代碼示例。如果您正苦於以下問題:Java EnforcementJobHelper.getEnforcements方法的具體用法?Java EnforcementJobHelper.getEnforcements怎麽用?Java EnforcementJobHelper.getEnforcements使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eu.atos.sla.service.rest.helpers.EnforcementJobHelper的用法示例。


在下文中一共展示了EnforcementJobHelper.getEnforcements方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getEnforcements

import eu.atos.sla.service.rest.helpers.EnforcementJobHelper; //導入方法依賴的package包/類
/**
 * Get the list of available enforcements
 * 
 * <pre>
 *   GET /enforcements 
 *   
 *   Request:
 *   	GET /enforcements HTTP/1.1
 *   	Accept: application/xml
 *   
 *   Response:
 *   
 *  {@code
 *  <?xml version="1.0" encoding="UTF-8"?>
 *  <collection href="/enforcements">
 *  <items offset="0" total="1">
 *  
 * <enforcement_job>
 *    <agreement_id>agreement04</agreement_id>
 *     <enabled>false</enabled>
 * </enforcement_job>
 * 
 *  </items>
 *  </collection>
 *  }
 * 
 * </pre>
 * 
 * Example: <li>curl http://localhost:8080/sla-service/enforcements</li>
 * 
 * @return XML information with the different details of the different
 *         enforcements
 * 
 * @throws Exception
 */
@GET
@Produces(MediaType.APPLICATION_XML)
public Response getEnforcements() {
	logger.debug("StartOf getEnforcements - REQUEST for /enforcements");

	EnforcementJobHelper enforcementJobService = getHelper();
	String serializedEnforcements = null;
	
	try{
		serializedEnforcements = enforcementJobService.getEnforcements();
	} catch (HelperException e) {
		logger.info("getEnforcements exception:"+e.getMessage());
		return buildResponse(e);
	}
	logger.debug("EndOf getEnforcements");
	return buildResponse(200, serializedEnforcements);
}
 
開發者ID:Atos-FiwareOps,項目名稱:sla-framework,代碼行數:53,代碼來源:EnforcementJobRest.java

示例2: getEnforcements

import eu.atos.sla.service.rest.helpers.EnforcementJobHelper; //導入方法依賴的package包/類
/**
 * Get the list of available enforcements
 * 
 * <pre>
 *   GET /enforcements 
 *   
 *   Request:
 *       GET /enforcements HTTP/1.1
 *       Accept: application/xml
 *   
 *   Response:
 *   
 *  {@code
 *  <?xml version="1.0" encoding="UTF-8"?>
 *  <collection href="/enforcements">
 *  <items offset="0" total="1">
 *  
 * <enforcement_job>
 *    <agreement_id>agreement04</agreement_id>
 *     <enabled>false</enabled>
 * </enforcement_job>
 * 
 *  </items>
 *  </collection>
 *  }
 * 
 * </pre>
 * 
 * Example: <li>curl http://localhost:8080/sla-service/enforcements</li>
 * 
 * @return XML information with the different details of the different
 *         enforcements
 * 
 * @throws Exception
 */
@GET
@Produces(MediaType.APPLICATION_XML)
public Response getEnforcements() {
    logger.debug("StartOf getEnforcements - REQUEST for /enforcements");

    EnforcementJobHelper enforcementJobService = getHelper();
    String serializedEnforcements = null;
    
    try{
        serializedEnforcements = enforcementJobService.getEnforcements();
    } catch (HelperException e) {
        logger.info("getEnforcements exception:"+e.getMessage());
        return buildResponse(e);
    }
    logger.debug("EndOf getEnforcements");
    return buildResponse(200, serializedEnforcements);
}
 
開發者ID:SeaCloudsEU,項目名稱:SeaCloudsPlatform,代碼行數:53,代碼來源:EnforcementJobRest.java


注:本文中的eu.atos.sla.service.rest.helpers.EnforcementJobHelper.getEnforcements方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。