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


Java Status.SUCCESS属性代码示例

本文整理汇总了Java中org.md2k.datakitapi.status.Status.SUCCESS属性的典型用法代码示例。如果您正苦于以下问题:Java Status.SUCCESS属性的具体用法?Java Status.SUCCESS怎么用?Java Status.SUCCESS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.md2k.datakitapi.status.Status的用法示例。


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

示例1: insertDB

private synchronized Status insertDB(SQLiteDatabase db, String tableName) {
    try {

        if (cValueCount == 0)
            return new Status(Status.SUCCESS);


        long st = System.currentTimeMillis();
        db.beginTransaction();

        for (int i = 0; i < cValueCount; i++)
            db.insert(tableName, null, cValues[i]);
        cValueCount = 0;
        try {
            db.setTransactionSuccessful();
        } finally {
            db.endTransaction();
        }
    } catch (Exception e) {
        return new Status(Status.INTERNAL_ERROR);
    }
    return new Status(Status.SUCCESS);
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:23,代码来源:DatabaseTable_Data.java

示例2: notifyAllObservers

public Status notifyAllObservers(DataType[] dataTypes, boolean highFrequency, boolean isUpdate) {
    Status status = new Status(Status.SUCCESS);
    if (databaseSubscriber != null) {
        if (highFrequency) {
            status = databaseSubscriber.insertHF(ds_id, (DataTypeDoubleArray[]) dataTypes);
        } else {
            status = databaseSubscriber.insert(ds_id, dataTypes, isUpdate);
        }
    }

    for (Iterator<MessageSubscriber> iterator = messageSubscribers.iterator(); iterator.hasNext(); ) {
        MessageSubscriber subscriber = iterator.next();
        if (!subscriber.update(ds_id, dataTypes))
            iterator.remove();
    }
    return status;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:17,代码来源:Publisher.java

示例3: insert

public Status insert(int ds_id, DataType[] dataTypes) {
    Status status=new Status(Status.SUCCESS);
    if(ds_id==-1 || dataTypes==null)
        return new Status(Status.INTERNAL_ERROR);
    if (listPrivacyListDsId.get(ds_id) == null) {
        status = routingManager.insert(ds_id, dataTypes);
        if(status.getStatusCode()==Status.INTERNAL_ERROR)
            return status;
    }
    if(ds_id==dsIdPrivacy){
        Log.d(TAG,"privacy data...process start...");
        processPrivacyData();
    }
    return status;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:15,代码来源:PrivacyManager.java

示例4: insertHF

public Status insertHF(int ds_id, DataTypeDoubleArray[] dataTypes) {
    Status status = new Status(Status.SUCCESS);
    if (ds_id == -1 || dataTypes == null)
        return new Status(Status.INTERNAL_ERROR);
    if (listPrivacyListDsId.get(ds_id) == null) {
        status = routingManager.insertHF(ds_id, dataTypes);
        if (status.getStatusCode() == Status.INTERNAL_ERROR)
            return status;
    }
    if (ds_id == dsIdPrivacy) {
        Log.d(TAG, "privacy data...process start...");
        processPrivacyData();
    }
    return status;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:15,代码来源:PrivacyManager.java

示例5: updateSummary

public Status updateSummary(DataSourceClient dataSourceClient, DataType dataType) {
    Status status=new Status(Status.SUCCESS);
    if(dataSourceClient==null || dataType==null)
        return new Status(Status.INTERNAL_ERROR);
    if (listPrivacyListDsId.get(dataSourceClient.getDs_id()) == null) {
        status = routingManager.updateSummary(dataSourceClient.getDataSource(), dataType);
        if(status.getStatusCode()==Status.INTERNAL_ERROR)
            return status;
    }
    return status;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:11,代码来源:PrivacyManager.java

示例6: register

public synchronized DataSourceClient register(SQLiteDatabase db, DataSource dataSource) {
    ContentValues cValues = prepareDataSource(dataSource);
    int newRowId;
    newRowId = (int) db.insert(TABLE_NAME, null, cValues);
    if (newRowId == -1) {
        return new DataSourceClient(-1, dataSource, new Status(Status.INTERNAL_ERROR));
    } else return new DataSourceClient(newRowId, dataSource, new Status(Status.SUCCESS));
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:8,代码来源:DatabaseTable_DataSource.java

示例7: insert

private synchronized Status insert(SQLiteDatabase db, int dataSourceId, DataType dataType) {
    Status status = new Status(Status.SUCCESS);
    if (dataType.getDateTime() - lastUnlock >= WAITTIME || cValueCount >= CVALUE_LIMIT) {
        status = insertDB(db, TABLE_NAME);
        cValueCount = 0;
        lastUnlock = dataType.getDateTime();
    }
    ContentValues contentValues = prepareData(dataSourceId, dataType);
    cValues[cValueCount++] = contentValues;
    return status;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:11,代码来源:DatabaseTable_Data.java

示例8: insertHF

private synchronized Status insertHF(int dataSourceId, DataTypeDoubleArray dataType) {
    Status status = new Status(Status.SUCCESS);
    if (dataType.getDateTime() - lastUnlock >= WAITTIME || hfValueCount >= HFVALUE_LIMIT) {
        status = gzLogger.insert(hfValues, hfValueCount);
        hfValueCount = 0;
        lastUnlock = dataType.getDateTime();
    }
    ContentValues contentValues = prepareDataHF(dataSourceId, dataType);
    hfValues[hfValueCount++] = contentValues;
    return status;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:11,代码来源:DatabaseTable_Data.java

示例9: addPublisher

public int addPublisher(int ds_id) {
    if (ds_id == -1) return Status.DATASOURCE_INVALID;
    if (publishers.indexOfKey(ds_id) < 0) {
        publishers.put(ds_id, new Publisher(ds_id));
    }
    return Status.SUCCESS;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:7,代码来源:Publishers.java

示例10: addSubscriber

public int addSubscriber(int ds_id) {
    if (ds_id == -1) return Status.DATASOURCE_INVALID;
    if (publishers.indexOfKey(ds_id) < 0) {
        publishers.put(ds_id, new Publisher(ds_id));
    }
    return Status.SUCCESS;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:7,代码来源:Publishers.java

示例11: subscribe

public int subscribe(int ds_id, String packageName, Messenger reply) {
    if(ds_id==-1 || packageName==null) return Status.DATASOURCE_INVALID;

    int status = addSubscriber(ds_id);
    if (status == Status.SUCCESS)
        status = publishers.get(ds_id).add(new MessageSubscriber(packageName, reply));

    return status;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:9,代码来源:Publishers.java

示例12: remove

public int remove(int ds_id) {
    if (!isExist(ds_id))
        return Status.DATASOURCE_NOT_EXIST;
    publishers.get(ds_id).setDatabaseSubscriber(null);
    return Status.SUCCESS;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:6,代码来源:Publishers.java

示例13: add

public int add(MessageSubscriber subscriber) {
    remove(subscriber);
    messageSubscribers.add(subscriber);
    return Status.SUCCESS;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:5,代码来源:Publisher.java

示例14: remove

public int remove(MessageSubscriber subscriber) {
    if (!isExists(subscriber)) return Status.DATASOURCE_NOT_EXIST;
    messageSubscribers.remove(get(subscriber));
    return Status.SUCCESS;
}
 
开发者ID:MD2Korg,项目名称:mCerebrum-DataKit,代码行数:5,代码来源:Publisher.java


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