Package org.zeroexchange.exception

Examples of org.zeroexchange.exception.BusinessLogicException


    public T visited(T object) {
        if(object == null) {
            return null;
        }
        if (!(object instanceof SharedViewable)) {
            throw new BusinessLogicException("Object of class '" + object.getClass().getName() +"' is not implements " +
                    SharedViewable.class.getName());
        }
        User currentUser = authorizedUserService.getCurrentUser();
        if(currentUser == null) {
            return object;
View Full Code Here


    public boolean isVisited(T object) {
        if(object == null) {
            return false;
        }
        if (!(object instanceof SharedViewable)) {
            throw new BusinessLogicException("Object of class '" + object.getClass().getName() +"' is not implements " +
                    SharedViewable.class.getName());
        }
        User currentUser = authorizedUserService.getCurrentUser();
        if(currentUser == null) {
            return true;
View Full Code Here

                  File bundleFile = nextBundleFile;
                    fileFound = true;
                    try {
                        bundle.load(new FileInputStream(bundleFile));
                    } catch (Exception e) {
                        throw new BusinessLogicException("", e);
                    }
                   
                }
            }
           
            if(!fileFound) {
                throw new BusinessLogicException("Cannot find localization file for bundle '" + bundleName + "' (file '" + localeBundlesFolder + "/" + bundleFileName + "')");
            }
           
            locale2Bundles.put(locale, bundle);
        }
       
        if(!bundle.containsKey(key)) {
            throw new BusinessLogicException("Cannot find entry for key '" + key + "' in the localization bundle '" + bundleName + "' (locale = '" + locale + "')");
        }
       
        return bundle.getProperty(key);
    }
View Full Code Here

                break;
            }
        }
       
        if(template == null) {
            throw new BusinessLogicException("Cannot find resource for template named '" + templateRelPath + "'");
        }
       
        VelocityContext context = new VelocityContext(parameters);
        StringWriter sw = new StringWriter();
        template.merge(context, sw);
View Full Code Here

     */
    @Override
    @Secured(Role.ACEGITOKEN_USER)
    public void updateUser(User user) {
        if(user.getId() == null) {
            throw new BusinessLogicException("To add a new user please use addUser method.");
        }
        getSession().update(user);
    }
View Full Code Here

            newUser = userWriter.createUser(newUser);
            credentialsWriter.addCredential(newUser, credential);
        }   
        User user = credential == null ? null : credential.getUser();
        if(user == null) {
            throw new BusinessLogicException("Cannot obtain user by specified openId:" + userOpenId);
        }
        return new ZEUserDetails(Collections.<GrantedAuthority>singletonList(
                new GrantedAuthorityImpl(Role.ACEGITOKEN_USER)), user, credential);
    }
View Full Code Here

        T resource = null;
        try {
            resource = resourceSubclass.newInstance();
        } catch (InstantiationException e) {
            log.error("Cannot instantiate the resource", e);
            throw new BusinessLogicException("Cannot instantiate the resource of class " + resourceSubclass, e);
        } catch (IllegalAccessException e) {
            log.error("Cannot instantiate the resource", e);
            throw new BusinessLogicException("Cannot instantiate the resource of class " + resourceSubclass, e);
        }
           
        //Contract identity
        Contract contract = contractReader.getContract(contractId);
        resource.setContract(contract);
View Full Code Here

        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if(authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) {
            Credential credential = authTokenInformer.getCredentials(authentication);
            User user = credential == null ? null : credential.getUser();
            if(user == null) {
                throw new BusinessLogicException("Unknown user '" + userName + "'");
            }
            return user;
        }
        return null;
    }
View Full Code Here

        for(EventProcessor eventProcessor: eventProcessors) {
            try {
                eventProcessor.onEvent(event);
            } catch (Exception e) {
                log.error("Cannot process event " + event.getClass() + ", processor " + eventProcessor.getClass(), e);
                throw new BusinessLogicException("Cannot process event " + event.getClass(), e);
            }
        }
    }
View Full Code Here

                }
            }
        }

        if(consumerTender == null) {
            throw new BusinessLogicException("The specified user #" + consumer.getId() + " is not consumer of the specified resource #" + resource.getId());
        }
       
        //Complete the tender
        needManager.completeTender(consumerTender);
       
View Full Code Here

TOP

Related Classes of org.zeroexchange.exception.BusinessLogicException

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.