public Boolean reconfigureLinks(LongList objIds, StatisticCreationRequestList statisticParameterDetailsList) { if (objIds.size() != statisticParameterDetailsList.size()) { return false; } statLinks.clear(); for (int i = 0; i < objIds.size(); i++) { statLinks.put(objIds.get(i), statisticParameterDetailsList.get(i)); } return true; }
public void loadPreviousConfigurations() throws IOException { // Activate the previous configuration this.reloadServiceConfigurations(reconfigurableServices, objIds); Logger.getLogger(PersistProviderConfiguration.class.getName()).log(Level.FINER, "The size of the objIds list is: " + objIds.size() + " and the size of the reconfigurableServices is: " + reconfigurableServices.size()); for (int i = 0; i < objIds.size(); i++) { final ReconfigurableService providerService = reconfigurableServices.get(i); final PersistLatestServiceConfigurationAdapter persistLatestConfig = new PersistLatestServiceConfigurationAdapter(providerService, objIds.get(i), this.archiveService, this.executor); providerService.setOnConfigurationChangeListener(persistLatestConfig); } }
/** * 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; }
/** * 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; }
@Override public void run() { dbBackend.createEntityManager(); // 0.166 ms // Generate the object Ids if needed and the persistence objects to be removed for (int i = 0; i < objIds.size(); i++) { final COMObjectEntityPK id = COMObjectEntity.generatePK(objTypeId, domainId, objIds.get(i)); COMObjectEntity perObj = dbBackend.getEM().find(CLASS_ENTITY, id); dbBackend.getEM().getTransaction().begin(); dbBackend.getEM().remove(perObj); dbBackend.getEM().getTransaction().commit(); } dbBackend.closeEntityManager(); // 0.410 ms generalExecutor.submit(publishEvents); } });
public Long storeAndGenerateAValobjId(AggregationValue aVal, Long related, ObjectId source, URI uri) { if (super.getArchiveService() == null) { uniqueObjIdAVal++; return this.uniqueObjIdAVal; } else { AggregationValueList aValList = new AggregationValueList(); aValList.add(aVal); try { //requirement: 3.7.4.d, 3.7.6.b LongList objIds = super.getArchiveService().store( true, AggregationHelper.AGGREGATIONVALUEINSTANCE_OBJECT_TYPE, ConfigurationProviderSingleton.getDomain(), HelperArchive.generateArchiveDetailsList(related, source, uri), //requirement: 3.7.4.e aValList, null); if (objIds.size() == 1) { return objIds.get(0); } } catch (MALException ex) { Logger.getLogger(ParameterManager.class.getName()).log(Level.SEVERE, null, ex); } catch (MALInteractionException ex) { Logger.getLogger(ParameterManager.class.getName()).log(Level.SEVERE, null, ex); } return null; } }
null); if (objIds.size() == 1) { return objIds.get(0);
null); if (objIds.size() == 1) { return objIds.get(0);
private static ObjectIdList generateSources(final ObjectType objType, final IdentifierList domain, final LongList objIds) { final ObjectIdList sourceList = new ObjectIdList(objIds.size()); for (int i = 0; i < objIds.size(); i++) { final ObjectId source = new ObjectId(objType, new ObjectKey(domain, objIds.get(i))); // Is the COM Object an Event coming from the archive? if (source.getType().equals(HelperCOM.generateCOMObjectType(ArchiveHelper.ARCHIVE_SERVICE, source.getType().getNumber()))) { continue; // requirement: 3.4.2.5 } sourceList.add(source); } return sourceList; }
/** * This method is getting all instances contained in the given groups. The * only difference to the other method (check the see part) is: you dont * care about the values and just want to get the identities referenced by * the groups * * @see getGroupInstancesForServiceOperation(InstanceBooleanPairList * enableInstances, GroupRetrieval groupRetrievalInformation, ObjectType * identyObjectType, IdentifierList domain, LongList allIdentities) * * @param groupIds * @param groupRetrievalInformation * @param identyObjectType * @param domain * @param allIdentities * @return */ public GroupRetrieval getGroupInstancesForServiceOperation(LongList groupIds, GroupRetrieval groupRetrievalInformation, ObjectType identyObjectType, IdentifierList domain, LongList allIdentities) { //if you cont care about the values and just want to get the identities referenced by the groups: InstanceBooleanPairList instBoolPairList = new InstanceBooleanPairList(groupIds.size()); for (Long enableInstance : groupIds) { instBoolPairList.add(new InstanceBooleanPair(enableInstance, Boolean.TRUE)); } return getGroupInstancesForServiceOperation(instBoolPairList, groupRetrievalInformation, identyObjectType, domain, allIdentities); }
for (int i = 0; i < checkIdentityIds.size(); i++) { if (checkIdentityIds.get(i) == 0L) { checkIdentityIds.clear(); for (int i = 0; i < checkIdentityIds.size(); i++) { for (int i = 0; i < checkIdentityIds.size(); i++) { if (i < checkIdentityIds.size() - 1) { interaction.sendUpdate(checkIdentityIds.get(i), manager.getCheckSummaries(checkIdentityIds.get(i))); } else {
for (int index = 0; index < actionDefInstIds.size(); index++) { final Long identityId = actionDefInstIds.get(index); || actionDefInstIds.size() != actionDefDetails.size()) { //requirement: 3.2.13.2.f invIndexList.add(new UInteger(index)); continue; for (int index = 0; index < actionDefInstIds.size(); index++) { // requirement: 3.2.13.2.e, k (incremental "for cycle" guarantees that) newDefIds.add(manager.update(actionDefInstIds.get(index), actionDefDetails.get(index),
for (int index = 0; index < alertIdentityIds.size(); index++) {
for (int index = 0; index < actionInstIds.size(); index++) {
for (int index = 0; index < objInstIds.size(); index++) { tempLong = objInstIds.get(index);
for (int index = 0; index < identityIds.size(); index++) { Long identityId = identityIds.get(index);
for (int index = 0; index < identityIds.size(); index++) { identityId = identityIds.get(index);
private IdObjectTypeList getGroupObjectIdsFromGroupRecursive(GroupDetails group, LongList previousGroupInstances) { if (archiveService == null || group == null) { // If there's no archive... return null; } //easiest case: group contains non-group-instances //requirement: 3.9.4.h if (!group.getObjectType().equals(GroupHelper.GROUPIDENTITY_OBJECT_TYPE)) { // It is no group of groups? return new IdObjectTypeList(group.getInstanceIds(), group.getObjectType()); } else { //solve a case with less complexity: get the instances of the groups groups final LongList groupsGroupIdentityIds = group.getInstanceIds(); //the recursive method-calls should not check the instances that will be checked during the iterations in this method call LongList newPreviousGroupInstances = new LongList(); newPreviousGroupInstances.addAll(previousGroupInstances); newPreviousGroupInstances.addAll(groupsGroupIdentityIds); //iterate through all new Groups and add all their instances to the final list IdObjectTypeList idObjectTypeList = new IdObjectTypeList(); for (int i = 0; i < groupsGroupIdentityIds.size(); i++) { final Long groupInstance = groupsGroupIdentityIds.get(i); //this group wasnt checked yet? if (!previousGroupInstances.contains(groupInstance)) { previousGroupInstances.add(groupInstance); // Retrieve the groups group-ids from the archive // requirement: 3.9.4.h GroupDetails nextGroupInstance = retrieveGroupDetailsFromArchive(group.getDomain(), groupInstance); idObjectTypeList.addAll(this.getGroupObjectIdsFromGroupRecursive(nextGroupInstance, newPreviousGroupInstances)); } } return idObjectTypeList; } }
for (int index = 0; index < checkLinkIds.size(); index++) { Long checkLinkId = checkLinkIds.get(index);