Package org.opentransactions.otapi

Examples of org.opentransactions.otapi.Storable


    }

    public static TradeListMarket getMarketTradeList(String serverID, String marketID) {

        TradeListMarket tradeListMarket = null;
        Storable storable = null;
        if (otapi.Exists("markets", serverID, "recent", marketID + ".bin")) {
            storable = otapi.QueryObject(StoredObjectType.STORED_OBJ_TRADE_LIST_MARKET, "markets", serverID, "recent", marketID + ".bin");
            if (storable == null) {
                return null;
            }
View Full Code Here


    }

    public static AddressBook getAddressBook() {

        AddressBook addressBook = null;
        Storable storable = null;
        if (otapi.Exists("moneychanger", "gui_contacts.dat")) {
            storable = otapi.QueryObject(StoredObjectType.STORED_OBJ_ADDRESS_BOOK, "moneychanger", "gui_contacts.dat");
            if (storable == null) {
                return null;
            }
View Full Code Here

    }

    public static WalletData getWalletData() {

        WalletData walletData = null;
        Storable storable = null;
        if (otapi.Exists("moneychanger", "gui_wallet.dat")) {
            storable = otapi.QueryObject(StoredObjectType.STORED_OBJ_WALLET_DATA, "moneychanger", "gui_wallet.dat");
            if (storable == null) {
                return null;
            }
View Full Code Here

    }

    public static MarketList getMarketList(String serverID) {

        MarketList marketList = null;
        Storable storable = null;
        if (otapi.Exists("markets", serverID, "market_data.bin")) {
            storable = otapi.QueryObject(StoredObjectType.STORED_OBJ_MARKET_LIST, "markets", serverID, "market_data.bin");
            if (storable == null) {
                return null;
            }
View Full Code Here

    }

    public static OfferListMarket getMarketOffer(String serverID, String marketID) {

        OfferListMarket offerListMarket = null;
        Storable storable = null;
        if (otapi.Exists("markets", serverID, "offers", marketID + ".bin")) {
            storable = otapi.QueryObject(StoredObjectType.STORED_OBJ_OFFER_LIST_MARKET, "markets", serverID, "offers", marketID + ".bin");
            if (storable == null) {
                return null;
            }
View Full Code Here

    }

    public static TradeListNym getNYMTrades(String serverID, String nymID) {

        TradeListNym tradeListNym = null;
        Storable storable = null;
        if (otapi.Exists("nyms", "trades", serverID, nymID)) {
            storable = otapi.QueryObject(StoredObjectType.STORED_OBJ_TRADE_LIST_NYM, "nyms", "trades", serverID, nymID);
            if (storable == null) {
                return null;
            }
View Full Code Here

    }

    public static OfferListNym getNYMOffer(String serverID, String nymID) {

        OfferListNym offerListNym = null;
        Storable storable = null;
        if (otapi.Exists("nyms", serverID, "offers", nymID + ".bin")) {
            storable = otapi.QueryObject(StoredObjectType.STORED_OBJ_OFFER_LIST_NYM, "nyms", serverID, "offers", nymID + ".bin");
            if (storable == null) {
                return null;
            }
View Full Code Here

        boolean bHaveImage = false;

        // First Lets Check if we already have a password image. (we don't need annother one)
        if (otapi.Exists("moneychanger", "settings.dat")) {

            Storable storable = null;
            StringMap stringMap = null;

            storable = otapi.QueryObject(StoredObjectType.STORED_OBJ_STRING_MAP, "moneychanger", "settings.dat");

            if (null != storable) {

                stringMap = StringMap.ot_dynamic_cast(storable);
                imagePath = stringMap.GetValue("ImagePath");

                File f = new File(imagePath);
                if (f.exists()) {
                    // Good we have a password Image
                    bHaveImage = true;
                }
            }
        }

        // We don't have an image... lets get it from the user, then save it.
        if (!bHaveImage) {

            for (;;) {
                imagePath = passwordImage.GetPasswordImageFromUser("passwordImage");
               
                if (passwordImage.GetIfUserCancelled()) {
                    bHaveImage = false;
                    break;
                }

                File f = new File(imagePath);
                if (f.exists()) {
                    bHaveImage = true;
                    // Good we have a password Image
                    break;
                }
            }
           
            if (!bHaveImage)
            {
                return false;
            }

            StringMap stringMap = null// we are about to create this object
            Storable storable = otapi.CreateObject(StoredObjectType.STORED_OBJ_STRING_MAP);

            if (storable != null) {
                stringMap = StringMap.ot_dynamic_cast(storable);
                System.out.println("stringMap:" + stringMap);
View Full Code Here

        if (addressBook == null) {
            System.out.println("createContact - addressBook returns null");
            return contactID;
        }
        System.out.println("in createContact,addressBook:"+addressBook);
        Storable storable = otapi.CreateObject(StoredObjectType.STORED_OBJ_CONTACT);
        System.out.println("in createContact, storable:"+storable);
        if (storable != null) {
            Contact contact = Contact.ot_dynamic_cast(storable);
            System.out.println("contact:"+contact);
            if (contact != null) {
View Full Code Here

            }
            if (contactID.equals(contact.getContact_id())) {
                System.out.println("createContactNym - contactID matches");
                ContactNym contactNYM = null;
                if (index == -1) {
                    Storable storable = otapi.CreateObject(StoredObjectType.STORED_OBJ_CONTACT_NYM);
                    if (storable != null) {
                        contactNYM = ContactNym.ot_dynamic_cast(storable);
                    }
                } else {
                    contactNYM = contact.GetContactNym(index);
                }
                if (contactNYM != null) {
                    contactNYM.setGui_label(label);
                    contactNYM.setMemo(memo);
                    contactNYM.setNym_id(nymID);
                    contactNYM.setNym_type(nymType);
                    contactNYM.setPublic_key(publickey);
                    while (contactNYM.GetServerInfoCount() > 0) {
                        contactNYM.RemoveServerInfo(0);
                    }

                    for (int j = 0; j < serverID.length; j++) {
                        Storable storable1 = otapi.CreateObject(StoredObjectType.STORED_OBJ_SERVER_INFO);
                        if (storable1 != null) {
                            ServerInfo serverInfo = ServerInfo.ot_dynamic_cast(storable1);
                            if (serverInfo != null) {
                                serverInfo.setServer_id(serverID[j]);
                                System.out.println("serverType[j]:"+serverType[j]);
View Full Code Here

TOP

Related Classes of org.opentransactions.otapi.Storable

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.