Package de.sosd.mediaserver.domain.db

Examples of de.sosd.mediaserver.domain.db.SystemDomain


      logger.info("skipped create-meta-info, already running");
    }
  }
 
  public void createThumbnails() {
    final SystemDomain system = this.systemDao.getSystem(cfg.getUSN());
    final Boolean running = system.getThumbnailGenerationRunning();
    if (((running == null) || !running.booleanValue())) {
      if (this.thumbnailCreator != null) {
        this.thumbnailCreator.interrupt();
      }
      this.thumbnailCreator = new ThumbnailCreationThread(system);
View Full Code Here


    store(system);
 

  @Transactional(propagation = Propagation.REQUIRED)
  public String initSystem() {
    final SystemDomain system = new SystemDomain();
    system.setUsn(UUID.randomUUID().toString());
    system.setUpdateId(1);
    system.setLastDataChange(new Date());
    system.setDidlRoot(new DidlDomain(system));
   
    store(system);
    return system.getUsn();
  }
View Full Code Here

  public List<FrontendFolderBean> loadScanFolders() {
    return this.fsDao.getAllFrontendScanFolders();
  }

  public FrontendSettingsBean loadSettings() {
    final SystemDomain sys = this.systemDao.getSystem(cfg.getUSN());
    return new FrontendSettingsBean(sys.getName(), "", "", sys.getPreviewCache(), sys.getMplayerPath(), sys.getMencoderPath());
  }
View Full Code Here

    return system.getUsn();
  }
 
  @Transactional(propagation = Propagation.REQUIRED)
  public void setMetaInfoGenerationRunning(final boolean value, final String usn) {
    final SystemDomain systemProperties = getSystem(usn);
    systemProperties.setMetaInfoGenerationRunning(value);
    manager.persist(systemProperties);
  }
View Full Code Here

    manager.persist(systemProperties);
  }
 
  @Transactional(propagation = Propagation.REQUIRED)
  public void setThumbnailGenerationRunning(final boolean value, final String usn) {
    final SystemDomain systemProperties = getSystem(usn);
    systemProperties.setThumbnailGenerationRunning(value);
    manager.persist(systemProperties)
  }
View Full Code Here

  }

  @Transactional(propagation=Propagation.REQUIRED)
  public void updateServerSettings(final String name, final String networkInterface,
      final String previews, final String mplayer, final String mencoder) {
    final SystemDomain sys = this.systemDao.getSystem(cfg.getUSN());
   
    if (!name.equals(sys.getName())) {
      sys.setName(name);
      sys.increaseUpdateId();
    }
   
    sys.setPreviewCache(previews);
    sys.setMplayerPath(mplayer);
    sys.setMencoderPath(mencoder);
   
    this.systemDao.store(sys);
  }
View Full Code Here

  @Autowired
  private SystemDao systemDao;
 
  @Transactional(propagation = Propagation.REQUIRED)
  public void updateDevices(List<NetworkDeviceBean> updated, String usn) {
    SystemDomain system = systemDao.getSystem(usn);
    for (NetworkDeviceBean ndb : updated) {
      updateDevice(ndb, system);
    }
  }
View Full Code Here

  }


  @Transactional(propagation = Propagation.SUPPORTS)
  public NetworkDeviceBean updateDevice(NetworkDeviceBean ndb, String usn) {
    SystemDomain system = systemDao.getSystem(usn);
    return updateDevice(ndb, system);
  }
View Full Code Here

    if (directory.isDirectory()) {
      final String id = this.idservice.getId(directory);
      if (!this.fsDao.isDirectoryPresent(id)) {
        final ScanFolderDomain scanFolder = new ScanFolderDomain(id, directory, null);
       
        final SystemDomain system = this.systemDao.getSystem(cfg.getUSN());
        system.getScanFolder().add(scanFolder);
        scanFolder.setSystem(system);
        scanFolder.setDidlRoot(this.didl.createDidlContainer(scanFolder, system.getDidlRoot()));
        this.systemDao.store(system);
        logger.info("added new scan-directory : " + scanFolder.getPath());
      }
    }
  }
View Full Code Here

 
  @Transactional(propagation=Propagation.REQUIRED
  private List<ScanContext> createScanContexts() {
    final List<ScanContext> scanContexts = new ArrayList<ScanContext>();
    final long currentTimeMillis = System.currentTimeMillis();
    final SystemDomain system = this.systemDao.getSystem(cfg.getUSN());
    for (final ScanFolderDomain sfd : system.getScanFolder()) {
      if (
      !ScanFolderState.SCANNING.equals(sfd.getScanState()) &&
        ((sfd.getLastScan() == null) ||
        ((sfd.getLastScan().getTime() + (sfd.getScanInterval() * 60000)) < currentTimeMillis))) {
       
        // should scan
       
        final File dir = new File(sfd.getPath());
        if (! dir.exists() || ! dir.isDirectory()) {
          // this could happen with external storage ..
          sfd.setScanState(ScanFolderState.NOT_FOUND);
          didlDao.setOnline(sfd.getId(), false);
          system.increaseUpdateId();
        } else {
          if (ScanFolderState.NOT_FOUND.equals(sfd.getScanState())) {
            didlDao.setOnline(sfd.getId(), true);
            system.increaseUpdateId();
          }
         
          sfd.setScanState(ScanFolderState.SCANNING);
          scanContexts.add(new ScanContext(sfd.getId(), dir));
        }
View Full Code Here

TOP

Related Classes of de.sosd.mediaserver.domain.db.SystemDomain

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.