当前位置: 首页>>代码示例>>Java>>正文


Java StorageRef类代码示例

本文整理汇总了Java中co.realtime.storage.StorageRef的典型用法代码示例。如果您正苦于以下问题:Java StorageRef类的具体用法?Java StorageRef怎么用?Java StorageRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StorageRef类属于co.realtime.storage包,在下文中一共展示了StorageRef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareClient

import co.realtime.storage.StorageRef; //导入依赖的package包/类
public static void prepareClient(Context context, InterfaceRefresher rootView){

        selfHandler = new StorageHandler();
        selfHandler.context = context;
        selfHandler.rootView = rootView;
        selfHandler.messages = new HashMap<String, Channel>();

        try {

            storageRef = new StorageRef(Config.APPKEY, Config.TOKEN, Config.PROJECT_ID, context);

            ArrayList<String> channels = PreferencesManager.getInstance(selfHandler.context).loadChannels();
            for (String channel : channels) {
                addChannel(channel);
            }

            StorageHandler.selfHandler.isConnected = true;
            StorageHandler.selfHandler.rootView.refreshData(null);

        } catch (StorageException e) {
            e.printStackTrace();
        }

    }
 
开发者ID:realtime-framework,项目名称:StorageAndroidChat,代码行数:25,代码来源:StorageHandler.java

示例2: convertProvisionType

