Class SpdxListedLicenseModelStore
java.lang.Object
org.spdx.storage.listedlicense.SpdxListedLicenseModelStore
- All Implemented Interfaces:
AutoCloseable,org.spdx.storage.IModelStore,IListedLicenseStore
- Direct Known Subclasses:
SpdxListedLicenseLocalStore,SpdxListedLicenseWebStore
Read-only model store for the SPDX listed licenses
License and exception ID's can be case-insensitive
License information is stored in a LicenseJson file with the ID being Listed License ID License Exception information is stored in an ExceptionJson file with the ID being the Listed Exception ID CrossRef information is stored within the LicenseJson file. Id's are anonymous and generated.
- Author:
- Gary O'Neall
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spdx.storage.IModelStore
org.spdx.storage.IModelStore.IdType, org.spdx.storage.IModelStore.IModelStoreLock, org.spdx.storage.IModelStore.ModelUpdate -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddValueToCollection(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor, Object value) voidclearValueCollection(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor) voidclose()booleancollectionContains(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor, Object value) intcollectionSize(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor) voidcreate(org.spdx.core.TypedValue typedValue) voidorg.spdx.storage.IModelStore.IModelStoreLockenterCriticalSection(boolean readLockRequested) booleanStream<org.spdx.core.TypedValue> getAllItems(String documentUri, String typeFilter) getCaseSensitiveId(String documentUri, String caseInsensitiveId) abstract InputStreamgetExceptionInputStream(String exceptionId) abstract InputStreamorg.spdx.storage.IModelStore.IdTypeabstract InputStreamgetLicenseInputStream(String licenseId) org.spdx.library.model.v3_0_1.core.CreationInfogetNextId(org.spdx.storage.IModelStore.IdType idType) List<org.spdx.storage.PropertyDescriptor> getPropertyValueDescriptors(String objectUri) abstract InputStreamOptional<org.spdx.core.TypedValue> getTypedValue(String objectUri) booleanbooleanisCollectionMembersAssignableTo(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor, Class<?> clazz) booleanisCollectionProperty(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor) booleanisPropertyValueAssignableTo(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor, Class<?> clazz, String specVersion) booleanisSpdxListedExceptionId(String listedLicenseDocumentUri, String exceptionId) booleanisSpdxListedLicenseId(String listedLicenseDocumentUri, String licenseId) voidleaveCriticalSection(org.spdx.storage.IModelStore.IModelStoreLock lock) static StringlistedExceptionIdCaseSensitive(String exceptionId) listedLicenseIdCaseSensitive(String licenseId) listValues(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor) static StringobjectUriToLicenseOrExceptionId(String objectUri) voidremoveProperty(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor) booleanremoveValueFromCollection(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor, Object value) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.spdx.storage.IModelStore
getCaseSensisitiveId
-
Field Details
-
LISTED_LICENSE_NAMESPACE
- See Also:
-
-
Constructor Details
-
SpdxListedLicenseModelStore
public SpdxListedLicenseModelStore() throws org.spdx.core.InvalidSPDXAnalysisException- Throws:
org.spdx.core.InvalidSPDXAnalysisException- on error loading ids
-
-
Method Details
-
objectUriToLicenseOrExceptionId
-
licenseOrExceptionIdToObjectUri
-
getTocInputStream
- Returns:
- InputStream for the Table of Contents of the licenses formatted in JSON SPDX
- Throws:
IOException- on IO errors
-
getExceptionTocInputStream
- Returns:
- InputStream for the Table of Contents of the exceptions formatted in JSON SPDX
- Throws:
IOException- on IO errors
-
getLicenseInputStream
- Returns:
- InputStream for a license formatted in SPDX JSON
- Throws:
IOException- on IO errors
-
getExceptionInputStream
- Returns:
- InputStream for an exception formatted in SPDX JSON
- Throws:
IOException- on IO errors
-
exists
- Specified by:
existsin interfaceorg.spdx.storage.IModelStore
-
create
public void create(org.spdx.core.TypedValue typedValue) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
createin interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getPropertyValueDescriptors
-
setValue
-
clearValueCollection
public void clearValueCollection(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
clearValueCollectionin interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
addValueToCollection
public boolean addValueToCollection(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor, Object value) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
addValueToCollectionin interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
removeValueFromCollection
public boolean removeValueFromCollection(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor, Object value) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
removeValueFromCollectionin interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
listValues
-
getValue
-
getNextId
public String getNextId(org.spdx.storage.IModelStore.IdType idType) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
getNextIdin interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getSpdxListedLicenseIds
- Specified by:
getSpdxListedLicenseIdsin interfaceIListedLicenseStore- Returns:
- List of all SPDX listed license IDs
-
getLicenseListVersion
- Specified by:
getLicenseListVersionin interfaceIListedLicenseStore- Returns:
- The version of the loaded license list in the form M.N, where M is the major release and N is the minor release.
-
getLicenseListReleaseDate
- Returns:
- the release date for the license list
-
getSpdxListedExceptionIds
- Specified by:
getSpdxListedExceptionIdsin interfaceIListedLicenseStore- Returns:
- list of SPDX exception IDs
-
isSpdxListedLicenseId
- Specified by:
isSpdxListedLicenseIdin interfaceIListedLicenseStore- Parameters:
listedLicenseDocumentUri- Prefix URL for the listed licenselicenseId- license ID- Returns:
- true if the licenseId belongs to an SPDX listed license
-
isSpdxListedExceptionId
- Specified by:
isSpdxListedExceptionIdin interfaceIListedLicenseStore- Parameters:
listedLicenseDocumentUri- prefix URL for the listed licenseexceptionId- exception ID maintained by the SPDX legal team- Returns:
- true if the exceptionId belongs to an SPDX listed exception
-
getTypedValue
-
removeProperty
public void removeProperty(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
removePropertyin interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getAllItems
-
collectionSize
public int collectionSize(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
collectionSizein interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
collectionContains
-
isCollectionMembersAssignableTo
public boolean isCollectionMembersAssignableTo(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor, Class<?> clazz) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
isCollectionMembersAssignableToin interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
isPropertyValueAssignableTo
public boolean isPropertyValueAssignableTo(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor, Class<?> clazz, String specVersion) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
isPropertyValueAssignableToin interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
isCollectionProperty
public boolean isCollectionProperty(String objectUri, org.spdx.storage.PropertyDescriptor propertyDescriptor) throws org.spdx.core.InvalidSPDXAnalysisException - Specified by:
isCollectionPropertyin interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getIdType
- Specified by:
getIdTypein interfaceorg.spdx.storage.IModelStore
-
isAnon
- Specified by:
isAnonin interfaceorg.spdx.storage.IModelStore
-
enterCriticalSection
public org.spdx.storage.IModelStore.IModelStoreLock enterCriticalSection(boolean readLockRequested) - Specified by:
enterCriticalSectionin interfaceorg.spdx.storage.IModelStore
-
leaveCriticalSection
public void leaveCriticalSection(org.spdx.storage.IModelStore.IModelStoreLock lock) - Specified by:
leaveCriticalSectionin interfaceorg.spdx.storage.IModelStore
-
listedLicenseIdCaseSensitive
- Specified by:
listedLicenseIdCaseSensitivein interfaceIListedLicenseStore- Parameters:
licenseId- case insensitive license ID- Returns:
- the case-sensitive license ID
-
listedExceptionIdCaseSensitive
- Specified by:
listedExceptionIdCaseSensitivein interfaceIListedLicenseStore- Parameters:
exceptionId- case-insensitive exception ID- Returns:
- case sensitive ID
-
getCaseSensitiveId
-
delete
- Specified by:
deletein interfaceorg.spdx.storage.IModelStore- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getListedLicenseCreationInfo
public org.spdx.library.model.v3_0_1.core.CreationInfo getListedLicenseCreationInfo() throws org.spdx.core.InvalidSPDXAnalysisException- Specified by:
getListedLicenseCreationInfoin interfaceIListedLicenseStore- Returns:
- the CreationInfo used for all SPDX listed licenses and listed exceptions
- Throws:
org.spdx.core.InvalidSPDXAnalysisException- on error inflating the CreationInfo
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-