com.novell.admin.rbs
Class NSModel

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

public class NSModel
extends java.lang.Object

Class of static helper methods to access NDS. Note the following: 1- All get methods return null if the desired information is not present. 2- All set methods remove all previous values and replace them. 3- All functions manipulate the NSObject passed in. IFF the NSObject is null, then the functions read and write directly to NDS.


Constructor Summary
NSModel()
           
 
Method Summary
static void addDN(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, ObjectEntry[] values)
          Adds to the DNs of an attribute the given ObjectEntries
static void addStrings(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, java.lang.String[] values)
          Adds to the strings of a given attribute.
static void addValueComponents(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, ValueComponent[] values)
          Adds the given ValueComponents to a specified attribute.
static void deleteDN(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, ObjectEntry[] values)
          Deletes from the DNs of an attribute the given ObjectEntries
static void deleteStrings(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, java.lang.String[] values)
          Deletes the given strings from a given attribute.
static void deleteValueComponents(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, ValueComponent[] values)
          Deletes the given ValueComponents from the specified attribute.
static java.util.Enumeration getAttribute(ObjectEntry oe, NSObject nsObj, java.lang.String attrName)
          Gets an Enumeration representing the values of an attribute.
static ObjectEntry[] getDN(ObjectEntry oe, NSObject nsObj, java.lang.String attrName)
          Reads the DNs of an attribute and returns the corresponding ObjectEntries.
static java.lang.String[] getStrings(ObjectEntry oe, NSObject nsObj, java.lang.String attrName)
          Gets a String[] representing the values of a specified attribute.
static void makeDNRelation(NSObject aObj, NSObject bObj, java.lang.String aAttrName, java.lang.String bAttrName)
          Given two NSObject and their corresponding attribute names, Puts a in b's attribute, and b in a's attribute.
static void makeTypedNameRelation(NSObject aObj, NSObject bObj, java.lang.String aAttrName, java.lang.String bAttrName, long aLevel, long aInterval, long bLevel, long bInterval)
          Given two NSObject and their corresponding attribute names, Puts a in b's attribute, and b in a's attribute.
static void modifyValueComponents(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, ValueComponent[] newValues, ValueComponent[] oldValues)
          Modifies the given ValueComponents in a specified attribute.
static void removeDNRelation(NSObject aObj, NSObject bObj, java.lang.String aAttrName, java.lang.String bAttrName)
          Given two NSObject and their corresponding attribute names, removes b from a's attribute and a from b's attribute.
static void removeTypedNameRelation(NSObject aObj, NSObject bObj, java.lang.String aAttrName, java.lang.String bAttrName, long aLevel, long aInterval, long bLevel, long bInterval)
          Given two NSObject and their corresponding attribute names, removes b from a's attribute and a from b's attribute.
static void setDN(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, ObjectEntry[] values)
          Sets the DNs of an attribute to the given ObjectEntries
static void setStrings(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, java.lang.String[] values)
          Sets the strings of a given attribute.
static void setValueComponents(ObjectEntry oe, NSObject nsObj, java.lang.String attrName, ValueComponent[] values)
          Sets a specified attribute to contain the given ValueComponents as its values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NSModel

public NSModel()
Method Detail

getAttribute

public static java.util.Enumeration getAttribute(ObjectEntry oe,
                                                 NSObject nsObj,
                                                 java.lang.String attrName)
                                          throws SPIException
Gets an Enumeration representing the values of an attribute.
Parameters:
oe - The ObjectEntry to get values from if nsObj is null
nsObj - The NSObject to read the data from.
attrName - The desired attribute name to read
Returns:
Enumeration of ValueComponents
Throws:
SPIException -  

setValueComponents

public static void setValueComponents(ObjectEntry oe,
                                      NSObject nsObj,
                                      java.lang.String attrName,
                                      ValueComponent[] values)
                               throws NamespaceException,
                                      SPIException,
                                      SnapinVetoException
Sets a specified attribute to contain the given ValueComponents as its values.
Parameters:
oe - The ObjectEntry to set values to if nsObj is null
nsObj - The NSObject to set the data to.
attrName - The desired attribute name
values - The ValueComponent[] containing the values
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.ComponentCreationException -  

addValueComponents

