Examples of Licence


Examples of edu.monash.merc.domain.Licence

        } else {
            this.updateRegMetadata(regMetadata);
        }
        //save the licence:
        LicenceBean licenceBean = mdRegistrationBean.getLicenceBean();
        Licence licence = copyLicenceBeanToLicence(licenceBean);
        licence.setRegMetadata(regMetadata);
        if (licence.getId() == 0) {
            Licence existedLicence = this.getLicenceByRegMetadataId(regMetadata.getId());
            if (existedLicence != null) {
                licence.setId(existedLicence.getId());
                this.mergeLicence(licence);
            } else {
                this.saveLicence(licence);
            }
        } else {
View Full Code Here

Examples of edu.monash.merc.domain.Licence

        //publish the rifcs
        this.rifcsService.publishExpRifcs(mdRegistrationBean);
    }

    private Licence copyLicenceBeanToLicence(LicenceBean licenceBean) {
        Licence licence = new Licence();
        licence.setLicenceType(licenceBean.getLicenceType());
        licence.setCommercial(licenceBean.getCommercial());
        licence.setDerivatives(licenceBean.getDerivatives());
        licence.setJurisdiction(licenceBean.getJurisdiction());
        licence.setLicenceContents(licenceBean.getLicenceContents());
        return licence;
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.utils.FeatureManager.Licence

      entryWindow.open(new UserPrompterResultListener() {
        public void prompterClosed(int result) {
          entryWindow = null;
          if (result == SWT.OK) {
            try {
              Licence licence = featman.addLicence(key[0].getText());
              int initialState = licence.getState();
              if (initialState == Licence.LS_AUTHENTICATED) {
                if ( !licence.isFullyInstalled()){
                  fml.licenceAdded(licence)// open installing window
                }else{
                  openLicenceSuccessWindow();
                }
              }else if (initialState == Licence.LS_PENDING_AUTHENTICATION ) {
View Full Code Here

Examples of org.gudy.azureus2.plugins.utils.FeatureManager.Licence

    TreeMap<Long, Object[]> mapOrder = new TreeMap<Long, Object[]>(
        Collections.reverseOrder());
    FeatureDetails[] featureDetails = featman.getFeatureDetails("dvdburn");
    // if any of the feature details are still valid, we have a full
    for (FeatureDetails fd : featureDetails) {
      Licence licence = fd.getLicence();
      int state = licence.getState();
      if (state == Licence.LS_ACTIVATION_DENIED) {
        mapOrder.put(-1L, new Object[] { licence, Long.valueOf(0) });
        continue;
      } else if (state == Licence.LS_CANCELLED) {
        mapOrder.put(-2L, new Object[] { licence, Long.valueOf(0) });
        continue;
      } else if (state == Licence.LS_INVALID_KEY) {
        mapOrder.put(-3L, new Object[] { licence, Long.valueOf(0) });
        continue;
      } else if (state == Licence.LS_REVOKED) {
        mapOrder.put(-4L, new Object[] { licence, Long.valueOf(0) });
        continue;
      } else if (state == Licence.LS_PENDING_AUTHENTICATION) {
        mapOrder.put(-6L, new Object[] { licence, Long.valueOf(0) });
        continue;
      }

      long now = SystemTime.getCurrentTime();
      Long lValidUntil = (Long) fd.getProperty(FeatureDetails.PR_VALID_UNTIL);
      Long lValidOfflineUntil = (Long) fd.getProperty(FeatureDetails.PR_OFFLINE_VALID_UNTIL);

      if (lValidUntil == null && lValidOfflineUntil == null) {
        continue;
      }

      long minValidUntil = -1;
      long maxValidUntil = -1;
      if (lValidUntil != null) {
        minValidUntil = maxValidUntil = lValidUntil.longValue();
        if (minValidUntil < now) {
          mapOrder.put(minValidUntil, new Object[] { licence, Long.valueOf(minValidUntil) });
          continue;
        }
      }
      if (lValidOfflineUntil != null) {
        long validOfflineUntil = lValidOfflineUntil.longValue();
        if (validOfflineUntil < now) {
          mapOrder.put(validOfflineUntil, new Object[] { licence, Long.valueOf(maxValidUntil) });
          continue;
        }
        if (maxValidUntil == -1 || validOfflineUntil > maxValidUntil) {
          maxValidUntil = validOfflineUntil;
        }
      }

      mapOrder.put(maxValidUntil, new Object[] { licence, minValidUntil });
    }

    if (mapOrder.size() == 0) {
      return null;
    }

    Long firstKey = mapOrder.firstKey();
    Object[] objects = mapOrder.get(firstKey);
    Licence licence = (Licence) objects[0];
    return new licenceDetails(firstKey.longValue(), ((Long) objects[1]).longValue(), licence);
  }
View Full Code Here

Examples of org.gudy.azureus2.plugins.utils.FeatureManager.Licence

  public void licenceChanged(Licence licence) {
    int state = licence.getState();

    boolean stateChanged = true;

    Licence lastLicence = mapLicence( licence );
     
    if (lastLicence != null) {
      stateChanged = lastLicence.getState() != licence.getState();
     
      if (   ( !stateChanged ) &&
          licence.getState() == Licence.LS_AUTHENTICATED &&
          lastLicence.isFullyInstalled() != licence.isFullyInstalled()){
         
          stateChanged = true;
        }
    } else {
      // licenceChanged gets fired for all licences after listener is added
View Full Code Here

Examples of org.gudy.azureus2.plugins.utils.FeatureManager.Licence

  private Licence
  mapLicence(
    Licence    licence )
  {
    Licence existing_licence;
   
    LicenceInstallationListener  new_listener = null;
   
    synchronized ( licence_map ){
     
      String key = licence.getKey();
     
      Object[] entry = licence_map.get( key );
         
      if ( entry == null ){
       
        existing_licence = null;
       
        new_listener =
          new LicenceInstallationListener()
          {
            FeatureManagerInstallWindow install_window = null;
 
            public void start(String licence_key) {
              if (DEBUG) {
                System.out.println("FEATINST: START! " + licence_key);
              }
              try {
                Licence licence = featman.addLicence(licence_key);
 
                install_window = new FeatureManagerInstallWindow(licence);
   
                install_window.open();
 
              } catch (PluginException e) {
                Debug.out(e);
              }
            }
 
            public void reportProgress(String licenceKey, String install, int percent) {
              if (DEBUG) {
                System.out.println("FEATINST: " + install + ": " + percent);
              }
            }
 
            public void reportActivity(String licenceKey, String install,
                String activity) {
              if (DEBUG) {
                System.out.println("FEAT: ACTIVITY: " + install + ": " + activity);
              }
            }
 
            public boolean alreadyFailing = false;
            public void failed(String licenceKey, PluginException error) {
              if (DEBUG) {
                System.out.println("FEAT: FAIL: " + licenceKey + ": " + error.toString());
              }
   
              if ( install_window != null ){
               
                install_window.close();
              }
             
              if ( licenceKey.equals(pendingAuthForKey)){
               
                pendingAuthForKey = null;
              }

              if (alreadyFailing) {
                return;
              }
              alreadyFailing = true;

              String s = Debug.getNestedExceptionMessage(error);
             
              MessageBoxShell mb = new MessageBoxShell(
                  SWT.ICON_ERROR | SWT.OK,
                  "License Addition Error for " + licenceKey,
                  s );

              mb.open( new UserPrompterResultListener() {
                public void prompterClosed(int result) {
                  alreadyFailing = false;
                }
              } );
            }
 
            public void complete(String licenceKey) {
   
              if ( licenceKey.equals(pendingAuthForKey)){
 
                pendingAuthForKey = null;
               
                FeatureManagerUI.openLicenceSuccessWindow();
              }
            }
          };
         
       
        licence_map.put( key, new Object[]{ licence, new_listener });
       
      }else{
       
        existing_licence = (Licence)entry[0];
       
        entry[0] = licence;
      }
    }

    if ( new_listener != null ){
     
      licence.addInstallationListener( new_listener );
   
   
    return( existing_licence );
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.model.jena.Licence

    assertTrue(licences.contains(getLicence(TEST_SIMAL_PROJECT_LICENCE_TWO)));
  }
 
  private IDoapLicence getLicence(String uri) {
    Resource resource = ((JenaSimalRepository)repository).getModel().createResource(TEST_SIMAL_PROJECT_LICENCE_ONE);
    return new Licence(resource);  
  }
View Full Code Here

Examples of uk.ac.osswatch.simal.model.jena.Licence

    Property o = model.createProperty(CC_LICENCE);
    StmtIterator itr = model.listStatements(null, RDF.type, o);
    Set<IDoapLicence> licences = new HashSet<IDoapLicence>();
    while (itr.hasNext()) {
      String uri = itr.nextStatement().getSubject().getURI();
      licences.add(new Licence(model.getResource(uri)));
    }
    return licences;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.