本文整理汇总了Java中eu.atos.sla.service.rest.helpers.AgreementHelper.getAgreementStatus方法的典型用法代码示例。如果您正苦于以下问题:Java AgreementHelper.getAgreementStatus方法的具体用法?Java AgreementHelper.getAgreementStatus怎么用?Java AgreementHelper.getAgreementStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eu.atos.sla.service.rest.helpers.AgreementHelper
的用法示例。
在下文中一共展示了AgreementHelper.getAgreementStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatusAgreementXML
import eu.atos.sla.service.rest.helpers.AgreementHelper; //导入方法依赖的package包/类
/**
* Gets the information of the status of the different Guarantee Terms of an
* agreement. *
*
* <pre>
* GET /agreements/{agreementId}/guaranteestatus
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 Ok
* Content-type: application/xml
*
* {@code
* <GuaranteeStatus agreementId="$agreementId" value="FULFILLED|VIOLATED|NON_DETERMINED">
* <GuaranteeTermStatus name="$gt_name1" value="FULFILLED|VIOLATED|NON_DETERMINED"/>
* ...
* <GuaranteeTermStatus name="$gt_nameN" value="FULFILLED|VIOLATED|NON_DETERMINED"/>
* </GuaranteeStatus>
* }
*
*
* </pre>
*
* Example: <li>curl -H "Content-type: application/xml" http://localhost:8080/sla-service/agreements/{agreementId}/guaranteestatus</li>
*
*
* @param id
* of the agreement
* @return XML information with Guarantee Status
*/
@GET
@Path("{id}/guaranteestatus")
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response getStatusAgreementXML(@PathParam("id") String agreement_id) {
logger.debug("StartOf getStatusAgreementXML - REQUEST for /agreements/" + agreement_id
+ "/guaranteestatus");
Response result;
try{
AgreementHelper agreementRestService = getAgreementHelper();
String serializedAgreement = agreementRestService.getAgreementStatus(agreement_id,
MediaType.APPLICATION_XML);
if (serializedAgreement!=null){
result = buildResponse(200, serializedAgreement);
}else{
result = buildResponse(404, printError(404, "No agreement with "+agreement_id));
}
} catch (HelperException e) {
logger.info("getStatusAgreementXML exception:"+e.getMessage());
return buildResponse(e);
}
logger.debug("EndOf getStatusAgreementXML");
return result;
}
示例2: getStatusAgreementJson
import eu.atos.sla.service.rest.helpers.AgreementHelper; //导入方法依赖的package包/类
/**
* Gets the information of the status of the different Guarantee Terms of an
* agreement. *
*
* <pre>
* GET /agreements/{agreementId}/guaranteestatus
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 Ok
* Content-type: application/xml
*
* {@code
* {"agreementId":"{agreementId}","value":"FULFILLED|VIOLATED|NON_DETERMINED",
* "GuaranteeTermStatus":
* [{"name":"{gt_name1}","value":"FULFILLED|VIOLATED|NON_DETERMINED"},
* {"name":"{gt_name2}","value":"FULFILLED|VIOLATED|NON_DETERMINED"}]}
* }
*
* </pre>
*
* Example:
* <li>curl -H "Content-type: application/xml" http://localhost:8080/sla-service/agreements/{agreementId}/guaranteestatus</li>
*
* @return Json information with Guarantee Status
*/
@GET
@Path("{id}/guaranteestatus")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response getStatusAgreementJson(@PathParam("id") String agreement_id) {
logger.debug("StartOf getStatusAgreementJson - REQUEST for /agreements/" + agreement_id
+ "/guaranteestatus");
Response result;
try{
AgreementHelper agreementRestService = getAgreementHelper();
String serializedAgreement = agreementRestService.getAgreementStatus(agreement_id,
MediaType.APPLICATION_JSON);
if (serializedAgreement!=null){
result = buildResponse(200, serializedAgreement);
}else{
result = buildResponse(404, printError(404, "No agreement with "+agreement_id));
}
} catch (HelperException e) {
logger.info("getStatusAgreementJson exception:"+e.getMessage());
return buildResponse(e);
}
logger.debug("EndOf getStatusAgreementJson");
return result;
}
示例3: getStatusAgreementXML
import eu.atos.sla.service.rest.helpers.AgreementHelper; //导入方法依赖的package包/类
/**
* Gets the information of the status of the different Guarantee Terms of an
* agreement. *
*
* <pre>
* GET /agreements/{agreementId}/guaranteestatus
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 Ok
* Content-type: application/xml
*
* {@code
* <GuaranteeStatus agreementId="$agreementId" value="FULFILLED|VIOLATED|NON_DETERMINED">
* <GuaranteeTermStatus name="$gt_name1" value="FULFILLED|VIOLATED|NON_DETERMINED"/>
* ...
* <GuaranteeTermStatus name="$gt_nameN" value="FULFILLED|VIOLATED|NON_DETERMINED"/>
* </GuaranteeStatus>
* }
*
*
* </pre>
*
* Example: <li>curl -H "Content-type: application/xml" http://localhost:8080/sla-service/agreements/{agreementId}/guaranteestatus</li>
*
*
* @param id
* of the agreement
* @return XML information with Guarantee Status
*/
@GET
@Path("{id}/guaranteestatus")
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response getStatusAgreementXML(@PathParam("id") String agreement_id) {
logger.debug("StartOf getStatusAgreementXML - REQUEST for /agreements/" + agreement_id
+ "/guaranteestatus");
Response result;
try{
AgreementHelper agreementRestService = getAgreementHelper();
String serializedAgreement = agreementRestService.getAgreementStatus(agreement_id,
MediaType.APPLICATION_XML);
if (serializedAgreement!=null){
result = buildResponse(200, serializedAgreement);
}else{
result = buildResponse(404, printError(404, "No agreement with "+agreement_id));
}
} catch (HelperException e) {
logger.info("getStatusAgreementXML exception:"+e.getMessage());
return buildResponse(e);
}
logger.debug("EndOf getStatusAgreementXML");
return result;
}
示例4: getStatusAgreementJson
import eu.atos.sla.service.rest.helpers.AgreementHelper; //导入方法依赖的package包/类
/**
* Gets the information of the status of the different Guarantee Terms of an
* agreement. *
*
* <pre>
* GET /agreements/{agreementId}/guaranteestatus
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 Ok
* Content-type: application/xml
*
* {@code
* {"agreementId":"{agreementId}","value":"FULFILLED|VIOLATED|NON_DETERMINED",
* "GuaranteeTermStatus":
* [{"name":"{gt_name1}","value":"FULFILLED|VIOLATED|NON_DETERMINED"},
* {"name":"{gt_name2}","value":"FULFILLED|VIOLATED|NON_DETERMINED"}]}
* }
*
* </pre>
*
* Example:
* <li>curl -H "Content-type: application/xml" http://localhost:8080/sla-service/agreements/{agreementId}/guaranteestatus</li>
*
* @return Json information with Guarantee Status
*/
@GET
@Path("{id}/guaranteestatus")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response getStatusAgreementJson(@PathParam("id") String agreement_id) {
logger.debug("StartOf getStatusAgreementJson - REQUEST for /agreements/" + agreement_id
+ "/guaranteestatus");
Response result;
try{
AgreementHelper agreementRestService = getAgreementHelper();
String serializedAgreement = agreementRestService.getAgreementStatus(agreement_id,
MediaType.APPLICATION_JSON);
if (serializedAgreement!=null){
result = buildResponse(200, serializedAgreement);
}else{
result = buildResponse(404, printError(404, "No agreement with "+agreement_id));
}
} catch (HelperException e) {
logger.info("getStatusAgreementJson exception:"+e.getMessage());
return buildResponse(e);
}
logger.debug("EndOf getStatusAgreementJson");
return result;
}