public static void addValueComponents(ObjectEntry oe,
                                      NSObject nsObj,
                                      java.lang.String attrName,
                                      ValueComponent[] values)
                               throws SPIException,
                                      NamespaceException,
                                      SnapinVetoException
Adds the given ValueComponents to a specified attribute.
Parameters:
oe - The ObjectEntry to add values to if nsObj is null
nsObj - The NSObject to add the data to.
attrName - The desired attribute name
values - The ValueComponent[] containing the values
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.SnapinVetoException -  

deleteValueComponents

public static void deleteValueComponents(ObjectEntry oe,
                                         NSObject nsObj,
                                         java.lang.String attrName,
                                         ValueComponent[] values)
                                  throws SPIException
Deletes the given ValueComponents from the specified attribute.
Parameters:
oe - The ObjectEntry to delete values from if nsObj is null
nsObj - The NSObject to delete the data from.
attrName - The desired attribute name
values - The ValueComponent[] containing the values
Throws:
SPIException -  

modifyValueComponents

public static void modifyValueComponents(ObjectEntry oe,
                                         NSObject nsObj,
                                         java.lang.String attrName,
                                         ValueComponent[] newValues,
                                         ValueComponent[] oldValues)
                                  throws SPIException,
                                         NamespaceException
Modifies the given ValueComponents in a specified attribute.
Parameters:
oe - The ObjectEntry to modify if nsObj is null
nsObj - The NSObject to modify
attrName - The desired attribute name
newValues - The ValueComponent[] containing the new values
oldValues - The ValueComponent[] containing the old values
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  

getStrings

public static java.lang.String[] getStrings(ObjectEntry oe,
                                            NSObject nsObj,
                                            java.lang.String attrName)
                                     throws SPIException
Gets a String[] representing the values of a specified attribute.
Parameters:
oe - The ObjectEntry to read if nsObj is null
nsObj - The NSObject to read the data from
attrName - The desired attribute name
Returns:
The String[] of the values
Throws:
SPIException -  

setStrings

public static void setStrings(ObjectEntry oe,
                              NSObject nsObj,
                              java.lang.String attrName,
                              java.lang.String[] values)
                       throws SPIException,
                              NamespaceException,
                              ComponentCreationException,
                              SnapinVetoException
Sets the strings of a given attribute. Can be used for all String syntaxes
Parameters:
oe - The ObjectEntry to set values to if nsObj is null
nsObj - The NSObject to set the data to.
attrName - The desired attribute name
values - The String[] containing the values
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.SnapinVetoException -  

addStrings

public static void addStrings(ObjectEntry oe,
                              NSObject nsObj,
                              java.lang.String attrName,
                              java.lang.String[] values)
                       throws SPIException,
                              NamespaceException,
                              ComponentCreationException,
                              SnapinVetoException
Adds to the strings of a given attribute. Can be used for all String syntaxes
Parameters:
oe - The ObjectEntry to add values to if nsObj is null
nsObj - The NSObject to add the data to.
attrName - The desired attribute name
values - The String[] containing the values
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.SnapinVetoException -  

deleteStrings

public static void deleteStrings(ObjectEntry oe,
                                 NSObject nsObj,
                                 java.lang.String attrName,
                                 java.lang.String[] values)
                          throws SPIException,
                                 NamespaceException,
                                 ComponentCreationException,
                                 SnapinVetoException
Deletes the given strings from a given attribute. Can be used for all String syntaxes
Parameters:
oe - The ObjectEntry to use if nsObj is null
nsObj - The NSObject to use
attrName - The desired attribute name
values - The String[] containing the values
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.SnapinVetoException -  

getDN

public static ObjectEntry[] getDN(ObjectEntry oe,
                                  NSObject nsObj,
                                  java.lang.String attrName)
                           throws SPIException
Reads the DNs of an attribute and returns the corresponding ObjectEntries.
Parameters:
oe - The ObjectEntry to read if nsObj is null
nsObj - The NSObject to read
attrName - The desired attribute name
Throws:
SPIException -  

setDN

public static void setDN(ObjectEntry oe,
                         NSObject nsObj,
                         java.lang.String attrName,
                         ObjectEntry[] values)
                  throws SPIException,
                         NamespaceException,
                         SnapinVetoException,
                         ComponentCreationException
