org.xiruss.repository.schema_aware.api
Interface SchemaAwareRepository

All Known Subinterfaces:
XirussRepository, XirussRepositoryServer
All Known Implementing Classes:
MultiUserSchemaAwareRepositoryBase, SchemaAwareRepositoryBase, XirussRepositoryDefaultImpl, XirussRepositoryProxy

public interface SchemaAwareRepository

A repository that manages XSD (or similar) schemas by maintaining a mapping of namespace names to schema instances such that a client can determine what schema document is to be used for a given namespace. Note that these methods are fairly simplistic in that they assume a one-to-one mapping between namespaces and schema docs. In practice, there may be several schema instances that can be used for a given namespace under different circumstances. This suggests that the getSchema methods need to take an optional "discriminator" parameter that lets the repository decide among multiple possible schemas. Since this discrimination is likely to be speicfic to local business rules, this would be an extension point to be handled by specializations, either of SchemaAwareRepository or of some as-yet-defined "SchemaSelector" class (which maybe would be best implemented as a dependency link between versions representing the namespaces themselves and specific schema instances. Hmmm.


Method Summary
 Resource getSchemaResource(java.lang.String schemaUri)
          Returns the resource of the specified schema.
 boolean hasSchema(java.lang.String schemaUri)
          Returns true if the specified schema URI has been registered.
 void registerSchema(java.lang.String namespaceUri, Resource schema)
          Registers a schema URI and its location.
 

Method Detail

registerSchema

void registerSchema(java.lang.String namespaceUri,
                    Resource schema)
Registers a schema URI and its location.

Parameters:
namespaceUri - The URI (namespace name) of the schema, that is, the namespace that this schema governs.
schema - The repository resource for the schema as it exists within the repository.

hasSchema

boolean hasSchema(java.lang.String schemaUri)
Returns true if the specified schema URI has been registered.

Parameters:
schemaUri - The URI (namespace name) of the schema.
Returns:
Returns true if the schema URI has been registered with the repository.

getSchemaResource

Resource getSchemaResource(java.lang.String schemaUri)
Returns the resource of the specified schema.

Parameters:
schemaUri - The schema to get.
Returns:
Returns the resource of the schema or null if the schema is not registered.