本文整理汇总了Java中eu.atos.sla.service.rest.helpers.AgreementHelperE类的典型用法代码示例。如果您正苦于以下问题:Java AgreementHelperE类的具体用法?Java AgreementHelperE怎么用?Java AgreementHelperE使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AgreementHelperE类属于eu.atos.sla.service.rest.helpers包,在下文中一共展示了AgreementHelperE类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getActiveAgreements
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
@GET
@Path("active")
public List<IAgreement> getActiveAgreements() throws NotFoundException {
logger.debug("StartOf getActiveAgreements - Get active agreements");
long actualDate = new Date().getTime();
AgreementHelperE agreementRestHelper = getAgreementHelper();
List<IAgreement> agreements = agreementRestHelper.getActiveAgreements(actualDate);
logger.debug("EndOf getActiveAgreements");
return agreements;
}
示例2: getActiveAgreements
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
@GET
@Path("active")
public List<IAgreement> getActiveAgreements() throws NotFoundException {
logger.debug("StartOf getActiveAgreements - Get active agreements");
long actualDate = new Date().getTime();
AgreementHelperE agreementRestHelper = getAgreementHelper();
List<IAgreement> agreements = agreementRestHelper.getActiveAgreements(actualDate);
logger.debug("EndOf getActiveAgreements");
return agreements;
}
示例3: getAgreementById
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
/**
* Gets the information of an specific agreement. If the agreement it is not
* in the database, it returns 404 with empty payload
*
*
* <pre>
* GET /agreements/{id}
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 OK
* Content-type: application/xml
*
* <?xml version="1.0" encoding="UTF-8"?>
* <wsag:Agreement>...</wsag:Agreement>
*
*
*
* Example: <li>curl
* http://localhost:8080/sla-service/agreements/agreement04</li>
*
*
* @param id
* of the agreement
* @return XML information with the different details of the agreement
* @throws NotFoundException
*/
@GET
@Path("{id}")
public IAgreement getAgreementById(@PathParam("id") String agreementId) throws NotFoundException {
logger.debug("StartOf getAgreementById REQUEST for /agreements/" + agreementId);
AgreementHelperE agreementRestHelper = getAgreementHelper();
IAgreement agreement = agreementRestHelper.getAgreementByID(agreementId);
if (agreement==null){
logger.info("getAgreementById NotFoundException: There is no agreement with id " + agreementId + " in the SLA Repository Database");
throw new NotFoundException("There is no agreement with id " + agreementId + " in the SLA Repository Database");
}
logger.debug("EndOf getAgreementById");
return agreement;
}
示例4: getAgreementContextById
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
/**
* Gets the context information of an specific agreement.
*
*
* <pre>
* GET /agreements/{id}
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 OK
* Content-type: application/xml
*
*
*
* Example: <li>curl
* http://localhost:8080/sla-service/agreements/context/agreement04</li>
*
*
* @param id of the agreement
* @return XML information with the different details of the context
* @throws NotFoundException
* @throws InternalException
*/
@GET
@Path("{id}/context")
public eu.atos.sla.parser.data.wsag.Context getAgreementContextById(@PathParam("id") String agreementId) throws NotFoundException, InternalException {
logger.debug("StartOf getAgreementContextById REQUEST for /agreements/{}/context", agreementId);
AgreementHelperE agreementRestHelper = getAgreementHelper();
eu.atos.sla.parser.data.wsag.Context context;
try {
context = agreementRestHelper.getAgreementContextByID(agreementId);
} catch (InternalHelperException e) {
logger.error("getAgreementContextById InternalException", e);
throw new InternalException(e.getMessage());
}
if (context==null){
logger.info("getAgreementContextById NotFoundException: There is no agreement with id " + agreementId + " in the SLA Repository Database");
throw new NotFoundException("There is no agreement with id " + agreementId + " in the SLA Repository Database");
}
logger.debug("EndOf getAgreementContextById");
return context;
}
示例5: deleteAgreement
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
/**
* Deletes an agreement, passing the corresponding agreement_id as
* parameter.
*
*
* <pre>
* DELETE /agreements/{agreement_id}
*
* Request:
* DELETE /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 Ok
* Content-type: application/xml
*
* {@code
* <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
* <message code="201" message= "The agreement has been deleted successfully in the SLA Repository Database"/>
* }
*
* </pre>
*
* Example:
* <li>curl -X DELETE
* localhost:8080/sla-service/agreements/agreement04</li>
*
* @throws Exception
*/
@DELETE
@Path("{agreementId}")
public Response deleteAgreement(@PathParam("agreementId") String agreementId){
logger.debug("DELETE /agreements/{}", agreementId);
AgreementHelperE agreementRestHelper = getAgreementHelper();
boolean deleted = agreementRestHelper.deleteByAgreementId(agreementId);
if (deleted)
return buildResponse(HttpStatus.OK,
"The agreement id " + agreementId + "with it's enforcement job was successfully deleted");
else{
logger.info("getAgreementContextById NotFoundException: There is no agreement with id " + agreementId + " in the SLA Repository Database");
return buildResponse(HttpStatus.NOT_FOUND,
printError(HttpStatus.NOT_FOUND, "There is no agreement with id "
+ agreementId + " in the SLA Repository Database"));
}
}
示例6: getStatusAgreement
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的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 or application/json
*
* In case of 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>
* }
*
* In case of application/json
* {@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")
public GuaranteeTermsStatus getStatusAgreement(@PathParam("id") String agreementId) throws NotFoundException{
logger.debug("StartOf getStatusAgreement - REQUEST for /agreements/" + agreementId
+ "/guaranteestatus");
GuaranteeTermsStatus guaranteeTermsStatus = null;
try{
AgreementHelperE agreementRestHelper = getAgreementHelper();
guaranteeTermsStatus = agreementRestHelper.getAgreementStatus(agreementId);
} catch (DBMissingHelperException e) {
logger.info("getStatusAgreement NotFoundException:"+e.getMessage());
throw new NotFoundException(e.getMessage());
}
logger.debug("EndOf getStatusAgreement");
return guaranteeTermsStatus;
}
示例7: getAgreementHelper
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
private AgreementHelperE getAgreementHelper() {
return helper;
}
示例8: getAgreementById
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
/**
* Gets the information of an specific agreement. If the agreement it is not
* in the database, it returns 404 with empty payload
*
*
* <pre>
* GET /agreements/{id}
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 OK
* Content-type: application/xml
*
* <?xml version="1.0" encoding="UTF-8"?>
* <wsag:Agreement>...</wsag:Agreement>
*
*
*
* Example: <li>curl
* http://localhost:8080/sla-service/agreements/agreement04</li>
*
*
* @param id
* of the agreement
* @return XML information with the different details of the agreement
* @throws NotFoundException
*/
@GET
@Path("{id}")
public IAgreement getAgreementById(@PathParam("id") String agreementId) throws NotFoundException {
logger.debug("StartOf getAgreementById REQUEST for /agreements/" + agreementId);
AgreementHelperE agreementRestHelper = getAgreementHelper();
IAgreement agreement = agreementRestHelper.getAgreementByID(agreementId);
if (agreement==null){
logger.info("getAgreementById NotFoundException: There is no agreement with id " + agreementId + " in the SLA Repository Database");
throw new NotFoundException("There is no agreement with id " + agreementId + " in the SLA Repository Database");
}
logger.debug("EndOf getAgreementById");
return agreement;
}
示例9: getAgreementContextById
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
/**
* Gets the context information of an specific agreement.
*
*
* <pre>
* GET /agreements/{id}
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 OK
* Content-type: application/xml
*
*
*
* Example: <li>curl
* http://localhost:8080/sla-service/agreements/context/agreement04</li>
*
*
* @param id of the agreement
* @return XML information with the different details of the context
* @throws NotFoundException
* @throws InternalException
*/
@GET
@Path("{id}/context")
public eu.atos.sla.parser.data.wsag.Context getAgreementContextById(@PathParam("id") String agreementId) throws NotFoundException, InternalException {
logger.debug("StartOf getAgreementContextById REQUEST for /agreements/{}/context", agreementId);
AgreementHelperE agreementRestHelper = getAgreementHelper();
eu.atos.sla.parser.data.wsag.Context context;
try {
context = agreementRestHelper.getAgreementContextByID(agreementId);
} catch (InternalHelperException e) {
logger.error("getAgreementContextById InternalException", e);
throw new InternalException(e.getMessage());
}
if (context==null){
logger.info("getAgreementContextById NotFoundException: There is no agreement with id " + agreementId + " in the SLA Repository Database");
throw new NotFoundException("There is no agreement with id " + agreementId + " in the SLA Repository Database");
}
logger.debug("EndOf getAgreementContextById");
return context;
}
示例10: deleteAgreement
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
/**
* Deletes an agreement, passing the corresponding agreement_id as
* parameter.
*
*
* <pre>
* DELETE /agreements/{agreement_id}
*
* Request:
* DELETE /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 Ok
* Content-type: application/xml
*
* {@code
* <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
* <message code="201" message= "The agreement has been deleted successfully in the SLA Repository Database"/>
* }
*
* </pre>
*
* Example:
* <li>curl -X DELETE
* localhost:8080/sla-service/agreements/agreement04</li>
*
* @throws Exception
*/
@DELETE
@Path("{agreementId}")
public Response deleteAgreement(@PathParam("agreementId") String agreementId){
logger.debug("DELETE /agreements/{}", agreementId);
AgreementHelperE agreementRestHelper = getAgreementHelper();
boolean deleted = agreementRestHelper.deleteByAgreementId(agreementId);
if (deleted)
return buildResponse(HttpStatus.OK,
"The agreement id " + agreementId + "with it's enforcement job was successfully deleted");
else{
logger.info("getAgreementContextById NotFoundException: There is no agreement with id " + agreementId + " in the SLA Repository Database");
return buildResponse(HttpStatus.NOT_FOUND,
printError(HttpStatus.NOT_FOUND, "There is no agreement with id "
+ agreementId + " in the SLA Repository Database"));
}
}
示例11: getStatusAgreement
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的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 or application/json
*
* In case of 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>
* }
*
* In case of application/json
* {@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")
public GuaranteeTermsStatus getStatusAgreement(@PathParam("id") String agreementId) throws NotFoundException{
logger.debug("StartOf getStatusAgreement - REQUEST for /agreements/" + agreementId
+ "/guaranteestatus");
GuaranteeTermsStatus guaranteeTermsStatus = null;
try{
AgreementHelperE agreementRestHelper = getAgreementHelper();
guaranteeTermsStatus = agreementRestHelper.getAgreementStatus(agreementId);
} catch (DBMissingHelperException e) {
logger.info("getStatusAgreement NotFoundException:"+e.getMessage());
throw new NotFoundException(e.getMessage());
}
logger.debug("EndOf getStatusAgreement");
return guaranteeTermsStatus;
}
示例12: getAgreementHelper
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
private AgreementHelperE getAgreementHelper() {
return helper;
}
示例13: getAgreements
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
/**
* Gets a the list of available agreements from where we can get metrics,
* host information, etc.
*
* <pre>
* GET /agreements{?providerId,consumerId,active}
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 OK
* Content-type: application/xml
* {@code
* <?xml version="1.0" encoding="UTF-8"?>
* <collection href="/agreements">
* <items offset="0" total="1">
* <wsag:Agreement xmlns:wsag="http://www.ggf.org/namespaces/ws-agreement"
* AgreementId="d25eea60-7cfe-11e3-baa7-0800200c9a66">
* ...
* </wsag:Agreement>
* </items>
* </collection>
* }
*
* </pre>
*
* Example:
* <li>curl http://localhost:8080/sla-service/agreements</li>
* <li>curl http://localhost:8080/sla-service/agreements?consumerId=user-10343</li>
* @throws NotFoundException
*
* @throws JAXBException
*/
@GET
public List<IAgreement> getAgreements(
@QueryParam("consumerId") String consumerId,
@QueryParam("providerId") String providerId,
@QueryParam("templateId") String templateId,
@QueryParam("active") BooleanParam active) {
logger.debug("StartOf getAgreements - REQUEST for /agreements");
AgreementHelperE agreementRestHelper = getAgreementHelper();
List<IAgreement> agreements = agreementRestHelper.getAgreements(
consumerId, providerId, templateId, BooleanParam.getValue(active));
return agreements;
}
示例14: getAgreementsPerTemplateAndConsumer
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
/**
* Gets a the list of available agreements from where we can get metrics,
* host information, etc.
*
* </pre>
*
* Example:
* <li>curl http://localhost:8080/sla-service/agreements</li>
* <li>curl http://localhost:8080/sla-service/agreements?consumerId=user-10343</li>
* @throws NotFoundException
*
* @throws JAXBException
*/
@GET
@Path("agreementsPerTemplateAndConsumer")
@Deprecated
public List<IAgreement> getAgreementsPerTemplateAndConsumer(
@QueryParam("consumerId") String consumerId,
@QueryParam("templateUUID") String templateUUID) {
logger.debug("StartOf getAgreementsPerTemplateAndConsumer - REQUEST for /agreementsPerTemplateAndConsumer");
AgreementHelperE agreementRestHelper = getAgreementHelper();
List<IAgreement> agreements = agreementRestHelper.getAgreementsPerTemplateAndConsumer(consumerId, templateUUID);
return agreements;
}
示例15: getAgreements
import eu.atos.sla.service.rest.helpers.AgreementHelperE; //导入依赖的package包/类
/**
* Gets a the list of available agreements from where we can get metrics,
* host information, etc.
*
* <pre>
* GET /agreements{?providerId,consumerId,active}
*
* Request:
* GET /agreements HTTP/1.1
*
* Response:
* HTTP/1.1 200 OK
* Content-type: application/xml
* {@code
* <?xml version="1.0" encoding="UTF-8"?>
* <collection href="/agreements">
* <items offset="0" total="1">
* <wsag:Agreement xmlns:wsag="http://www.ggf.org/namespaces/ws-agreement"
* AgreementId="d25eea60-7cfe-11e3-baa7-0800200c9a66">
* ...
* </wsag:Agreement>
* </items>
* </collection>
* }
*
* </pre>
*
* Example:
* <li>curl http://localhost:8080/sla-service/agreements</li>
* <li>curl http://localhost:8080/sla-service/agreements?consumerId=user-10343</li>
* @throws NotFoundException
*
* @throws JAXBException
*/
@GET
public List<IAgreement> getAgreements(
@QueryParam("consumerId") String consumerId,
@QueryParam("providerId") String providerId,
@QueryParam("templateId") String templateId,
@QueryParam("active") BooleanParam active) {
logger.debug("StartOf getAgreements - REQUEST for /agreements");
AgreementHelperE agreementRestHelper = getAgreementHelper();
List<IAgreement> agreements = agreementRestHelper.getAgreements(
consumerId, providerId, templateId, BooleanParam.getValue(active));
return agreements;
}