Class SimpleUserSystemServiceHelper
- java.lang.Object
-
- org.kie.server.services.taskassigning.user.system.simple.SimpleUserSystemServiceHelper
-
public class SimpleUserSystemServiceHelper extends Object
Utility class for loading users definition from a file using the Wildfly roles.properties definition file format. i.e. user1=group1,group2 user1=group2,group3and additionally facilitates the reading of user attributes like skills and affinities in a similar format. e.g. skills.properties: user1=skill1,skill2 user2=skill3
e.g. affinities.properties user1=affinity1,affinity2
When configured, the users skills will be loaded in the SKILLS_ATTRIBUTE_NAME. Following the example above user.getAttributes().get(SKILLS_ATTRIBUTE_NAME) will return the String "skill1,skill2");
When configured, the users affinities will be loaded in the AFFINITIES_ATTRIBUTE_NAME. Following the example above user1.getAttributes().get(AFFINITIES_ATTRIBUTE_NAME) will return the String "affinity1,affinity2"); and user2.getAttributes().get(AFFINITIES_ATTRIBUTE_NAME) will return null.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleUserSystemServiceHelper.UserGroupInfo
-
Field Summary
Fields Modifier and Type Field Description static StringAFFINITIES_ATTRIBUTE_NAMEstatic StringSKILLS_ATTRIBUTE_NAME
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SimpleUserSystemServiceHelper.UserGroupInfobuildInfo(InputStream usersIn, InputStream skillsIn, InputStream affinitiesIn)Reads the users definitions for a file in the Wildfly roles.properties definition file format.static SimpleUserSystemServiceHelper.UserGroupInfobuildInfo(Path users, Path skills, Path affinities)Reads the users definitions from a file using the Wildfly roles.properties definition file format.
-
-
-
Field Detail
-
SKILLS_ATTRIBUTE_NAME
public static final String SKILLS_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
AFFINITIES_ATTRIBUTE_NAME
public static final String AFFINITIES_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
buildInfo
public static SimpleUserSystemServiceHelper.UserGroupInfo buildInfo(Path users, Path skills, Path affinities) throws IOException
Reads the users definitions from a file using the Wildfly roles.properties definition file format. See class comments. Additionally loads the users skills and affinities if present.- Parameters:
users- a path to the user + roles file in the WF format.skills- an optional path to the users skills file.affinities- an optional path to the users affinities file.- Returns:
- a UserGroupInfo instance with the Users and Groups loaded.
- Throws:
IOException- if an I/O error occurs
-
buildInfo
public static SimpleUserSystemServiceHelper.UserGroupInfo buildInfo(InputStream usersIn, InputStream skillsIn, InputStream affinitiesIn) throws IOException
Reads the users definitions for a file in the Wildfly roles.properties definition file format. See class comments. Additionally loads the users skills and affinities if present.- Parameters:
usersIn- InputStream with the user + roles file in the WF format.skillsIn- InputStream with the users skills.affinitiesIn- InputStream with the users affinities.- Returns:
- a UserGroupInfo instance with the Users and Groups loaded.
- Throws:
IOException- if an I/O error occurs
-
-