com.ibm.tspaces.ac
Class AclFactory

java.lang.Object
  |
  +--com.ibm.tspaces.ac.AclFactory

public class AclFactory
extends java.lang.Object

This class will create various objects that implement the java.security.acl interfaces AclFactory.createAcl() AclFactory.createAclEntry() AclFactory.createPrincipal(); AclFactory.createPermission(); Although its name suggests that this is a Java object Factory, in fact it is not. There are a number of ways that Factory classes can be built. Since I don't know what type of other implementations might be desired in the future, I will leave the coding of the Factory to the person that wants to add a 2nd implementation of the ACL interfaces. Since TSpaces itself, only refers to the Acl interfaces found in java.security and java.security.acl and to this AclFactory class, one should be able to easily replace the current implementation with another implementation that might be based on the user/group/password files that are used by the host OS.

Author:
John Thomas
See Also:
Tuplespace

Inner Class Summary
static interface AclFactory.DefaultPermissions
          Interface to define default Permissions A class can "implement AclFactory.DefaultPermissions" and then refer to these directly.
 
Constructor Summary
AclFactory()
           
 
Method Summary
static java.security.acl.Acl createAcl(java.lang.String name, java.security.Principal owner)
          Construct an instance of an Acl To complete the Acl, you need to add some AclEntry objects to it.
static java.security.acl.Acl createAcl(java.lang.String name, java.security.Principal owner, java.security.acl.AclEntry[] array)
          Construct an instance of an Acl, with an array of AclEntry objects filled in.
static java.security.acl.Acl createAcl(java.lang.String name, java.security.Principal owner, java.security.Principal user, java.security.acl.Permission[] pArray)
          Construct an instance of an Acl, with one AclEntry filled in.
static java.security.acl.Acl createAcl(java.lang.String name, java.lang.String ownerStr)
          Construct an instance of an Acl with a userid string specified for the owner instead of a Principle To complete the Acl, you need to add some AclEntry objects to it.
static java.security.acl.Acl createAcl(java.lang.String name, java.lang.String ownerStr, java.security.acl.AclEntry[] array)
          Construct an instance of an Acl, with an array of AclEntry objects filled in.
static java.security.acl.Acl createAcl(java.lang.String name, java.lang.String ownerStr, java.lang.String userStr, java.security.acl.Permission[] pArray)
          Construct an instance of an Acl, with an array of AclEntry objects filled in.
static java.security.acl.AclEntry createAclEntry(java.security.Principal user, java.security.acl.Permission p)
          Construct an instance of an AclEntry that can be added to a Acl.
static java.security.acl.AclEntry createAclEntry(java.security.Principal user, java.security.acl.Permission[] pArray)
          Construct an instance of an AclEntry that can be added to a Acl.
static java.security.acl.AclEntry createAclEntry(java.lang.String userStr, java.security.acl.Permission p)
          Construct an instance of an AclEntry that can be added to a Acl.
static java.security.acl.AclEntry createAclEntry(java.lang.String user, java.security.acl.Permission[] pArray)
          Construct an instance of an AclEntry that can be added to a Acl.
static java.security.acl.Permission createPermission(java.lang.String type)
          Construct an instance of a Permission A Permission is "right" to invoke some operation on a TupleSpace.
static java.security.Principal createPrincipal(java.lang.String name)
          Construct an instance of a Principal A Principal is either a User or a group.
static java.security.Principal getPrincipal(java.lang.String name)
          Get an instance of a Principal from the TSAclDBase
static void setAclDBase(TsAclDBase aclDB)
          setAclDBase **
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AclFactory

public AclFactory()
Method Detail

setAclDBase

public static void setAclDBase(TsAclDBase aclDB)
setAclDBase **

createAcl

public static java.security.acl.Acl createAcl(java.lang.String name,
                                              java.security.Principal owner)
Construct an instance of an Acl To complete the Acl, you need to add some AclEntry objects to it.
Parameters:
name - The name that will be given to the Acl.
owner - The owner of the Acl.
See Also:
Acl, Principal, AclEntry

createAcl

public static java.security.acl.Acl createAcl(java.lang.String name,
                                              java.lang.String ownerStr)
Construct an instance of an Acl with a userid string specified for the owner instead of a Principle To complete the Acl, you need to add some AclEntry objects to it.
Parameters:
name - The name that will be given to the Acl.
owner - The owner of the Acl.
See Also:
Acl, Principal, AclEntry

createAcl

