Mac Developer Library

Developer

OpenDirectory Framework Reference ODNode Class Reference

Options
Deployment Target:

On This Page
Language:

ODNode

An ODNode object serves as a Cocoa wrapper for an Open Directory node.

Inheritance


Conforms To


Import Statement


Swift

import OpenDirectory

Objective-C

@import OpenDirectory;

Availability


Available in OS X v10.6 and later.
  • Creates a node object with a specified session and name.

    Declaration

    Swift

    init!(session inSession: ODSession!, name inName: String!, error outError: NSErrorPointer)

    Objective-C

    - (instancetype)initWithSession:(ODSession *)inSession name:(NSString *)inName error:(NSError **)outError

    Parameters

    inSession

    The session.

    inName

    The name of the node.

    outError

    An error reference for error details. Can be nil.

    Return Value

    The created node object.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Creates a node object with a specified session and type.

    Declaration

    Swift

    init!(session inSession: ODSession!, type inType: ODNodeType, error outError: NSErrorPointer)

    Objective-C

    - (instancetype)initWithSession:(ODSession *)inSession type:(ODNodeType)inType error:(NSError **)outError

    Parameters

    inSession

    The session.

    inType

    The node type.

    outError

    An error reference for error details. Can be nil.

    Return Value

    The created node object.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

    See Also

    Node_Types

  • Returns an autoreleased node object with a specified session and name.

    Declaration

    Objective-C

    + (instancetype)nodeWithSession:(ODSession *)inSession name:(NSString *)inName error:(NSError **)outError

    Parameters

    inSession

    The session.

    inName

    The name of the node.

    outError

    An error reference for error details. Can be nil.

    Return Value

    The created node object.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Availability

    Available in OS X v10.6 and later.

  • Returns an autoreleased node object with a specified session and type.

    Declaration

    Objective-C

    + (instancetype)nodeWithSession:(ODSession *)inSession type:(ODNodeType)inType error:(NSError **)outError

    Parameters

    inSession

    The session.

    inType

    The node type.

    outError

    An error reference for error details. Can be nil.

    Return Value

    The created node object.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Availability

    Available in OS X v10.6 and later.

    See Also

    Node_Types

  • Returns the result of a custom call to the node.

    Declaration

    Swift

    func customCall(_ inCustomCode: Int, sendData inSendData: NSData!, error outError: NSErrorPointer) -> NSData!

    Objective-C

    - (NSData *)customCall:(NSInteger)inCustomCode sendData:(NSData *)inSendData error:(NSError **)outError

    Parameters

    inCustomCode

    The custom code to send to the node.

    inSendData

    Data required by inCustomCode. Can be nil.

    outError

    An error reference for error details. Can be nil.

    Return Value

    The result of the custom call.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Returns a dictionary containing details about a node.

    Declaration

    Swift

    func nodeDetailsForKeys(_ inKeys: [AnyObject]!, error outError: NSErrorPointer) -> [NSObject : AnyObject]!

    Objective-C

    - (NSDictionary *)nodeDetailsForKeys:(NSArray *)inKeys error:(NSError **)outError

    Parameters

    inKeys

    An array of keys corresponding to the values returned in the dictionary.

    outError

    An error reference for error details. Can be nil.

    Return Value

    A dictionary containing details about the node corresponding to keys specified by inKeys.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • nodeName nodeName Property

    The node’s name. (read-only)

    Declaration

    Swift

    var nodeName: String! { get }

    Objective-C

    @property(nonatomic, readonly, copy) NSString *nodeName

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Returns the names of subnodes for the node.

    Declaration

    Swift

    func subnodeNamesAndReturnError(_ outError: NSErrorPointer) -> [AnyObject]!

    Objective-C

    - (NSArray *)subnodeNamesAndReturnError:(NSError **)outError

    Parameters

    outError

    An error reference for error details. Can be nil.

    Return Value

    An array of subnode names.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Returns an array of the subnodes of a given node that are currently unreachable.

    Declaration

    Swift

    func unreachableSubnodeNamesAndReturnError(_ outError: NSErrorPointer) -> [AnyObject]!

    Objective-C

    - (NSArray *)unreachableSubnodeNamesAndReturnError:(NSError **)outError

    Parameters

    outError

    An error reference for error details. Can be nil.

    Return Value

    An array of unreachable subnodes.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Sets credentials for interacting with the node.

    Declaration

    Swift

    func setCredentialsWithRecordType(_ inRecordType: String!, recordName inRecordName: String!, password inPassword: String!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)setCredentialsWithRecordType:(ODRecordType)inRecordType recordName:(NSString *)inRecordName password:(NSString *)inPassword error:(NSError **)outError

    Parameters

    inRecordType

    The record type that uses the credentials. Can be nil. The default value is kODRecordTypeUsers.

    inRecordName

    The username to use to authenticate with the node.

    inPassword

    The password to use to authenticate with the node.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the credentials are successfully set; otherwise, NOfalse.

    Discussion

    If this function fails, the previous credentials for the node are used.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Sets the credentials for interaction with the node using other types of authentication available to Open Directory.

    Declaration

    Swift

    func setCredentialsWithRecordType(_ inRecordType: String!, authenticationType inType: String!, authenticationItems inItems: [AnyObject]!, continueItems outItems: AutoreleasingUnsafeMutablePointer<NSArray?>, context outContext: AutoreleasingUnsafeMutablePointer<AnyObject?>, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)setCredentialsWithRecordType:(ODRecordType)inRecordType authenticationType:(ODAuthenticationType)inType authenticationItems:(NSArray *)inItems continueItems:(NSArray **)outItems context:(id *)outContext error:(NSError **)outError

    Parameters

    inRecordType

    The record type that uses the credentials. Can be nil. The default value is kODRecordTypeUsers.

    inType

    The authentication type.

    inItems

    An array of NSString or NSData objects to be used in the authentication process.

    outItems

    An array of NSData objects returned from the authentication process, if any are returned; nil otherwise.

    outContext

    The proper context if the authentication attempt requires a context; nil otherwise. If not nil, then more calls must be made with the Context to continue the authentication.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if no error occurs; otherwise, NOfalse.

    Discussion

    If this function fails, the previous credentials for the node are used.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Sets the credentials for interaction with the node using a Kerberos cache.

    Declaration

    Swift

    func setCredentialsUsingKerberosCache(_ inCacheName: String!, error outError: NSErrorPointer) -> Bool

    Objective-C

    - (BOOL)setCredentialsUsingKerberosCache:(NSString *)inCacheName error:(NSError **)outError

    Parameters

    inCacheName

    The name of the Kerberos cache.

    outError

    An error reference for error details. Can be nil.

    Return Value

    YEStrue if the credentials are successfully set; otherwise, NOfalse.

    Discussion

    If this function fails, the previous credentials for the node are used.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Creates a record in a specified node with specified properties.

    Declaration

    Swift

    func createRecordWithRecordType(_ inRecordType: String!, name inRecordName: String!, attributes inAttributes: [NSObject : AnyObject]!, error outError: NSErrorPointer) -> ODRecord!

    Objective-C

    - (ODRecord *)createRecordWithRecordType:(ODRecordType)inRecordType name:(NSString *)inRecordName attributes:(NSDictionary *)inAttributes error:(NSError **)outError

    Parameters

    inRecordType

    The record’s type.

    inRecordName

    The record’s name.

    inAttributes

    A dictionary of key-value pairs representing attributes for the record. Can be nil.

    outError

    An error reference for error details. Can be nil.

    Return Value

    The created record.

    Discussion

    The record is automatically assigned a UUID. This UUID can be overridden if one is specified in inAttributes.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Returns a record from the node with a specified type and name.

    Declaration

    Swift

    func recordWithRecordType(_ inRecordType: String!, name inRecordName: String!, attributes inAttributes: AnyObject!, error outError: NSErrorPointer) -> ODRecord!

    Objective-C

    - (ODRecord *)recordWithRecordType:(ODRecordType)inRecordType name:(NSString *)inRecordName attributes:(id)inAttributes error:(NSError **)outError

    Parameters

    inRecordType

    The type of the record.

    inRecordName

    The name of the record.

    inAttributes

    An array of record attributes to be cached before the record is returned. Can be nil.

    outError

    An error reference for error details. Can be nil.

    Return Value

    The requested record.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Returns an array of attribute types supported by the node’s records.

    Declaration

    Swift

    func supportedAttributesForRecordType(_ inRecordType: String!, error outError: NSErrorPointer) -> [AnyObject]!

    Objective-C

    - (NSArray *)supportedAttributesForRecordType:(ODRecordType)inRecordType error:(NSError **)outError

    Parameters

    inRecordType

    The record type to list supported attribute types for. Can be nil.

    outError

    An error reference for error details. Can be nil.

    Return Value

    An array of supported attribute types.

    Discussion

    If inRecordType is nil, this function returns all attribute types supported by all record types of the node; otherwise, only attribute types specific to inRecordType are returned.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.

  • Returns an array of the record types supported by the node.

    Declaration

    Swift

    func supportedRecordTypesAndReturnError(_ outError: NSErrorPointer) -> [AnyObject]!

    Objective-C

    - (NSArray *)supportedRecordTypesAndReturnError:(NSError **)outError

    Parameters

    outError

    An error reference for error details. Can be nil.

    Return Value

    An array of supported record types.

    Discussion

    If the node does not support checking for supported record types, all possible record types are returned.

    Import Statement

    Objective-C

    @import OpenDirectory;

    Swift

    import OpenDirectory

    Availability

    Available in OS X v10.6 and later.