com.novell.admin.rbs
Class RBSUtil

java.lang.Object
  |
  +--com.novell.admin.rbs.RBSUtil

public class RBSUtil
extends java.lang.Object

Static helper methods class for RBS.


Constructor Summary
RBSUtil()
           
 
Method Summary
static boolean canPerformTask(ObjectEntry identity, ObjectEntry scope, RBSTask task)
          Checks to see if a user can perform a task at a certain scope; NOTE that this does NOT check for NDS rights to perform the task it only checks to see if the Task is a member of a role assigned to this user.
static void createAssociation(RBSAssociation assc, NSObject nsObj, NSObject roleObj, NSObject scopeObj)
          Given a RBSAssociation and the NSObjects representing the object and Role, creates the necessary association between the objects and their attributes.
static javax.swing.JPanel createPanel(javax.swing.JLabel label, java.awt.Component c)
          Creates a panel for the given label and component.
static void deleteAssociation(RBSAssociation assc, NSObject nsObj, NSObject roleObj, NSObject scopeObj)
          Given a RBSAssociation and the NSObjects representing the object and Role, deletes the association.
static long getAvailableTrusteeIndex(ObjectEntry oe, NSObject nsObj)
          Finds the highest Interval portion of the rbsTrusteeOf attribute of oe and returns that value + 1
static void makeGroupOrContainerTrusteeOfContent(NSObject contentObj, ObjectEntry memberOE)
          This makes the group or container object a trustee of the task or job object Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
static void makeRoleAndUserSecurityEquivalent(NSObject userObj, NSObject roleObj)
          This makes the role and user objects security equivalent to each other Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
static void makeRoleTrusteeOfContent(NSObject contentObj, NSObject roleObj)
          This makes the role object a trustee of the task or job object Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
static void modifyAssociation(RBSAssociation assc, NSObject nsObj, NSObject roleObj, NSObject newScopeObj, NSObject oldScopeObj)
          Given a RBSAssociation and the NSObjects representing the object and Role, modifies the scope, start and stop times in the relationship if necessary.
static void removeGroupOrContainerTrusteeFromContent(NSObject contentObj, ObjectEntry memberOE)
          This removes the group or container object as a trustee from the task or job object Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
static void removeRoleAndUserSecurityEquivalent(NSObject userObj, NSObject roleObj)
          This removes the role and user objects security equivalent from each other Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
static void removeRoleTrusteeFromContent(NSObject contentObj, NSObject roleObj)
          This removes the role object as a trustee from the task or job object Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
static java.util.Vector sortNodesByInterval(java.util.Vector nodes)
          Given a vector, sorts the vector based on the Interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RBSUtil

public RBSUtil()
Method Detail

sortNodesByInterval

public static java.util.Vector sortNodesByInterval(java.util.Vector nodes)
Given a vector, sorts the vector based on the Interval.
Parameters:
nodes - Vector of ValueComponentsNodes with TypedNameSytax
Returns:
A Vector of ValueComponentNodes soreted by interval

getAvailableTrusteeIndex

public static long getAvailableTrusteeIndex(ObjectEntry oe,
                                            NSObject nsObj)
                                     throws SPIException
Finds the highest Interval portion of the rbsTrusteeOf attribute of oe and returns that value + 1
Parameters:
oe - The ObjectEntry representing a User, Group, O or OU
Throws:
SPIException -  

createAssociation

public static void createAssociation(RBSAssociation assc,
                                     NSObject nsObj,
                                     NSObject roleObj,
                                     NSObject scopeObj)
                              throws SPIException,
                                     NamespaceException
Given a RBSAssociation and the NSObjects representing the object and Role, creates the necessary association between the objects and their attributes. Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
assc - The RBSAssociation object
nsObj - The NSObject for the User, Group, O, or OU in assc.
roleObj - The NSObject for the Role in assc.
scopeObj - The NSObject for the Scope in assc.
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  

deleteAssociation

public static void deleteAssociation(RBSAssociation assc,
                                     NSObject nsObj,
                                     NSObject roleObj,
                                     NSObject scopeObj)
                              throws SPIException,
                                     NamespaceException
