package it.nch.yava.rte.wfm.services.mapper; /** * This operation is served by an asynchronous process. */ public class AsyncBPELProcessInfoSupplier extends ServiceInfoSupplier { private final boolean externalOperation; private final String servedQueueId; public AsyncBPELProcessInfoSupplier(final String servedQueueId, final boolean externalOperation) { checkParametersForValidity(servedQueueId, externalOperation); this.processName = processName; this.externalOperation = externalOperation; this.servedQueueId = servedQueueId; } private static void checkParametersForValidity(String servedQueueId, boolean externalOperation) { if (processName == null || servedQueueId == null) { throw new IllegalArgumentException("Arguments in AsyncBPELProcessInfoSupplier cannot be null!"); } } /** * @return Returns if the process serves an "external" operation, * i.e. an external queue. */ public boolean isExternalOperation() { return externalOperation; } /** * @return Returns the queue id from which the process read * its input. */ public String getServedQueueId() { return servedQueueId; } public void accept(Visitor v) { v.visit(this); } @Override public boolean equals(Object obj) { boolean result = false; if (obj instanceof AsyncBPELProcessInfoSupplier) { AsyncBPELProcessInfoSupplier suppl = (AsyncBPELProcessInfoSupplier)obj; result = servedQueueId.equals(suppl.servedQueueId) && externalOperation == suppl.externalOperation; } return result; } @Override public int hashCode() { int result = 17; result *= 37 + processName.hashCode(); result *= 37 + servedQueueId.hashCode(); result *= 37 + (externalOperation ? 1 : 0); return result; } @Override public String toString() { return "servedQueueId=[" + servedQueueId + "] externalOperation=[" + externalOperation + "]"; } }