Interface ResourceSchema

    • Method Detail

      • getObjectTypeDefinitions

        @NotNull
        default @NotNull List<? extends ResourceObjectTypeDefinition> getObjectTypeDefinitions​(@Nullable
                                                                                               @Nullable ShadowKindType kind)
        Returns definitions for all types with given kind. (If null, returns all types.)
      • findObjectDefinition

        @Nullable
        default @Nullable ResourceObjectDefinition findObjectDefinition​(@NotNull
                                                                        @NotNull ShadowKindType kind,
                                                                        @Nullable
                                                                        @Nullable String intent,
                                                                        @Nullable
                                                                        @Nullable QName objectClassName)
        Returns object definition (type or class) matching given kind and intent, and object class. The object class parameter is used to: 1. verify that object type that matches given kind and intent is compatible with (currently: equal to) the object class; 2. provide a complementary means to select a type when intent is not specified. There is a special treatment for: - intent being null: see findObjectDefinitionForKind(ShadowKindType, QName); - (a hack) for ACCOUNT/default: see findDefaultAccountObjectClass() [this may be removed later] The "unknown" values for kind/intent are not supported. The client must know if these are even applicable, or (if they are) how they should be interpreted.
        Throws:
        IllegalStateException - if there are more matching definitions for known kind/intent (we should have checked this when parsing)
        IllegalArgumentException - if "unknown" values are present; or if only the kind is specified, and there's more than one applicable definition for the kind (TODO or should be that ConfigurationException?)
      • findObjectTypeDefinitionForAnyMatchingIntent

        default ResourceObjectTypeDefinition findObjectTypeDefinitionForAnyMatchingIntent​(@NotNull
                                                                                          @NotNull ShadowKindType kind,
                                                                                          @NotNull
                                                                                          @NotNull Collection<String> intents)
                                                                                   throws SchemaException
        Returns object type definition matching given kind and one of the intents. (Or, if no intents are provided, default type for given kind is returned. We are not very eager here - by default we mean just the flag "default" being set. This is in contrast with e.g. findObjectDefinitionForKind(ShadowKindType, QName). But here we won't go into such levels. This is quite a specialized method.) The matching types must be co share at least the object class name. This is checked by this method. However, in practice they must share much more, as described in the description for ResourceObjectAssociationType.getIntent() (see XSD). To be used in special circumstances.
        Throws:
        SchemaException
      • findDefaultObjectTypeDefinition

        @Nullable
        default @Nullable ResourceObjectTypeDefinition findDefaultObjectTypeDefinition​(@NotNull
                                                                                       @NotNull ShadowKindType kind,
                                                                                       @Nullable
                                                                                       @Nullable QName objectClassName)
        Returns the default definition for given kind. The `default` flag must be explicitly set. Object class must match, if it's specified.
      • findDefaultOrAnyObjectTypeDefinition

        @Nullable
        default @Nullable ResourceObjectTypeDefinition findDefaultOrAnyObjectTypeDefinition​(@NotNull
                                                                                            @NotNull ShadowKindType kind)
        Returns the definition for given kind. If default one is present, it is returned. Otherwise, any definition is returned. This is similar to pre-4.5 behavior observed when looking for "refined definitions". (Although not exactly the same: now we require type definition, whereas in 4.4 and before we could return a definition even if no schemaHandling was present.) TODO Determine if this method is really needed.
      • findDefinitionForObjectClass

        @Nullable
        default @Nullable ResourceObjectDefinition findDefinitionForObjectClass​(@NotNull
                                                                                @NotNull QName name)
        Returns a definition for a given object class: - if there's a "default for class" type defined, it is returned (this is a kind of pre-4.5 behavior) - otherwise, the object class definition is returned (if there's any)
      • findObjectClassDefinition

        @Nullable
        default @Nullable ResourceObjectClassDefinition findObjectClassDefinition​(@NotNull
                                                                                  @NotNull QName name)
        Returns object class definition for a given object class name.
      • getObjectClassNames

        @NotNull
        default @NotNull Collection<QName> getObjectClassNames()
        Returns names of all object classes mentioned in the "raw" resource definition.
      • getNamespace

        @NotNull
        default @NotNull String getNamespace()
        Description copied from interface: PrismSchema
        Returns schema namespace. All schema definitions are placed in the returned namespace.
        Specified by:
        getNamespace in interface PrismSchema
        Returns:
        schema namespace
      • isRaw

        default boolean isRaw()
        Returns true if the schema contains no "refined" (type) definitions.