public class AmetysObjectDao extends AbstractLogEnabled implements Component, Serviceable
AmetysObject
s.Modifier and Type | Field and Description |
---|---|
protected AmetysObjectResolver |
_resolver
The AmetysObject resolver.
|
Constructor and Description |
---|
AmetysObjectDao() |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
addAmetysObject(String parentId,
String name,
String type)
Add an AmetysObject to the repository.
|
Map<String,Object> |
getAmetysObject(String id)
Get information on an
AmetysObject from its identifier. |
Map<String,Object> |
getAmetysObjectByPath(String path)
Get information on an
AmetysObject , found by its path. |
Map<String,Object> |
getAmetysObjects(Collection<String> ids)
Get information on a
AmetysObject s from their identifier. |
protected void |
putAmetysObjectInfo(Map<String,Object> info,
AmetysObject obj)
Fill the given Map with information on an AmetysObject.
|
List<Map<String,Object>> |
query(String query)
Execute a query to find AmetysObjects.
|
void |
removeAmetysObject(String id)
Remove an AmetysObject.
|
void |
removeMetadata(String id,
String compositePath,
String metadataName)
Remove a metadata of a Ametys object
|
void |
service(ServiceManager serviceManager) |
void |
unlockAmetysObject(String id)
Unlock an AmetysObject.
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected AmetysObjectResolver _resolver
public AmetysObjectDao()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> getAmetysObject(String id)
AmetysObject
from its identifier.id
- the AmetysObject identifier.public Map<String,Object> getAmetysObjectByPath(String path)
AmetysObject
, found by its path.path
- the absolute AmetysObject path (starting with /ametys:root).public Map<String,Object> getAmetysObjects(Collection<String> ids)
AmetysObject
s from their identifier.ids
- a Collection of AmetysObject identifiers.public Map<String,Object> addAmetysObject(String parentId, String name, String type)
parentId
- the parent AmetysObject ID, must be ModifiableTraversable.name
- the name of the AmetysObject to create.type
- the AmetysObject type.public void removeAmetysObject(String id)
id
- the identifier of the AmetysObject to remove.public void removeMetadata(String id, String compositePath, String metadataName)
id
- the identifier of the AmetysObjectcompositePath
- the path of the parent metadata. Can be null or empty.metadataName
- The name of metadata to removepublic void unlockAmetysObject(String id)
id
- the identifier of the AmetysObject to remove.public List<Map<String,Object>> query(String query)
query
- the query to execute.protected void putAmetysObjectInfo(Map<String,Object> info, AmetysObject obj)
info
- the Map to fill.obj
- the AmetysObject.