本文整理汇总了Java中org.wso2.carbon.registry.core.exceptions.RegistryException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java RegistryException.getMessage方法的具体用法?Java RegistryException.getMessage怎么用?Java RegistryException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.wso2.carbon.registry.core.exceptions.RegistryException
的用法示例。
在下文中一共展示了RegistryException.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invokeAction
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
/**
* Invoke lifecycle action
*
* @param action lifecycle action tobe invoked
* @param parameters extra parameters needed when promoting
* @param aspectName aspect name of which the action need to be invoked
* @throws org.wso2.carbon.governance.api.exception.GovernanceException
* throws if the operation failed.
*/
public void invokeAction(String action, Map<String, String> parameters, String aspectName) throws GovernanceException {
Resource artifactResource = getArtifactResource();
CheckListItemBean[] checkListItemBeans = GovernanceUtils.getAllCheckListItemBeans(artifactResource, this, aspectName);
try {
if (checkListItemBeans != null) {
for (CheckListItemBean checkListItemBean : checkListItemBeans) {
parameters.put(checkListItemBean.getOrder() + ".item", checkListItemBean.getValue().toString());
}
}
registry.invokeAspect(getArtifactPath(), aspectName, action, parameters);
} catch (RegistryException e) {
String msg = "Invoking lifecycle action \"" + action + "\" failed. " + e.getMessage();
log.error(msg, e);
throw new GovernanceException(e.getMessage(), e);
}
}
示例2: setTaskMetadataProp
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
@Override
public void setTaskMetadataProp(String taskName, String key, String value) throws TaskException {
try {
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(
MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true);
Resource res = this.getTaskMetadataPropResource(taskName);
res.setProperty(key, value);
getRegistry().put(res.getPath(), res);
} catch (RegistryException e) {
throw new TaskException("Error in setting task metadata properties: " + e.getMessage(),
Code.UNKNOWN, e);
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
示例3: spool
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
public void spool(OutputContext outputContext) throws IOException {
try {
if (exists()) {
if (!isCollection()) {
final InputStream in = getUnderLineResource().getContentStream();
final OutputStream out = outputContext.getOutputStream();
if (null != out) {
byte[] buf = new byte[1024];
int read;
while ((read = in.read(buf)) >= 0) {
out.write(buf, 0, read);
}
}
}
} else {
throw new IOException("Resource " + path + " does not exists");
}
} catch (RegistryException e) {
throw new IOException("Error writing resource " + path + ":" + e.getMessage());
}
}
示例4: getDirectArtifactPath
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
/**
* Method to obtain the artifact path of a governance artifact on the registry.
* without going through the UUID cache
*
* @param registry the registry instance.
* @param artifactId the identifier of the artifact.
* @return the artifact path.
* @throws GovernanceException if the operation failed.
* TODO: This method is added since UUID cache cannot be properly implemented without proper
* TODO: changes in the registry core. getArtifactPath needs to be moved into the registry core
* TODO: and UUID caching should be handled by the cacheBackedRegistry and cachingHandler
*/
public static String getDirectArtifactPath(Registry registry, String artifactId)
throws GovernanceException {
try {
String sql = "SELECT REG_PATH_ID, REG_NAME FROM REG_RESOURCE WHERE REG_UUID = ?";
String[] result;
Map<String, String> parameter = new HashMap<String, String>();
parameter.put("1", artifactId);
parameter.put("query", sql);
result = registry.executeQuery(null, parameter).getChildren();
if (result != null && result.length == 1) {
return result[0];
}
return null;
} catch (RegistryException e) {
String msg = "Error in getting the path from the registry. Execute query failed with message : "
+ e.getMessage();
log.error(msg, e);
throw new GovernanceException(msg, e);
}
}
示例5: process
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
public static void process(String pathToDelete, UserRegistry registry) throws Exception {
try {
if (RegistryConstants.ROOT_PATH.equals(pathToDelete) ||
RegistryConstants.SYSTEM_COLLECTION_BASE_PATH.equals(pathToDelete) ||
RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH.equals(pathToDelete) ||
RegistryConstants.CONFIG_REGISTRY_BASE_PATH.equals(pathToDelete) ||
RegistryConstants.LOCAL_REPOSITORY_BASE_PATH.equals(pathToDelete)) {
throw new RegistryException("Unable to delete system collection at " + pathToDelete
+ ".");
}
registry.delete(pathToDelete);
} catch (RegistryException e) {
String msg = "Failed to delete " + pathToDelete + ". " + ((e.getCause() instanceof SQLException) ?
"" : e.getMessage());
log.error(msg, e);
throw new RegistryException(msg, e);
}
}
示例6: find
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
/**
* Search all meta data instances of this particular type with the given search attributes
*
* @param criteria Key value map that has search attributes
* @return
*/
protected static List<Base> find(Registry registry, Map<String, String> criteria, String mt) throws MetadataException {
BaseProvider provider = Util.getBaseProvider(mt);
if (criteria != null && criteria.get(Constants.ATTRIBUTE_MEDIA_TYPE) == null) {
criteria.put(Constants.ATTRIBUTE_MEDIA_TYPE, mt);
}
List<Base> baseResult = new ArrayList<Base>();
try {
ResourceData[] results = Util.getAttributeSearchService().search(criteria);
for (ResourceData resourceData : results) {
String path = RegistryUtils.getRelativePathToOriginal(resourceData.getResourcePath(), RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH);
if (registry.resourceExists(path)) {
Resource resource = registry.get(path);
baseResult.add(provider.get(resource, registry));
}
}
} catch (RegistryException e) {
log.error(e.getMessage());
throw new MetadataException(e.getMessage(), e);
}
return baseResult;
}
示例7: getEndpoints
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
public HTTPEndpointV1[] getEndpoints(HTTPEndpointV1 httpEndpointV1) throws MetadataException {
ArrayList<HTTPEndpointV1> list = new ArrayList<HTTPEndpointV1>();
try {
for (Association as : Util.getAssociations(registry, uuid, Constants.ASSOCIATION_ENDPOINT)) {
if (registry.resourceExists(as.getDestinationPath())) {
Resource r = registry.get(as.getDestinationPath());
list.add((HTTPEndpointV1)Util.getBaseProvider(httpEndpointV1.getMediaType()).get(r, registry));
}
}
} catch (RegistryException e) {
throw new MetadataException(e.getMessage(), e);
}
return list.toArray(new HTTPEndpointV1[list.size()]);
}
示例8: add
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
protected static void add(Registry registry, Base metadata, String path) throws MetadataException {
try {
Resource resource = Util.getBaseProvider(metadata.getMediaType()).buildResource(metadata, registry.newResource());
putResource(registry, path, resource);
} catch (RegistryException e) {
log.error(e.getMessage());
throw new MetadataException(e.getMessage(), e);
}
}
示例9: getAssociations
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
public static Association[] getAssociations(Registry registry, String sourceUUID, String type) throws MetadataException {
Association[] associations = null;
try {
associations = registry.getAssociations(Util.getMetadataPath(sourceUUID, registry), type);
} catch (RegistryException e) {
throw new MetadataException(e.getMessage(), e);
}
return associations;
}
示例10: transfer
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
public void transfer(String action, Map<String, String> params) throws MetadataException {
try {
registry.invokeAspect(Util.getMetadataPath(uuid, registry), this.name, action, params);
} catch (RegistryException e) {
log.error("Error occurred while invoking operation " + action + " for lifecycle "+ name);
throw new MetadataException(e.getMessage(), e);
}
}
示例11: add
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
protected static void add(Registry registry, VersionBase metadata, String path) throws MetadataException {
try {
Resource resource = Util.getVersionBaseProvider(metadata.getMediaType()).buildResource(metadata, registry.newResource());
putResource(registry, path, resource);
Util.createAssociation(registry, metadata.getBaseUUID(), metadata.getUUID(), Constants.ASSOCIATION_CHILD_VERSION);
Util.createAssociation(registry, metadata.getUUID(), metadata.getBaseUUID(), Constants.ASSOCIATION_VERSION_OF);
} catch (RegistryException e) {
throw new MetadataException(e.getMessage(), e);
}
}
示例12: delete
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
/**
* Deletes the meta data instance that represents from the given UUID
*
* @param uuid UUID of the instance
*/
public static void delete(Registry registry, String uuid) throws MetadataException {
try {
String path = Util.getMetadataPath(uuid, registry);
if (registry.resourceExists(path)) {
registry.delete(path);
} else {
log.error("Metadata instance " + uuid + " does not exists");
}
} catch (RegistryException e) {
throw new MetadataException(e.getMessage(), e);
}
}
示例13: attachLifecycle
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
public void attachLifecycle(String name) throws MetadataException {
try {
this.lifecycle = new StateMachineLifecycle(registry, name, uuid);
registry.associateAspect(Util.getMetadataPath(uuid, registry), name);
} catch (RegistryException e) {
throw new MetadataException(e.getMessage(), e);
}
}
示例14: buildTopicTree
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
/**
* Building the topic tree
*
* @param topicNode node of the topic
* @param resource the resource that holds child topics
* @param userRegistry user registry
* @throws EventBrokerException
*/
private void buildTopicTree(TopicNode topicNode, Collection resource, UserRegistry userRegistry)
throws EventBrokerException {
try {
String[] children = resource.getChildren();
if (children != null) {
List<TopicNode> nodes = new ArrayList<TopicNode>();
for (String childTopic : children) {
Resource childResource = userRegistry.get(childTopic);
if (childResource instanceof Collection) {
if (childTopic.endsWith("/")) {
childTopic = childTopic.substring(0, childTopic.length() - 2);
}
String nodeName = childTopic.substring(childTopic.lastIndexOf("/") + 1);
if (!nodeName.equals(EventBrokerConstants.EB_CONF_WS_SUBSCRIPTION_COLLECTION_NAME) &&
!nodeName.equals(EventBrokerConstants.EB_CONF_JMS_SUBSCRIPTION_COLLECTION_NAME)) {
childTopic =
childTopic.substring(childTopic.indexOf(this.topicStoragePath)
+ this.topicStoragePath.length() + 1);
TopicNode childNode = new TopicNode(nodeName, childTopic);
nodes.add(childNode);
buildTopicTree(childNode, (Collection) childResource, userRegistry);
}
}
}
topicNode.setChildren(nodes.toArray(new TopicNode[nodes.size()]));
}
} catch (RegistryException e) {
throw new EventBrokerException(e.getMessage(), e);
}
}
示例15: vote
import org.wso2.carbon.registry.core.exceptions.RegistryException; //导入方法依赖的package包/类
public void vote(Map<String,String> map) throws MetadataException {
try {
registry.invokeAspect(Util.getMetadataPath(uuid, registry), this.name, "voteClick",map);
} catch (RegistryException e) {
log.error("Error occurred while invoking approval vote for lifecycle "+ name);
throw new MetadataException(e.getMessage(), e);
}
}