public class SchemaManager extends Object
Constructor and Description |
---|
SchemaManager(org.wso2.carbon.registry.core.Registry registry)
Constructor accepting an instance of the registry to use.
|
Modifier and Type | Method and Description |
---|---|
void |
addSchema(Schema schema)
Adds the given schema artifact to the registry.
|
Schema[] |
findSchemas(SchemaFilter criteria)
Finds all schema artifacts matching the given filter criteria.
|
Schema[] |
getAllSchemas()
Finds all schema artifacts on the registry.
|
Schema |
getSchema(String schemaId)
Fetches the given schema artifact on the registry.
|
Schema |
newSchema(byte[] content)
Create a new Schema based on content either embedded or passed to a service.
|
Schema |
newSchema(byte[] content,
String name)
Create a new Schema based on content either embedded or passed to a service.
|
Schema |
newSchema(String url)
Creates a new schema artifact from the given URL.
|
void |
removeSchema(String schemaId)
Removes the given schema artifact from the registry.
|
protected void |
setContent(Schema schema,
org.wso2.carbon.registry.core.Resource schemaResource)
Sets content of the given schema artifact to the given resource on the
registry.
|
void |
updateSchema(Schema schema)
Updates the given schema artifact on the registry.
|
public SchemaManager(org.wso2.carbon.registry.core.Registry registry)
registry
- the instance of the registry.public Schema newSchema(String url) throws GovernanceException
url
- the given URL.GovernanceException
- if the operation failed.public Schema newSchema(byte[] content) throws org.wso2.carbon.registry.core.exceptions.RegistryException
content
- the schema contentGovernanceException
- if the operation failed.org.wso2.carbon.registry.core.exceptions.RegistryException
public Schema newSchema(byte[] content, String name) throws org.wso2.carbon.registry.core.exceptions.RegistryException
content
- the schema contentname
- the schema nameGovernanceException
- if the operation failed.org.wso2.carbon.registry.core.exceptions.RegistryException
public void addSchema(Schema schema) throws GovernanceException
schema
- the schema artifact.GovernanceException
- if the operation failed.public void updateSchema(Schema schema) throws GovernanceException
schema
- the schema artifact.GovernanceException
- if the operation failed.public Schema getSchema(String schemaId) throws GovernanceException
schemaId
- the identifier of the schema artifact.GovernanceException
- if the operation failed.public void removeSchema(String schemaId) throws GovernanceException
schemaId
- the identifier of the schema artifact.GovernanceException
- if the operation failed.protected void setContent(Schema schema, org.wso2.carbon.registry.core.Resource schemaResource) throws GovernanceException
schema
- the schema artifact.schemaResource
- the content resource.GovernanceException
- if the operation failed.public Schema[] findSchemas(SchemaFilter criteria) throws GovernanceException
criteria
- the filter criteria to be matched.GovernanceException
- if the operation failed.public Schema[] getAllSchemas() throws GovernanceException
GovernanceException
- if the operation failed.Copyright © 2015 WSO2. All Rights Reserved.