SilverStream
Application Server 3.5

com.sssw.rts.acl
Interface AgiPrincipalFactory

All Known Subinterfaces:
AgiAdmClusterServer, AgiAdmServer, AgiServer

public interface AgiPrincipalFactory

An interface for constructing "principals" from a string representation. This interface is necessary because principals are represented differently in the client and the server.

See Also:
Principal, AgiAdmGroup, AgiAdmUser, AgiAdmServer

Method Summary
 Principal getCurrentPrincipal()
          Return the Principal corresponding to the "current" user.
 Principal getWorldPrincipal()
          Return a principal representing "world" -- a distinguished identity that every other principal group belongs to.
 boolean isWorldPrincipal(Principal principal)
          Return true if this principal is the principal representing "world".
 Group parseGroup(String groupName)
          Create a Principal for the specified group name.
 Principal parseUser(String userName)
          Create a Principal for the specified user name.
 

Method Detail

parseUser

public Principal parseUser(String userName)
                    throws AgoBadPrincipalException
Create a Principal for the specified user name.
Parameters:
userName - the user name
Returns:
Principal representing the user
Usage:

Returns Principal representing the user. Exception AgoBadPrincipalException is thrown if the user name can't be parsed or doesn't exist.

Example:
// Get an AgiAdmServer.
 AgiAdmServer server = AgAdmin.getServer("server1", -1);
 // Given a user name, get a Principal for it.
 Principal pr = server.parseUser(
 	"LDAP\\ldapserver\\cn=JBrown,cn=Administrators,ou=Corp_HQ,o=Meridian.com");
 // The principal may be treated as an AgiAdmUser.
 if (pr instanceof AgiAdmUser)
 	AgiAdmUser agUser = (AgiAdmUser)pr;
 

parseGroup

public Group parseGroup(String groupName)
                 throws AgoBadPrincipalException
Create a Principal for the specified group name.
Parameters:
userName - the group name
Returns:
Principal representing the group
Usage:

Returns Principal representing the group. Exception AgoBadPrincipalException is thrown if the group name can't be parsed or doesn't exist.

Example:
// Get an AgiAdmServer.
 AgiAdmServer server = AgAdmin.getServer("server1", -1);
 // Given the name of a group, get a Group for it.
 Group group = server.parseGroup("brilliant\\Domain Admins")
 // The Group may be treated as an AgiAdmGroup.
 if (group instanceof AgiAdmGroup)
 	AgiAdmGroup agGroup = (AgiAdmGroup)group;
 

getWorldPrincipal

public Principal getWorldPrincipal()
Return a principal representing "world" -- a distinguished identity that every other principal group belongs to.
Example:
// Get an AgiAdmServer.
 AgiAdmServer server = AgAdmin.getServer("server1", -1);
 // Get the "World" Principal.
 Principal pr = server.getWorldPrincipal();
 

isWorldPrincipal

public boolean isWorldPrincipal(Principal principal)
Return true if this principal is the principal representing "world".
Example:
// Get an AgiAdmServer.
 AgiAdmServer server = AgAdmin.getServer("server1", -1);
 // Get a Principal (may be an AgiAdmUser or AgiAdmGroup)
 Principal pr = ...
 // See if the specified Principal is the "World" Principal.
 boolean isWorld = server.isWorldPrincipal(pr);
 

getCurrentPrincipal

public Principal getCurrentPrincipal()
Return the Principal corresponding to the "current" user.
Example:
// Get an AgiAdmServer.
 AgiAdmServer server = AgAdmin.getServer("server1", -1);
 // Get the current Principal.
 Principal pr = server.getCurrentPrincipal();
 

SilverStream
Application Server 3.5