Package org.opencastproject.security.api
Class JaxbUser
java.lang.Object
org.opencastproject.security.api.JaxbUser
- All Implemented Interfaces:
User
A simple user model.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe user's email addressprotected booleanprotected StringThe user's nameprotected JaxbOrganizationThe user's home organization identifierprotected StringThe optional password.protected StringThe user's providerThe rolesprotected StringThe user name -
Constructor Summary
ConstructorsConstructorDescriptionJaxbUser()No-arg constructor needed by JAXBJaxbUser(String userName, String password, String name, String email, String provider, JaxbOrganization organization, Set<JaxbRole> roles) Constructs a user which is a member of the given organization that has the specified roles.JaxbUser(String userName, String password, String provider, JaxbOrganization organization, Set<JaxbRole> roles) Constructs a user which is a member of the given organization that has the specified roles.JaxbUser(String userName, String password, String provider, JaxbOrganization organization, JaxbRole... roles) Constructs a user which is a member of the given organization that has the specified roles.Constructs a user which is a member of the given organization that has the specified roles and no password set.JaxbUser(String userName, String provider, JaxbOrganization organization, JaxbRole... roles) Constructs a user which is a member of the given organization that has the specified roles and no password set. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic JaxbUserCreates a JAXB user from a regular user object.static JaxbUserfromUser(User user, Collection<? extends Role> extraRoles) Creates a JAXB user from a regular user object with an additional set of roles.getEmail()Gets the user's email address.getName()Gets the user's name.Returns the user's organization identifier.Gets this user's password, if available.Gets the provider where the user is coming from.getRoles()Gets the user's roles.Gets this user's unique account name.inthashCode()booleanReturns whether the user is in a specific role.booleanReturnstrueif this user object can be managed by Opencast.voidsetManageable(boolean isManageable) voidsetProvider(String provider) toString()
-
Field Details
-
userName
The user name -
name
The user's name -
email
The user's email address -
provider
The user's provider -
isManageable
protected boolean isManageable -
roles
The roles -
password
The optional password. Note that this will never be serialized to xml -
organization
The user's home organization identifier
-
-
Constructor Details
-
JaxbUser
public JaxbUser()No-arg constructor needed by JAXB -
JaxbUser
public JaxbUser(String userName, String provider, JaxbOrganization organization, JaxbRole... roles) throws IllegalArgumentException Constructs a user which is a member of the given organization that has the specified roles and no password set.- Parameters:
userName- the usernameprovider- the providerorganization- the organizationroles- the set of roles for this user- Throws:
IllegalArgumentException- ifuserNameororganizationisnull
-
JaxbUser
public JaxbUser(String userName, String password, String provider, JaxbOrganization organization, JaxbRole... roles) throws IllegalArgumentException Constructs a user which is a member of the given organization that has the specified roles.- Parameters:
userName- the usernamepassword- the passwordprovider- the providerorganization- the organizationroles- the set of roles for this user- Throws:
IllegalArgumentException- ifuserNameororganizationisnull
-
JaxbUser
public JaxbUser(String userName, String password, String provider, JaxbOrganization organization, Set<JaxbRole> roles) throws IllegalArgumentException Constructs a user which is a member of the given organization that has the specified roles.- Parameters:
userName- the usernamepassword- the passwordprovider- the providerorganization- the organizationroles- the set of roles for this user- Throws:
IllegalArgumentException- ifuserNameororganizationisnull
-
JaxbUser
public JaxbUser(String userName, String provider, JaxbOrganization organization, Set<JaxbRole> roles) throws IllegalArgumentException Constructs a user which is a member of the given organization that has the specified roles and no password set.- Parameters:
userName- the usernameprovider- the providerorganization- the organizationroles- the set of roles for this user- Throws:
IllegalArgumentException- ifuserNameororganizationisnull
-
JaxbUser
public JaxbUser(String userName, String password, String name, String email, String provider, JaxbOrganization organization, Set<JaxbRole> roles) throws IllegalArgumentException Constructs a user which is a member of the given organization that has the specified roles.- Parameters:
userName- the usernamepassword- the passwordname- the nameemail- the emailprovider- the providerorganization- the organizationroles- the set of roles for this user- Throws:
IllegalArgumentException- ifuserNameororganizationisnull
-
-
Method Details
-
fromUser
Creates a JAXB user from a regular user object.- Parameters:
user- the user- Returns:
- the JAXB user
-
fromUser
Creates a JAXB user from a regular user object with an additional set of roles.- Parameters:
user- the user- Returns:
- the JAXB user
-
getUsername
Description copied from interface:UserGets this user's unique account name.- Specified by:
getUsernamein interfaceUser- Returns:
- the account name
- See Also:
-
getPassword
Description copied from interface:UserGets this user's password, if available.- Specified by:
getPasswordin interfaceUser- Returns:
- the password
- See Also:
-
getOrganization
Description copied from interface:UserReturns the user's organization identifier.- Specified by:
getOrganizationin interfaceUser- Returns:
- the organization
- See Also:
-
getRoles
Description copied from interface:UserGets the user's roles. For anonymous users, this will return Anonymous. -
hasRole
Description copied from interface:UserReturns whether the user is in a specific role. -
equals
-
hashCode
public int hashCode() -
toString
-
getName
Description copied from interface:UserGets the user's name. -
getEmail
Description copied from interface:UserGets the user's email address. -
getProvider
Description copied from interface:UserGets the provider where the user is coming from.- Specified by:
getProviderin interfaceUser- Returns:
- the provider where the user is coming from.
-
setProvider
-
isManageable
public boolean isManageable()Description copied from interface:UserReturnstrueif this user object can be managed by Opencast.- Specified by:
isManageablein interfaceUser- Returns:
trueif this user is manageable
-
setManageable
public void setManageable(boolean isManageable)
-