org.nuiton.license.plugin.repository
Class LicenseRepository

java.lang.Object
  extended by org.nuiton.license.plugin.repository.LicenseRepository

public class LicenseRepository
extends Object

Since:
1.0.3
Author:
chemit

Field Summary
protected  URL baseURL
          the base url of the licenses repository
protected  Map<LicenseDefinition,License> cache
           
protected  List<LicenseDefinition> definitions
           
protected  boolean init
          flag to known if repository was init (pass to true when invoking the method load()).
protected  LicenseRepository next
          next repository (can be null).
static String REPOSITORY_DEFINITION_FILE
           
 
Constructor Summary
LicenseRepository()
           
 
Method Summary
 LicenseRepository appendRepository(LicenseRepository next)
           
protected  boolean checkExists(URL url)
           
protected  void checkInit()
           
protected  void checkNotInit()
           
 List<LicenseDefinition> getAllDefinitions()
           
protected  LicenseRepository[] getAllRepositories()
           
 URL getBaseURL()
           
 LicenseDefinition getDefinition(String licenseName)
           
 List<LicenseDefinition> getDefinitions()
           
protected  LicenseRepository getLastRepository()
           
 License getLicense(String licenseName)
           
static URL getUrl(URL baseUrl, String suffix)
           
 void load()
           
 void reload()
           
 void setBaseURL(URL baseURL)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPOSITORY_DEFINITION_FILE

public static final String REPOSITORY_DEFINITION_FILE
See Also:
Constant Field Values

baseURL

protected URL baseURL
the base url of the licenses repository


next

protected LicenseRepository next
next repository (can be null).


definitions

protected List<LicenseDefinition> definitions

cache

protected final Map<LicenseDefinition,License> cache

init

protected boolean init
flag to known if repository was init (pass to true when invoking the method load()).

Constructor Detail

LicenseRepository

public LicenseRepository()
Method Detail

getBaseURL

public URL getBaseURL()

setBaseURL

public void setBaseURL(URL baseURL)

appendRepository

public LicenseRepository appendRepository(LicenseRepository next)

reload

public void reload()
            throws IOException
Throws:
IOException

load

public void load()
          throws IOException
Throws:
IOException

getAllDefinitions

public List<LicenseDefinition> getAllDefinitions()

getDefinitions

public List<LicenseDefinition> getDefinitions()

getDefinition

public LicenseDefinition getDefinition(String licenseName)

getLicense

public License getLicense(String licenseName)
                   throws IOException
Throws:
IOException

getUrl

public static URL getUrl(URL baseUrl,
                         String suffix)
                  throws IllegalArgumentException
Throws:
IllegalArgumentException

getLastRepository

protected LicenseRepository getLastRepository()

getAllRepositories

protected LicenseRepository[] getAllRepositories()

checkExists

protected boolean checkExists(URL url)
                       throws IOException
Throws:
IOException

checkNotInit

protected void checkNotInit()
                     throws IllegalStateException
Throws:
IllegalStateException

checkInit

protected void checkInit()
                  throws IllegalStateException
Throws:
IllegalStateException


Copyright © 2008-2010 CodeLutin. All Rights Reserved.