Examples of CardDetails


Examples of com.googlecode.memwords.domain.CardDetails

    public CardDetails getCardDetails(String cardId, SecretKey encryptionKey) {
        Card card = em.find(Card.class, cardId);
        if (card == null) {
            return null;
        }
        return new CardDetails(
                card.getId(),
                cryptoEngine.decryptString(card.getName(),
                                           encryptionKey,
                                           card.getInitializationVector()),
                cryptoEngine.decryptString(card.getLogin(),
View Full Code Here

Examples of com.googlecode.memwords.domain.CardDetails

    /**
     * Performs the card creation
     */
    protected void doCreateCard() {
        loadFavIconUrlIfNecessary(null);
        CardDetails cardDetails = new CardDetails(null, name, login, password, url, iconUrl, note);
        cardService.createCard(
                getContext().getUserInformation().getUserId(),
                cardDetails,
                getContext().getUserInformation().getEncryptionKey());
        getContext().getMessages().add(
            new ScopedLocalizableMessage(CreateCardActionBean.class,
                                         "cardCreated",
                                         cardDetails.getName()));
    }
View Full Code Here

Examples of com.googlecode.memwords.domain.CardDetails

            accountService.destroyAccount(account.getUserId());
        }
        String testUserId = "test";
        SecretKey testSecretKey = accountService.createAccount(testUserId, "test").getEncryptionKey();

        CardDetails cardDetails = new CardDetails(null,
                                                  "card1",
                                                  "login1",
                                                  "password1",
                                                  "http://www.google.com",
                                                  "http://www.google.com/favicon.ico",
                                                  "This is the note\nfor card1");
        cardService.createCard(testUserId,
                               cardDetails,
                               testSecretKey);
        cardDetails = new CardDetails(null,
                                      "card2",
                                      "login2",
                                      "password2",
                                      "http://www.yahoo.com",
                                      "http://www.yahoo.com/favicon.ico",
                                      "This is the note\nfor card2");
        cardService.createCard(testUserId,
                               cardDetails,
                               testSecretKey);
        cardDetails = new CardDetails(null,
                                      "card3",
                                      "login3",
                                      "password3",
                                      "http://www.my.site.com",
                                      null,
View Full Code Here

Examples of com.googlecode.memwords.domain.CardDetails

                      justification = "Normal not to use FavIconException")
    protected void loadFavIconUrlIfNecessary(String cardId) {
        if (!iconUrlFetched) {
            String previousUrl = null;
            if (cardId != null) {
                CardDetails previousCardDetails =
                    cardService.getCardDetails(cardId, getContext().getUserInformation().getEncryptionKey());
                previousUrl = previousCardDetails.getUrl();
            }
            if (!equalOrBothNull(this.url, previousUrl)) {
                try {
                    if (this.url == null) {
                        this.iconUrl = null;
View Full Code Here

Examples of com.googlecode.memwords.domain.CardDetails

    /**
     * Loads the card details
     */
    protected void loadCardDetails() {
        CardDetails card =
            cardService.getCardDetails(cardId, getContext().getUserInformation().getEncryptionKey());
        this.name = card.getName();
        this.login = card.getLogin();
        this.password = card.getPassword();
        this.url = card.getUrl();
        this.iconUrl = card.getIconUrl();
        this.note = card.getNote();
    }
View Full Code Here

Examples of com.googlecode.memwords.domain.CardDetails

    /**
     * Performs the card modification
     */
    protected void doModifyCard() {
        loadFavIconUrlIfNecessary(cardId);
        CardDetails cardDetails = new CardDetails(cardId, name, login, password, url, iconUrl, note);
        cardService.modifyCard(
                cardDetails,
                getContext().getUserInformation().getEncryptionKey(),
                changePassword);
        getContext().getMessages().add(new ScopedLocalizableMessage(ModifyCardActionBean.class,
                                                                    "cardModified",
                                                                    cardDetails.getName()));
    }
View Full Code Here

Examples of com.googlecode.memwords.domain.CardDetails

        UserInformation userInfo = implWithRealCryptoEngine.createAccount(userId, "masterPassword");

        CardService cardService = new CardServiceImpl(em, new CryptoEngineImpl(), null, null);
        Card card =
            cardService.createCard(userId,
                                   new CardDetails("id",
                                                   "name",
                                                   "login",
                                                   "password",
                                                   null,
                                                   null,
View Full Code Here

Examples of com.googlecode.memwords.domain.CardDetails

        assertEquals(cardDetails.getNote(), result.getNote());
    }

    @Test
    public void testDeleteCard() {
        CardDetails cardDetails = new CardDetails(null, "name", "login", "password", "url", "iconUrl", "note");
        Card card = impl.createCard(userId, cardDetails, encryptionKey);
        assertNotNull(impl.getCardDetails(card.getId(), encryptionKey));
        impl.deleteCard(card.getId());
        assertNull(impl.getCardDetails(card.getId(), encryptionKey));
    }
View Full Code Here

Examples of com.googlecode.memwords.domain.CardDetails

        super.tearDown();
    }

    @Test
    public void testGetCards() {
        CardDetails cardDetails1 = new CardDetails(null, "name", "login", "password", "url", "iconUrl", "note");
        CardDetails cardDetails2 = new CardDetails(null, "name2", "login2", "password2", "url2", "iconUrl2", "note2");
        Card card2 = impl.createCard(userId, cardDetails2, encryptionKey);
        Card card1 = impl.createCard(userId, cardDetails1, encryptionKey);
        List<CardBasicInformation> cards = impl.getCards(userId, encryptionKey);
        assertEquals(2, cards.size());
        assertEquals(card1.getId(), cards.get(0).getId());
        assertEquals(cardDetails1.getName(), cards.get(0).getName());
        assertEquals(cardDetails1.getIconUrl(), cards.get(0).getIconUrl());
        assertEquals(card2.getId(), cards.get(1).getId());
        assertEquals(cardDetails2.getName(), cards.get(1).getName());
        assertEquals(cardDetails2.getIconUrl(), cards.get(1).getIconUrl());
    }
View Full Code Here

Examples of com.googlecode.memwords.domain.CardDetails

    }

    @Test
    public void testCardExists() {
        assertFalse(impl.cardExists(userId, "name", null, encryptionKey));
        CardDetails cardDetails1 = new CardDetails(null, "name", "login", "password", "url", "iconUrl", "note");
        Card card1 = impl.createCard(userId, cardDetails1, encryptionKey);
        assertTrue(impl.cardExists(userId, "name", null, encryptionKey));
        assertFalse(impl.cardExists(userId, "name", card1.getId(), encryptionKey));
    }
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.