public void addExceptionPart(Object key, Exception ex) { addPart(key, ex, EXCEPTION, null); }
public void addObjectPart(Object key, Object value, boolean isObject, VersionTag versionTag) { addPart(key, value, isObject ? OBJECT : BYTES, versionTag); }
private void addObjectToPartList(ObjectPartList objPartList, Object key, Object value, final SecurityService securityService) { Object object = value; boolean isObject = true; if (value instanceof CachedDeserializable) { object = ((CachedDeserializable) value).getSerializedValue(); } else if (value instanceof byte[]) { isObject = false; } object = securityService.postProcess(null, key, object, isObject); if (key != null) { objPartList.addPart(null, key, ObjectPartList.OBJECT, null); } objPartList.addPart(null, object, isObject ? ObjectPartList.OBJECT : ObjectPartList.BYTES, null); }
@Override public void addPart(Object key, Object value, byte objectType, VersionTag versionTag) { if (logger.isTraceEnabled(LogMarker.VERSIONED_OBJECT_LIST_VERBOSE)) { logger.trace(LogMarker.VERSIONED_OBJECT_LIST_VERBOSE, "addPart({}; {}; {}; {}", key, value, objectType, versionTag); } super.addPart(key, value, objectType, versionTag); if (this.regionIsVersioned) { int tagsSize = this.versionTags.size(); if (keys != null && (tagsSize != this.keys.size() - 1)) { // this should not happen - either all or none of the entries should have tags throw new InternalGemFireException(); } if (this.objects != null && (this.objects.size() > 0) && (tagsSize != this.objects.size() - 1)) { // this should not happen - either all or none of the entries should have tags throw new InternalGemFireException(); } // Assert.assertTrue(versionTag != null); this.versionTags.add(versionTag); } }
private void addToObjectPartList(ObjectPartList serializedObjs, Object res, CollectionType collectionType, boolean lastChunk, ServerConnection servConn, boolean isStructs, final SecurityService securityService) throws IOException { if (isStructs && (res instanceof Struct)) { Object[] values = ((Struct) res).getFieldValues(); // create another ObjectPartList for the struct ObjectPartList serializedValueObjs = new ObjectPartList(values.length, false); for (Object value : values) { addObjectToPartList(serializedValueObjs, null, value, securityService); } serializedObjs.addPart(null, serializedValueObjs, ObjectPartList.OBJECT, null); } else if (res instanceof Object[]) {// for CQ key-value pairs Object[] values = ((Object[]) res); // create another ObjectPartList for the Object[] ObjectPartList serializedValueObjs = new ObjectPartList(values.length, false); for (int i = 0; i < values.length; i += 2) { Object key = values[i]; Object value = values[i + 1]; addObjectToPartList(serializedValueObjs, key, value, securityService); } serializedObjs.addPart(null, serializedValueObjs, ObjectPartList.OBJECT, null); } else { // for deserialized objects addObjectToPartList(serializedObjs, null, res, securityService); } }