Package org.wso2.carbon.registry.core.exceptions

Examples of org.wso2.carbon.registry.core.exceptions.RegistryException


    public void invoke(RequestContext context, String action) throws RegistryException {
        Resource resource = context.getResource();
        String currentState = resource.getProperty(stateProperty);
        int stateIndex = states.indexOf(currentState);
        if (stateIndex == -1) {
            throw new RegistryException("State '" + currentState + "' is not valid!");
        }

        String newState;
        if (PROMOTE.equals(action)) {
            if (stateIndex == states.size() - 1) {
                throw new RegistryException("Can't promote beyond end of configured lifecycle!");
            }

            // Make sure all conditions are met
            List<Condition> conditions = transitions.get(currentState);
            if (conditions != null) {
                for (Condition condition : conditions) {
                    if (!condition.isTrue(resource)) {
                        throw new RegistryException(
                                "Condition failed - " + condition.getDescription());
                    }
                }
            }
            newState = states.get(stateIndex + 1);
        } else if (DEMOTE.equals(action)) {
            if (stateIndex == 0) {
                throw new RegistryException("Can't demote beyond start of configured lifecycle!");
            }
            newState = states.get(stateIndex - 1);
        }
        else {
          return;
View Full Code Here


            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

        } catch (AxisFault axisFault) {
            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
            log.error(msg, axisFault);
            throw new RegistryException(msg, axisFault);
        }
    }
View Full Code Here

            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

        } catch (AxisFault axisFault) {
            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
            log.error(msg, axisFault);
            throw new RegistryException(msg, axisFault);
        }
    }
View Full Code Here

            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);

        } catch (AxisFault axisFault) {
            String msg = "Failed to initiate resource service client. " + axisFault.getMessage();
            log.error(msg, axisFault);
            throw new RegistryException(msg, axisFault);
        }
    }
View Full Code Here

        int i;
        byte[] buff = new byte[1024];
        try {
            zipentry = zis.getNextEntry();
            if (zipentry == null) {
                throw new RegistryException("Gadget bundle should be a zip file");
            }
        } catch (IOException e) {
            log.error(e);
        }
View Full Code Here

            registry.put(resourcePath, resource);
            registry.commitTransaction();

        } catch (Exception e) {
            registry.rollbackTransaction();
            throw new RegistryException("Unable to persist element", e);
        }
    }
View Full Code Here

                }
            }
            return servicePaths.toArray(new String[servicePaths.size()]);
        } catch (Exception ignore) {
            String msg = "Error in filtering the services. " + ignore.getMessage();
            throw new RegistryException(msg);
        }
    }
View Full Code Here

            OMElement serviceInfoElement = builder.getDocumentElement();
            return getNameFromContent(serviceInfoElement);
        } catch(Exception e) {
            String msg = "Error in getting the service name. service path: " + resource.getPath() + ".";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }
    }
View Full Code Here

            OMElement serviceInfoElement = builder.getDocumentElement();
            return getNamespaceFromContent(serviceInfoElement);
        } catch(Exception e) {
            String msg = "Error in getting the service namespace. service path: " + resource.getPath() + ".";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }
    }
View Full Code Here

//             result = (String[])governanceRegistry.executeQuery(path, parameter).getContent();
             result = (String[])governanceRegistry.executeQuery(null, parameter).getContent();
         } catch (RegistryException e) {
             String msg = "Unable to get result for media type: " + mediatype + ".";
             log.error(msg, e);
             throw new RegistryException(msg, e);
         }
        String[] paths = removeSymbolicLinks(result, governanceRegistry);
        Arrays.sort(paths, new Comparator<String>() {
            public int compare(String o1, String o2) {
                int result = RegistryUtils.getResourceName(o1)
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.exceptions.RegistryException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.