Class WsdlManager
- java.lang.Object
-
- org.wso2.carbon.governance.api.wsdls.WsdlManager
-
public class WsdlManager extends Object
This provides the management functionality for WSDL artifacts stored on the registry.
-
-
Constructor Summary
Constructors Constructor Description WsdlManager(org.wso2.carbon.registry.core.Registry registry)Constructor accepting an instance of the registry to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWsdl(Wsdl wsdl)Adds the given WSDL artifact to the registry.Wsdl[]findWsdls(WsdlFilter criteria)Finds all WSDL artifacts matching the given filter criteria.Wsdl[]getAllWsdls()Finds all WSDL artifacts on the registry.WsdlgetWsdl(String wsdlId)Fetches the given WSDL artifact on the registry.WsdlnewWsdl(byte[] content)Create a new WSDL based on content either embedded or passed to a service.WsdlnewWsdl(byte[] content, String name)Create a new WSDL based on content either embedded or passed to a service.WsdlnewWsdl(String url)Adds a new WSDL artifact from the given URL.voidremoveWsdl(String wsdlId)Removes the given WSDL artifact from the registry.protected voidsetContent(Wsdl wsdl, org.wso2.carbon.registry.core.Resource wsdlResource)Sets content of the given WSDL artifact to the given resource on the registry.voidupdateWsdl(Wsdl wsdl)Updates the given WSDL artifact on the registry.
-
-
-
Method Detail
-
newWsdl
public Wsdl newWsdl(String url) throws GovernanceException
Adds a new WSDL artifact from the given URL.- Parameters:
url- the given URL.- Returns:
- the artifact added.
- Throws:
GovernanceException- if the operation failed.
-
newWsdl
public Wsdl newWsdl(byte[] content) throws org.wso2.carbon.registry.core.exceptions.RegistryException
Create a new WSDL based on content either embedded or passed to a service.- Parameters:
content- the WSDL content- Returns:
- the artifact added.
- Throws:
GovernanceException- if the operation failed.org.wso2.carbon.registry.core.exceptions.RegistryException
-
newWsdl
public Wsdl newWsdl(byte[] content, String name) throws org.wso2.carbon.registry.core.exceptions.RegistryException
Create a new WSDL based on content either embedded or passed to a service.- Parameters:
content- the WSDL contentname- the WSDL name- Returns:
- the artifact added.
- Throws:
GovernanceException- if the operation failed.org.wso2.carbon.registry.core.exceptions.RegistryException
-
addWsdl
public void addWsdl(Wsdl wsdl) throws GovernanceException
Adds the given WSDL artifact to the registry. Please do not use this method to update an existing artifact use the update method instead. If this method is used to update an existing artifact, all existing properties (such as lifecycle details) will be removed from the existing artifact.- Parameters:
wsdl- the WSDL artifact.- Throws:
GovernanceException- if the operation failed.
-
updateWsdl
public void updateWsdl(Wsdl wsdl) throws GovernanceException
Updates the given WSDL artifact on the registry.- Parameters:
wsdl- the WSDL artifact.- Throws:
GovernanceException- if the operation failed.
-
getWsdl
public Wsdl getWsdl(String wsdlId) throws GovernanceException
Fetches the given WSDL artifact on the registry.- Parameters:
wsdlId- the identifier of the WSDL artifact.- Returns:
- the WSDL artifact.
- Throws:
GovernanceException- if the operation failed.
-
removeWsdl
public void removeWsdl(String wsdlId) throws GovernanceException
Removes the given WSDL artifact from the registry.- Parameters:
wsdlId- the identifier of the WSDL artifact.- Throws:
GovernanceException- if the operation failed.
-
setContent
protected void setContent(Wsdl wsdl, org.wso2.carbon.registry.core.Resource wsdlResource) throws GovernanceException
Sets content of the given WSDL artifact to the given resource on the registry.- Parameters:
wsdl- the WSDL artifact.wsdlResource- the content resource.- Throws:
GovernanceException- if the operation failed.
-
findWsdls
public Wsdl[] findWsdls(WsdlFilter criteria) throws GovernanceException
Finds all WSDL artifacts matching the given filter criteria.- Parameters:
criteria- the filter criteria to be matched.- Returns:
- the WSDL artifacts that match.
- Throws:
GovernanceException- if the operation failed.
-
getAllWsdls
public Wsdl[] getAllWsdls() throws GovernanceException
Finds all WSDL artifacts on the registry.- Returns:
- all WSDL artifacts on the registry.
- Throws:
GovernanceException- if the operation failed.
-
-