Examples of Validity


Examples of com.volantis.shared.dependency.Validity

            }
        } finally {
            checked = null;
        }

        Validity validity;
        if (freshness == Freshness.FRESH) {
            // The dependency is fresh so is valid.
            validity = Validity.VALID;
        } else if (freshness == Freshness.REVALIDATE) {
            // The dependency is still not sure so treat it as if it were
View Full Code Here

Examples of com.volantis.shared.dependency.Validity

        generateSimpleElement(target, cacheability.toString(), "cacheability");

        Period timeToLive = dependency.getTimeToLive();
        generateSimpleElement(target, timeToLive.toString(), "time-to-live");

        Validity validity = context.checkValidity(dependency);
        generateSimpleElement(target, validity.toString(), "validity");
    }
View Full Code Here

Examples of com.yourpackagename.framework.validation.Validity

    }


    @Override public Validity validate(User user) {
        EntityValidator<User> entityValidator = new EntityValidator<User>();
        Validity validity = entityValidator.validate(user, User.class);

        // Check for username and email uniqueness
        if (isUsernameExists(user.getUserName())) {
            validity.addError(msg.userExists);
        }

        if (isEmailExists(user.getEmail())) {
            validity.addError(msg.emailExists);
        }

        return validity;
    }
View Full Code Here

Examples of com.yourpackagename.framework.validation.Validity

    @RequestMapping(value = Route.registerUser, method = RequestMethod.POST, consumes = Key.formEncoded)
    public String registerUser(Locale locale, Model model,
                                   @ModelAttribute(Key.regUserForm) UserRO userRO) {
        try {
            User u = userRO.user(props);
            Validity validity = userService.validate(u);
            if (validity.isValid()) {
                userService.registerUser(u, request);
                mailSenderActor.sendUserEmailIdConfirmationMail(u);
                request.getSession(true).setAttribute(Key.userInSession, u);
                model.addAttribute(Key.isRegister, true);
                return Key.redirect + Route.dashboard;
View Full Code Here

Examples of com.yourpackagename.framework.validation.Validity


    public Response validateAndSaveEntity(Entity entity, BaseService service) {
        Response response = serverResponse();
        try {
            Validity vsEntity = service.validate(entity);
            if (vsEntity.isValid()) {
                service.insert(entity);
                response.setResult(entity);
            } else {
                response.setError(key.vdnCode, vsEntity.errors());
            }
        } catch (Exception e) {
            log.error(e.getMessage());
            response.setError(key.iseCode, e.getMessage());
        }
View Full Code Here

Examples of com.yourpackagename.framework.validation.Validity

                                               @RequestHeader("pass") String password) {
        Response response = serverResponse();
        try {
            User user = userRO.user(props);
            user.setPassWord(password);
            Validity vsUser = userService.validate(user);
            if (vsUser.isValid()) {
                userService.registerUser(user, request);
                response.setResult(user);
            } else {
                response.setError(key.vdnCode, vsUser.errorMsgs());
            }
        } catch (Exception e) {
            log.error(e.getMessage());
            response.setError(key.iseCode, e.getMessage());
        }
View Full Code Here

Examples of org.apache.falcon.entity.v0.process.Validity

        assert new Path(hdfsUrl).getFileSystem(new Configuration()).mkdirs(wfpath);
    }

    public void testDefCoordMap(Process process, COORDINATORAPP coord) throws Exception {
        assertEquals("FALCON_PROCESS_DEFAULT_" + process.getName(), coord.getName());
        Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
        assertEquals(SchemaHelper.formatDateUTC(processValidity.getStart()), coord.getStart());
        assertEquals(SchemaHelper.formatDateUTC(processValidity.getEnd()), coord.getEnd());
        assertEquals("${coord:" + process.getFrequency().toString() + "}", coord.getFrequency());
        assertEquals(process.getTimezone().getID(), coord.getTimezone());

        assertEquals(process.getParallel() + "", coord.getControls().getConcurrency());
        assertEquals(process.getOrder().name(), coord.getControls().getExecution());
View Full Code Here

Examples of org.apache.falcon.entity.v0.process.Validity

    public void testUpdateCheckUser() throws Exception {
        TestContext context = newContext();
        Map<String, String> overlay = context.getUniqueOverlay();
        String tmpFileName = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
        Process process = (Process) EntityType.PROCESS.getUnmarshaller().unmarshal(new File(tmpFileName));
        Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
        processValidity.setEnd(new Date(new Date().getTime() + 2 * 24 * 60 * 60 * 1000));
        File tmpFile = context.getTempFile();
        EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
        context.scheduleProcess(tmpFile.getAbsolutePath(), overlay);
        context.waitForBundleStart(Status.RUNNING);

View Full Code Here

Examples of org.apache.falcon.entity.v0.process.Validity

        input.setName("inputData2");
        input.setStart("today(20,0)");
        input.setEnd("today(20,20)");
        process.getInputs().getInputs().add(input);

        Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
        processValidity.setEnd(new Date(new Date().getTime() + 2 * 24 * 60 * 60 * 1000));
        File tmpFile = context.getTempFile();
        EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
        response = context.service.path("api/entities/update/process/"
                + context.processName).header("Remote-User",
                TestContext.REMOTE_USER).accept(MediaType.TEXT_XML)
View Full Code Here

Examples of org.apache.falcon.entity.v0.process.Validity

                "Remote-User", TestContext.REMOTE_USER)
                .accept(MediaType.TEXT_XML).get(ClientResponse.class);
        Process process = (Process) EntityType.PROCESS.getUnmarshaller()
                .unmarshal(new StringReader(response.getEntity(String.class)));

        Validity processValidity = process.getClusters().getClusters().get(0).getValidity();
        processValidity.setEnd(new Date(new Date().getTime() + 60 * 60 * 1000));
        File tmpFile = context.getTempFile();
        EntityType.PROCESS.getMarshaller().marshal(process, tmpFile);
        response = context.service.path("api/entities/update/process/" + context.processName).header("Remote-User",
                TestContext.REMOTE_USER).accept(MediaType.TEXT_XML)
                .post(ClientResponse.class, context.getServletInputStream(tmpFile.getAbsolutePath()));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.