本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例13: add
public int add(MessageSubscriber subscriber) {
remove(subscriber);
messageSubscribers.add(subscriber);
return Status.SUCCESS;
}
示例14: remove
public int remove(MessageSubscriber subscriber) {
if (!isExists(subscriber)) return Status.DATASOURCE_NOT_EXIST;
messageSubscribers.remove(get(subscriber));
return Status.SUCCESS;
}