|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfr.inra.refcomp.services.StorageServiceImpl
public class StorageServiceImpl
User: couteau Date: 30 nov. 2010
| Field Summary | |
|---|---|
static String |
PRIVATE_GROUP
|
| Method Summary | |
|---|---|
AgentSkill |
addSkill(String agentId)
|
void |
adminCreationIfDoNotExist()
|
protected void |
checkResults(Locale locale,
org.nuiton.validator.NuitonValidatorResult result)
check the validation results and throw exception with appropriate error messages. |
void |
clear()
|
protected EntitiesList |
createAgentList(List<Agent> agents)
|
AgentSkill |
createAgentSkill(String agentId)
|
protected EntitiesList |
createAgentSkillList(List<AgentSkill> skills)
|
Cati |
createCati()
Return a new cati created in database. |
Department |
createDepartment()
Return a new department created in database. |
Frequency |
createFrequency()
Return a new frequency created in database. |
void |
createPrivateGroupIfDoNotExist()
|
Skill |
createSkill(String parentId)
Return a new user created in database. |
Unit |
createUnit()
Return a new unit created in database. |
User |
createUser()
Return a new user created in database. |
void |
deleteCati(Cati cati)
Delete a cati |
void |
deleteDepartment(Department department)
Delete a department |
void |
deleteEntity(org.nuiton.wikitty.entities.BusinessEntity entity)
|
void |
deleteFrequency(Frequency frequency,
boolean force)
Delete a frequency |
void |
deleteSkill(Skill skill)
Delete a skill present in database. |
void |
deleteUnit(Unit unit)
Delete a unit |
void |
deleteUser(User user)
Delete a user |
protected boolean |
exist(Cati cati)
Check if a cati is already present in database |
protected Boolean |
exist(Department department)
|
protected Boolean |
exist(Frequency frequency)
|
protected Boolean |
exist(Skill skill)
|
protected Boolean |
exist(Unit unit)
|
protected boolean |
exist(User user)
Check if a user is already present in database |
void |
exportEntitiesReferentiel(Writer writer)
|
void |
exportSkillsReferentiel(Writer writer)
|
void |
exportUserBase(Writer writer)
|
String |
getAdminEmail()
Get the administrator email address from config |
Agent |
getAgent(String id)
|
EntitiesList |
getAgentAndDependencies(String id)
|
AgentSkill |
getAgentSkill(String skillId)
|
Cati |
getCati(String id)
Get a cati from its id |
List<Cati> |
getCatis()
Get all the catis. |
List<Skill> |
getChildrenSkill(String id)
|
Department |
getDepartment(String id)
Get a department with its id |
List<UnitDeptLink> |
getDepartmentLinks(Department entity)
|
List<Department> |
getDepartments()
Get all the departments. |
List<Department> |
getDepartments(String id)
Get all departments for a unit |
List<Frequency> |
getFrequencies()
Get all the frequencies. |
Frequency |
getFrequency(String id)
Get a frequency from its id |
org.nuiton.wikitty.entities.WikittyUser |
getLoggedInUser()
|
String |
getPath(String id)
Get the path for a Skill |
protected org.nuiton.wikitty.entities.WikittyGroup |
getPrivateGroup()
|
org.nuiton.wikitty.WikittyProxy |
getProxy()
|
Skill |
getSkill(String id)
Get a skill with its id |
EntitiesList |
getSkills(String agentId)
Get the skills for an agent |
protected int |
getTimeUsed(Frequency frequency)
|
Unit |
getUnit(String id)
Get a unit with its id |
List<UnitDeptLink> |
getUnitLinks(Unit entity)
|
List<Unit> |
getUnits()
Get all the departments. |
List<Unit> |
getUnits(String id)
Get all the units for a department |
User |
getUser(String id)
Get a user from its id |
List<User> |
getUsers()
Get all the users. |
void |
importCSV(Reader reader)
|
boolean |
isAdmin()
|
boolean |
isAdmin(String id)
|
boolean |
isAgent()
|
protected boolean |
isChildren(String parent,
String children,
boolean recursive)
|
Boolean |
isLoggedIn()
|
protected boolean |
isSkillUsed(Skill skill)
Check if a skill is used by users in their skills description |
Boolean |
login(String login,
String password)
Log the user in |
void |
logout()
|
boolean |
moveSkill(String destination,
String node)
Move a skill in the tree skill |
void |
removeSkill(String skillId)
|
Agent |
saveAgent(Locale locale,
String context,
Agent agent)
Save an agent in database. |
void |
saveAgentSkill(Locale locale,
AgentSkill skill)
|
Cati |
saveCati(Locale locale,
Cati cati)
Save a cati in database. |
Department |
saveDepartment(Locale locale,
Department department)
Save a department in database. |
Department |
saveDepartment(Locale locale,
Department department,
List<String> units)
Save a department in database. |
void |
saveEntity(org.nuiton.wikitty.entities.BusinessEntity entity)
|
Frequency |
saveFrequency(Locale locale,
Frequency frequency)
Save a frequency in database. |
EntitiesList |
saveMySkills(Locale locale,
List<AgentSkill> skills)
|
Skill |
saveSkill(Locale locale,
Skill skill)
Save a skill in database. |
Unit |
saveUnit(Locale locale,
Unit unit)
Save a unit in database. |
Unit |
saveUnit(Locale locale,
Unit unit,
List<String> departments)
Save a unit in database. |
User |
saveUser(Locale locale,
String context,
User user)
Save a user in database. |
EntitiesList |
searchSkill(String search,
String cati,
String department,
String unit,
String frequency)
|
EntitiesList |
searchUser(String search,
String cati,
String department,
String unit,
String frequency)
|
boolean |
sendPassword(Locale locale,
String userId)
|
void |
setAdmin(String agentId,
boolean admin)
|
Agent |
setAgent(User user)
|
void |
setPrivateSkills(List<String> ids)
|
void |
setProxy(org.nuiton.wikitty.WikittyProxy proxy)
|
void |
setPublicSkills(List<String> ids)
|
void |
unsetAgent(String id)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PRIVATE_GROUP
| Method Detail |
|---|
public org.nuiton.wikitty.WikittyProxy getProxy()
getProxy in interface StorageServicepublic void setProxy(org.nuiton.wikitty.WikittyProxy proxy)
setProxy in interface StorageServicepublic List<Cati> getCatis()
getCatis in interface StorageService
public Cati saveCati(Locale locale,
Cati cati)
throws AlreadyExistingException,
InvalidEntityException
saveCati in interface StorageServicecati - the cati to save
AlreadyExistingException - if a cati with the same name already
exist in database
InvalidEntityException - if the cati is not valid and cannot be savedpublic Cati createCati()
createCati in interface StorageServicepublic void deleteCati(Cati cati)
deleteCati in interface StorageServicecati - the cati to deletepublic Cati getCati(String id)
getCati in interface StorageServiceid - the cati id
public List<Frequency> getFrequencies()
getFrequencies in interface StorageService
public Frequency saveFrequency(Locale locale,
Frequency frequency)
throws AlreadyExistingException,
InvalidEntityException
saveFrequency in interface StorageServicefrequency - the frequency to save
AlreadyExistingException - if a frequency with the same name already
exist in database
InvalidEntityExceptionpublic Frequency createFrequency()
createFrequency in interface StorageService
public void deleteFrequency(Frequency frequency,
boolean force)
throws UsedException
deleteFrequency in interface StorageServicefrequency - the frequency to deleteforce - true to force the deletion even if used
UsedException - if not forcing deletion and frequency still used in skillsprotected int getTimeUsed(Frequency frequency)
public Frequency getFrequency(String id)
getFrequency in interface StorageServiceid - the frequency id
public List<User> getUsers()
getUsers in interface StorageService
public User saveUser(Locale locale,
String context,
User user)
throws AlreadyExistingException,
InvalidEntityException
saveUser in interface StorageServiceuser - the user to save
AlreadyExistingException - if a user with the same name already
exist in database
InvalidEntityExceptionpublic User createUser()
createUser in interface StorageServicepublic void deleteUser(User user)
deleteUser in interface StorageServiceuser - the user to deletepublic User getUser(String id)
getUser in interface StorageServiceid - the user id
public Agent getAgent(String id)
getAgent in interface StorageServicepublic EntitiesList getAgentAndDependencies(String id)
getAgentAndDependencies in interface StorageServicepublic Agent setAgent(User user)
setAgent in interface StorageServicepublic void unsetAgent(String id)
unsetAgent in interface StorageService
public Agent saveAgent(Locale locale,
String context,
Agent agent)
throws AlreadyExistingException,
InvalidEntityException
StorageService
saveAgent in interface StorageServiceagent - the agent to save
AlreadyExistingException - if a user/agent with the same name already
exist in database
InvalidEntityException
public Skill saveSkill(Locale locale,
Skill skill)
throws AlreadyExistingException,
InvalidEntityException
StorageService
saveSkill in interface StorageServicelocale - the user locale for error messagesskill - the skill to save
AlreadyExistingException - if a user with the same name already
exist in database
InvalidEntityException - if the skill is not validpublic Skill createSkill(String parentId)
StorageService
createSkill in interface StorageServiceparentId - the parent skill wikitty Id
public void deleteSkill(Skill skill)
throws UsedException
deleteSkill in interface StorageServiceskill - the skill to delete
UsedException - If the skill is used and we cannot delete the skillprotected boolean isSkillUsed(Skill skill)
skill - the skill to check
public Skill getSkill(String id)
StorageService
getSkill in interface StorageServiceid - the skill to get's id
protected Boolean exist(Skill skill)
protected boolean exist(User user)
user - the user to check
protected Boolean exist(Frequency frequency)
protected boolean exist(Cati cati)
cati - the cati to check
public Boolean login(String login,
String password)
StorageService
login in interface StorageServicelogin - the user loginpassword - the user password
public void logout()
logout in interface StorageServicepublic List<Skill> getChildrenSkill(String id)
getChildrenSkill in interface StorageService
public Department saveDepartment(Locale locale,
Department department)
throws AlreadyExistingException,
InvalidEntityException
StorageService
saveDepartment in interface StorageServicedepartment - the department to save
AlreadyExistingException - if a department with the same name
already exist in database
InvalidEntityException
public Department saveDepartment(Locale locale,
Department department,
List<String> units)
throws AlreadyExistingException,
InvalidEntityException
StorageService
saveDepartment in interface StorageServicedepartment - the department to saveunits - the units linked to the department
AlreadyExistingException - if a department with the same name
already exist in database
InvalidEntityExceptionpublic List<UnitDeptLink> getDepartmentLinks(Department entity)
public Department createDepartment()
StorageService
createDepartment in interface StorageServicepublic void deleteDepartment(Department department)
StorageService
deleteDepartment in interface StorageServicedepartment - the department to deletepublic Department getDepartment(String id)
StorageService
getDepartment in interface StorageServiceid - the department to get's id
public List<Department> getDepartments()
getDepartments in interface StorageServicepublic List<Department> getDepartments(String id)
StorageService
getDepartments in interface StorageServiceid - the unit id
protected Boolean exist(Department department)
public Unit saveUnit(Locale locale,
Unit unit)
throws AlreadyExistingException,
InvalidEntityException
StorageService
saveUnit in interface StorageServiceunit - the unit to save
AlreadyExistingException - if a unit with the same name already
exist in database
InvalidEntityException
public Unit saveUnit(Locale locale,
Unit unit,
List<String> departments)
throws AlreadyExistingException,
InvalidEntityException
StorageService
saveUnit in interface StorageServiceunit - the unit to savedepartments - the departments that got the unit
AlreadyExistingException - if a unit with the same name already
exist in database
InvalidEntityExceptionpublic List<UnitDeptLink> getUnitLinks(Unit entity)
public Unit createUnit()
StorageService
createUnit in interface StorageServicepublic void deleteUnit(Unit unit)
StorageService
deleteUnit in interface StorageServiceunit - the unit to deletepublic Unit getUnit(String id)
StorageService
getUnit in interface StorageServiceid - the unit to get's id
public List<Unit> getUnits(String id)
StorageService
getUnits in interface StorageServiceid - the department id
public List<Unit> getUnits()
getUnits in interface StorageServicepublic void saveEntity(org.nuiton.wikitty.entities.BusinessEntity entity)
saveEntity in interface StorageServicepublic void deleteEntity(org.nuiton.wikitty.entities.BusinessEntity entity)
deleteEntity in interface StorageServicepublic String getAdminEmail()
StorageService
getAdminEmail in interface StorageServicepublic AgentSkill createAgentSkill(String agentId)
createAgentSkill in interface StorageService
public void saveAgentSkill(Locale locale,
AgentSkill skill)
throws InvalidEntityException
saveAgentSkill in interface StorageServiceInvalidEntityExceptionprotected org.nuiton.wikitty.entities.WikittyGroup getPrivateGroup()
protected Boolean exist(Unit unit)
public boolean isAdmin()
isAdmin in interface StorageServicepublic boolean isAdmin(String id)
isAdmin in interface StorageServicepublic boolean isAgent()
isAgent in interface StorageServicepublic Boolean isLoggedIn()
isLoggedIn in interface StorageServicepublic void adminCreationIfDoNotExist()
adminCreationIfDoNotExist in interface StorageServicepublic void createPrivateGroupIfDoNotExist()
createPrivateGroupIfDoNotExist in interface StorageServicepublic void setPrivateSkills(List<String> ids)
setPrivateSkills in interface StorageServicepublic void setPublicSkills(List<String> ids)
setPublicSkills in interface StorageServicepublic void clear()
clear in interface StorageServicepublic EntitiesList getSkills(String agentId)
StorageService
getSkills in interface StorageServiceagentId - the wikittyId of the agent to get the skills of
public AgentSkill addSkill(String agentId)
addSkill in interface StorageServicepublic void removeSkill(String skillId)
removeSkill in interface StorageServicepublic org.nuiton.wikitty.entities.WikittyUser getLoggedInUser()
getLoggedInUser in interface StorageService
public EntitiesList saveMySkills(Locale locale,
List<AgentSkill> skills)
throws InvalidEntityException
saveMySkills in interface StorageServiceInvalidEntityExceptionpublic AgentSkill getAgentSkill(String skillId)
getAgentSkill in interface StorageService
public EntitiesList searchUser(String search,
String cati,
String department,
String unit,
String frequency)
searchUser in interface StorageService
public EntitiesList searchSkill(String search,
String cati,
String department,
String unit,
String frequency)
searchSkill in interface StorageService
public void setAdmin(String agentId,
boolean admin)
setAdmin in interface StorageServiceprotected EntitiesList createAgentSkillList(List<AgentSkill> skills)
protected EntitiesList createAgentList(List<Agent> agents)
public void importCSV(Reader reader)
importCSV in interface StorageServicepublic void exportSkillsReferentiel(Writer writer)
exportSkillsReferentiel in interface StorageServicepublic void exportEntitiesReferentiel(Writer writer)
exportEntitiesReferentiel in interface StorageServicepublic void exportUserBase(Writer writer)
exportUserBase in interface StorageServicepublic String getPath(String id)
getPath in interface StorageServiceid - the skill id
protected void checkResults(Locale locale,
org.nuiton.validator.NuitonValidatorResult result)
throws InvalidEntityException
locale - the user locale for error messagesresult - the validation result
InvalidEntityException - if the validation gets errors
public boolean moveSkill(String destination,
String node)
moveSkill in interface StorageService
public boolean sendPassword(Locale locale,
String userId)
sendPassword in interface StorageService
protected boolean isChildren(String parent,
String children,
boolean recursive)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||