本文整理匯總了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);
}
示例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);
}