public static java.security.acl.Acl createAcl(java.lang.String name,
                                              java.security.Principal owner,
                                              java.security.Principal user,
                                              java.security.acl.Permission[] pArray)
Construct an instance of an Acl, with one AclEntry filled in.
Parameters:
name - The name that will be given to the Acl.
owner - The owner of the Acl.
user - The Principal(user or group) that you want to give permission to.
pArray - An array of Permissions to be given to the Principal
See Also:
Acl, Principal, AclEntry

createAcl

public static java.security.acl.Acl createAcl(java.lang.String name,
                                              java.security.Principal owner,
                                              java.security.acl.AclEntry[] array)
Construct an instance of an Acl, with an array of AclEntry objects filled in.
Parameters:
name - The name that will be given to the Acl.
owner - The owner of the Acl.
array - An array of AclEntries
See Also:
Acl, Principal, AclEntry

createAcl

public static java.security.acl.Acl createAcl(java.lang.String name,
                                              java.lang.String ownerStr,
                                              java.security.acl.AclEntry[] array)
Construct an instance of an Acl, with an array of AclEntry objects filled in.
Parameters:
name - The name that will be given to the Acl.
ownerStr - The owner of the Acl.
array - An array of AclEntries
See Also:
Acl, Principal, AclEntry

createAcl

public static java.security.acl.Acl createAcl(java.lang.String name,
                                              java.lang.String ownerStr,
                                              java.lang.String userStr,
                                              java.security.acl.Permission[] pArray)
Construct an instance of an Acl, with an array of AclEntry objects filled in.
Parameters:
name - The name that will be given to the Acl.
ownerStr - The owner of the Acl.
pArray - An array of AclEntries
See Also:
Acl, Principal, AclEntry

createAclEntry

public static java.security.acl.AclEntry createAclEntry(java.security.Principal user,
                                                        java.security.acl.Permission p)
Construct an instance of an AclEntry that can be added to a Acl. An AclEntry consists of a Principal that is to be given permission and an array of Permissions instances.
Parameters:
user - The Principal(user or group) that you want to give permission to.
p - Permission to be given to the Principal
See Also:
Acl, Principal, AclEntry

createAclEntry

public static java.security.acl.AclEntry createAclEntry(java.lang.String userStr,
                                                        java.security.acl.Permission p)
Construct an instance of an AclEntry that can be added to a Acl. An AclEntry consists of a Principal that is to be given permission and an array of Permissions instances.
Parameters:
userStr - The name of the user or group that you want to give permission to.
p - Permission to be given to the Principal
See Also:
Acl, Principal, AclEntry

createAclEntry

public static java.security.acl.AclEntry createAclEntry(java.security.Principal user,
                                                        java.security.acl.Permission[] pArray)
Construct an instance of an AclEntry that can be added to a Acl. An AclEntry consists of a Principal that is to be given permission and an array of Permissions instances.
Parameters:
user - The Principal(user or group) that you want to give permission to.
pArray - An array of Permissions to be given to the Principal
See Also:
Acl, Permission, Principal, AclEntry

createAclEntry

public static java.security.acl.AclEntry createAclEntry(java.lang.String user,
                                                        java.security.acl.Permission[] pArray)
Construct an instance of an AclEntry that can be added to a Acl. An AclEntry consists of a Principal that is to be given permission and an array of Permissions instances.
Parameters:
user - The Principal(user or group) that you want to give permission to.
pArray - An array of Permissions to be given to the Principal
See Also:
Acl, Permission, Principal, AclEntry

createPrincipal

public static java.security.Principal createPrincipal(java.lang.String name)
Construct an instance of a Principal A Principal is either a User or a group. From the standpoint of the ACL, there is no difference between a user and a gropu. There is a Group object that is a subclass of Principal. It is a Principal that has members that belong to it.
Parameters:
name - The name that is associated with the Principal(user or group)
See Also:
Acl, Principal, Group, AclEntry

getPrincipal

public static java.security.Principal getPrincipal(java.lang.String name)
Get an instance of a Principal from the TSAclDBase
Parameters:
name - The name that is associated with the Principal(user or group)
See Also:
Acl, Principal, Group, AclEntry

createPermission

public static java.security.acl.Permission createPermission(java.lang.String type)
Construct an instance of a Permission A Permission is "right" to invoke some operation on a TupleSpace. There are a number of prebuilt Permission objects defined in AclFactory.DefaultPermissions.
Parameters:
The - name that is associated with the Permission
See Also:
Acl, Principal, Group, AclEntry, Permission