this repo has no description
1/*
2 * Copyright (c) 2012 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#import <Foundation/Foundation.h>
25
26NS_CLASS_AVAILABLE(10_9, NA)
27@interface ODAttributeMap : NSObject {
28 @protected
29 NSString *customQueryFunction;
30 NSString *customTranslationFunction;
31 NSArray *customAttributes;
32 NSString *value;
33}
34
35/*
36 * Custom functions are in the format of:
37 * "<module>:<function>"
38 *
39 * Example: "ldap:query_attribute"
40 */
41
42/* Custom function to be used when querying the attribute */
43@property(copy) NSString *customQueryFunction NS_AVAILABLE_MAC(10_9);
44
45/* Custom function to be used when translating the result for the client */
46@property(copy) NSString *customTranslationFunction NS_AVAILABLE_MAC(10_9);
47
48/* Attributes required for the custom functions */
49@property(copy) NSArray *customAttributes NS_AVAILABLE_MAC(10_9);
50
51/* The value used for the mapping. Static, variable substitution and native are all represented */
52@property(copy) NSString *value NS_AVAILABLE_MAC(10_9);
53
54/*!
55 * @method attributeMapWithValue:
56 *
57 * @abstract
58 * Returns an initialized and autoreleased ODAttributeMap object with the given value mapped.
59 *
60 * @discussion
61 * Returns an initialized and autoreleased ODAttributeMap object with the given value mapped.
62 */
63+ (instancetype)attributeMapWithValue:(NSString *)value;
64
65/*!
66 * @method attributeMapWithStaticValue:
67 *
68 * @abstract
69 * Returns an initialized and autoreleased ODAttributeMap object with the given static value.
70 *
71 * @discussion
72 * Returns an initialized and autoreleased ODAttributeMap object with the given static value.
73 */
74+ (instancetype)attributeMapWithStaticValue:(NSString *)staticValue;
75
76/*!
77 * @method setStaticValue:
78 *
79 * @abstract
80 * Sets a static value that will always be returned for this mapping.
81 *
82 * @discussion
83 * Sets a static value that will always be returned for this mapping, i.e., "20".
84 */
85- (void)setStaticValue:(NSString *)staticValue NS_AVAILABLE_MAC(10_9);
86
87/*!
88 * @method setVariableSubstitution:
89 *
90 * @abstract
91 * Sets a variable substitution-based value.
92 *
93 * @discussion
94 * Value should be using the syntax '$native$' for all substited values. For example,
95 * to form a home directory using the "cn" of an LDAP record, substitution could be done
96 * with "/home/$cn$".
97 */
98- (void)setVariableSubstitution:(NSString *)variableSubstitution NS_AVAILABLE_MAC(10_9);
99
100@end