Sets the DNs of an attribute to the given ObjectEntries
Parameters:
oe - The ObjectEntry to read if nsObj is null
nsObj - The NSObject to read
attrName - The desired attribute name
values - The values to set
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.ComponentCreationException -  
com.novell.admin.common.exceptions.SnapinVetoException -  

addDN

public static void addDN(ObjectEntry oe,
                         NSObject nsObj,
                         java.lang.String attrName,
                         ObjectEntry[] values)
                  throws NamespaceException,
                         SPIException,
                         SnapinVetoException,
                         ComponentCreationException
Adds to the DNs of an attribute the given ObjectEntries
Parameters:
oe - The ObjectEntry to use if nsObj is null
nsObj - The NSObject to use
attrName - The desired attribute name
values - The values to set
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.SnapinVetoException -  

deleteDN

public static void deleteDN(ObjectEntry oe,
                            NSObject nsObj,
                            java.lang.String attrName,
                            ObjectEntry[] values)
                     throws SPIException,
                            SnapinVetoException,
                            ComponentCreationException
Deletes from the DNs of an attribute the given ObjectEntries
Parameters:
oe - The ObjectEntry to use if nsObj is null
nsObj - The NSObject to use
attrName - The desired attribute name
values - The values to delete
Throws:
SPIException -  
com.novell.admin.common.exceptions.SnapinVetoException -  

makeDNRelation

public static void makeDNRelation(NSObject aObj,
                                  NSObject bObj,
                                  java.lang.String aAttrName,
                                  java.lang.String bAttrName)
                           throws SPIException,
                                  NamespaceException,
                                  ComponentCreationException
Given two NSObject and their corresponding attribute names, Puts a in b's attribute, and b in a's attribute. Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
aObj - The NSObject for a.
bObj - The NSObject for b.
aAttrName - String for attribute name for a
bAttrName - String for attribute name for b
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.ComponentCreationException -  

removeDNRelation

public static void removeDNRelation(NSObject aObj,
                                    NSObject bObj,
                                    java.lang.String aAttrName,
                                    java.lang.String bAttrName)
                             throws SPIException,
                                    NamespaceException,
                                    ComponentCreationException
Given two NSObject and their corresponding attribute names, removes b from a's attribute and a from b's attribute. Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
aObj - The NSObject for a.
bObj - The NSObject for b.
aAttrName - String for attribute name for a
bAttrName - String for attribute name for b
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.ComponentCreationException -  

makeTypedNameRelation

public static void makeTypedNameRelation(NSObject aObj,
                                         NSObject bObj,
                                         java.lang.String aAttrName,
                                         java.lang.String bAttrName,
                                         long aLevel,
                                         long aInterval,
                                         long bLevel,
                                         long bInterval)
                                  throws SPIException,
                                         NamespaceException,
                                         ComponentCreationException
Given two NSObject and their corresponding attribute names, Puts a in b's attribute, and b in a's attribute. Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
aObj - The NSObject for a.
bObj - The NSObject for b.
aAttrName - String for attribute name for a
bAttrName - String for attribute name for b
aLevel - long representing object a's level
aInterval - long representing object a's interval
bLevel - long representing object b's level
bInterval - long representing object b's interval
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.ComponentCreationException -  

removeTypedNameRelation

public static void removeTypedNameRelation(NSObject aObj,
                                           NSObject bObj,
                                           java.lang.String aAttrName,
                                           java.lang.String bAttrName,
                                           long aLevel,
                                           long aInterval,
                                           long bLevel,
                                           long bInterval)
                                    throws SPIException,
                                           NamespaceException,
                                           ComponentCreationException
Given two NSObject and their corresponding attribute names, removes b from a's attribute and a from b's attribute. Note that this does NOT write to NDS, it writes to the NSObject, the caller is responsible for updating the NSObjects.
Parameters:
aObj - The NSObject for a.
bObj - The NSObject for b.
aAttrName - String for attribute name for a
bAttrName - String for attribute name for b
aLevel - long representing object a's level
aInterval - long representing object a's interval
bLevel - long representing object b's level
bInterval - long representing object b's interval
Throws:
SPIException -  
com.novell.admin.common.exceptions.NamespaceException -  
com.novell.admin.common.exceptions.ComponentCreationException -  


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