use of org.jaffa.soa.services.configdomain.Param in project jaffa-framework by jaffa-projects.
the class SOAEventParam method validate.
// .//GEN-END:performPreDeleteReferentialIntegrity_1_be
// .//GEN-BEGIN:3_be
/**
* @clientCardinality 0..*
* @supplierCardinality 1
* @clientQualifier eventId
* @supplierQualifier eventId
* @link association
*/
/*#SOAEvent lnkSOAEvent;*/
// .//GEN-END:3_be
// All the custom code goes here//GEN-FIRST:custom
/**
* {@inheritDoc}
*/
@Override
public void validate() throws ApplicationExceptions, FrameworkException {
// Ensure that the eventId is specified
if (getEventId() == null)
throw new ApplicationExceptions(new MandatoryFieldException(SOAEventParamMeta.META_EVENT_ID.getLabelToken()));
// Log a WARNing message if the paramter is not documented in soa-events.xml
if (getName() != null && isModified(SOAEventParamMeta.NAME)) {
try {
SOAEvent soaEvent = getSOAEventObject();
SoaEventInfo soaEventInfo = ConfigurationService.getInstance().getSoaEventInfo(soaEvent.getEventName());
if (soaEventInfo != null) {
boolean foundParam = false;
for (Param param : soaEventInfo.getParam()) {
if (getName().equals(param.getName())) {
foundParam = true;
break;
}
}
if (!foundParam)
log.warn("SOA Event Parameter'" + soaEvent.getEventName() + ": " + getName() + "' should be documented in soa-events.xml");
}
} catch (ValidationException e) {
throw new ApplicationExceptions(e);
}
}
super.validate();
}
use of org.jaffa.soa.services.configdomain.Param in project jaffa-framework by jaffa-projects.
the class SOAEventMetaDataService method getParams.
private String getParams(SoaEventInfo soaEvent) {
List<Param> params = soaEvent.getParam();
if (log.isDebugEnabled()) {
log.debug("params size:" + params);
}
JSON json = JSONSerializer.toJSON(params);
if (log.isDebugEnabled()) {
log.debug("json:" + json.toString());
}
return json.toString();
}
Aggregations