public String getDirtyStatus() { return this.getValue("dirty"); }
private void prepareChannels(Record record) { String cour = record.getValue("myChannels:size"); if(cour != null && cour.trim().length()>0) { int channelCount = Integer.parseInt(cour); for(int i=0; i<channelCount; i++) { String channel = record.getValue("myChannels["+i+"]"); this.addMyChannel(channel); } } }
private void prepareChannels(MatrixCursor cursor, Record record) { String cour = record.getValue("myChannels:size"); if(cour != null && cour.trim().length()>0) { int channelCount = Integer.parseInt(cour); for(int i=0; i<channelCount; i++) { String channel = record.getValue("myChannels["+i+"]"); cursor.addRow(new String[]{"myChannels["+i+"]",channel}); } } }
private void prepareCursor(MatrixCursor cursor, Record record) { cursor.addRow(new String[]{"message",record.getValue("message")}); }
this.deviceId = record.getValue("deviceId"); this.serverId = record.getValue("serverId"); this.serverIp = record.getValue("serverIp"); this.plainServerPort = record.getValue("plainServerPort"); this.secureServerPort = record.getValue("secureServerPort"); this.authenticationHash = record.getValue("authenticationHash"); this.authenticationNonce = record.getValue("authenticationNonce"); this.email = record.getValue("email"); this.cometMode = record.getValue("cometMode"); this.httpPort = record.getValue("httpPort"); String cometPollIntervalStr = record.getValue("cometPollInterval"); if(cometPollIntervalStr != null && cometPollIntervalStr.trim().length()>0) String maxPacketSizeStr = record.getValue("maxPacketSize"); if(maxPacketSizeStr != null && maxPacketSizeStr.trim().length()>0) String sslStatus = record.getValue("isSSLActive"); if(sslStatus != null && sslStatus.trim().length()>0) String isActiveStr = record.getValue("isActive"); if(isActiveStr != null && isActiveStr.trim().length()>0) String isSSLCertStoredStr = record.getValue("isSSLCertStored"); if(isSSLCertStoredStr != null && isSSLCertStoredStr.trim().length()>0) String bootedChannelsString = record.getValue(BOOTUP_CHANNELS_PROPERTY); if (bootedChannelsString != null) { long[] bootedChannelsValues = new long[] {Long.parseLong(bootedChannelsString)};
public boolean isStoreable() { long size = 0; Set<String> names = this.getNames(); for(String name:names) { String value = this.getValue(name); /* * Alteração feita na versão 2.4-M3.1 do OpenMobster. * Suporte a valores nulos para o contorno feito em OpenMobsterBugUtils.onBeforeInsertRecord. */ if (value == null) { continue; } size += name.length(); size += value.length(); } //Object is too big for local storage if(size > 2000000) { return false; } return true; } }
this.storageId = record.getValue("storageId"); this.recordId = record.getRecordId(); this.dirtyStatus = record.getDirtyStatus(); if(record.getValue("serverRecordId") != null) this.serverRecordId = record.getValue("serverRecordId"); if(record.getValue("isCreatedOnDevice").equals(Boolean.TRUE.toString())) if(record.getValue("isLocked").equals(Boolean.TRUE.toString())) if(record.getValue("isProxy").equals(Boolean.TRUE.toString())) if(record.getValue("count") != null) int count = Integer.parseInt(record.getValue("count")); for(int index=0; index < count; index++) field.setUri(record.getValue("field["+index+"].uri")); field.setName(record.getValue("field["+index+"].name")); field.setValue(record.getValue("field["+index+"].value")); if(record.getValue("arrayMetaDataCount") != null) int count = Integer.parseInt(record.getValue("arrayMetaDataCount")); for(int index=0; index < count; index++) local.setArrayUri(record.getValue("arrayMetaData["+index+"].arrayUri")); local.setArrayLength(record.getValue("arrayMetaData["+index+"].arrayLength"));
private void prepareCursor(MatrixCursor cursor, Record record) cursor.addRow(new String[]{"deviceId",record.getValue("deviceId")}); cursor.addRow(new String[]{"serverId",record.getValue("serverId")}); cursor.addRow(new String[]{"serverIp",record.getValue("serverIp")}); cursor.addRow(new String[]{"plainServerPort",record.getValue("plainServerPort")}); cursor.addRow(new String[]{"secureServerPort",record.getValue("secureServerPort")}); cursor.addRow(new String[]{"authenticationHash",record.getValue("authenticationHash")}); cursor.addRow(new String[]{"authenticationNonce",record.getValue("authenticationNonce")}); cursor.addRow(new String[]{"email",record.getValue("email")}); cursor.addRow(new String[]{"cometMode",record.getValue("cometMode")}); cursor.addRow(new String[]{"httpPort",record.getValue("httpPort")}); String cometPollIntervalStr = record.getValue("cometPollInterval"); if(cometPollIntervalStr != null && cometPollIntervalStr.trim().length()>0) String maxPacketSizeStr = record.getValue("maxPacketSize"); if(maxPacketSizeStr != null && maxPacketSizeStr.trim().length()>0) String sslStatus = record.getValue("isSSLActive"); if(sslStatus != null && sslStatus.trim().length()>0) String isActiveStr = record.getValue("isActive"); if(isActiveStr != null && isActiveStr.trim().length()>0) String isSSLCertStoredStr = record.getValue("isSSLCertStored"); if(isSSLCertStoredStr != null && isSSLCertStoredStr.trim().length()>0)
public String generateReport() { try { StringBuffer buffer = new StringBuffer(); Context context = Registry.getActiveInstance().getContext(); Set<Record> all = this.query(context); if(all != null && !all.isEmpty()) { for(Record record:all) { String message = record.getValue("message"); buffer.append(message); buffer.append("\n----------------------------------------------\n"); } } return buffer.toString(); } catch(Exception ex) { throw new SystemException(this.getClass().getName(), "generateReport", new Object[]{ "Exception="+ex.toString(), "Message="+ex.getMessage() }); } }
private BusRegistration parse(Record record) { BusRegistration reg = new BusRegistration(record.getRecordId()); Set<String> names = record.getNames(); for(String name: names) { if(name.equals("recordId") || name.equals("dirty")) { continue; } reg.addInvocationHandler(record.getValue(name)); } return reg; }
cursor.addRow(new String[]{recordId,"storageId",record.getValue("storageId")}); cursor.addRow(new String[]{recordId,"dirty",record.getDirtyStatus()}); if(record.getValue("serverRecordId") != null) cursor.addRow(new String[]{recordId,"serverRecordId",record.getValue("serverRecordId")}); if(record.getValue("isCreatedOnDevice").equals(Boolean.TRUE.toString())) if(record.getValue("isLocked").equals(Boolean.TRUE.toString())) if(record.getValue("isProxy").equals(Boolean.TRUE.toString())) if(record.getValue("count") != null) int count = Integer.parseInt(record.getValue("count")); cursor.addRow(new String[]{recordId,"count", ""+count}); String[]{recordId,"field["+index+"].uri", record.getValue("field["+index+"].uri")}); cursor.addRow(new String[]{recordId,"field["+index+"].name", record.getValue("field["+index+"].name")}); cursor.addRow(new String[]{recordId,"field["+index+"].value", record.getValue("field["+index+"].value")}); if(record.getValue("arrayMetaDataCount") != null) int count = Integer.parseInt(record.getValue("arrayMetaDataCount")); cursor.addRow(new String[]{recordId,"arrayMetaDataCount", ""+count});
private CloudPhoto parse(Record record) throws IOException { CloudPhoto photo = new CloudPhoto(); photo.setFullName(record.getValue("fullname")); String encoded = record.getValue("photo"); byte[] decoded = Base64.decode(encoded.getBytes()); photo.setPhoto(decoded); String mime = record.getValue("mime"); if(mime != null) { photo.setMimeType(mime); } Set<String> names = record.getNames(); for(String name:names) { if(!name.equals("fullname") && !name.equals("photo") && !name.equals("mime")) { photo.addTag(name); } } photo.setOid(record.getRecordId()); return photo; }
/** * * @return */ public Anchor readAnchor(String target) throws DBException { Context context = Registry.getActiveInstance().getContext(); Set<Record> anchors = Database.getInstance(context).selectAll(Database.sync_anchor); if(anchors!=null && !anchors.isEmpty()) { for(Record local:anchors) { if(local.getValue("target").equals(target)) { return new Anchor(local); } } } return null; }
String status = record.getValue("container-status"); cursor.addRow(new String[]{status});
for(String name:names) String value = this.getValue(name);
String localTarget = local.getValue("target");