/** * 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 handleInvoke(org.ccsds.moims.mo.mal.provider.MALInvoke 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: interaction.sendError(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"))); } }
@Override public MALMessage createMessage(final Blob authenticationId, final URI uriTo, final Time timestamp, final QoSLevel qosLevel, final UInteger priority, final IdentifierList domain, final Identifier networkZone, final SessionType session, final Identifier sessionName, final Long transactionId, final Boolean isErrorMessage, final MALOperation op, final UOctet interactionStage, final Map qosProperties, final Object... body) throws MALException { GENMessageHeader hdr = createMessageHeader(getURI(), authenticationId, uriTo, timestamp, qosLevel, priority, domain, networkZone, session, sessionName, op.getInteractionType(), interactionStage, transactionId, op.getService().getArea().getNumber(), op.getService().getNumber(), op.getNumber(), op.getService().getArea().getVersion(), isErrorMessage, qosProperties); try { return new TCPIPMessage(false, hdr, qosProperties, op, transport.getStreamFactory(), body); } catch (MALInteractionException e) { throw new MALException("Error creating message", e); } }
private static MALMessage createMessage(final MessageDetails details, final MALOperation op, final Long transactionId, final UOctet interactionStage, final Object... body) throws MALException { URI to = details.brokerUri; if (op.getInteractionType() != InteractionType.PUBSUB) { to = details.uriTo; } return details.endpoint.createMessage(details.authenticationId, to, new Time(new Date().getTime()), details.qosLevel, details.priority, details.domain, details.networkZone, details.sessionType, details.sessionName, transactionId, Boolean.FALSE, op, interactionStage, details.qosProps, body); }
protected void encodeSubElement(final Element e, final Object sf, final MALEncodingContext ctx) throws MALException { if (null == sf) { // dirty check to see if we are trying to decode an abstract Attribute (and not a list of them either) Object[] finalEleShortForms = null; if (null != ctx) { finalEleShortForms = ctx.getOperation().getOperationStage(ctx.getHeader().getInteractionStage()).getLastElementShortForms(); } if ((null != finalEleShortForms) && (Attribute._URI_TYPE_SHORT_FORM == finalEleShortForms.length) && ((((Long) finalEleShortForms[0]) & 0x800000L) == 0)) { enc.encodeNullableOctet(enc.internalEncodeAttributeType(e.getTypeShortForm().byteValue())); } else { enc.encodeAbstractElementType(e.getShortForm(), true); } // now encode the element enc.encodeElement(e); } else { enc.encodeNullableElement(e); } }
private static MALMessage createMessage(final MessageDetails details, final MALOperation op, final Long transactionId, final UOctet interactionStage, final MALEncodedBody body) throws MALException { URI to = details.brokerUri; if (op.getInteractionType() != InteractionType.PUBSUB) { to = details.uriTo; } return details.endpoint.createMessage(details.authenticationId, to, new Time(new Date().getTime()), details.qosLevel, details.priority, details.domain, details.networkZone, details.sessionType, details.sessionName, transactionId, Boolean.FALSE, op, interactionStage, details.qosProps, body); } }
Object sf = ctx.getOperation().getOperationStage(stage).getElementShortForms()[0]; encodeBodyPart(streamFactory, enc, wrappedBodyParts, sf, getBodyElement(0, null), ctx); sf = ctx.getOperation().getOperationStage(stage).getElementShortForms()[i];
/** * 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 handleInvoke(org.ccsds.moims.mo.mal.provider.MALInvoke 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: interaction.sendError(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"))); } }
session, sessionName, op.getInteractionType(), interactionStage, transactionId, op.getService().getArea().getNumber(), op.getService().getNumber(), op.getNumber(), op.getService().getArea().getVersion(), isErrorMessage, qosProperties), session, sessionName, op.getInteractionType(), interactionStage, transactionId, op.getService().getArea().getNumber(), op.getService().getNumber(), op.getNumber(), op.getService().getArea().getVersion(), isErrorMessage, qosProperties),
icmap.continueTransaction(op.getInteractionType().getOrdinal(), lastInteractionStage, transactionId, listener);
bodyPartCount = ctx.getOperation().getOperationStage(ctx.getHeader().getInteractionStage()).getElementShortForms().length; Object sf = ctx.getOperation().getOperationStage(ctx.getHeader().getInteractionStage()).getElementShortForms()[0]; messageParts[0] = decodeBodyPart(encBodyElements, ctx, sf); sf = ctx.getOperation().getOperationStage(ctx.getHeader().getInteractionStage()).getElementShortForms()[i];
/** * 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 handleProgress(org.ccsds.moims.mo.mal.provider.MALProgress 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: interaction.sendError(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"))); } }
/** * Performs a two way interaction, sends the message. * * @param details Message details structure. * @param op The operation. * @param initialStage The initial interaction stage. * @param listener Interaction listener to use for the reception of other stages. * @param msgBody The message body. * @return The sent MAL message. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessage asynchronousInteraction(final MessageDetails details, final MALOperation op, final UOctet initialStage, final MALInteractionListener listener, final Object... msgBody) throws MALInteractionException, MALException { final Long transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), false, listener); return initiateAsynchronousInteraction(details, createMessage(details, op, transId, initialStage, msgBody)); }
return; case MALPubSubOperation._PUBLISH_STAGE: if ((0 < ctx.getBodyElementIndex()) && (null == ctx.getOperation().getOperationStage(ctx.getHeader().getInteractionStage()).getElementShortForms()[ctx.getBodyElementIndex()])) if ((1 < ctx.getBodyElementIndex()) && (null == ctx.getOperation().getOperationStage(ctx.getHeader().getInteractionStage()).getElementShortForms()[ctx.getBodyElementIndex()])) Object sf = ctx.getOperation().getOperationStage(stage).getElementShortForms()[ctx.getBodyElementIndex()];
/** * 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 handleRequest(org.ccsds.moims.mo.mal.provider.MALRequest 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: interaction.sendError(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"))); } }
/** * Performs a oneway interaction, sends the message and then returns. * * @param details Message details structure. * @param transId The transaction identifier to use. * @param op The operation. * @param stage The interaction stage to use. * @param msgBody The already encoded message body. * @return The sent MAL message. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessage onewayInteraction(final MessageDetails details, Long transId, final MALOperation op, final UOctet stage, final MALEncodedBody msgBody) throws MALInteractionException, MALException { if (null == transId) { transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), true, null); } return initiateOnewayInteraction(details, createMessage(details, op, transId, stage, msgBody)); }
Object sf = ctx.getOperation().getOperationStage(ctx.getHeader().getInteractionStage()).getElementShortForms()[ctx.getBodyElementIndex()]; Object sf = ctx.getOperation().getOperationStage(ctx.getHeader().getInteractionStage()).getElementShortForms()[ctx.getBodyElementIndex()]; Object[] finalEleShortForms = ctx.getOperation().getOperationStage(ctx.getHeader().getInteractionStage()).getLastElementShortForms();
/** * 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 handleProgress(org.ccsds.moims.mo.mal.provider.MALProgress 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: interaction.sendError(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"))); } }
/** * Performs a oneway interaction, sends the message and then returns. * * @param details Message details structure. * @param transId The transaction identifier to use. * @param op The operation. * @param stage The interaction stage to use. * @param msgBody The message body. * @return The sent MAL message. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessage onewayInteraction(final MessageDetails details, Long transId, final MALOperation op, final UOctet stage, final Object... msgBody) throws MALInteractionException, MALException { if (null == transId) { transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), true, null); } return initiateOnewayInteraction(details, createMessage(details, op, transId, stage, msgBody)); }
/** * 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 handleInvoke(org.ccsds.moims.mo.mal.provider.MALInvoke 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: interaction.sendError(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"))); } }
/** * Performs a two way interaction, sends the message and then waits for the specified stage before returning. * * @param details Message details structure. * @param op The operation. * @param syncStage The interaction stage to wait for before returning. * @param listener Interaction listener to use for the reception of other stages. * @param msgBody The already encoded message body. * @return The returned message body. * @throws MALInteractionException if there is a problem during the interaction. * @throws MALException on Error. */ public MALMessageBody synchronousInteraction(final MessageDetails details, final MALOperation op, final UOctet syncStage, final MALInteractionListener listener, final MALEncodedBody msgBody) throws MALInteractionException, MALException { final Long transId = icmap.createTransaction(op.getInteractionType().getOrdinal(), true, listener); return initiateSynchronousInteraction(transId, details, createMessage(details, op, transId, syncStage, msgBody)); }