org.nuiton.license.plugin.repository
Class LicenseRepository

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

public class LicenseRepository
extends java.lang.Object

Since:
1.0.3
Author:
chemit

Field Summary
protected  java.net.URL baseURL
          the base url of the licenses repository
protected  java.util.Map<LicenseDefinition,License> cache
           
protected  java.util.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 java.lang.String REPOSITORY_DEFINITION_FILE
           
 
Constructor Summary
LicenseRepository()
           
 
Method Summary
 LicenseRepository appendRepository(LicenseRepository next)
           
protected  boolean checkExists(java.net.URL url)
           
protected  void checkInit()
           
protected  void checkNotInit()
           
 java.util.List<LicenseDefinition> getAllDefinitions()
           
protected  LicenseRepository[] getAllRepositories()
           
 java.net.URL getBaseURL()
           
 LicenseDefinition getDefinition(java.lang.String licenseName)
           
 java.util.List<LicenseDefinition> getDefinitions()
           
protected  LicenseRepository getLastRepository()
           
 License getLicense(java.lang.String licenseName)
           
static java.net.URL getUrl(java.net.URL baseUrl, java.lang.String suffix)
           
 void load()
           
 void reload()
           
 void setBaseURL(java.net.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 java.lang.String REPOSITORY_DEFINITION_FILE
See Also:
Constant Field Values

baseURL

protected java.net.URL baseURL
the base url of the licenses repository


next

protected LicenseRepository next
next repository (can be null).


definitions

protected java.util.List<LicenseDefinition> definitions

cache

protected final java.util.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 java.net.URL getBaseURL()

setBaseURL

public void setBaseURL(java.net.URL baseURL)

appendRepository

public LicenseRepository appendRepository(LicenseRepository next)

reload

public void reload()
            throws java.io.IOException
Throws:
java.io.IOException

load

public void load()
          throws java.io.IOException
Throws:
java.io.IOException

getAllDefinitions

public java.util.List<LicenseDefinition> getAllDefinitions()

getDefinitions

public java.util.List<LicenseDefinition> getDefinitions()

getDefinition

public LicenseDefinition getDefinition(java.lang.String licenseName)

getLicense

public License getLicense(java.lang.String licenseName)
                   throws java.io.IOException
Throws:
java.io.IOException

getUrl

public static java.net.URL getUrl(java.net.URL baseUrl,
                                  java.lang.String suffix)
                           throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getLastRepository

protected LicenseRepository getLastRepository()

getAllRepositories

protected LicenseRepository[] getAllRepositories()

checkExists

protected boolean checkExists(java.net.URL url)
                       throws java.io.IOException
Throws:
java.io.IOException

checkNotInit

protected void checkNotInit()
                     throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

checkInit

protected void checkInit()
                  throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException


Copyright © 2008-2009 CodeLutin. All Rights Reserved.