@Override public void free(Long transactionTicket, MALInteraction interaction) throws MALInteractionException, MALException { final Dispatcher dispatcher = dispatchers.get(transactionTicket); if (dispatcher == null) { throw new MALInteractionException(new MALStandardError(MALHelper.UNKNOWN_ERROR_NUMBER, null)); } dispatcher.clear(); dispatchers.remove(transactionTicket); }
@Override public void run() { try { archiveService.store( false, ActivityTrackingHelper.OPERATIONACTIVITY_OBJECT_TYPE, interaction.getMessageHeader().getDomain(), archiveDetails, opActivityList, interaction); // requirement: 3.5.2.3 & 3.5.2.5 } catch (MALException ex) { Logger.getLogger(ActivityTrackingProviderServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } catch (MALInteractionException ex) { // A duplicate might happen if the the consumer stored the Operation Activity object if(ex.getStandardError().getErrorNumber().getValue() != COMHelper.DUPLICATE_ERROR_NUMBER.getValue()){ Logger.getLogger(ActivityTrackingProviderServiceImpl.class.getName()).log(Level.SEVERE, null, ex); }else{ // It's a Duplicate error, the object already exists... Do nothing! } } } });
public MALMessage getResult() throws MALInteractionException, MALException { if (inError) { throw new MALInteractionException(((MALErrorBody) result.getBody()).getError()); } return result; }
private void internalHandleSubmit(final MALMessage msg, final Address address) throws MALInteractionException { SubmitInteractionImpl interaction = new SubmitInteractionImpl(sender, address, msg); try { try { MALContextFactoryImpl.LOGGER.log(Level.FINE, "internalHandleSubmit for {0} type {1}", new Object[] { msg.getHeader().getTransactionId(), address.handler }); address.handler.handleSubmit(interaction, msg.getBody()); } catch (MALInteractionException ex) { interaction.sendError(ex.getStandardError()); } } catch (MALException ex) { sender.returnError(address, msg.getHeader(), MALSubmitOperation.SUBMIT_ACK_STAGE, ex); } }
protected void internalHandlePublish(final GENMessage msg, Session lqs) throws MALException, MALInteractionException, MALTransmitErrorException { JMSTransport.RLOGGER.fine("Starting PUBLISH"); JMSPublishHandler details = publishHandlerMap.get(createProviderKey(msg.getHeader())); if (null == details) { JMSTransport.RLOGGER.warning("JMS : ERR Provider not known"); throw new MALInteractionException(new MALStandardError(MALHelper.INCORRECT_STATE_ERROR_NUMBER, null)); } GENMessage rMsg = details.publish(msg, lqs); if (null != rMsg) { receiveMessage(rMsg); } }
private void internalHandleRequest(final MALMessage msg, final Address address) throws MALInteractionException { RequestInteractionImpl interaction = new RequestInteractionImpl(sender, address, msg); try { try { MALContextFactoryImpl.LOGGER.log(Level.FINE, "internalHandleRequest for {0} type {1}", new Object[] { msg.getHeader().getTransactionId(), address.handler }); address.handler.handleRequest(interaction, msg.getBody()); } catch (MALInteractionException ex) { interaction.sendError(ex.getStandardError()); } } catch (MALException ex) { sender.returnError(address, msg.getHeader(), MALRequestOperation.REQUEST_RESPONSE_STAGE, ex); } }
private synchronized java.util.List<NotifyMessageSet> createNotify(final BrokerKey key, final MALMessageHeader hdr, final MALPublishBody publishBody) throws MALInteractionException, MALException { MALBrokerImpl.LOGGER.fine("Checking provider"); final PublisherSource details = getProviderEntry(key, hdr, false); if (null == details) { MALBrokerImpl.LOGGER.warning("Provider not known"); throw new MALInteractionException(new MALStandardError(MALHelper.INCORRECT_STATE_ERROR_NUMBER, null)); } final UpdateHeaderList hl = publishBody.getUpdateHeaderList(); details.checkPublish(hdr, hl); final List<NotifyMessageSet> lst = new LinkedList<NotifyMessageSet>(); if (hl != null) { final Map<String, SubscriptionSource> rv = getConsumerMap(key); for (Map.Entry<String, SubscriptionSource> entry : rv.entrySet()) { entry.getValue().populateNotifyList(hdr, lst, hl, publishBody); } } return lst; }
private void internalHandleProgress(final MALMessage msg, final Address address) throws MALInteractionException { ProgressInteractionImpl interaction = new ProgressInteractionImpl(sender, address, msg); try { try { MALContextFactoryImpl.LOGGER.log(Level.FINE, "internalHandleProgresss for {0} type {1}", new Object[] { msg.getHeader().getTransactionId(), address.handler }); address.handler.handleProgress(interaction, msg.getBody()); } catch (MALInteractionException ex) { interaction.sendError(ex.getStandardError()); } } catch (MALException ex) { try { interaction.sendError(new MALStandardError(MALHelper.INTERNAL_ERROR_NUMBER, new Union(ex.getLocalizedMessage()))); } catch (MALException noex) { // this exception cannot actually be thrown in this implmentation, therefore we can safely ignore it } } }
@Override public Boolean preCheckAction(ActionInstanceDetails actionDetails, MALInteraction interaction) throws MALInteractionException, MALException { UIntegerList invIndexList = new UIntegerList(); // requirement: 3.2.10.3.2 if (!manager.existsDef(actionDetails.getDefInstId())) { throw new MALInteractionException(new MALStandardError(MALHelper.UNKNOWN_ERROR_NUMBER, null)); } // requirement: 3.2.10.2.a, 3.2.10.2.b //TODO: check the checkActionInstanceDetails-mehod after spec-update -> issue #99 boolean accepted = manager.checkActionInstanceDetails(actionDetails, invIndexList); // Errors if (!invIndexList.isEmpty()) { // requirement: 3.2.10.3.1 throw new MALInteractionException(new MALStandardError(COMHelper.INVALID_ERROR_NUMBER, invIndexList)); } return accepted; }
private void internalHandleInvoke(final MALMessage msg, final Address address) throws MALInteractionException { InvokeInteractionImpl interaction = new InvokeInteractionImpl(sender, address, msg); try { try { MALContextFactoryImpl.LOGGER.log(Level.FINE, "internalHandleInvoke for {0} type {1}", new Object[] { msg.getHeader().getTransactionId(), address.handler }); address.handler.handleInvoke(interaction, msg.getBody()); } catch (MALInteractionException ex) { interaction.sendError(ex.getStandardError()); } } catch (MALException ex) { try { interaction.sendError(new MALStandardError(MALHelper.INTERNAL_ERROR_NUMBER, new Union(ex.getLocalizedMessage()))); } catch (MALException noex) { // this exception cannot actually be thrown in this implmentation, therefore we can safely ignore it } } }
throw new MALInteractionException(new MALStandardError(MALHelper.UNKNOWN_ERROR_NUMBER, "There is a problem with the checkDefinition referenced by the checkLink"));
throw new MALInteractionException(new MALStandardError(MALHelper.UNKNOWN_ERROR_NUMBER, lst)); throw new MALInteractionException(new MALStandardError(MALHelper.UNKNOWN_ERROR_NUMBER, null));
if (null == area) throw new MALInteractionException(new MALStandardError(MALHelper.UNSUPPORTED_AREA_ERROR_NUMBER, null)); if (null == service) throw new MALInteractionException(new MALStandardError(MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, null)); if (null == this.operation) throw new MALInteractionException(new MALStandardError(MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, null));
/** * Called by the provider MAL layer on reception of a message to handle the interaction. * @param interaction interaction the interaction object. * @param body body the message body. * @throws org.ccsds.moims.mo.mal.MALException if there is a internal error. * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a operation interaction error. */ public void handleSend(org.ccsds.moims.mo.mal.provider.MALInteraction interaction, org.ccsds.moims.mo.mal.transport.MALMessageBody body) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException { switch (interaction.getOperation().getNumber().getValue()) { default: throw new org.ccsds.moims.mo.mal.MALInteractionException(new org.ccsds.moims.mo.mal.MALStandardError(org.ccsds.moims.mo.mal.MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Union("Unknown operation"))); } }
/** * Called by the provider MAL layer on reception of a message to handle the interaction. * @param interaction interaction the interaction object. * @param body body the message body. * @throws org.ccsds.moims.mo.mal.MALException if there is a internal error. * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a operation interaction error. */ public void handleSend(org.ccsds.moims.mo.mal.provider.MALInteraction interaction, org.ccsds.moims.mo.mal.transport.MALMessageBody body) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException { switch (interaction.getOperation().getNumber().getValue()) { default: throw new org.ccsds.moims.mo.mal.MALInteractionException(new org.ccsds.moims.mo.mal.MALStandardError(org.ccsds.moims.mo.mal.MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Union("Unknown operation"))); } }
/** * Called by the provider MAL layer on reception of a message to handle the interaction. * @param interaction interaction the interaction object. * @param body body the message body. * @throws org.ccsds.moims.mo.mal.MALException if there is a internal error. * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a operation interaction error. */ public void handleSend(org.ccsds.moims.mo.mal.provider.MALInteraction interaction, org.ccsds.moims.mo.mal.transport.MALMessageBody body) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException { switch (interaction.getOperation().getNumber().getValue()) { default: throw new org.ccsds.moims.mo.mal.MALInteractionException(new org.ccsds.moims.mo.mal.MALStandardError(org.ccsds.moims.mo.mal.MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Union("Unknown operation"))); } }
/** * Called by the provider MAL layer on reception of a message to handle the interaction. * @param interaction interaction the interaction object. * @param body body the message body. * @throws org.ccsds.moims.mo.mal.MALException if there is a internal error. * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a operation interaction error. */ public void handleSend(org.ccsds.moims.mo.mal.provider.MALInteraction interaction, org.ccsds.moims.mo.mal.transport.MALMessageBody body) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException { switch (interaction.getOperation().getNumber().getValue()) { default: throw new org.ccsds.moims.mo.mal.MALInteractionException(new org.ccsds.moims.mo.mal.MALStandardError(org.ccsds.moims.mo.mal.MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Union("Unknown operation"))); } }
/** * Called by the provider MAL layer on reception of a message to handle the interaction. * @param interaction interaction the interaction object. * @param body body the message body. * @throws org.ccsds.moims.mo.mal.MALException if there is a internal error. * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a operation interaction error. */ public void handleSend(org.ccsds.moims.mo.mal.provider.MALInteraction interaction, org.ccsds.moims.mo.mal.transport.MALMessageBody body) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException { switch (interaction.getOperation().getNumber().getValue()) { default: throw new org.ccsds.moims.mo.mal.MALInteractionException(new org.ccsds.moims.mo.mal.MALStandardError(org.ccsds.moims.mo.mal.MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Union("Unknown operation"))); } }
/** * Called by the provider MAL layer on reception of a message to handle the interaction. * @param interaction interaction the interaction object. * @param body body the message body. * @throws org.ccsds.moims.mo.mal.MALException if there is a internal error. * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a operation interaction error. */ public void handleSend(org.ccsds.moims.mo.mal.provider.MALInteraction interaction, org.ccsds.moims.mo.mal.transport.MALMessageBody body) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException { switch (interaction.getOperation().getNumber().getValue()) { default: throw new org.ccsds.moims.mo.mal.MALInteractionException(new org.ccsds.moims.mo.mal.MALStandardError(org.ccsds.moims.mo.mal.MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Union("Unknown operation"))); } }
/** * Called by the provider MAL layer on reception of a message to handle the interaction. * @param interaction interaction the interaction object. * @param body body the message body. * @throws org.ccsds.moims.mo.mal.MALException if there is a internal error. * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a operation interaction error. */ public void handleSend(org.ccsds.moims.mo.mal.provider.MALInteraction interaction, org.ccsds.moims.mo.mal.transport.MALMessageBody body) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException { switch (interaction.getOperation().getNumber().getValue()) { default: throw new org.ccsds.moims.mo.mal.MALInteractionException(new org.ccsds.moims.mo.mal.MALStandardError(org.ccsds.moims.mo.mal.MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Union("Unknown operation"))); } }