public UInteger getLastKnownIndex() { return new UInteger(lastknowIndex); }
@Override public UInteger decodeUInteger() throws MALException { return new UInteger(sourceBuffer.getUnsignedLong32()); }
@Override public UInteger decodeUInteger() throws MALException { return new UInteger(sourceBuffer.getUnsignedLong32()); }
@Override public MALListEncoder createListEncoder(List list) throws IllegalArgumentException, MALException { // encode number of elements encodeUInteger(new UInteger(list.size())); return this; }
@Override public UInteger actionArrived(Identifier name, AttributeValueList attributeValues, Long actionInstanceObjId, boolean reportProgress, MALInteraction interaction) { // Just an example if ("Go".equals(name.getValue())) { // action1 was called? return null; } return new UInteger(1); // Action service not integrated }
public UInteger decodeUInteger() throws MALException { return new UInteger(((TCPIPBufferHolder) sourceBuffer).getUnsignedIntValue()); }
public void sendUpdateToConsumer(int index, byte[] aChunk) { chunksFlushed.add(index, aChunk); try { interaction.sendUpdate(new Blob(aChunk), new UInteger(index)); } catch (MALInteractionException ex) { Logger.getLogger(ArchiveSyncProviderServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } catch (MALException ex) { Logger.getLogger(ArchiveSyncProviderServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } }
/** * This method adds all numbers to the invIndexList, which have a higher * number than the number of the smaller of the two sizes * * @param firstList * @param secondList * @param invIndexList * @return the modified invIndexList */ private UIntegerList getInvalidIndexes(int size1, int size2) { UIntegerList invIndexList = new UIntegerList(); // requirement: 3.5.17.2.g int min = Math.min(size1, size2); int max = Math.max(size1, size2); for (; min < max; min++) { invIndexList.add(new UInteger(min)); } return invIndexList; }
public UIntegerList getMissingIndexes() { UIntegerList missingIndexes = new UIntegerList(); long nOfChunks = numberOfChunks.getValue(); for (int i = 0; i < nOfChunks; i++) { if (receivedChunks.get(i) == null) { missingIndexes.add(new UInteger()); } } return missingIndexes; }
public static UIntegerList checkForDuplicates(ArchiveDetailsList archiveDetailsList) { UIntegerList dupList = new UIntegerList(); for (int i = 0; i < archiveDetailsList.size() - 1; i++) { if (archiveDetailsList.get(i).getInstId().intValue() == 0) { // Wildcard? Then jump over it continue; } for (int j = i + 1; j < archiveDetailsList.size(); j++) { if (archiveDetailsList.get(i).getInstId().intValue() == archiveDetailsList.get(j).getInstId().intValue()) { dupList.add(new UInteger(j)); } } } return dupList; }
/** * Encode a blob */ @Override public void encodeBlob(final Blob value) throws MALException { byte[] byteValue = value.getValue(); encodeUInteger(new UInteger(byteValue.length)); if (value.getLength() > 0) { try { outputStream.directAdd(byteValue); } catch (IOException ex) { throw new MALException(ENCODING_EXCEPTION_STR, ex); } } }
/** * Called by the MAL when a PROGRESS update is received from a provider. * @param msgHeader msgHeader The header of the received message. * @param body body The body of the received message. * @param qosProperties qosProperties The QoS properties associated with the message. * @throws org.ccsds.moims.mo.mal.MALException if an error is detected processing the message. */ public final void progressUpdateReceived(org.ccsds.moims.mo.mal.transport.MALMessageHeader msgHeader, org.ccsds.moims.mo.mal.transport.MALMessageBody body, java.util.Map qosProperties) throws org.ccsds.moims.mo.mal.MALException { switch (msgHeader.getOperation().getValue()) { case org.ccsds.moims.mo.com.archivesync.ArchiveSyncHelper._RETRIEVERANGE_OP_NUMBER: retrieveRangeUpdateReceived(msgHeader, (org.ccsds.moims.mo.mal.structures.Blob) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Blob()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), qosProperties); break; case org.ccsds.moims.mo.com.archivesync.ArchiveSyncHelper._RETRIEVERANGEAGAIN_OP_NUMBER: retrieveRangeAgainUpdateReceived(msgHeader, (org.ccsds.moims.mo.mal.structures.Blob) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Blob()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), qosProperties); break; default: throw new org.ccsds.moims.mo.mal.MALException("Consumer adapter was not expecting operation number " + msgHeader.getOperation().getValue()); } }
/** * Called by the MAL when a PROGRESS response is received from a provider. * @param msgHeader msgHeader The header of the received message. * @param body body The body of the received message. * @param qosProperties qosProperties The QoS properties associated with the message. * @throws org.ccsds.moims.mo.mal.MALException if an error is detected processing the message. */ public final void progressResponseReceived(org.ccsds.moims.mo.mal.transport.MALMessageHeader msgHeader, org.ccsds.moims.mo.mal.transport.MALMessageBody body, java.util.Map qosProperties) throws org.ccsds.moims.mo.mal.MALException { switch (msgHeader.getOperation().getValue()) { case org.ccsds.moims.mo.com.archivesync.ArchiveSyncHelper._RETRIEVERANGE_OP_NUMBER: retrieveRangeResponseReceived(msgHeader, (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.UInteger()), qosProperties); break; case org.ccsds.moims.mo.com.archivesync.ArchiveSyncHelper._RETRIEVERANGEAGAIN_OP_NUMBER: retrieveRangeAgainResponseReceived(msgHeader, qosProperties); break; default: throw new org.ccsds.moims.mo.mal.MALException("Consumer adapter was not expecting operation number " + msgHeader.getOperation().getValue()); } }
private StatisticValue newStatisticValue(long paramIdentityId, TimeList times, AttributeValueList values) { if (times == null || values == null) { // Nothing to do here... return null; } // Different list sizes or zero elements? if (times.size() != values.size() || values.size() == 0) { return null; } StatisticValue statValue = new StatisticValue(); statValue.setStartTime(times.get(0)); statValue.setEndTime(times.get(times.size() - 1)); // Last element statValue.setSampleCount(new UInteger(times.size())); long paramDefInstId = parameterManager.getDefinitionId(paramIdentityId); statValue.setParamDefInstId(paramDefInstId); return statValue; }
/** * 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()) { case org.ccsds.moims.mo.softwaremanagement.memorymanagement.MemoryManagementHelper._DUMPMEMORY_OP_NUMBER: dumpMemory((org.ccsds.moims.mo.mal.structures.Identifier) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Identifier()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), (org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryAreaList) body.getBodyElement(2, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryAreaList()), new DumpMemoryInteraction(interaction)); break; 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"))); } }
/** * 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()) { case org.ccsds.moims.mo.softwaremanagement.memorymanagement.MemoryManagementHelper._DUMPMEMORY_OP_NUMBER: delegate.dumpMemory((org.ccsds.moims.mo.mal.structures.Identifier) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Identifier()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), (org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryAreaList) body.getBodyElement(2, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryAreaList()), new DumpMemoryInteraction(interaction)); break; 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"))); } }
/** * 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()) { case org.ccsds.moims.mo.softwaremanagement.memorymanagement.MemoryManagementHelper._CHECKMEMORY_OP_NUMBER: delegate.checkMemory((org.ccsds.moims.mo.mal.structures.Identifier) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Identifier()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), (org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryAreaList) body.getBodyElement(2, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryAreaList()), (body.getBodyElement(3, new org.ccsds.moims.mo.mal.structures.Union("")) == null) ? null : ((org.ccsds.moims.mo.mal.structures.Union) body.getBodyElement(3, new org.ccsds.moims.mo.mal.structures.Union(""))).getStringValue(), new CheckMemoryInteraction(interaction)); break; 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"))); } }
/** * 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()) { case org.ccsds.moims.mo.softwaremanagement.memorymanagement.MemoryManagementHelper._CHECKMEMORY_OP_NUMBER: checkMemory((org.ccsds.moims.mo.mal.structures.Identifier) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Identifier()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), (org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryAreaList) body.getBodyElement(2, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryAreaList()), (body.getBodyElement(3, new org.ccsds.moims.mo.mal.structures.Union("")) == null) ? null : ((org.ccsds.moims.mo.mal.structures.Union) body.getBodyElement(3, new org.ccsds.moims.mo.mal.structures.Union(""))).getStringValue(), new CheckMemoryInteraction(interaction)); break; 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"))); } }
/** * 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 handleSubmit(org.ccsds.moims.mo.mal.provider.MALSubmit 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()) { case org.ccsds.moims.mo.softwaremanagement.memorymanagement.MemoryManagementHelper._LOADMEMORY_OP_NUMBER: loadMemory((org.ccsds.moims.mo.mal.structures.Identifier) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Identifier()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), (org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.DataBlockList) body.getBodyElement(2, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.DataBlockList()), interaction); interaction.sendAcknowledgement(); break; case org.ccsds.moims.mo.softwaremanagement.memorymanagement.MemoryManagementHelper._ABORTMEMORYDUMP_OP_NUMBER: abortMemoryDump((org.ccsds.moims.mo.mal.structures.LongList) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.LongList()), interaction); interaction.sendAcknowledgement(); break; 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"))); } }
/** * 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 handleSubmit(org.ccsds.moims.mo.mal.provider.MALSubmit 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()) { case org.ccsds.moims.mo.softwaremanagement.memorymanagement.MemoryManagementHelper._LOADMEMORY_OP_NUMBER: delegate.loadMemory((org.ccsds.moims.mo.mal.structures.Identifier) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Identifier()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), (org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.DataBlockList) body.getBodyElement(2, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.DataBlockList()), interaction); interaction.sendAcknowledgement(); break; case org.ccsds.moims.mo.softwaremanagement.memorymanagement.MemoryManagementHelper._ABORTMEMORYDUMP_OP_NUMBER: delegate.abortMemoryDump((org.ccsds.moims.mo.mal.structures.LongList) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.LongList()), interaction); interaction.sendAcknowledgement(); break; 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"))); } }