/** * Changes the current set of definitions available by the provided set. * * @param objIds Object instance identifiers * @param definitions The object body of the definitions * @return True if the configuration was successfully changed. False * otherwise. */ public synchronized Boolean reconfigureDefinitions(LongList objIds, ElementList definitions) { if (objIds == null || definitions == null) { return false; } if (objIds.size() != definitions.size()) { return false; } defs.clear(); for (int i = 0; i < objIds.size(); i++) { defs.put(objIds.get(i), (Element) definitions.get(i)); } return true; }
/** * Get the object body of a retrieved COM object from the Archive * * @param archiveService The Archive * @param objType The object Type of the COM object * @param domain The domain of the COM object * @param objId The object instance identifier of the COM object * @return The object body of the retrieved COM object */ public static Element getObjectBodyFromArchive(final Object archiveService, final ObjectType objType, final IdentifierList domain, final Long objId) { final LongList objIds = new LongList(); objIds.add(objId); final ElementList objs = (ElementList) getFromArchive( archiveService, objType, domain, objIds, ToBeReturned.OBJECT_BODY ); return (objs != null) ? (Element) objs.get(0) : null; /* if (objs != null) { return (Element) objs.get(0); } else { return null; } */ }
/** * Changes the current set of definitions available by the provided set. * * @param identityIds the identityIds of the parameters to be set * @param names the names of the parameters to be set * @param defIds the definitionsIds of the parameters to be set * @param definitions The object body of the definitions to be set * @return True if the configuration was successfully changed. False * otherwise. */ public synchronized Boolean reconfigureDefinitions(final LongList identityIds, final IdentifierList names, final LongList defIds, final ElementList definitions) { if (identityIds == null || names == null || defIds == null || definitions == null) { return false; } if (identityIds.size() != names.size() && defIds.size() != definitions.size() && identityIds.size() != defIds.size()) { return false; } this.identitiesToNamesMap.clear(); this.namesToPairsMap.clear(); this.objIdToDefMap.clear(); for (int i = 0; i < identityIds.size(); i++) { this.identitiesToNamesMap.put(identityIds.get(i), names.get(i)); this.namesToPairsMap.put(names.get(i), new ObjectInstancePair(identityIds.get(i), defIds.get(i))); this.objIdToDefMap.put(defIds.get(i), (Element) definitions.get(i)); } return true; }
protected void updateEntries(final ObjectType objType, final IdentifierList domain, final ArchiveDetailsList lArchiveDetails, final ElementList objects, final MALInteraction interaction) { final int domainId = this.fastDomain.getDomainId(domain); final Integer objTypeId = this.fastObjectType.getObjectTypeId(objType); final ArrayList<COMObjectEntity> newObjs = new ArrayList<COMObjectEntity>(); final LongList objIds = new LongList(); // Generate the object Ids if needed and the persistence objects to be stored for (int i = 0; i < lArchiveDetails.size(); i++) { final Integer providerURIId = this.fastProviderURI.getProviderURIId(lArchiveDetails.get(i).getProvider()); final Integer networkId = this.fastNetwork.getNetworkId(lArchiveDetails.get(i).getNetwork()); // If there are no objects in the list, inject null... Object objBody = (objects == null) ? null : ((objects.get(i) == null) ? null : objects.get(i)); SourceLinkContainer sourceLink = this.createSourceContainerFromObjectId(lArchiveDetails.get(i).getDetails().getSource()); final COMObjectEntity newObj = new COMObjectEntity( objTypeId, domainId, lArchiveDetails.get(i).getInstId(), lArchiveDetails.get(i).getTimestamp().getValue(), providerURIId, networkId, sourceLink, lArchiveDetails.get(i).getDetails().getRelated(), objBody); // 0.170 ms newObjs.add(newObj); objIds.add(lArchiveDetails.get(i).getInstId()); } Runnable publishEvents = this.generatePublishEventsThread(ArchiveHelper.OBJECTUPDATED_OBJECT_TYPE, objType, domain, objIds, interaction); this.dbProcessor.update(newObjs, publishEvents); }
ObjectId obj = (ObjectId) objects.get(0);