Class MemoryRepositoryData
java.lang.Object
org.ametys.plugins.repository.data.repositorydata.impl.MemoryRepositoryData
- All Implemented Interfaces:
ModifiableRepositoryData
,RepositoryData
Class for data values management in memory
-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.data.repositorydata.ModifiableRepositoryData
DATA_NAME_PATTERN
Fields inherited from interface org.ametys.plugins.repository.data.repositorydata.RepositoryData
BOOLEAN_REPOSITORY_DATA_TYPE, CALENDAR_REPOSITORY_DATA_TYPE, DOUBLE_REPOSITORY_DATA_TYPE, LONG_REPOSITORY_DATA_TYPE, STREAM_REPOSITORY_DATA_TYPE, STRING_REPOSITORY_DATA_TYPE
-
Constructor Summary
ConstructorDescriptionMemoryRepositoryData
(String name) Creates a memory repository data with the given nameMemoryRepositoryData
(String name, String defaultPrefix) Creates a memory repository data with the given name -
Method Summary
Modifier and TypeMethodDescriptionaddRepositoryData
(String name, String dataTypeName, String prefix) Creates a repository data and stores it in the repository with the given namegetAllRepositoryData
(String name, String prefix) Retrieves the values of all the repository data stored in the repository with the given namegetBoolean
(String name, String prefix) Retrieves the value of the boolean data stored in the repository with the given nameBoolean[]
getBooleans
(String name, String prefix) Retrieves the values of the multiple boolean data stored in the repository with the given namegetDataNames
(String prefix) Retrieves the names of data in this repository data with the given prefixRetrieves the value of the date data stored as calendar in the repository with the given nameCalendar[]
Retrieves the values of the multiple date data as calendar stored in the repository with the given nameRetrieves the default prefixRetrieves the value of the double data stored in the repository with the given nameDouble[]
getDoubles
(String name, String prefix) Retrieves the values of the multiple double data stored in the repository with the given nameRetrieves the value of the long data stored in the repository with the given nameLong[]
Retrieves the values of the multiple long data stored in the repository with the given namegetName()
Retrieves the name of the current repository data, excluding its prefixgetRepositoryData
(String name, String prefix) Retrieves the value of the repository data stored in the repository with the given nameRetrieves the value of the stream data stored in the repository with the given namegetStreamLength
(String name, String prefix) Retrieves the length of the value of the stream data stored in the repository with the given namegetStreams
(String name, String prefix) Retrieves the values of the multiple stream data stored in the repository with the given nameRetrieves the value of the string data stored in the repository with the given nameString[]
getStrings
(String name, String prefix) Retrieves the values of the multiple string data stored in the repository with the given nameRetrieves the type of the value for the data stored in the repository with the given nameboolean
Checks if there is a value for the data stored in the repository with the given nameboolean
isMultiple
(String name, String prefix) Checks if the value for the data stored in the repository with the given name is multiplevoid
removeValue
(String name, String prefix) Removes the value of the data stored in the repository with the given namevoid
Rename the current repository datavoid
setValue
(String name, InputStream value, String prefix) Sets the value of the input stream data stored in the repository with the given namevoid
Sets the value of the boolean data stored in the repository with the given namevoid
Sets the value of the double data stored in the repository with the given namevoid
Sets the value of the long data stored in the repository with the given namevoid
Sets the value of the string data stored in the repository with the given namevoid
Sets the value of the date data stored in the repository with the given namevoid
setValues
(String name, InputStream[] values, String prefix) Sets the values of the multiple input stream data stored in the repository with the given namevoid
Sets the values of the multiple boolean data stored in the repository with the given namevoid
Sets the values of the multiple double data stored in the repository with the given namevoid
Sets the values of the multiple long data stored in the repository with the given namevoid
Sets the values of the multiple string data stored in the repository with the given namevoid
Sets the values of the multiple date data stored in the repository with the given nametoString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.data.repositorydata.ModifiableRepositoryData
addRepositoryData, getRepositoryData, removeValue, rename, setValue, setValue, setValue, setValue, setValue, setValue, setValues, setValues, setValues, setValues, setValues, setValues
Methods inherited from interface org.ametys.plugins.repository.data.repositorydata.RepositoryData
getAllDataNames, getAllRepositoryData, getBoolean, getBooleans, getDataNames, getDate, getDates, getDouble, getDoubles, getLong, getLongs, getStream, getStreamLength, getStreams, getString, getStrings, getType, hasValue, isMultiple
-
Constructor Details
-
MemoryRepositoryData
Creates a memory repository data with the given name- Parameters:
name
- the name of the current data
-
MemoryRepositoryData
Creates a memory repository data with the given name- Parameters:
name
- the name of the current datadefaultPrefix
- prefix to use for properties and child nodes
-
-
Method Details
-
getString
Description copied from interface:RepositoryData
Retrieves the value of the string data stored in the repository with the given name- Specified by:
getString
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the value of the data
-
getStrings
Description copied from interface:RepositoryData
Retrieves the values of the multiple string data stored in the repository with the given name- Specified by:
getStrings
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the values of the data as a string array
-
getDate
Description copied from interface:RepositoryData
Retrieves the value of the date data stored as calendar in the repository with the given name- Specified by:
getDate
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the value of the data
-
getDates
Description copied from interface:RepositoryData
Retrieves the values of the multiple date data as calendar stored in the repository with the given name- Specified by:
getDates
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the values of the data as a date array
-
getLong
Description copied from interface:RepositoryData
Retrieves the value of the long data stored in the repository with the given name- Specified by:
getLong
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the value of the data
-
getLongs
Description copied from interface:RepositoryData
Retrieves the values of the multiple long data stored in the repository with the given name- Specified by:
getLongs
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the values of the data as a long array
-
getDouble
Description copied from interface:RepositoryData
Retrieves the value of the double data stored in the repository with the given name- Specified by:
getDouble
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the value of the data
-
getDoubles
Description copied from interface:RepositoryData
Retrieves the values of the multiple double data stored in the repository with the given name- Specified by:
getDoubles
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the values of the data as a double array
-
getBoolean
Description copied from interface:RepositoryData
Retrieves the value of the boolean data stored in the repository with the given name- Specified by:
getBoolean
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the value of the data
-
getBooleans
Description copied from interface:RepositoryData
Retrieves the values of the multiple boolean data stored in the repository with the given name- Specified by:
getBooleans
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the values of the data as a boolean array
-
getRepositoryData
Description copied from interface:RepositoryData
Retrieves the value of the repository data stored in the repository with the given name- Specified by:
getRepositoryData
in interfaceModifiableRepositoryData
- Specified by:
getRepositoryData
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the value of the data
-
getAllRepositoryData
Description copied from interface:RepositoryData
Retrieves the values of all the repository data stored in the repository with the given name- Specified by:
getAllRepositoryData
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the values of the data
-
getDataNames
Description copied from interface:RepositoryData
Retrieves the names of data in this repository data with the given prefix- Specified by:
getDataNames
in interfaceRepositoryData
- Parameters:
prefix
- prefix of the data names to retrieve. Ifnull
, retrieves all the data names of this repository data- Returns:
- the names of data by this repository data
-
getName
Description copied from interface:RepositoryData
Retrieves the name of the current repository data, excluding its prefix- Specified by:
getName
in interfaceRepositoryData
- Returns:
- the name of the current repository data
-
hasValue
Description copied from interface:RepositoryData
Checks if there is a value for the data stored in the repository with the given name- Specified by:
hasValue
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- true if there is value for the data, false otherwise
-
getType
Description copied from interface:RepositoryData
Retrieves the type of the value for the data stored in the repository with the given name- Specified by:
getType
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the value's type of the data
- Throws:
UnknownDataException
- if there is no data stored with the given name
-
isMultiple
Description copied from interface:RepositoryData
Checks if the value for the data stored in the repository with the given name is multiple- Specified by:
isMultiple
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- true if the value for the data is multiple, false otherwise
- Throws:
UnknownDataException
- if there is no data stored with the given name
-
getDefaultPrefix
Description copied from interface:RepositoryData
Retrieves the default prefix- Specified by:
getDefaultPrefix
in interfaceRepositoryData
- Returns:
- the default prefix
-
addRepositoryData
Description copied from interface:ModifiableRepositoryData
Creates a repository data and stores it in the repository with the given name- Specified by:
addRepositoryData
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datadataTypeName
- data type name to use on creationprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the value of the data
-
rename
Description copied from interface:ModifiableRepositoryData
Rename the current repository data- Specified by:
rename
in interfaceModifiableRepositoryData
- Parameters:
newName
- the new nameprefix
- prefix of the data name, to use instead of the default one.
-
setValue
Description copied from interface:ModifiableRepositoryData
Sets the value of the string data stored in the repository with the given name- Specified by:
setValue
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValues
Description copied from interface:ModifiableRepositoryData
Sets the values of the multiple string data stored in the repository with the given name- Specified by:
setValues
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValue
Description copied from interface:ModifiableRepositoryData
Sets the value of the date data stored in the repository with the given name- Specified by:
setValue
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValues
Description copied from interface:ModifiableRepositoryData
Sets the values of the multiple date data stored in the repository with the given name- Specified by:
setValues
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValue
Description copied from interface:ModifiableRepositoryData
Sets the value of the long data stored in the repository with the given name- Specified by:
setValue
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValues
Description copied from interface:ModifiableRepositoryData
Sets the values of the multiple long data stored in the repository with the given name- Specified by:
setValues
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValue
Description copied from interface:ModifiableRepositoryData
Sets the value of the double data stored in the repository with the given name- Specified by:
setValue
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValues
Description copied from interface:ModifiableRepositoryData
Sets the values of the multiple double data stored in the repository with the given name- Specified by:
setValues
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValue
Description copied from interface:ModifiableRepositoryData
Sets the value of the boolean data stored in the repository with the given name- Specified by:
setValue
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValues
Description copied from interface:ModifiableRepositoryData
Sets the values of the multiple boolean data stored in the repository with the given name- Specified by:
setValues
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
removeValue
Description copied from interface:ModifiableRepositoryData
Removes the value of the data stored in the repository with the given name- Specified by:
removeValue
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Throws:
UnknownDataException
- if there is no data stored with the given name
-
getStream
Description copied from interface:RepositoryData
Retrieves the value of the stream data stored in the repository with the given name- Specified by:
getStream
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the value of the data
-
getStreamLength
Description copied from interface:RepositoryData
Retrieves the length of the value of the stream data stored in the repository with the given name- Specified by:
getStreamLength
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the length of the value of the data
-
getStreams
Description copied from interface:RepositoryData
Retrieves the values of the multiple stream data stored in the repository with the given name- Specified by:
getStreams
in interfaceRepositoryData
- Parameters:
name
- name of the dataprefix
- prefix of the data name, to use instead of the default one.- Returns:
- the values of the data as an input stream array
-
setValue
Description copied from interface:ModifiableRepositoryData
Sets the value of the input stream data stored in the repository with the given name- Specified by:
setValue
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalue
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
setValues
Description copied from interface:ModifiableRepositoryData
Sets the values of the multiple input stream data stored in the repository with the given name- Specified by:
setValues
in interfaceModifiableRepositoryData
- Parameters:
name
- name of the datavalues
- the value to setprefix
- prefix of the data name, to use instead of the default one.
-
toString
-