1 /*
2 * Copyright 2014 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.apache.juddi.validation.vsv;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 /**
22 * There are several value sets in UDDI that have entity keys as valid values,
23 * and other such value sets may be defined. Special handling of the keyValue
24 * values is required for these value sets to ensure that they can be used by
25 * applications using any version of the UDDI API. By categorizing a value set
26 * with this tModel the publisher of the value set indicates that entity keys
27 * form the valid values of the value set. This allows a UDDI implementation to
28 * map entity keys between versions as is done with all other uses of entity
29 * keys.
30 *
31 * If keys of only one type are valid for a particular value set, then that
32 * value set should have a single keyedReference relating to this tModel and the
33 * keyValue should contain the type of entity key that is valid, for example
34 * "tModelKey". If multiple types of key are valid, as in the case of
35 * uddi-org:isReplacedBy, then multiple keyedReferences can be used, one for
36 * each type of key. If any type of key is valid then a single keyedReference
37 * should be used with a keyValue of "entityKey".
38 *
39 * A value set categorized with this tModel SHOULD be treated as an internally
40 * checked value set, whether or not it is also categorized as checked.
41 *
42 * If the entity key supplied as the keyValue in a keyedReference relating to
43 * such a value set is not a valid entity key, or is the key of an entity of a
44 * type not supported by the particular value set, then the error E_invalidValue
45 * MAY be returned.
46 *
47 * Value sets may require additional validation, and this additional validation
48 * MAY be performed before or after the validation of the key itself, therefore
49 * a different error MAY be returned if one of these additional validation steps
50 * fails before the validation of the key itself.
51 *
52 * If an entityKeyValue value set is updated to remove all of the keyedReference
53 * elements referring to the "Entity Key Values" category system, a normative
54 * mapping behavior to update the keyValue of any existing references to the
55 * entityKeyValue value set is unspecified. Any new references or updates to
56 * existing references using keyedReference elements pointing to the tModel that
57 * formerly represented the entityKeyValue value set will be treated as a normal
58 * value set, where the keyValue is a string. *
59 * Further, if a tModel is updated to add at least one keyedReference element
60 * referring to the "Entity Key Values" category system, a normative mapping
61 * behavior to update the keyValue of any existing references to the
62 * entityKeyValue value set is unspecified. Any new references or updates to
63 * existing references using keyedReference elements pointing to the tModel that
64 * formerly represented the value set will be case folded and validated as an
65 * entityKeyValue value set, where the keyValue is verified to be an existing
66 * and appropriate entityKey. *
67 * In inquiry, the treatment of the keyValue is determined by the state of the
68 * value set tModel at the time of the inquiry. If the keyValue in an inquiry is
69 * contained in a keyedReference referring to the "Entity Key Value" set tModel,
70 * the keyValue must be case folded as part of the inquiry.
71 *
72 * @author Alex O'Ree
73 */
74 public class Uddiuddiorgcategorizationentitykeyvalues extends AbstractSimpleValidator {
75
76 @Override
77 public List<String> getValidValues() {
78 List<String> ret = new ArrayList<String>();
79 ret.add("entityKey");
80 ret.add("businessKey");
81 ret.add("tModelKey");
82 ret.add("serviceKey");
83 ret.add("bindingKey");
84 ret.add("subscriptionKey");
85 return ret;
86 }
87
88 @Override
89 public String getMyKey() {
90 return "uddi:uddi.org:categorization:entitykeyvalues";
91 }
92
93 }