com.tivoli.pd.jadmin
Class PDDomain

java.lang.Object
  extended by com.tivoli.pd.jutil.PDEnvironmentObject
      extended by com.tivoli.pd.jadmin.PDDomain
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PDDomain
extends com.tivoli.pd.jutil.PDEnvironmentObject
implements java.lang.Cloneable

This class represents a Security Access Manager policy server domain. A domain is a logical collection of data, such as users, groups, access control lists and so forth, to which access is typically limited to one organization. Multiple domains can co-exist in a Security Access Manager installation, and data is securely partitioned among domains. A user or process must be specifically authenticated to a domain in order to access data within it.

Each Security Access Manager installation contains a single Management Domain. A user must be authenticated to this Management Domain in order to create, delete, list or modify other domains. To specify the Management Domain in methods that take a domain argument, use the static getMgmtDomainName method.

In addition, each Java Runtime Environment (JRE) may optionally be configured to use a specific domain. This domain is called the Local Domain. To specify the Local Domain in methods that take a domain argument, use the static getLocalDomainName method. If a JRE has not been configured to use a specific domain, the Local Domain defaults to the Management Domain.

See Also:
Serialized Form

Constructor Summary
PDDomain(PDContext context, java.lang.String name, PDMessages messages)
          Creates a PDDomain object with the specified input name.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this object.
static void createDomain(PDContext context, java.lang.String name, java.lang.String description, java.lang.String adminId, char[] adminPwd, PDMessages messages)
          Creates a new domain.
static void deleteDomain(PDContext context, java.lang.String name, boolean registry, PDMessages messages)
          Deletes a domain.
 boolean equals(java.lang.Object obj)
          Determines whether this PDDomain is equivalent to the input object.
 java.lang.String getDescription()
          Returns the domain description from this object.
 java.lang.String getId()
          Returns the domain name from this object.
static java.lang.String getLocalDomainName()
          Returns the name of the Local Domain.
static java.lang.String getMgmtDomainName()
          Returns the name of the Management Domain.
static java.util.ArrayList listDomains(PDContext context, PDMessages messages)
          List all domains, other than the Management Domain.
 void setDescription(PDContext context, java.lang.String newDesc, PDMessages messages)
          Modifies this domain's description.
static void setDescription(PDContext context, java.lang.String name, java.lang.String newDesc, PDMessages messages)
          Modifies the description for the specified domain.
 java.lang.String toString()
          Returns a String representation of this object.
 
Methods inherited from class com.tivoli.pd.jutil.PDEnvironmentObject
getContext, setContext
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDDomain

public PDDomain(PDContext context,
                java.lang.String name,
                PDMessages messages)
         throws PDException
Creates a PDDomain object with the specified input name.

This constructor corresponds to the ivadmin_domain_get() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server. This context must be authenticated to the Management Domain.
name - the name of the domain to instantiate.
messages - in/out parameter; empty PDMessages on input; might contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception might contain error and message codes defined in the product Error Message Reference document.
Method Detail

getId

public java.lang.String getId()
                       throws PDException
Returns the domain name from this object.

This method corresponds to the ivadmin_domain_getid() C API.

Throws:
PDException

getDescription

public java.lang.String getDescription()
                                throws PDException
Returns the domain description from this object. The return value will never be null, but it may be an empty String.

This method corresponds to the ivadmin_domain_getdescription() C API.

Throws:
PDException

setDescription

public void setDescription(PDContext context,
                           java.lang.String newDesc,
                           PDMessages messages)
                    throws PDException
Modifies this domain's description. This change affects both the current object and the domain data in the Security Access Manager policy server.

This method corresponds to the ivadmin_domain_setdescription() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server. This context must be authenticated to the Management Domain.
newDesc - the new description. May not be null; use the empty String to clear the existing description.
messages - in/out parameter; empty PDMessages on input; might contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception might contain error and message codes defined in the product Error Message Reference document.

toString

public java.lang.String toString()
Returns a String representation of this object.

Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Returns a copy of this object.

Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Determines whether this PDDomain is equivalent to the input object.

Overrides:
equals in class java.lang.Object

getMgmtDomainName

public static java.lang.String getMgmtDomainName()
                                          throws PDException
Returns the name of the Management Domain.

Throws:
PDException

getLocalDomainName

public static java.lang.String getLocalDomainName()
                                           throws PDException
Returns the name of the Local Domain.

Throws:
PDException

createDomain

public static void createDomain(PDContext context,
                                java.lang.String name,
                                java.lang.String description,
                                java.lang.String adminId,
                                char[] adminPwd,
                                PDMessages messages)
                         throws PDException
Creates a new domain.

This method corresponds to the ivadmin_domain_create() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server. This context must be authenticated to the Management Domain.
name - the name of the domain.
description - the domain's description. May be null, in which case the domain is created with an empty description.
adminId - the name of the initial administrative user for the new domain. May not be null or zero length.
adminPwd - the initial password to associate with the new domain's administrative user.
messages - in/out parameter; empty PDMessages on input; might contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception might contain error and message codes defined in the product Error Message Reference document.

deleteDomain

public static void deleteDomain(PDContext context,
                                java.lang.String name,
                                boolean registry,
                                PDMessages messages)
                         throws PDException
Deletes a domain.

This method corresponds to the ivadmin_domain_delete() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server. This context must be authenticated to the Management Domain.
name - the name of the domain.
registry - indicates whether to delete the domain's user and group data from the user registry as well as from Security Access Manager. If a domain's user and group data is not deleted from the user registry, those users and groups will be available automatically if the domain is recreated.
messages - in/out parameter; empty PDMessages on input; might contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception might contain error and message codes defined in the product Error Message Reference document.

listDomains

public static java.util.ArrayList listDomains(PDContext context,
                                              PDMessages messages)
                                       throws PDException
List all domains, other than the Management Domain.

This method corresponds to the ivadmin_domain_list() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server. This context must be authenticated to the Management Domain.
messages - in/out parameter; empty PDMessages on input; might contain zero or more informational or warning messages on output.
Returns:
an ArrayList of Strings that represent the names of domains. The returned list will never be null but it may be empty if no domains have been created, or all domains have been deleted.
Throws:
PDException - if an error occurs. This exception might contain error and message codes defined in the product Error Message Reference document.

setDescription

public static void setDescription(PDContext context,
                                  java.lang.String name,
                                  java.lang.String newDesc,
                                  PDMessages messages)
                           throws PDException
Modifies the description for the specified domain. This change affects only the domain data at the Security Access Manager policy server.

This method corresponds to the ivadmin_domain_setdescription() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server. This context must be authenticated to the Management Domain.
name - the name of the domain.
newDesc - the new description. May not be null; use the empty String to clear the existing description.
messages - in/out parameter; empty PDMessages on input; might contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception might contain error and message codes defined in the product Error Message Reference document.