@Override public URI getURI() { return new URI(localURI); }
public void setProviderURI(String providerURI) { this.providerURI = new URI(providerURI); }
public void setBrokerURI(String brokerURI) { this.brokerURI = new URI(brokerURI); }
public synchronized URI getProviderURI(final Integer id) throws Exception { final URI providerURI = new URI(this.fastIDreverse.get(id)); if (providerURI == null) { throw new Exception(); } return providerURI; } }
public MALBrokerBinding createBroker(String localName, Blob authenticationId, QoSLevel[] expectedQos, UInteger priorityLevelNumber, Map defaultQoSProperties) throws MALException { // not support by transport return new JMSBrokerBinding(new URI(uriBase + localName), localName, authenticationId, expectedQos, priorityLevelNumber); }
@Override public URI decodeURI() throws MALException { return new URI(sourceBuffer.getString()); }
@Override public URI decodeURI() throws MALException { return new URI(sourceBuffer.getString()); }
@Override public URI decodeNullableURI() throws MALException { final String s = sourceBuffer.getString(); if (null != s) { return new URI(s); } return null; }
/** * Constructor. * * @param socket the TCPIP socket. * @param localPort * @throws IOException if there is an error. */ public TCPIPTransportDataTransceiver(Socket socket, int localPort) throws IOException { RLOGGER.log(Level.FINE, "Creating new Data Transceiver"); this.socket = socket; socketWriteIf = new DataOutputStream(socket.getOutputStream()); socketReadIf = new DataInputStream(socket.getInputStream()); // get information String remoteHost = socket.getInetAddress().getHostAddress(); int remotePort = socket.getPort(); String localHost = socket.getLocalAddress().getHostAddress(); this.from = new URI("maltcp://" + remoteHost + ":" + remotePort); this.to = new URI("maltcp://" + localHost + ":" + localPort); // We need to use this localPort in order to fool the MAL }
public MALBrokerBinding createBroker(MALEndpoint endpoint, Blob authenticationId, QoSLevel[] qosLevels, UInteger priorities, Map properties) throws MALException { // not support by transport return new JMSBrokerBinding(new URI(uriBase + endpoint.getLocalName()), endpoint.getLocalName(), authenticationId, qosLevels, priorities); }
public static URI convertMALInteractionToURI(final MALInteraction interaction) { if (interaction != null) { if (interaction.getMessageHeader() != null) { return interaction.getMessageHeader().getURITo(); } } return new URI(""); }
/** * 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); }
/** * Creates a tmConsumer connection for a specified subsystem * * @param subsystem Name of the subsystem * @param service Definition of the consumed service * @return Wrapped MALconsumer * @throws org.ccsds.moims.mo.mal.MALException * @throws java.net.MalformedURLException */ public Object createConsumer(String subsystem, MALService service) throws MALException, MalformedURLException { Logger.getLogger(ConsumerServiceImpl.class.getName()).log(Level.INFO, "URI" + this.connectionDetails.getProviderURI().toString() + "@" + subsystem); MALConsumer consumer = connection.startService( new URI(this.connectionDetails.getProviderURI().toString() + "@" + subsystem), this.connectionDetails.getBrokerURI(), this.connectionDetails.getDomain(), service); Object stub = generateServiceStub(consumer); servicesMap.put(new Identifier(subsystem), stub); return stub; }
private void publishActionFailureEvent(final UInteger errorNumber, final Long related, final ObjectId source, final MALInteraction interaction, final SingleConnectionDetails connectionDetails) { // requirement: 3.2.5.f final UIntegerList errorNumbers = new UIntegerList(1); errorNumbers.add(errorNumber); // requirement: 3.2.5.c and 3.2.5.d and 3.2.5.e if (this.getEventService() != null) { Long objId = this.getEventService().generateAndStoreEvent( ActionHelper.ACTIONFAILURE_OBJECT_TYPE, ConfigurationProviderSingleton.getDomain(), errorNumber, related, source, interaction); try { this.getEventService().publishEvent(new URI(""), objId, ActionHelper.ACTIONFAILURE_OBJECT_TYPE, related, source, errorNumbers); } catch (IOException ex) { Logger.getLogger(ActionManager.class.getName()).log(Level.SEVERE, null, ex); } } }
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); } }
public ArchiveDetails getArchiveDetails() { final Identifier net = (this.network == null) ? null : new Identifier(network); final URI uri = (this.providerURI == null) ? null : new URI(providerURI); return new ArchiveDetails(objId, new ObjectDetails(relatedLink, sourceLink), net, new FineTime(timestampArchiveDetails), uri); }
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; }
private Long publishTransferEventOperation(MALInteraction interaction, final URI uri, final Identifier network, final ObjectType objType, final boolean success, final Duration duration, final URI nextDestination, final ObjectId source) throws MALInteractionException, MALException { // Produce ActivityTransferList ActivityTransferList atl = new ActivityTransferList(); ActivityTransfer at = new ActivityTransfer(success, duration, nextDestination); atl.add(at); final Long objId; URI sourceURI = uri; if (interaction != null) { objId = eventService.generateAndStoreEvent(objType, ConfigurationProviderSingleton.getDomain(), atl, null, source, interaction); sourceURI = (interaction.getMessageHeader() != null) ? interaction.getMessageHeader().getURITo() : new URI(""); } else { objId = eventService.generateAndStoreEvent(objType, ConfigurationProviderSingleton.getDomain(), atl, null, source, uri, network); } try { eventService.publishEvent(sourceURI, objId, objType, null, source, atl); } catch (IOException ex) { Logger.getLogger(ActivityTrackingProviderServiceImpl.class.getName()).log(Level.SEVERE, null, "Could not publish the Event!"); } return objId; }
ConfigurationProviderSingleton.getDomain(), HelperArchive.generateArchiveDetailsList(null, null, ConfigurationProviderSingleton.getNetwork(), new URI("")), archObj1, null); ConfigurationProviderSingleton.getDomain(), HelperArchive.generateArchiveDetailsList(objIds1.get(0), null, ConfigurationProviderSingleton.getNetwork(), new URI(""), defaultObjId), serviceKeyList, null);
private ObjectId publishExecutionEventOperation(final MALInteraction interaction, final URI uri, final Identifier network, boolean success, int currentStageCount, int totalStageCount, final Long related, ObjectId source) throws MALInteractionException, MALException { // Produce ActivityExecutionList ActivityExecutionList ael = new ActivityExecutionList(1); ActivityExecution activityExecutionInstance = new ActivityExecution( success, new UInteger(currentStageCount), new UInteger(totalStageCount)); ael.add(activityExecutionInstance); final Long objId; URI sourceURI = uri; if (interaction != null) { objId = eventService.generateAndStoreEvent(ActivityTrackingHelper.EXECUTION_OBJECT_TYPE, ConfigurationProviderSingleton.getDomain(), ael, related, source, interaction); sourceURI = (interaction.getMessageHeader() != null) ? interaction.getMessageHeader().getURITo() : new URI(""); } else { objId = eventService.generateAndStoreEvent(ActivityTrackingHelper.EXECUTION_OBJECT_TYPE, ConfigurationProviderSingleton.getDomain(), ael, related, source, uri, network); } final ObjectKey key = new ObjectKey(ConfigurationProviderSingleton.getDomain(), objId); try { eventService.publishEvent(sourceURI, objId, ActivityTrackingHelper.EXECUTION_OBJECT_TYPE, related, source, ael); } catch (IOException ex) { Logger.getLogger(ActivityTrackingProviderServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } return new ObjectId(ActivityTrackingHelper.EXECUTION_OBJECT_TYPE, key); }