public void addObjIdToBeEnabled(Long objIdToBeEnabled) { this.objIdToBeEnabled.add(objIdToBeEnabled); }
/** * Provides the current set of definitions available in the Manager. * * @return The definitions set and the corresponding object instance * identifiers. */ public synchronized ConfigurationObjectSetList getCurrentConfiguration() { LongList idObjIds = new LongList(); LongList defObjIds = new LongList(); for (ObjectInstancePair pair : this.namesToPairsMap.values()) { idObjIds.add(pair.getObjIdentityInstanceId()); defObjIds.add(pair.getObjDefInstanceId()); } ConfigurationObjectSet idents = new ConfigurationObjectSet(); idents.setDomain(ConfigurationProviderSingleton.getDomain()); idents.setObjInstIds(idObjIds); LongList currentObjIds1 = new LongList(); currentObjIds1.addAll(defObjIds); ConfigurationObjectSet defis = new ConfigurationObjectSet(); defis.setDomain(ConfigurationProviderSingleton.getDomain()); defis.setObjInstIds(currentObjIds1); ConfigurationObjectSetList list = new ConfigurationObjectSetList(); list.add(idents); list.add(defis); return list; }
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; } }
public LongList listAllCheckLinkIds() { LongList checkLinkIdList = new LongList(); for (Long key : checkLinkIds.keySet()) { checkLinkIdList.add(key); } return checkLinkIdList; }
unkIndexList.add(new UInteger(index)); // requirement: 3.2.14.2.c } else { tempIdentityLst.add(tempIdentity);
/** * gets all the Object Instances of the group and the groups group and so on * that these are referencing. All the objects will be added. no matter if * they are from different object-types. the service should check for * itself, if they are different * * @param groupIdentityId the id of this group-identity * @param group the details of the group * @param previousGroupInstances groups that shouldnt be checked * @return the identity-ids of the other services objects (e.g. * parameter-identity-ids, action-identity-ids,...) */ protected IdObjectTypeList getGroupObjectIdsFromGroup(Long groupIdentityId, GroupDetails group, LongList previousGroupInstances) { //dont check the parent group later again previousGroupInstances.add(groupIdentityId); //get all referenced instances return getGroupObjectIdsFromGroupRecursive(group, previousGroupInstances); }
unkIndexList.add(new UInteger(index)); // requirement: 3.4.12.2.c } else { removalLst.add(identityId);
public LongList getStatisticLinksForFunction(Long statFuncId) { LongList foundList = new LongList(); final Set<Long> statLinkIds = statLinks.keySet(); for (Long statLinkId : statLinkIds) { if (statLinks.get(statLinkId).getStatFuncInstId().equals(statFuncId)) { foundList.add(statLinkId); } } return foundList; }
tempIdsToRemoveLst.add(tempLong); } else { unkIndexList.add(new UInteger(index)); // requirement: 3.6.15.2.c
/** * Retrieved a 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 to be * retrieved * @return The COM object */ public static ArchivePersistenceObject getArchiveCOMObject(Object archiveService, final ObjectType objType, final IdentifierList domain, final Long objId) { LongList objIds = new LongList(); objIds.add(objId); List<ArchivePersistenceObject> archiveCOMobjectList = (List<ArchivePersistenceObject>) getFromArchive( archiveService, objType, domain, objIds, ToBeReturned.COM_OBJECT ); if (archiveCOMobjectList == null) { return null; } return archiveCOMobjectList.get(0); }
unkIndexList.add(new UInteger(index)); } else { removalLst.add(identityId);
/** * Get the ArchiveDetails object 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 ArchiveDetails object of the retrieved COM objects */ public static ArchiveDetails getArchiveDetailsFromArchive(Object archiveService, final ObjectType objType, final IdentifierList domain, final Long objId) { final LongList objIds = new LongList(); objIds.add(objId); final ArchiveDetailsList archiveDetailsList = (ArchiveDetailsList) getFromArchive(archiveService, objType, domain, objIds, ToBeReturned.ARCHIVE_DETAILS); return archiveDetailsList.get(0); }
tempCheckLinkIds.add(checkLinkId); } else { unkIndexList.add(new UInteger(index)); // requirement: 3.5.19.2.d
/** * Returns all checkLinks that point to the given check. The given check * must be the same as the related link of the CheckLink, to add it to the * returned list of checkLinks. * * @param identityId the given identity id of the check * @return checkLinks that point to the given check */ protected LongList findLinksPointingToCheck(Long identityId) { LongList output = new LongList(); for (Long checkLinkId : listAllCheckLinkIds()) { if (getCheckLinkLinks(checkLinkId).getRelated().equals(identityId)) { output.add(checkLinkId); } } return output; }
/** * 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; } */ }
relateds.add(comObject.getArchiveDetails().getDetails().getRelated());
public synchronized void init() { // Retrieve all the ids and objectTypes from the Database dbBackend.createEntityManager(); // Get All the objectTypes available Query query = dbBackend.getEM().createQuery(QUERY_SELECT_OBJECTTYPE); List resultList = query.getResultList(); ArrayList<ObjectTypeHolderEntity> objectTypeHolderEntities = new ArrayList<ObjectTypeHolderEntity>(); objectTypeHolderEntities.addAll(resultList); dbBackend.closeEntityManager(); final IntegerList ids = new IntegerList(); final LongList objectTypes = new LongList(); // From the list of entities to separate lists of ids and objectTypeIds for (int i = 0; i < objectTypeHolderEntities.size(); i++) { ids.add(objectTypeHolderEntities.get(i).getId()); objectTypes.add(objectTypeHolderEntities.get(i).getObjectType()); } int max = 0; // Populate the variables on this class for (int i = 0; i < ids.size(); i++) { this.fastID.put(objectTypes.get(i), ids.get(i)); this.fastIDreverse.put(ids.get(i), objectTypes.get(i)); if (ids.get(i) > max) { // Get the maximum value max = ids.get(i); } } uniqueId = new AtomicInteger(max); }
private void addPeriodicSampling(Long identityId) { final AggregationDefinitionDetails aggrDef = manager.getAggregationDefinition(identityId); if (!aggrDef.getGenerationEnabled()) { return; // Periodic Sampling shall not occur if the generation is not enabled at the definition level } final int parameterSetsTotal = aggrDef.getParameterSets().size(); int index = sampleTimerList.size(); for (int indexOfParameterSet = 0; indexOfParameterSet < parameterSetsTotal; indexOfParameterSet++) { Duration sampleInterval = aggrDef.getParameterSets().get(indexOfParameterSet).getSampleInterval(); //means ad hoc value, dont add to sample timer if (sampleInterval.getValue() > aggrDef.getReportInterval().getValue()) { sampleInterval = new Duration(0); } // Add to the Periodic Sampling Manager only if there's a sampleInterval selected for the parameterSet if (sampleInterval.getValue() != 0) { aggregationObjIdList.add(index, identityId); parameterSetIndexList.add(index, indexOfParameterSet); Timer timer = new Timer(); // Take care of adding a new timer sampleTimerList.add(index, timer); startTimer(index, sampleInterval); index++; } } }
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); }
objBody) ); objIds.add(objId);