ServiceSchema.java revision 465cbeb237a572b2165a1f55cfad77a6b6518883
299N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 299N/A * Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved 299N/A * The contents of this file are subject to the terms 299N/A * of the Common Development and Distribution License 299N/A * (the License). You may not use this file except in 6982N/A * compliance with the License. 299N/A * You can obtain a copy of the License at 299N/A * See the License for the specific language governing 6982N/A * permission and limitations under the License. 6982N/A * When distributing Covered Code, include this CDDL 6982N/A * Header Notice in each file and include the License file 299N/A * If applicable, add the following below the CDDL Header, 299N/A * with the fields enclosed by brackets [] replaced by 299N/A * your own identifying information: 299N/A * "Portions Copyrighted [year] [name of copyright owner]" 299N/A * Portions Copyrighted 2011-2016 ForgeRock AS. 299N/A * The class <code>ServiceSchema</code> provides interfaces to manage the 299N/A * schema information of a service. The schema for a service can be one of the 299N/A * following types: GLOBAL, ORGANIZATION, DYNAMIC, USER, and POLICY. 299N/A // Pointer to service's schema manager & type * Default constructor (private). * Returns the name of the service. * @return the name of the schema * Returns the version of the service. * @return version of the service schema * Returns the name of the schema. * @return the name of the schema * Returns the schema type. * @return the schema type. * Returns the I18N key that points to the description of the service. * @return the I18N key that points to the description of the service * Returns <code>true</code> if service schema supports multiple * configurations; <code>false</code> otherwise * @return <code>true</code> if service schema supports multiple * configurations; <code>false</code> otherwise * Sets the value of the I18N key in the service schema. * Value to be set for the I18N key of the service schema. * if there is a problem setting the value in the data store. * If the user has an invalid SSO token. * Set the value of inheritance attribute in service schema. * New value of inheritance attribute. * if there is a problem setting the value in the data store. * if the user has an invalid single sign on token. "sms-invalid-inheritance-value",
arg);
* Returns the view bean URL for this service * @return file name that contains I18N messages * Returns the name of the status attribute, as defined in the Service * @return String name of status attribute * Returns <code>true</code> if the service configuration created can be * exported to other organizations. * @return <code>true</code> if service configurations for this schema can * be exported to other organizations; <code>false</code> * Sets the exportable nature of the service configurations created for this * schema. Setting it to <code>true</code> allows the configurations to be * exported to other organizations and a value of <code>false</code> * disables exporting of configuration data. * <code>true</code> if service configurations for this schema * can be exported to other organizations; <code>false</code> * Returns the I18N properties file name for the service schema. * @return the I18N properties file name for the service schema * Sets the I18N properties file name for the service schema * if an error occurred while trying to perform the operation * if the single sign on token is invalid or expired * Returns the name for the service schema when used in a CREST representation. * Should this service schema be hidden in the Configuration UI. * @return True if it should be hidden. * During the creation of a new organisation/realm the services assigned to the parent realm are copied to the * child realm. This will include the sub configs for that service, which in some cases are realm specific and will * fail validation if copied. The schemas of these sub configs should set {@code realmCloneable} to {@code no} to * @return {@code true} if the config is cloneable between realms. * Sets the CREST resource name for the service schema. * if an error occurred while trying to perform the operation * if the single sign on token is invalid or expired * Returns the names of the schema attributes defined for the service. It * does not return the schema attributes defined for the sub-schema. * @return the names of schema attributes defined for the service * Returns the names of the schema attributes defined for the service which * are searchable. It does not return the schema attributes defined for the * @return the names of schema attributes defined for the service which are * Returns the schema for an attribute given the name of the attribute, * defined for this service. It returns only the attribute schema defined at * the top level for the service and not from the sub-schema. * the name of the schema attribute * @return the schema for the attribute * Returns the attribute schemas defined for the service. It does not return * the schema attributes defined for the sub-schema. * @return attribute schemas defined for the service * Returns the attribute schemas defined for the service that is not a * status attribute and is not a service attribute. It does not return the * schema attributes defined for the sub-schema. * @return attribute schemas defined for the service * Validates the <code>attrMap</code> against the attributes defined in * this schema of the service. It will throw an exception if the map * contains any attribute not listed in the schema. It will also pick up * default values for any attributes not in the map but which are listed in * the schema, if the boolean <Code>inherit</Code> is set to true. * if true, then inherit the default values * @return Map of validated attributes with default values * if invalid attribute names are present in the * Validates the <code>attrMap</code> against the attributes defined in * this schema of the service for the given organization. It will throw an * exception if the map contains any attribute not listed in the schema. It * will also pick up default values for any attributes not in the map but * which are listed in the schema, if the boolean <Code>inherit</Code> is * if true, then inherit the default values * @return Map of validated attributes with default values * if invalid attribute names are present in the // This attribute is not listed in the service. "services_validator_invalid_attr_name",
null);
// If orgName is not null, populate the envMap // Inherit default values of this attribute, if // A required attribute is being deleted debug.
error(
"ServiceSchema.validateAndInheritDefaults: " +
attr +
" is a required attribute and cannot" "sms-required-attribute-delete",
args);
// validate the attribute against Schema * Adds the attribute schema to this service. The schema is defined in XML * input stream that follows the SMS DTD. * the XML format of the attribute schema * if an error occurred while performing the operation * if the single sign on token is invalid or expired // Check if attribute exists "sms-attributeschema-already-exists",
args));
* Removes the attribute schema from this service. * the name of the attribute schema * if an error occurred while performing the operation * if the single sign on token is invalid or expired * Returns a map of all the attribute and their default values in this * @return Map of Attribute Names and Sets of their default values as * Returns a map of all the attribute and their example values in this * @return Map of Attribute Names and Sets of their example values as * Returns an unmodifiable map of all the attribute and their default values * @return Map of Attribute Names and Sets of their default values as * Method to change the default values of attributes in the schema. * A map of the names of <code>AttributeSchema</code> to * modify, and a Set of Values which should replace the default * values of the current schema. * if an error occurred while performing the operation * if the single sign on token is invalid or expired // Get a copy of the XML document "sms-invalid-attr-name",
args));
* Method to change default value for a specific attribute. * Name of the attribute for which defaults values need to be * Set of new values to replace the old ones. * @throws SchemaException * if an error occurred while parsing the XML * if an error occurred while performing the operation * if the single sign on token is invalid or expired "sms-invalid-attr-name",
args));
* Removes the default values of attributes in the schema. * A set of the names of <code>AttributeSchema</code>. * if an error occurred while performing the operation * if the single sign on token is invalid or expired * Returns the names of sub-schemas for the service. * @return the names of service's sub-schemas * Returns <code>ServiceSchema</code> object given the name of the * the name of the service's sub-schema * @return <code>ServiceSchema</code> object * if an error occurred while performing the operation * Adds the service's sub-schema given the XML input stream that follows the * the XML format of the sub-schema * if an error occurred while performing the operation * if the single sign on token is invalid or expired // Check if attribute exists "sms-subschema-already-exists",
args));
* Removes the service's sub-schema from the service. * the name of the service's sub-schema * if an error occurred while performing the operation * if the single sign on token is invalid or expired * Determines whether each attribute in the attribute set is valid. Iterates * though the set checking each element to see if there is a validator that * the <code>Map</code> where key is the attribute name and * value is the <code>Set</code> of attribute values * @return true if all attributes are valid * if an error occurred while performing the operation * Determines whether each attribute in the attribute set is valid for the * given organization. Iterates though the set checking each element to see * if there is a validator that needs to execute. * the <code>Map</code> where key is the attribute name and * value is the <code>Set</code> of attribute values * @return true if all attributes are valid * if an error occurred while performing the operation * Returns string representation of the schema. * @return string representation of the schema. * Returns the Node of this schema element. Used by Policy component's * <code>ServiceType</code> to get <code>ActionSchema</code>. * @return the Node of this schema element. Used by Policy component's * <code>ServiceType</code> to get <code>ActionSchema</code>. debug.
error(
"ServiceSchema::getSchemaNode: invalid schema");
* Removes the attribute schema from this service. * the name of the attribute schema * if an error occurred while performing the operation * if the single sign on token is invalid or expired //In this case we've found an entry that is not an AttributeSchema, so this is definitely an //element before which we can place a SubSchema. (i.e. the found element was a SubSchema or //an OrganizationAttributeSchema). Note that this will change the order of the SubSchema //elements in the service description, however the order should not matter for SMS. // ----------------------------------------------------------- // ----------------------------------------------------------- debug.
message(
"ServiceSchema::replaceChildNode called for: " debug.
message(
"ServiceSchema::replaceChildNode failed to retrieve service schema for : " // ----------------------------------------------------------- // Method to obtain schema node // ----------------------------------------------------------- // Get the schema type node // Walk the component name // OrganizationAttributeSchema // ----------------------------------------------------------- // Method to obtain organizationattributeschema node // ----------------------------------------------------------- "sms-invalid-orgattr-schema-document",
null));