/** * 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; }
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); } } }
interaction.sendAcknowledgement(null); UIntegerList unkIndexList = new UIntegerList(); UIntegerList invIndexList = new UIntegerList();
/** * Decodes the value of this object using the provided MALDecoder. * @param decoder decoder - the decoder to use for decoding. * @return Returns this object. * @throws org.ccsds.moims.mo.mal.MALException if any decoding errors are detected. */ public org.ccsds.moims.mo.mal.structures.Element decode(org.ccsds.moims.mo.mal.MALDecoder decoder) throws org.ccsds.moims.mo.mal.MALException { serviceProviderName = decoder.decodeIdentifier(); domain = (org.ccsds.moims.mo.mal.structures.IdentifierList) decoder.decodeElement(new org.ccsds.moims.mo.mal.structures.IdentifierList()); network = decoder.decodeIdentifier(); sessionType = (org.ccsds.moims.mo.mal.structures.SessionType) decoder.decodeNullableElement(org.ccsds.moims.mo.mal.structures.SessionType.LIVE); sessionName = decoder.decodeIdentifier(); serviceKey = (org.ccsds.moims.mo.common.structures.ServiceKey) decoder.decodeElement(new org.ccsds.moims.mo.common.structures.ServiceKey()); requiredCapabilities = (org.ccsds.moims.mo.mal.structures.UIntegerList) decoder.decodeElement(new org.ccsds.moims.mo.mal.structures.UIntegerList()); return this; }
@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; }
UIntegerList unkIndexList = new UIntegerList(); for (int i = 0; i < actionNames.size(); i++) { //requirement: 3.2.11.2.f foreach-cycle steps through list in order Identifier actionName = actionNames.get(i);
UIntegerList unkIndexList = new UIntegerList(); for (int i = 0; i < alertNames.size(); i++) { //requirement: 3.4.9.2.f foreach-cycle steps through list in order Identifier alertName = alertNames.get(i);
@Override public ObjectInstancePairList listDefinition(final IdentifierList nameList, final MALInteraction interaction) throws MALException, MALInteractionException { // requirement: 3.7.9.2.1 ObjectInstancePairList outLongLst = new ObjectInstancePairList(); UIntegerList unkIndexList = new UIntegerList();
MALInteraction interaction) throws MALInteractionException, MALException { UIntegerList unkIndexList = new UIntegerList(); UIntegerList invIndexList = new UIntegerList();
@Override public LongList updateDefinition(LongList actionDefInstIds, ActionDefinitionDetailsList actionDefDetails, MALInteraction interaction) throws MALInteractionException, MALException { UIntegerList unkIndexList = new UIntegerList(); UIntegerList invIndexList = new UIntegerList();
@Override public void removeAlert(LongList alertIdentityIds, MALInteraction interaction) throws MALInteractionException, MALException { UIntegerList unkIndexList = new UIntegerList(); LongList removalLst = new LongList();
@Override public void removeAction(final LongList actionInstIds, final MALInteraction interaction) throws MALException, MALInteractionException { // requirement: 3.7.12.2.1 UIntegerList unkIndexList = new UIntegerList(); Long tempIdentity; LongList tempIdentityLst = new LongList();
@Override public void removeParameterEvaluation(LongList objInstIds, MALInteraction interaction) throws MALInteractionException, MALException { UIntegerList unkIndexList = new UIntegerList(); Long tempLong; LongList tempIdsToRemoveLst = new LongList();
@Override public AggregationValueDetailsList getValue(final LongList inIdentityIds, final MALInteraction interaction) throws MALException, MALInteractionException { // requirement 3.7.6.2.1 UIntegerList unkIndexList = new UIntegerList();
@Override public void removeParameterCheck(LongList checkLinkIds, MALInteraction interaction) throws MALInteractionException, MALException { UIntegerList unkIndexList = new UIntegerList();
/** * 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.com.archivesync.ArchiveSyncHelper._RETRIEVERANGE_OP_NUMBER: retrieveRange((org.ccsds.moims.mo.mal.structures.FineTime) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.FineTime()), (org.ccsds.moims.mo.mal.structures.FineTime) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.FineTime()), (org.ccsds.moims.mo.com.structures.ObjectTypeList) body.getBodyElement(2, new org.ccsds.moims.mo.com.structures.ObjectTypeList()), (org.ccsds.moims.mo.mal.structures.Identifier) body.getBodyElement(3, new org.ccsds.moims.mo.mal.structures.Identifier()), new RetrieveRangeInteraction(interaction)); break; case org.ccsds.moims.mo.com.archivesync.ArchiveSyncHelper._RETRIEVERANGEAGAIN_OP_NUMBER: retrieveRangeAgain((body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE)) == null) ? null : ((org.ccsds.moims.mo.mal.structures.Union) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE))).getLongValue(), (org.ccsds.moims.mo.mal.structures.UIntegerList) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UIntegerList()), new RetrieveRangeAgainInteraction(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.com.archivesync.ArchiveSyncHelper._RETRIEVERANGE_OP_NUMBER: delegate.retrieveRange((org.ccsds.moims.mo.mal.structures.FineTime) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.FineTime()), (org.ccsds.moims.mo.mal.structures.FineTime) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.FineTime()), (org.ccsds.moims.mo.com.structures.ObjectTypeList) body.getBodyElement(2, new org.ccsds.moims.mo.com.structures.ObjectTypeList()), (org.ccsds.moims.mo.mal.structures.Identifier) body.getBodyElement(3, new org.ccsds.moims.mo.mal.structures.Identifier()), new RetrieveRangeInteraction(interaction)); break; case org.ccsds.moims.mo.com.archivesync.ArchiveSyncHelper._RETRIEVERANGEAGAIN_OP_NUMBER: delegate.retrieveRangeAgain((body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE)) == null) ? null : ((org.ccsds.moims.mo.mal.structures.Union) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE))).getLongValue(), (org.ccsds.moims.mo.mal.structures.UIntegerList) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UIntegerList()), new RetrieveRangeAgainInteraction(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"))); } }
@Override public void getSummaryReport(LongList checkIdentityIds, GetSummaryReportInteraction interaction) throws MALInteractionException, MALException { UIntegerList unkIndexList = new UIntegerList();