Given a RBSAssociation and the NSObjects representing the object and Role, deletes the association. Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
assc - The RBSAssociation object
nsObj - The NSObject for the User, Group, O, or OU in assc.
roleObj - The NSObject for the Role in assc.
scopeObj - The NSObject for the Scope in assc.
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  

modifyAssociation

public static void modifyAssociation(RBSAssociation assc,
                                     NSObject nsObj,
                                     NSObject roleObj,
                                     NSObject newScopeObj,
                                     NSObject oldScopeObj)
                              throws SPIException,
                                     NamespaceException
Given a RBSAssociation and the NSObjects representing the object and Role, modifies the scope, start and stop times in the relationship if necessary. Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
assc - The RBSAssociation object
nsObj - The NSObject for the User, Group, O, or OU in assc.
roleObj - The NSObject for the Role in assc.
newScopeObj - The NSObject for the new scope in assc.
oldScopeObj - The NSObject for the old scope in assc.
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  

createPanel

public static javax.swing.JPanel createPanel(javax.swing.JLabel label,
                                             java.awt.Component c)
Creates a panel for the given label and component.
Parameters:
label - The label to use in the panel
c - The component to use in the panel
Returns:
A JPanel with the given label and component

makeRoleTrusteeOfContent

public static void makeRoleTrusteeOfContent(NSObject contentObj,
                                            NSObject roleObj)
                                     throws SPIException,
                                            NamespaceException
This makes the role object a trustee of the task or job object Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
contentObj - The NSObject for a task or job object
roleObj - The NSObject for a role object.
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  

removeRoleTrusteeFromContent

public static void removeRoleTrusteeFromContent(NSObject contentObj,
                                                NSObject roleObj)
This removes the role object as a trustee from the task or job object Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
contentObj - The NSObject for a task or job object
roleObj - The NSObject for a role object.

makeRoleAndUserSecurityEquivalent

public static void makeRoleAndUserSecurityEquivalent(NSObject userObj,
                                                     NSObject roleObj)
                                              throws NamespaceException,
                                                     SPIException,
                                                     ComponentCreationException
This makes the role and user objects security equivalent to each other Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
userObj - The NSObject for a task or job object
roleObj - The NSObject for a role object.
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  

removeRoleAndUserSecurityEquivalent

public static void removeRoleAndUserSecurityEquivalent(NSObject userObj,
                                                       NSObject roleObj)
                                                throws NamespaceException,
                                                       SPIException,
                                                       ComponentCreationException
This removes the role and user objects security equivalent from each other Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
userObj - The NSObject for a task or job object
roleObj - The NSObject for a role object.
Throws:
SPIException -  
com.novell.admin.common.exceptions.SnapinVetoException -  

makeGroupOrContainerTrusteeOfContent

public static void makeGroupOrContainerTrusteeOfContent(NSObject contentObj,
                                                        ObjectEntry memberOE)
                                                 throws NamespaceException,
                                                        SPIException
This makes the group or container object a trustee of the task or job object Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
contentObj - The NSObject for a task or job object
memberOE - The ObjectEntry for a group or container object.
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  

removeGroupOrContainerTrusteeFromContent

public static void removeGroupOrContainerTrusteeFromContent(NSObject contentObj,
                                                            ObjectEntry memberOE)
This removes the group or container object as a trustee from the task or job object Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
contentObj - The NSObject for a task or job object
memberObj - The ObjectEntry for a group or container object.

canPerformTask

public static boolean canPerformTask(ObjectEntry identity,
                                     ObjectEntry scope,
                                     RBSTask task)
                              throws SPIException,
                                     RBSException
Checks to see if a user can perform a task at a certain scope; NOTE that this does NOT check for NDS rights to perform the task it only checks to see if the Task is a member of a role assigned to this user.
Parameters:
identity - The ObjectEntry for the user.
scope - The ObjectEntry representing an object in NDS.
task - The RBSTask object
Returns:
true if task assigned and available at the scope, false otherwise
Throws:
SPIException -  


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
ConsoleOne is a registered trademark of Novell Inc.
Generated December 9 2003 1727.