}
private ObjectInfo adaptObjectInfo( com.emc.atmos.api.bean.ObjectInfo objectInfo ) throws JAXBException {
if ( objectInfo == null ) return null;
ObjectInfo newObjectInfo = new ObjectInfo();
newObjectInfo.setObjectId( (ObjectId) adaptIdentifier( objectInfo.getObjectId() ) );
newObjectInfo.setSelection( objectInfo.getSelection() );
if ( objectInfo.getExpiration() != null ) {
ObjectExpiration objectExpiration = new ObjectExpiration();
objectExpiration.setEnabled( objectInfo.getExpiration().isEnabled() );
objectExpiration.setEndAt( objectInfo.getExpiration().getEndAt() );
newObjectInfo.setExpiration( objectExpiration );
}
if ( objectInfo.getRetention() != null ) {
ObjectRetention objectRetention = new ObjectRetention();
objectRetention.setEnabled( objectInfo.getRetention().isEnabled() );
objectRetention.setEndAt( objectInfo.getRetention().getEndAt() );
newObjectInfo.setRetention( objectRetention );
}
if ( objectInfo.getReplicas() != null ) {
List<ObjectReplica> replicas = new ArrayList<ObjectReplica>();
for ( Replica replica : objectInfo.getReplicas() ) {
ObjectReplica newReplica = new ObjectReplica();
newReplica.setId( "" + replica.getId() );
newReplica.setCurrent( replica.isCurrent() );
newReplica.setLocation( replica.getLocation() );
newReplica.setReplicaType( replica.getType() );
newReplica.setStorageType( replica.getStorageType() );
replicas.add( newReplica );
}
newObjectInfo.setReplicas( replicas );
}
StringWriter xmlString = new StringWriter();
getMarshaller().marshal( objectInfo, xmlString );
newObjectInfo.setRawXml( xmlString.toString() );
return newObjectInfo;
}