org.apache.felix.useradmin.impl
Class GroupImpl

java.lang.Object
  extended by org.apache.felix.useradmin.impl.RoleImpl
      extended by org.apache.felix.useradmin.impl.UserImpl
          extended by org.apache.felix.useradmin.impl.GroupImpl
All Implemented Interfaces:
Serializable, Version, Group, Role, User

public class GroupImpl
extends UserImpl
implements Group

This class represents Group role. Group is an aggregation of basic and required roles. Basic and required roles are used in the autorization phase.

Version:
$Rev$ $Date$
See Also:
Group, Serialized Form

Field Summary
 
Fields inherited from class org.apache.felix.useradmin.impl.RoleImpl
name, userAdmin
 
Fields inherited from interface org.osgi.service.useradmin.Role
GROUP, ROLE, USER, USER_ANYONE
 
Constructor Summary
GroupImpl()
          Construct new Group role.
 
Method Summary
 boolean addMember(Role role)
          Adds the specified Role object as a basic member to this Group object.
 boolean addRequiredMember(Role role)
          Adds the specified Role object as a required member to this Group object.
 Role[] getMembers()
          Gets the basic members of this Group object.
 Role[] getRequiredMembers()
          Gets the required members of this Group object.
 int getType()
          Returns the type of this role.
protected  boolean impliedBy(AuthorizationImpl authorization)
          Checks if this role is implied by provided Authorization object.
 boolean removeMember(Role role)
          Removes the specified Role object from this Group object.
 
Methods inherited from class org.apache.felix.useradmin.impl.UserImpl
getCredentials, hasCredential
 
Methods inherited from class org.apache.felix.useradmin.impl.RoleImpl
getName, getProperties, getVersion, increaseVersion, setName, setUserAdmin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.osgi.service.useradmin.User
getCredentials, hasCredential
 
Methods inherited from interface org.osgi.service.useradmin.Role
getName, getProperties
 

Constructor Detail

GroupImpl

public GroupImpl()
Construct new Group role.

Method Detail

addMember

public boolean addMember(Role role)
Description copied from interface: Group
Adds the specified Role object as a basic member to this Group object.

Specified by:
addMember in interface Group
Parameters:
role - The role to add as a basic member.
Returns:
true if the given role could be added as a basic member, and false if this Group object already contains a Role object whose name matches that of the specified role.
See Also:
Group.addMember(Role)

addRequiredMember

public boolean addRequiredMember(Role role)
Description copied from interface: Group
Adds the specified Role object as a required member to this Group object.

Specified by:
addRequiredMember in interface Group
Parameters:
role - The Role object to add as a required member.
Returns:
true if the given Role object could be added as a required member, and false if this Group object already contains a Role object whose name matches that of the specified role.
See Also:
Group.addRequiredMember(Role)

getMembers

public Role[] getMembers()
Description copied from interface: Group
Gets the basic members of this Group object.

Specified by:
getMembers in interface Group
Returns:
The basic members of this Group object, or null if this Group object does not contain any basic members.
See Also:
Group.getMembers()

getRequiredMembers

public Role[] getRequiredMembers()
Description copied from interface: Group
Gets the required members of this Group object.

Specified by:
getRequiredMembers in interface Group
Returns:
The required members of this Group object, or null if this Group object does not contain any required members.
See Also:
Group.getRequiredMembers()

removeMember

public boolean removeMember(Role role)
Description copied from interface: Group
Removes the specified Role object from this Group object.

Specified by:
removeMember in interface Group
Parameters:
role - The Role object to remove from this Group object.
Returns:
true if the Role object could be removed, otherwise false.
See Also:
Group.removeMember(Role)

getType

public int getType()
Description copied from interface: Role
Returns the type of this role.

Specified by:
getType in interface Role
Overrides:
getType in class UserImpl
Returns:
The role's type.
See Also:
Role.getType()

impliedBy

protected boolean impliedBy(AuthorizationImpl authorization)
Checks if this role is implied by provided Authorization object.

Overrides:
impliedBy in class UserImpl
Parameters:
authorization - Authorization instance.
Returns:
true if is implied false if not.
See Also:
org.osgi.service.useradmin.Autorization


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.