Package com.iizix.urn
Enum Class URNResourceType
- All Implemented Interfaces:
- Serializable,- Comparable<URNResourceType>,- Constable
The types of URN Resource Type. All file sizes except external files are limited to 2 GB or 2,147,483,648 bytes.
- Nested Class Summary- Nested classes/interfaces inherited from class java.lang.Enum- Enum.EnumDesc<E extends Enum<E>>
- Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionApplication session file, removed when an application session is stopped, or when the server is stopped or restarted.Application file, persisted in the server database.Application file, removed when an application is added or removed.Application file.Client session files for a user, removed when the client session is stopped.Common server files for everyone, persisted in the server database.Common server files for everyone.Common server files for everyone, removed when server starts or stops.External files, common for everyone, should be accessible by every server in a cluster.User files, private for a user.User files, private for a user.User files, private for a user.
- Field SummaryFieldsModifier and TypeFieldDescription- static final List- <URNResourceType> Unmodifiable list of all possible resource types.- static final intThe count of URNResourceType's.- final StringThe description.- final booleanFlag indicating files should be deleted upon server dispose.- static final Map- <String, - URNResourceType> Unmodifiable map of external start path to type.- final StringThe external (web-facing) start path, {code null} for external files.- final Class- <?> The ID class type if stored in the database- Long.classor- nullfor none.- final StringThe ID column name for database storage,- nullif not used.- final StringThe internal subdirectory name, can consists of several directories.- final booleanFlag indicating the type is subject based and can have multiple instances.- final longMaximum file length when stored in a database, zero for none.- static final List- <URNResourceType> Unmodifiable list of the non-subject based types:- COMMON_DATABASE_PERSISTENT,- COMMON_PERSISTENTand- COMMON_VOLATILE.- final StringThe NSS part of the URN.- final URNLocationStorage location.- static final List- <URNResourceType> Unmodifiable list of the subject based types:- APPLICATION_DATABASE_PERSISTENT,- APPLICATION_PERSISTENT.- final StringThe table name for database storage,- nullif not using a database.
- Method SummaryModifier and TypeMethodDescriptionGets a unique number to use for the directory.- static URNResourceTypeGets the NSS resource for the case sensitive string.- static final URNResourceType- ofExternalStartPath- (String path) From an external- paththat may be prefixed by "/$$", and if so ends with the first "/", look-up the corresponding type.- static URNResourceTypeReturns the enum constant of this class with the specified name.- static URNResourceType[]- values()Returns an array containing the constants of this enum class, in the order they are declared.
- Enum Constant Details- COMMON_DATABASE_PERSISTENTCommon server files for everyone, persisted in the server database. The files are cached on the server event when it starts or stops. Just a single instance is allowed.
- COMMON_PERSISTENTCommon server files for everyone. The files and directories persists when server starts or stops. Just a single instance is allowed.
- COMMON_VOLATILECommon server files for everyone, removed when server starts or stops. Just a single instance is allowed.
- EXTERNAL_FILESExternal files, common for everyone, should be accessible by every server in a cluster. The database is backing up the external file entry for URN's.
- APPLICATION_DATABASE_PERSISTENTApplication file, persisted in the server database. The administrator must purge the files.- Subject based with "App Numeric ID" as subject (long). 
- APPLICATION_PERSISTENTApplication file, removed when an application is added or removed.- Subject based with "App Numeric ID" as subject (long). 
- APPLICATION_VOLATILEApplication file. The files and directories persists when an application is added or removed, or when server is starts or stops.- Subject based with "application ID" as subject. 
- GROUP_DATABASE_FILESUser files, private for a user. Remains present until a group is removed. Typically used for group profile image, etc. The subject is a special unique name generated from the user ID that is a valid file name.
- USER_FILESUser files, private for a user. Remains present until a user is removed. Typically used for user profile image, etc. The subject is a special unique name generated from the user ID that is a valid file name.
- USER_DATABASE_FILESUser files, private for a user. Remains present until a user is removed. Typically used for user profile image, etc. The subject is a special unique name generated from the user ID that is a valid file name.
- APP_SESSIONApplication session file, removed when an application session is stopped, or when the server is stopped or restarted. The subject is the session ID.
- CLIENT_SESSIONClient session files for a user, removed when the client session is stopped. The subject is the appSession ID followed by "-" and the client session ID.
 
- Field Details- descrThe description.
- nssThe NSS part of the URN.
- isSubjectBasedpublic final boolean isSubjectBasedFlag indicating the type is subject based and can have multiple instances.
- internalSubDirectoryThe internal subdirectory name, can consists of several directories.
- externalStartPathThe external (web-facing) start path, {code null} for external files.
- doDeleteFilespublic final boolean doDeleteFilesFlag indicating files should be deleted upon server dispose.
- storageLocationStorage location.
- tableNameThe table name for database storage,- nullif not using a database.
- idColumnThe ID column name for database storage,- nullif not used.
- idClassThe ID class type if stored in the database- Long.classor- nullfor none.
- maxSizepublic final long maxSizeMaximum file length when stored in a database, zero for none.
- COUNTpublic static final int COUNTThe count of URNResourceType's.
- ALLUnmodifiable list of all possible resource types.
- NON_SUBJECT_BASEDUnmodifiable list of the non-subject based types:
- SUBJECT_BASEDUnmodifiable list of the subject based types:
- EXTERNAL_START_PATH_TO_TYPEUnmodifiable map of external start path to type. The path String is case sensitive.- Use it to look up the WSFileType from an external path. The external path is always preceded with "/$$" and ends at the first '/' after this, but the look-up is done without the prefix "/$$" and suffix "/". 
 
- Method Details- valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- getUniqueDirectoryGets a unique number to use for the directory.- Returns:
- A string as randomHexValue.
 
- ofGets the NSS resource for the case sensitive string.- Parameters:
- nss- The NSS string.
- Returns:
- The URN resource found, or nullif not found.
 
- ofExternalStartPathFrom an external- paththat may be prefixed by "/$$", and if so ends with the first "/", look-up the corresponding type. If the- pathis not prefixed by "/$$", the entire- pathstring is used as look-up.- Parameters:
- path- The path to look-up, either a single part such as "av" or "cs".
- Returns:
- The URN resource type found, or nullfor none.