Skip to content

Commit

Permalink
Implement Asset, ContentKey, File and Locator classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert Cheng committed Aug 26, 2012
1 parent af16f0e commit b2c91d1
Show file tree
Hide file tree
Showing 13 changed files with 1,297 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
* Copyright 2011 Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.microsoft.windowsazure.services.media.models;

import java.util.Date;

public class Asset {
private String id;
private AssetState state;
private Date created;
private Date lastModified;
private String alternateId;
private String name;
private EncryptionOption options;
private Iterable<Locator> locators;
private Iterable<ContentKey> contentKeys;
private Iterable<File> files;
private Iterable<Asset> parentAssets;

public String getId() {
return this.id;
}

public Asset setId(String id) {
this.id = id;
return this;
}

public AssetState getState() {
return this.state;
}

public Asset setState(AssetState state) {
this.state = state;
return this;
}

public Date getCreated() {
return this.created;
}

public Asset setCreate(Date created) {
this.created = created;
return this;
}

public Date getLastModified() {
return this.lastModified;
}

public Asset setLastModified(Date lastModified) {
this.lastModified = lastModified;
return this;
}

public String getAlternateId() {
return this.alternateId;
}

public Asset setAlternateId(String alternateId) {
this.alternateId = alternateId;
return this;
}

public String getName() {
return this.name;
}

public Asset setName(String name) {
this.name = name;
return this;
}

public EncryptionOption getOptions() {
return this.options;
}

public Asset setOptions(EncryptionOption options) {
this.options = options;
return this;
}

public Iterable<Locator> getLocators() {
return this.locators;
}

public Asset setLocators(Iterable<Locator> locators) {
this.locators = locators;
return this;
}

public Iterable<ContentKey> getContentKeys() {
return this.contentKeys;
}

public Asset setContentKeys(Iterable<ContentKey> expectedContentKeys) {
this.contentKeys = expectedContentKeys;
return this;
}

public Iterable<File> getFiles() {
return this.files;
}

public Asset setFiles(Iterable<File> files) {
this.files = files;
return this;
}

public Iterable<Asset> getParentAssets() {
return this.parentAssets;
}

public Asset setParentAssets(Iterable<Asset> parentAssets) {
this.parentAssets = parentAssets;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.microsoft.windowsazure.services.media.models;

/**
* Specifies the states of the asset.
*/
public enum AssetState {
Initialized(0), Published(1), Deleted(2);

private int assetStateCode;

private AssetState(int assetStateCode) {
this.assetStateCode = assetStateCode;
}

public int getCode() {
return assetStateCode;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Copyright 2011 Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.microsoft.windowsazure.services.media.models;

import java.util.Date;

public class ContentKey {
private String id;
private Date created;
private Date lastModified;
private ContentKeyType contentKeyType;
private String encryptedContentKey;
private String name;
private String protectionKeyId;
private String checkSum;
private ProtectionKeyType protectionKeyType;

public String getId() {
return this.id;
}

public ContentKey setId(String id) {
this.id = id;
return this;
}

public ContentKey setCreate(Date created) {
this.created = created;
return this;
}

public Date getLastModified() {
return this.lastModified;
}

public ContentKey setLastModified(Date lastModified) {
this.lastModified = lastModified;
return this;
}

public String getName() {
return this.name;
}

public ContentKey setName(String name) {
this.name = name;
return this;
}

public ContentKey setCheckSum(String checkSum) {
this.checkSum = checkSum;
return this;
}

public String getCheckSum() {
return this.checkSum;
}

public ContentKey setProtectionKeyType(ProtectionKeyType protectionKeyType) {
this.protectionKeyType = protectionKeyType;
return this;
}

public ProtectionKeyType getProtectionKeyType() {
return this.protectionKeyType;
}

public ContentKey setProtectionKeyId(String protectionKeyId) {
this.protectionKeyId = protectionKeyId;
return this;
}

public String getProtectionKeyId() {
return this.protectionKeyId;
}

public ContentKey setEncryptedContentKey(String encryptedContentKey) {
this.encryptedContentKey = encryptedContentKey;
return this;
}

public String getEncryptedContentKey() {
return this.encryptedContentKey;
}

public ContentKey setContentKeyType(ContentKeyType contentKeyType) {
this.contentKeyType = contentKeyType;
return this;
}

public ContentKeyType getContentKeyType() {
return this.contentKeyType;
}

public ContentKey setCreated(Date created) {
this.created = created;
return this;
}

public Date getCreated() {
return this.created;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2011 Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.microsoft.windowsazure.services.media.models;

/**
*
* Specifies the type of a content key.
*
*/
public enum ContentKeyType {
CommonEncryption(0), StorageEncryption(1), ConfigurationEncryption(2);

private int contentKeyTypeCode;

private ContentKeyType(int contentKeyTypeCode) {
this.contentKeyTypeCode = contentKeyTypeCode;
}

public int getCode() {
return contentKeyTypeCode;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2011 Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.microsoft.windowsazure.services.media.models;

/**
* Specifies the options for encryption.
*/
public enum EncryptionOption {
None(0), StorageEncrypted(1), CommonEncryptionProtected(2);

private int encryptionOptionCode;

private EncryptionOption(int encryptionOptionCode) {
this.encryptionOptionCode = encryptionOptionCode;
}

public int getCode() {
return encryptionOptionCode;
}
}
Loading

0 comments on commit b2c91d1

Please sign in to comment.