OMCStorageObject Class Reference

Inherits from NSObject
Declared in OMCStorageObject.h

Overview

This interface manages the contents and metadata of a StorageObject. Note that a StorageObject can be in either a “raw” or “completed” state. After the user initializes the StorageObject from data or an input stream, none of the object metadata (such as creation date) is populated, so it is still in the “raw” state. It is only when the object reference is retrieved from a PUT, POST, or GET call on OMCStorageCollection, that the object is in its completed state. In other words, the object must interact with the server or storage cache (Sync) to be fully initialized.

  ID

Identification of the OMCStorageObject should be unique across the OMCStorageCollection.

@property (readwrite, nonatomic) NSString *ID

Declared In

OMCStorageObject.h

  displayName

Display Name of the OMCStorageObject.

@property (readwrite, nonatomic) NSString *displayName

Declared In

OMCStorageObject.h

  contentType

The MIME Content-Type of the payload in the OMCStorageObject, for example “image/jpeg”.

@property (readwrite, nonatomic) NSString *contentType

Declared In

OMCStorageObject.h

  createdBy

The property createdBy.

@property (readonly, nonatomic) NSString *createdBy

Declared In

OMCStorageObject.h

  modifiedBy

The property modifiedBy. Might be NULL if the object is never modified.

@property (readonly, nonatomic) NSString *modifiedBy

Declared In

OMCStorageObject.h

  createdOn

The property createdOn in the date format “yyyy-MM-dd’T'HH:mm:ss'Z'”.

@property (readonly, nonatomic) NSDate *createdOn

Declared In

OMCStorageObject.h

  modifiedOn

The property modifiedOn in the date format “yyyy-MM-dd’T'HH:mm:ss'Z'”. Might be NULL if the object is never modified.

@property (readonly, nonatomic) NSDate *modifiedOn

Declared In

OMCStorageObject.h

  canonicalLink

The property canonicalLink is the canonical link for the current StorageObject. The link is a relative url.

@property (readonly, nonatomic) NSString *canonicalLink

Declared In

OMCStorageObject.h

– initPayload:withData:andContentType:

Initializes an OMCStorageObject object with NSData format payload.

- (instancetype)initPayload:(NSString *)objectID withData:(NSData *)data andContentType:(NSString *)contentType

Parameters

objectID

The ID of the object in the Storage service.

data

The payload of the current object in the format of NSData.

contentType

The MIME Content-Type of the payload, for example “image/jpeg”.

Declared In

OMCStorageObject.h

– initPayload:withStream:andContentType:

Initializes an OMCStorageObject object with NSInputStream format payload. Note: as reading an NSInputStream involves registering on a Run Loop and doing asynchronous processing, invoking this API will block the current thread until the asynchronous processing completes. Thus, it is not recommended that this method be called on the UI (main) thread.

- (instancetype)initPayload:(NSString *)objectID withStream:(NSInputStream *)inputStream andContentType:(NSString *)contentType

Parameters

objectID

The ID of the object in the Storage service.

inputStream

The payload of the current object in the format of NSInputStream.

contentType

The MIME Content-Type of the payload, for example “image/jpeg”.

Declared In

OMCStorageObject.h

– getPayloadData

Returns the payload as NSData.

- (NSData *)getPayloadData

Declared In

OMCStorageObject.h

– getPayloadStream

Returns the payload as NSInputStream.

- (NSInputStream *)getPayloadStream

Declared In

OMCStorageObject.h

– setPayloadFromData:withContentType:

Sets the payload and content-Type of the OMCStorageObject. Returns the updated OMCStorageObject.

- (OMCStorageObject *)setPayloadFromData:(NSData *)data withContentType:(NSString *)contentType

Parameters

data

is the new payload

contentType

The MIME Content-Type of the payload, for example “image/jpeg”.

Declared In

OMCStorageObject.h

– setPayloadFromStream:withContentType:

Sets the payload and content-Type of the OMCStorageObject. Returns the updated OMCStorageObject. Note: as reading an NSInputStream involves registering on a Run Loop and doing asynchronous processing, invoking this API will block the current thread until the asynchronous processing completes. Thus, it is not recommended that this method be called on the UI (main) thread.

- (OMCStorageObject *)setPayloadFromStream:(NSInputStream *)inputStream withContentType:(NSString *)contentType

Parameters

inputStream

The new payload.

contentType

The MIME Content-Type of the payload, for example “image/jpeg”.

Declared In

OMCStorageObject.h