public static URI convertMALInteractionToURI(final MALInteraction interaction) { if (interaction != null) { if (interaction.getMessageHeader() != null) { return interaction.getMessageHeader().getURITo(); } } return new URI(""); }
/** * 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"))); } }
lvl, MALPubSubOperation.PUBLISH_DEREGISTER_ACK_STAGE, interaction.getOperation(), interaction.getQoSProperties(), (Object[]) 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"))); } }
msg.getHeader().getQoSlevel(), MALPubSubOperation.DEREGISTER_ACK_STAGE, interaction.getOperation(), interaction.getQoSProperties(), (Object[]) 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"))); } }
/** * Stores an Event in the Archive */ private Long storeEventOnArchive(final ObjectDetailsList objectDetailsList, final IdentifierList domain, final ObjectType objType, final ElementList events, final MALInteraction interaction) { if (interaction != null) { return this.storeEventOnArchive(objectDetailsList, domain, objType, events, interaction.getMessageHeader().getURIFrom(), interaction.getMessageHeader().getNetworkZone()); } else { return this.storeEventOnArchive(objectDetailsList, domain, objType, events, null, null); } }
lvl, MALPubSubOperation.PUBLISH_REGISTER_ACK_STAGE, interaction.getOperation(), interaction.getQoSProperties(), (Object[]) 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"))); } }
/** * This method is deprecated! The sourceURI should be explicitly stated. The * extraction of it from the interaction object should happen on the layers * above. The broker won't publish the event if the source is not correct. * Publishes an Event through the Event service. * * @param interaction Interaction object * @param objId Object instance identifier * @param objType Object type * @param related Related link * @param source Source link * @param eventBodies Bodies of the event * @throws java.io.IOException if it cannot publish the Event */ @Deprecated public void publishEvent(final MALInteraction interaction, final Long objId, final ObjectType objType, final Long related, final ObjectId source, final ElementList eventBodies) throws IOException { URI sourceURI = new URI(""); if (interaction != null) { if (interaction.getMessageHeader() != null) { sourceURI = interaction.getMessageHeader().getURITo(); } } // requirement: 3.3.2.1 this.publishEvent(sourceURI, objId, objType, related, source, eventBodies); }
msg.getHeader().getQoSlevel(), MALPubSubOperation.REGISTER_ACK_STAGE, interaction.getOperation(), interaction.getQoSProperties(), (Object[]) 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"))); } }
@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! } } } });
/** * 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"))); } }
private void generateAndPublishEvents(final ObjectType objType, final ObjectIdList sourceList, final MALInteraction interaction) { if (eventService == null) { return; } if (sourceList.isEmpty()) { // Don't store anything if the list is empty... return; } /* Just use it for debugging Logger.getLogger(ArchiveManager.class.getName()).log(Level.FINE, "\nobjType: " + objType.toString() + "\nDomain: " + ConfigurationProviderSingleton.getDomain().toString() + "\nSourceList: " + sourceList.toString()); */ // requirement: 3.4.2.4 final LongList eventObjIds = eventService.generateAndStoreEvents(objType, ConfigurationProviderSingleton.getDomain(), null, sourceList, interaction); /* Just use it for debugging Logger.getLogger(ArchiveManager.class.getName()).log(Level.FINE, "The eventObjIds are: " + eventObjIds.toString()); */ URI sourceURI = new URI(""); if (interaction != null) { if (interaction.getMessageHeader() != null) { sourceURI = interaction.getMessageHeader().getURITo(); } } try { eventService.publishEvents(sourceURI, eventObjIds, objType, null, sourceList, null); } catch (IOException ex) { Logger.getLogger(ArchiveManager.class.getName()).log(Level.SEVERE, null, ex); } }
/** * 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"))); } }
@Override public synchronized void handlePublishDeregister(final MALInteraction interaction) throws MALInteractionException, MALException { final MALMessageHeader hdr = interaction.getMessageHeader(); final BrokerKey key = new BrokerKey(hdr); report(key); final Map<StringPair, PublisherSource> rv = getProviderMap(key); if (null != rv.remove(new StringPair(hdr.getURIFrom().getValue(), createProviderKey(hdr)))) { MALBrokerImpl.LOGGER.log(Level.FINE, "Removing publisher details: {0}", hdr); } if (rv.isEmpty()) { providerMap.remove(key); } report(key); }
/** * 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"))); } }
public Long publishAcceptanceEventOperation(MALInteraction interaction, final URI uri, final Identifier network, boolean success, final Long related, final ObjectId source) throws MALInteractionException, MALException { // Create ActivityAcceptanceList ActivityAcceptanceList aal = new ActivityAcceptanceList(); aal.add(new ActivityAcceptance(success)); final Long objId; URI sourceURI = uri; if (interaction != null) { objId = eventService.generateAndStoreEvent(ActivityTrackingHelper.ACCEPTANCE_OBJECT_TYPE, ConfigurationProviderSingleton.getDomain(), aal, related, source, interaction); sourceURI = (interaction.getMessageHeader() != null) ? interaction.getMessageHeader().getURITo() : new URI(""); } else { objId = eventService.generateAndStoreEvent(ActivityTrackingHelper.ACCEPTANCE_OBJECT_TYPE, ConfigurationProviderSingleton.getDomain(), aal, related, source, uri, network); } try { eventService.publishEvent(sourceURI, objId, ActivityTrackingHelper.ACCEPTANCE_OBJECT_TYPE, null, source, aal); } catch (IOException ex) { Logger.getLogger(ActivityTrackingProviderServiceImpl.class.getName()).log(Level.SEVERE, null, "Could not publish the Event!"); } return objId; }
/** * 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"))); } }