public class ContainerStoreService<T> extends java.lang.Object implements IContainerStoreService<T>
Modifier and Type | Field and Description |
---|---|
protected ChangelogStore |
changelogStore |
protected Container |
container |
protected boolean |
hasChangeLog |
protected ItemStore |
itemStore |
protected IItemValueStore<T> |
itemValueStore |
protected static org.slf4j.Logger |
logger |
protected SecurityContext |
securityContext |
Constructor and Description |
---|
ContainerStoreService(javax.sql.DataSource pool,
SecurityContext securityContext,
Container container,
java.lang.String itemType,
IItemValueStore<T> itemValueStore) |
Modifier and Type | Method and Description |
---|---|
java.util.List<ItemValue<T>> |
all() |
java.util.List<java.lang.String> |
allUids() |
java.util.List<java.lang.String> |
allUidsOrderedByDisplayname() |
void |
attach(java.lang.String uid,
java.lang.String displayName,
T value) |
ContainerChangelog |
changelog(java.lang.Long from,
long to) |
ItemChangelog |
changelog(java.lang.String itemUid,
java.lang.Long from,
long to) |
ContainerChangeset<java.lang.String> |
changeset(java.lang.Long from,
long to) |
ContainerChangeset<java.lang.Long> |
changesetById(java.lang.Long from,
long to) |
long |
create(java.lang.String uid,
java.lang.String extId,
java.lang.String displayName,
T value)
Create item with external ID
|
long |
create(java.lang.String uid,
java.lang.String displayName,
T value)
Create item without external ID
|
protected void |
createValue(Item item,
T value) |
long |
createWithId(java.lang.String uid,
java.lang.Long internalId,
java.lang.String extId,
java.lang.String displayName,
T value)
Create item with external and a given internal ID.
|
protected void |
decorate(Item item,
ItemValue<T> value) |
protected void |
decorate(java.util.List<Item> items,
java.util.List<ItemValue<T>> values) |
boolean |
delete(java.lang.String uid) |
void |
deleteAll()
delete all values ( changelog is available for deleted values )
|
protected void |
deleteValue(Item item) |
protected void |
deleteValues() |
void |
detach(java.lang.String uid) |
ItemValue<T> |
get(long id,
java.lang.Long version) |
ItemValue<T> |
get(java.lang.String uid,
java.lang.Long version) |
ItemValue<T> |
getByExtId(java.lang.String extId)
Get item by external ID
|
ItemStore |
getItemStore() |
java.util.List<ItemValue<T>> |
getItemsValue(java.util.List<Item> items) |
protected ItemValue<T> |
getItemValue(Item item) |
IItemValueStore<T> |
getItemValueStore() |
java.util.List<ItemValue<T>> |
getMultiple(java.util.List<java.lang.String> uids) |
java.util.List<ItemValue<T>> |
getMultipleById(java.util.List<java.lang.Long> uids) |
protected T |
getValue(Item item) |
long |
getVersion() |
<Res> Res |
inTransaction(JdbcAbstractStore.SqlOperation<Res> op) |
void |
prepareContainerDelete()
delete all values.
|
long |
setExtId(java.lang.String uid,
java.lang.String extId) |
void |
touch(java.lang.String uid) |
long |
update(java.lang.String uid,
java.lang.String displayName,
T value) |
protected void |
updateValue(Item item,
T value) |
protected static final org.slf4j.Logger logger
protected Container container
protected ItemStore itemStore
protected IItemValueStore<T> itemValueStore
protected ChangelogStore changelogStore
protected SecurityContext securityContext
protected boolean hasChangeLog
public ContainerStoreService(javax.sql.DataSource pool, SecurityContext securityContext, Container container, java.lang.String itemType, IItemValueStore<T> itemValueStore)
public <Res> Res inTransaction(JdbcAbstractStore.SqlOperation<Res> op) throws ServerFault
ServerFault
public ContainerChangelog changelog(java.lang.Long from, long to) throws ServerFault
changelog
in interface IContainerStoreService<T>
ServerFault
public ItemChangelog changelog(java.lang.String itemUid, java.lang.Long from, long to) throws ServerFault
changelog
in interface IContainerStoreService<T>
ServerFault
public ContainerChangeset<java.lang.String> changeset(java.lang.Long from, long to) throws ServerFault
ServerFault
public ContainerChangeset<java.lang.Long> changesetById(java.lang.Long from, long to) throws ServerFault
ServerFault
public ItemValue<T> get(java.lang.String uid, java.lang.Long version) throws ServerFault
get
in interface IContainerStoreService<T>
ServerFault
public ItemValue<T> get(long id, java.lang.Long version) throws ServerFault
get
in interface IContainerStoreService<T>
ServerFault
protected ItemValue<T> getItemValue(Item item) throws ServerFault
ServerFault
public ItemValue<T> getByExtId(java.lang.String extId) throws ServerFault
IContainerStoreService
getByExtId
in interface IContainerStoreService<T>
ServerFault
protected T getValue(Item item) throws ServerFault
ServerFault
public long create(java.lang.String uid, java.lang.String displayName, T value) throws ServerFault
IContainerStoreService
create
in interface IContainerStoreService<T>
ServerFault
public long create(java.lang.String uid, java.lang.String extId, java.lang.String displayName, T value) throws ServerFault
IContainerStoreService
create
in interface IContainerStoreService<T>
ServerFault
public long createWithId(java.lang.String uid, java.lang.Long internalId, java.lang.String extId, java.lang.String displayName, T value) throws ServerFault
IContainerStoreService
createWithId
in interface IContainerStoreService<T>
ServerFault
public void attach(java.lang.String uid, java.lang.String displayName, T value) throws ServerFault
attach
in interface IContainerStoreService<T>
ServerFault
protected void createValue(Item item, T value) throws ServerFault, java.sql.SQLException
ServerFault
java.sql.SQLException
public long update(java.lang.String uid, java.lang.String displayName, T value) throws ServerFault
update
in interface IContainerStoreService<T>
ServerFault
protected void updateValue(Item item, T value) throws ServerFault, java.sql.SQLException
ServerFault
java.sql.SQLException
public boolean delete(java.lang.String uid) throws ServerFault
delete
in interface IContainerStoreService<T>
ServerFault
public void detach(java.lang.String uid) throws ServerFault
detach
in interface IContainerStoreService<T>
ServerFault
protected void deleteValue(Item item) throws ServerFault, java.sql.SQLException
ServerFault
java.sql.SQLException
public void deleteAll() throws ServerFault
IContainerStoreService
deleteAll
in interface IContainerStoreService<T>
ServerFault
public void prepareContainerDelete() throws ServerFault
IContainerStoreService
prepareContainerDelete
in interface IContainerStoreService<T>
ServerFault
protected void deleteValues() throws ServerFault
ServerFault
public ItemStore getItemStore()
public IItemValueStore<T> getItemValueStore()
public java.util.List<ItemValue<T>> getItemsValue(java.util.List<Item> items) throws ServerFault
ServerFault
protected void decorate(java.util.List<Item> items, java.util.List<ItemValue<T>> values) throws ServerFault
ServerFault
protected void decorate(Item item, ItemValue<T> value) throws ServerFault
ServerFault
public java.util.List<ItemValue<T>> getMultiple(java.util.List<java.lang.String> uids) throws ServerFault
ServerFault
public java.util.List<ItemValue<T>> getMultipleById(java.util.List<java.lang.Long> uids) throws ServerFault
ServerFault
public java.util.List<ItemValue<T>> all() throws ServerFault
ServerFault
public void touch(java.lang.String uid) throws ServerFault
touch
in interface IContainerStoreService<T>
ServerFault
public java.util.List<java.lang.String> allUids() throws ServerFault
allUids
in interface IContainerStoreService<T>
ServerFault
public java.util.List<java.lang.String> allUidsOrderedByDisplayname() throws ServerFault
allUidsOrderedByDisplayname
in interface IContainerStoreService<T>
ServerFault
public long getVersion() throws ServerFault
ServerFault
public long setExtId(java.lang.String uid, java.lang.String extId) throws ServerFault
setExtId
in interface IContainerStoreService<T>
ServerFault
Copyright © 2021. All Rights Reserved.