public List < Violation > getGuaranteeTermViolations ( Agreement agreement , GuaranteeTerm guaranteeTerm ) { String json = getJerseyClient ( ) . target ( getEndpoint ( ) + "/violations?agreementId=" + agreement . getAgreementId ( ) + "&guaranteeTerm=" + guaranteeTerm . getName ( ) ) . request ( ) . header ( "Accept" , MediaType . APPLICATION_JSON ) . header ( "Content-Type" , MediaType . APPLICATION_JSON ) . buildGet ( ) . invoke ( ) . readEntity ( String . class ) ; try { return mapper . readValue ( json , new TypeReference < List < Violation > > ( ) { } ) ; } catch ( IOException e ) { /* * TODO: Change Runtime for a DashboardException */ throw new RuntimeException ( e ) ; } }
Creates proxied HTTP GET request to SeaClouds SLA core which retrieves the Agreement Term Violations