/** * Updates a definition in the manager. * * @param objId The object instance identifier of the definition * @param definition The object body of the definition * @return True if successful. False if the object instance identifier does * not exist in the manager, in this case, the definition is not added. */ public synchronized boolean updateDef(Long objId, Element definition) { return (this.deleteDef(objId) == true) ? this.addDef(objId, definition) : false; }
/** * Lists the object instance identifier for a parameter name identifier. * * @param input The name identifier of the Definition * @return The object instance identifier of the Definition. Null if not * found. */ public synchronized Long list(Identifier input) { final LongList objIds = this.listAll(); for (Long objId : objIds) { if (compareName(objId, input)) { return objId; } } return null; // Not found! }
/** * Stores the COM Operation Activity object in the Archive * * @param interaction The MALInteraction object for the operation * @return The link to the stored COM Operation Activity. Null if not * stored. */ public ObjectId storeCOMOperationActivity(final MALInteraction interaction) { if (getActivityTrackingService() != null) { return getActivityTrackingService().storeCOMOperationActivity(interaction, null); } else { return null; } }
public AppsLauncherManager(COMServicesProvider comServices) { super(comServices); // If there is a property for that, then use it!! if (System.getProperty(FOLDER_LOCATION_PROPERTY) != null) { apps_folder_path = new File(System.getProperty(FOLDER_LOCATION_PROPERTY)); } runnable_filename = osValidator.isWindows() ? RUN_WIN_FILENAME : RUN_LIN_FILENAME; try { AppsLauncherHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } if (super.getArchiveService() == null) { // No Archive? this.uniqueObjIdDef = new AtomicLong(0); } else { // With Archive... } }
/** * Get all the definition objects available. * * @return The Definitions. */ public synchronized ElementList getAllDefs() { ElementList list = this.newDefinitionList(); list.addAll(defs.values()); return list; }
"Sending event to app: {0} (Name: ''{1}'')", new Object[]{appInstId, appDirectoryNames.get(i)}); this.setRunning(appInstId, false, interaction.getInteraction()); sourceList.add(super.getCOMServices().getActivityTrackingService().storeCOMOperationActivity(interaction.getInteraction(), null)); final LongList objIds = super.getCOMServices().getEventService().generateAndStoreEvents(objType, ConfigurationProviderSingleton.getDomain(), appInstIds, sourceList, interaction.getInteraction()); super.getCOMServices().getEventService().publishEvents(uri, objIds, objType, appInstIds, sourceList, appDirectoryNames); } catch (IOException ex) { Logger.getLogger(AppsLauncherManager.class.getName()).log(Level.SEVERE, null, ex);
final Long id = super.list(singleApp.getName()); AppDetails previousAppDetails = this.get(id);
protected boolean update(final Long objId, final AppDetails definition, final MALInteraction interaction) { // requirement: 3.3.2.5 Boolean success = this.updateDef(objId, definition); if (super.getArchiveService() != null) { // It should also update on the COM Archive try { AppDetailsList defs = new AppDetailsList(); defs.add(definition); final IdentifierList domain = ConfigurationProviderSingleton.getDomain(); ArchiveDetails archiveDetails = HelperArchive.getArchiveDetailsFromArchive(super.getArchiveService(), AppsLauncherHelper.APP_OBJECT_TYPE, domain, objId); ArchiveDetailsList archiveDetailsList = new ArchiveDetailsList(); archiveDetailsList.add(archiveDetails); super.getArchiveService().update( AppsLauncherHelper.APP_OBJECT_TYPE, domain, archiveDetailsList, defs, interaction); } catch (MALException ex) { Logger.getLogger(AppsLauncherManager.class.getName()).log(Level.SEVERE, null, ex); return false; } catch (MALInteractionException ex) { Logger.getLogger(AppsLauncherManager.class.getName()).log(Level.SEVERE, null, ex); return false; } } return success; }
if (super.getArchiveService() == null) { if (objId == null) { objId = uniqueObjIdDef.incrementAndGet(); archDetails.get(0).setInstId(objId); LongList objIds = super.getArchiveService().store( true, AppsLauncherHelper.APP_OBJECT_TYPE,