import co.realtime.storage.StorageRef; //导入依赖的package包/类
private StorageRef.StorageProvisionType convertProvisionType(String ProvisionTypeString)
{
    try {
        HashMap<String, StorageRef.StorageProvisionType> enu = new HashMap();
        enu.put("ProvisionType_LIGHT", StorageRef.StorageProvisionType.LIGHT);
        enu.put("ProvisionType_MEDIUM", StorageRef.StorageProvisionType.MEDIUM);
        enu.put("ProvisionType_INTERMEDIATE", StorageRef.StorageProvisionType.INTERMEDIATE);
        enu.put("ProvisionType_HEAVY", StorageRef.StorageProvisionType.HEAVY);
        enu.put("ProvisionType_CUSTOM", StorageRef.StorageProvisionType.CUSTOM);

        StorageRef.StorageProvisionType res = enu.get(ProvisionTypeString);
        return res;
    }catch (NullPointerException e){
        return null;
    }
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:17,代码来源:RealtimeStorageAndroid.java

示例3: once

import co.realtime.storage.StorageRef; //导入依赖的package包/类
@ReactMethod
public void once(final String eventType, final Integer sId, final String table){

    StorageRef.StorageEvent event = convertStorageEvent(eventType);
    TableRef tableRef = _tableRefs.get(sId).get(table);

    tableRef.once(event, new OnItemSnapshot() {
        @Override
        public void run(ItemSnapshot itemSnapshot) {
            sendEvent(getReactApplicationContext(), table + "-once-" + eventType, convertlinkedMap(itemSnapshot.val()));
        }
    }, new OnError() {
        @Override
        public void run(Integer integer, String s) {
            WritableNativeMap map = new WritableNativeMap();
            map.putString("error", s);
            sendEvent(getReactApplicationContext(), table + "-once-" + eventType, map);
        }
    });
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:21,代码来源:RealtimeStorageAndroid.java

示例4: onceCustom

import co.realtime.storage.StorageRef; //导入依赖的package包/类
@ReactMethod
public void onceCustom(final String eventType, String aPrimaryKeyValue, final Integer sId, final String table){

    StorageRef.StorageEvent event = convertStorageEvent(eventType);
    TableRef tableRef = _tableRefs.get(sId).get(table);

    tableRef.once(event, new ItemAttribute(aPrimaryKeyValue), new OnItemSnapshot() {
        @Override
        public void run(ItemSnapshot itemSnapshot) {
            sendEvent(getReactApplicationContext(), table + "-once-" + eventType, convertlinkedMap(itemSnapshot.val()));
        }
    }, new OnError() {
        @Override
        public void run(Integer integer, String s) {
            WritableNativeMap map = new WritableNativeMap();
            map.putString("error", s);
            sendEvent(getReactApplicationContext(), table + "-once-" + eventType, map);
        }
    });
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:21,代码来源:RealtimeStorageAndroid.java

示例5: convertProvisionLoad

import co.realtime.storage.StorageRef; //导入依赖的package包/类
private StorageRef.StorageProvisionLoad convertProvisionLoad(String ProvisionLoadString)
{
    try {
        HashMap<String, StorageRef.StorageProvisionLoad> enu = new HashMap();
        enu.put("ProvisionLoad_READ", StorageRef.StorageProvisionLoad.READ);
        enu.put("ProvisionLoad_WRITE", StorageRef.StorageProvisionLoad.WRITE);
        enu.put("ProvisionLoad_BALANCED", StorageRef.StorageProvisionLoad.BALANCED);

        StorageRef.StorageProvisionLoad res = enu.get(ProvisionLoadString);
        return res;
    }catch (NullPointerException e){
        return null;
    }
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:15,代码来源:RealtimeStorageAndroid.java

示例6: convertStorageDataType

import co.realtime.storage.StorageRef; //导入依赖的package包/类
private StorageRef.StorageDataType convertStorageDataType(String StorageDataTypeString)
{
    try {
        HashMap<String, StorageRef.StorageDataType> enu = new HashMap();
        enu.put("StorageDataType_STRING", StorageRef.StorageDataType.STRING);
        enu.put("StorageDataType_NUMBER", StorageRef.StorageDataType.NUMBER);

        StorageRef.StorageDataType res = enu.get(StorageDataTypeString);
        return res;
    }catch (NullPointerException e){
        return null;
    }
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:14,代码来源:RealtimeStorageAndroid.java

示例7: convertStorageEvent

import co.realtime.storage.StorageRef; //导入依赖的package包/类
private StorageRef.StorageEvent convertStorageEvent(String StorageEventString)
{
    try {
        HashMap<String, StorageRef.StorageEvent> enu = new HashMap();
        enu.put("StorageEvent_PUT", StorageRef.StorageEvent.PUT);
        enu.put("StorageEvent_UPDATE", StorageRef.StorageEvent.UPDATE);
        enu.put("StorageEvent_DELETE", StorageRef.StorageEvent.DELETE);

        StorageRef.StorageEvent res = enu.get(StorageEventString);
        return res;
    }catch (NullPointerException e){
        return null;
    }
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:15,代码来源:RealtimeStorageAndroid.java

示例8: table

import co.realtime.storage.StorageRef; //导入依赖的package包/类
@ReactMethod
public void table(String tableName, Integer sId, String tId){
    StorageRef storageRef = _storagerefs.get(sId);
    if (storageRef == null)
        return;

    TableRef tableRef;
    try{
        tableRef = storageRef.table(tableName);
        appendTable(tableRef, sId, tId);
    }catch (NullPointerException e){

        return;
    }
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:16,代码来源:RealtimeStorageAndroid.java

示例9: activateOfflineBuffering

import co.realtime.storage.StorageRef; //导入依赖的package包/类
@ReactMethod
public void activateOfflineBuffering(final Integer sId){
    StorageRef storageRef = _storagerefs.get(sId);
    if (storageRef == null)
        return;
    storageRef.activateOfflineBuffering();
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:8,代码来源:RealtimeStorageAndroid.java

示例10: deactivateOfflineBuffering

import co.realtime.storage.StorageRef; //导入依赖的package包/类
@ReactMethod
public void deactivateOfflineBuffering(final Integer sId){
    StorageRef storageRef = _storagerefs.get(sId);
    if (storageRef == null)
        return;
    storageRef.deactivateOfflineBuffering();
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:8,代码来源:RealtimeStorageAndroid.java

示例11: on

import co.realtime.storage.StorageRef; //导入依赖的package包/类
@ReactMethod
public void on(final String eventType, final Integer sId, final String table){

    StorageRef.StorageEvent event = convertStorageEvent(eventType);
    TableRef tableRef = _tableRefs.get(sId).get(table);

    tableRef.on(event, new OnItemSnapshot() {
        @Override
        public void run(ItemSnapshot itemSnapshot) {
            sendEvent(getReactApplicationContext(), table + "-on-" + eventType, convertlinkedMap(itemSnapshot.val()));
        }
    });
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:14,代码来源:RealtimeStorageAndroid.java

示例12: onCustom

import co.realtime.storage.StorageRef; //导入依赖的package包/类
@ReactMethod
public void onCustom(final String eventType, String aPrimaryKeyValue, final Integer sId, final String table){

    StorageRef.StorageEvent event = convertStorageEvent(eventType);
    TableRef tableRef = _tableRefs.get(sId).get(table);

    tableRef.on(event, new ItemAttribute(aPrimaryKeyValue), new OnItemSnapshot() {
        @Override
        public void run(ItemSnapshot itemSnapshot) {
            sendEvent(getReactApplicationContext(), table + "-on-" + eventType, convertlinkedMap(itemSnapshot.val()));
        }
    });
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:14,代码来源:RealtimeStorageAndroid.java

示例13: off

import co.realtime.storage.StorageRef; //导入依赖的package包/类
@ReactMethod
public void off(final String eventType, final Integer sId, String table){
    StorageRef.StorageEvent event = convertStorageEvent(eventType);
    TableRef tableRef = _tableRefs.get(sId).get(table);

    tableRef.off(event, new OnItemSnapshot() {
        @Override
        public void run(ItemSnapshot itemSnapshot) {

        }
    });
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:13,代码来源:RealtimeStorageAndroid.java

示例14: offCustom

import co.realtime.storage.StorageRef; //导入依赖的package包/类
@ReactMethod
public void offCustom(final String eventType, String aPrimaryKeyValue, final Integer sId, String table){
    StorageRef.StorageEvent event = convertStorageEvent(eventType);
    TableRef tableRef = _tableRefs.get(sId).get(table);

    tableRef.off(event, new ItemAttribute(aPrimaryKeyValue), new OnItemSnapshot() {
        @Override
        public void run(ItemSnapshot itemSnapshot) {

        }
    });
}
 
开发者ID:realtime-framework,项目名称:RCTRealtimeStorageAndroid,代码行数:13,代码来源:RealtimeStorageAndroid.java

示例15: Player

import co.realtime.storage.StorageRef; //导入依赖的package包/类
public Player(StorageRef storage, String _gameID, String _playerID, String _name, int _score) {
    gameID= _gameID;
    playerID = _playerID;
    name = _name;
    score = _score;
    gameTableRef = storage.table("Game").equals("gameID", new ItemAttribute(gameID));
}
 
开发者ID:jparreira,项目名称:memorygame,代码行数:8,代码来源:Player.java


注:本文中的co.realtime.storage.StorageRef类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。