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 {
            throw new RegistryException("Invalid action '" + action + "'");
        }

        resource.setProperty(stateProperty, newState);
        context.getRepository().put(resource.getPath(), resource);
    }
View Full Code Here


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

        } catch (AxisFault axisFault) {
            String msg = "Failed to initiate AddServices 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 Add Services service client. " + axisFault.getMessage();
            log.error(msg, axisFault);
            throw new RegistryException(msg, axisFault);
        }
    }
View Full Code Here

                        DBMapperImpl.PATH_TO_INSTANCE_LIST).getContent();
                this.userInfoList = (List<DatabaseUserInfo>) registry.get(DBMapperImpl.PATH_TO_USER_LIST);
            } catch (RegistryException e) {
                String msg = "Cannot Find The Resource";
                log.error(msg, e);
                throw new RegistryException(msg, e);
            }
        }
    }
View Full Code Here

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

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

            this.dbInstanceMap = new HashMap<String, ArrayList<String>>();

        } catch (RegistryException e) {
            String msg = "Cannot Obtain The Registry Instance";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }
    }
View Full Code Here

            }
            return new ArrayList<DatabaseInfo>();
        } catch (RegistryException e) {
            String msg = "Cannot Find The Resource";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        } catch (XMLStreamException e) {
            String msg = "";
            log.error(msg, e);
            throw new XMLStreamException(msg, e);
        }
View Full Code Here

            }
            return new ArrayList<DatabaseInstanceInfo>();
        } catch (RegistryException e) {
            String msg = "Cannot Find The Resource";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        } catch (XMLStreamException e) {
            String msg = "";
            log.error(msg, e);
            throw new XMLStreamException(msg, e);
        }
View Full Code Here

            }
            return new ArrayList<DatabaseUserInfo>();
        } catch (RegistryException e) {
            String msg = "Cannot Find The Resource";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        } catch (XMLStreamException e) {
            String msg = "";
            log.error(msg, e);
            throw new XMLStreamException(msg, e);
        }
View Full Code Here

            }
            return this.dbInstanceMap;
        } catch (RegistryException e) {
            String msg = "Cannot Find The Resource";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }
    }
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.