test jive

03-07-24 mopker

mopker5w4i5Et57E.jpg

<B>来了,测试jive论坛</B><br>来了,测试jive论坛

摩托车论坛

mopker
2003-07-24 15:14

eagoo
2003-07-24 15:27

package com.jivesoftware.base;

import com.jivesoftware.jdom.JDOMException;
import com.jivesoftware.util.StringUtils;
import java.io.*;
import java.security.KeyFactory;
import java.security.Signature;
import java.security.spec.X509EncodedKeySpec;
import java.util.*;

// Referenced classes of package com.jivesoftware.base:
//            License, LicenseException, LicenseWrapper, JiveGlobals, 
//            Log

public final class LicenseManager
{

    private static List licenses = null;

    private LicenseManager()
    {
    }

    public static void validateLicense(String product, String version)
        throws LicenseException
    {
        loadLicenses();
        
    }

    public static void reloadLicenses()
    {
        if(licenses != null)
        {
            licenses.clear();
        }
        licenses = null;
        loadLicenses();
    }

    public static Iterator getLicenses()
    {
        if(licenses == null)
        {
            return Collections.EMPTY_LIST.iterator();
        }
        List licenseProxies = new ArrayList();
        for(int i = 0; i < licenses.size(); i++)
        {
            licenseProxies.add(new LicenseWrapper((License)licenses.get(i)));
        }

        return licenseProxies.iterator();
    }

    public static int getNumClusterMembers()
    {
        int allowedMembers = 1;
        for(Iterator licenses = getLicenses(); licenses.hasNext();)
        {
            LicenseWrapper licenseWrapper = (LicenseWrapper)licenses.next();
            if(licenseWrapper.getNumClusterMembers() < allowedMembers)
            {
                allowedMembers = licenseWrapper.getNumClusterMembers();
            }
            if(allowedMembers == 1)
            {
                allowedMembers = licenseWrapper.getNumClusterMembers();
            }
        }

        return allowedMembers;
    }

    static boolean validate(License license)
        throws Exception
    {
        
        return true;
    }

    private static synchronized void loadLicenses()
    {
        licenses = new ArrayList();
        License license = new License(0xbc614eL, "Jive Forums Professional", "3.1.2", License.LicenseType.COMMERCIAL);
        license.setCompany("365do.com");
        license.setCreationDate(new Date());
        license.setName("365do.com");
        license.setNumClusterMembers(9999);
        license.setNumCopies(9999);
        license.setURL("http://www.365do.com/");
        licenses.add(license);
        return;
    }

    private static boolean isValidProduct(String product, License license)
    {
        return true;
    }

}
<p>