@GET
    @Path("{agreementId}")
    public EnforcementJob getEnforcementJobByAgreementId(@PathParam("agreementId") String agreementUUID) throws NotFoundException{
        logger.debug("StartOf getEnforcementJobByAgreementId - REQUEST for /enforcements/{}", agreementUUID);
        EnforcementJobHelperE enforcementJobService = getHelper();
        EnforcementJob enforcementJob= enforcementJobService.getEnforcementJobByUUID(agreementUUID);
        if (enforcementJob==null){
            logger.info("getEnforcementJobByAgreementId NotFoundException: There is no agreement with uuid " + agreementUUID + " in the SLA Repository Database");                                    
            throw new NotFoundException("There is no enforcement job associated to the agreement with uuid " + agreementUUID + " in the SLA Repository Database");
        }
        logger.debug("EndOf getEnforcementJobByAgreementId");
        return enforcementJob;
    }
@ GET @ Path ( "{agreementId}" ) public EnforcementJob getEnforcementJobByAgreementId ( @ PathParam ( "agreementId" ) String agreementUUID ) throws NotFoundException { logger . debug ( "StartOf getEnforcementJobByAgreementId - REQUEST for /enforcements/{}" , agreementUUID ) ; EnforcementJobHelperE enforcementJobService = getHelper ( ) ; EnforcementJob enforcementJob = enforcementJobService . getEnforcementJobByUUID ( agreementUUID ) ; if ( enforcementJob == null ) { logger . info ( "getEnforcementJobByAgreementId NotFoundException: There is no agreement with uuid " + agreementUUID + " in the SLA Repository Database" ) ; throw new NotFoundException ( "There is no enforcement job associated to the agreement with uuid " + agreementUUID + " in the SLA Repository Database" ) ; } logger . debug ( "EndOf getEnforcementJobByAgreementId" ) ; return enforcementJob ; }
Gets an specific enforcements given a agreementId If the enforcementJob
it is not in the database, it returns 404 with empty payload


<pre>
GET /enforcements/{agreementId}

Request:
GET /enforcements HTTP/1.1

Response:

{@code
<?xml version="1.0" encoding="UTF-8"?>

<enforcement_job>
<agreement_id>agreement04</agreement_id>
<enabled>false</enabled>
</enforcement_job>

}

</pre>

Example: <li>curl
http://localhost:8080/sla-service/enforcements/agreement04</li>

@param agreementId
of the enforcementJob
@return XML information with the different details of the enforcementJob