From a97adf5ded972531eb404abdd43702c3392a6f58 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 20 Sep 2012 16:14:33 -0700 Subject: [PATCH] address code review feedback. --- .../media/models/AccessPolicyPermission.java | 2 +- .../services/media/models/Asset.java | 132 ------- .../services/media/models/AssetInfo.java | 289 ++++++++++++++ .../services/media/models/AssetState.java | 35 +- .../services/media/models/ContentKey.java | 117 ------ .../services/media/models/ContentKeyInfo.java | 253 ++++++++++++ .../services/media/models/ContentKeyType.java | 22 +- .../media/models/EncryptionOption.java | 22 +- .../services/media/models/File.java | 167 -------- .../services/media/models/FileInfo.java | 373 ++++++++++++++++++ .../services/media/models/Locator.java | 92 ----- .../services/media/models/LocatorInfo.java | 193 +++++++++ .../services/media/models/LocatorType.java | 27 +- .../media/models/ProtectionKeyType.java | 19 +- .../{AssetTest.java => AssetInfoTest.java} | 56 +-- ...ntKeyTest.java => ContentKeyInfoTest.java} | 41 +- .../{FileTest.java => FileInfoTest.java} | 59 +-- ...{LocatorTest.java => LocatorInfoTest.java} | 30 +- 18 files changed, 1320 insertions(+), 609 deletions(-) delete mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java delete mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKey.java create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfo.java delete mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/File.java create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/FileInfo.java delete mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Locator.java create mode 100644 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorInfo.java rename microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/{AssetTest.java => AssetInfoTest.java} (60%) rename microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/{ContentKeyTest.java => ContentKeyInfoTest.java} (65%) rename microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/{FileTest.java => FileInfoTest.java} (66%) rename microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/{LocatorTest.java => LocatorInfoTest.java} (70%) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AccessPolicyPermission.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AccessPolicyPermission.java index a1abc4a25587b..b5f7dd0e88699 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AccessPolicyPermission.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AccessPolicyPermission.java @@ -1,5 +1,5 @@ /** - * Copyright 2011 Microsoft Corporation + * Copyright 2012 Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java deleted file mode 100644 index be3b534bcb3d0..0000000000000 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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 locators; - private Iterable contentKeys; - private Iterable files; - private Iterable 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 getLocators() { - return this.locators; - } - - public Asset setLocators(Iterable locators) { - this.locators = locators; - return this; - } - - public Iterable getContentKeys() { - return this.contentKeys; - } - - public Asset setContentKeys(Iterable expectedContentKeys) { - this.contentKeys = expectedContentKeys; - return this; - } - - public Iterable getFiles() { - return this.files; - } - - public Asset setFiles(Iterable files) { - this.files = files; - return this; - } - - public Iterable getParentAssets() { - return this.parentAssets; - } - - public Asset setParentAssets(Iterable parentAssets) { - this.parentAssets = parentAssets; - return this; - } - -} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java new file mode 100644 index 0000000000000..420b4a4bf66fb --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java @@ -0,0 +1,289 @@ +/* + * Copyright 2012 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; + +/** + * The Class AssetInfo. + */ +public class AssetInfo { + + /** The id. */ + private String id; + + /** The state. */ + private AssetState state; + + /** The created. */ + private Date created; + + /** The last modified. */ + private Date lastModified; + + /** The alternate id. */ + private String alternateId; + + /** The name. */ + private String name; + + /** The options. */ + private EncryptionOption options; + + /** The locator infos. */ + private Iterable locatorInfos; + + /** The content key infos. */ + private Iterable contentKeyInfos; + + /** The file infos. */ + private Iterable fileInfos; + + /** The parent asset infos. */ + private Iterable parentAssetInfos; + + /** + * Gets the id. + * + * @return the id + */ + public String getId() { + return this.id; + } + + /** + * Sets the id. + * + * @param id + * the id + * @return the asset info + */ + public AssetInfo setId(String id) { + this.id = id; + return this; + } + + /** + * Gets the state. + * + * @return the state + */ + public AssetState getState() { + return this.state; + } + + /** + * Sets the state. + * + * @param state + * the state + * @return the asset info + */ + public AssetInfo setState(AssetState state) { + this.state = state; + return this; + } + + /** + * Gets the created. + * + * @return the created + */ + public Date getCreated() { + return this.created; + } + + /** + * Sets the create. + * + * @param created + * the created + * @return the asset info + */ + public AssetInfo setCreate(Date created) { + this.created = created; + return this; + } + + /** + * Gets the last modified. + * + * @return the last modified + */ + public Date getLastModified() { + return this.lastModified; + } + + /** + * Sets the last modified. + * + * @param lastModified + * the last modified + * @return the asset info + */ + public AssetInfo setLastModified(Date lastModified) { + this.lastModified = lastModified; + return this; + } + + /** + * Gets the alternate id. + * + * @return the alternate id + */ + public String getAlternateId() { + return this.alternateId; + } + + /** + * Sets the alternate id. + * + * @param alternateId + * the alternate id + * @return the asset info + */ + public AssetInfo setAlternateId(String alternateId) { + this.alternateId = alternateId; + return this; + } + + /** + * Gets the name. + * + * @return the name + */ + public String getName() { + return this.name; + } + + /** + * Sets the name. + * + * @param name + * the name + * @return the asset info + */ + public AssetInfo setName(String name) { + this.name = name; + return this; + } + + /** + * Gets the options. + * + * @return the options + */ + public EncryptionOption getOptions() { + return this.options; + } + + /** + * Sets the options. + * + * @param options + * the options + * @return the asset info + */ + public AssetInfo setOptions(EncryptionOption options) { + this.options = options; + return this; + } + + /** + * Gets the locators. + * + * @return the locators + */ + public Iterable getLocators() { + return this.locatorInfos; + } + + /** + * Sets the locators. + * + * @param locatorInfos + * the locator infos + * @return the asset info + */ + public AssetInfo setLocators(Iterable locatorInfos) { + this.locatorInfos = locatorInfos; + return this; + } + + /** + * Gets the content keys. + * + * @return the content keys + */ + public Iterable getContentKeys() { + return this.contentKeyInfos; + } + + /** + * Sets the content keys. + * + * @param expectedContentKeys + * the expected content keys + * @return the asset info + */ + public AssetInfo setContentKeys(Iterable expectedContentKeys) { + this.contentKeyInfos = expectedContentKeys; + return this; + } + + /** + * Gets the files. + * + * @return the files + */ + public Iterable getFiles() { + return this.fileInfos; + } + + /** + * Sets the files. + * + * @param fileInfos + * the file infos + * @return the asset info + */ + public AssetInfo setFiles(Iterable fileInfos) { + this.fileInfos = fileInfos; + return this; + } + + /** + * Gets the parent assets. + * + * @return the parent assets + */ + public Iterable getParentAssets() { + return this.parentAssetInfos; + } + + /** + * Sets the parent assets. + * + * @param parentAssetInfos + * the parent asset infos + * @return the asset info + */ + public AssetInfo setParentAssets(Iterable parentAssetInfos) { + this.parentAssetInfos = parentAssetInfos; + return this; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetState.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetState.java index 35a504b6da720..2e8dd175b7259 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetState.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetState.java @@ -1,17 +1,50 @@ +/* + * Copyright 2012 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 states of the asset. */ public enum AssetState { - Initialized(0), Published(1), Deleted(2); + /** The Initialized. */ + Initialized(0), + /** The Published. */ + Published(1), + /** The Deleted. */ + Deleted(2); + + /** The asset state code. */ private int assetStateCode; + /** + * Instantiates a new asset state. + * + * @param assetStateCode + * the asset state code + */ private AssetState(int assetStateCode) { this.assetStateCode = assetStateCode; } + /** + * Gets the code. + * + * @return the code + */ public int getCode() { return assetStateCode; } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKey.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKey.java deleted file mode 100644 index 8ea9b530b43f6..0000000000000 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKey.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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; - } - -} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfo.java new file mode 100644 index 0000000000000..3fbf2e76c1579 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfo.java @@ -0,0 +1,253 @@ +/* + * Copyright 2012 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; + +/** + * The Class ContentKeyInfo. + */ +public class ContentKeyInfo { + + /** The id. */ + private String id; + + /** The created. */ + private Date created; + + /** The last modified. */ + private Date lastModified; + + /** The content key type. */ + private ContentKeyType contentKeyType; + + /** The encrypted content key. */ + private String encryptedContentKey; + + /** The name. */ + private String name; + + /** The protection key id. */ + private String protectionKeyId; + + /** The check sum. */ + private String checkSum; + + /** The protection key type. */ + private ProtectionKeyType protectionKeyType; + + /** + * Gets the id. + * + * @return the id + */ + public String getId() { + return this.id; + } + + /** + * Sets the id. + * + * @param id + * the id + * @return the content key info + */ + public ContentKeyInfo setId(String id) { + this.id = id; + return this; + } + + /** + * Sets the create. + * + * @param created + * the created + * @return the content key info + */ + public ContentKeyInfo setCreate(Date created) { + this.created = created; + return this; + } + + /** + * Gets the last modified. + * + * @return the last modified + */ + public Date getLastModified() { + return this.lastModified; + } + + /** + * Sets the last modified. + * + * @param lastModified + * the last modified + * @return the content key info + */ + public ContentKeyInfo setLastModified(Date lastModified) { + this.lastModified = lastModified; + return this; + } + + /** + * Gets the name. + * + * @return the name + */ + public String getName() { + return this.name; + } + + /** + * Sets the name. + * + * @param name + * the name + * @return the content key info + */ + public ContentKeyInfo setName(String name) { + this.name = name; + return this; + } + + /** + * Sets the check sum. + * + * @param checkSum + * the check sum + * @return the content key info + */ + public ContentKeyInfo setCheckSum(String checkSum) { + this.checkSum = checkSum; + return this; + } + + /** + * Gets the check sum. + * + * @return the check sum + */ + public String getCheckSum() { + return this.checkSum; + } + + /** + * Sets the protection key type. + * + * @param protectionKeyType + * the protection key type + * @return the content key info + */ + public ContentKeyInfo setProtectionKeyType(ProtectionKeyType protectionKeyType) { + this.protectionKeyType = protectionKeyType; + return this; + } + + /** + * Gets the protection key type. + * + * @return the protection key type + */ + public ProtectionKeyType getProtectionKeyType() { + return this.protectionKeyType; + } + + /** + * Sets the protection key id. + * + * @param protectionKeyId + * the protection key id + * @return the content key info + */ + public ContentKeyInfo setProtectionKeyId(String protectionKeyId) { + this.protectionKeyId = protectionKeyId; + return this; + } + + /** + * Gets the protection key id. + * + * @return the protection key id + */ + public String getProtectionKeyId() { + return this.protectionKeyId; + } + + /** + * Sets the encrypted content key. + * + * @param encryptedContentKey + * the encrypted content key + * @return the content key info + */ + public ContentKeyInfo setEncryptedContentKey(String encryptedContentKey) { + this.encryptedContentKey = encryptedContentKey; + return this; + } + + /** + * Gets the encrypted content key. + * + * @return the encrypted content key + */ + public String getEncryptedContentKey() { + return this.encryptedContentKey; + } + + /** + * Sets the content key type. + * + * @param contentKeyType + * the content key type + * @return the content key info + */ + public ContentKeyInfo setContentKeyType(ContentKeyType contentKeyType) { + this.contentKeyType = contentKeyType; + return this; + } + + /** + * Gets the content key type. + * + * @return the content key type + */ + public ContentKeyType getContentKeyType() { + return this.contentKeyType; + } + + /** + * Sets the created. + * + * @param created + * the created + * @return the content key info + */ + public ContentKeyInfo setCreated(Date created) { + this.created = created; + return this; + } + + /** + * Gets the created. + * + * @return the created + */ + public Date getCreated() { + return this.created; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyType.java index 1a7bc64e9d565..5bfaf65f9030e 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyType.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyType.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 Microsoft Corporation + * Copyright 2012 Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,32 @@ * */ public enum ContentKeyType { - CommonEncryption(0), StorageEncryption(1), ConfigurationEncryption(2); + /** The Common encryption. */ + CommonEncryption(0), + /** The Storage encryption. */ + StorageEncryption(1), + /** The Configuration encryption. */ + ConfigurationEncryption(2); + + /** The content key type code. */ private int contentKeyTypeCode; + /** + * Instantiates a new content key type. + * + * @param contentKeyTypeCode + * the content key type code + */ private ContentKeyType(int contentKeyTypeCode) { this.contentKeyTypeCode = contentKeyTypeCode; } + /** + * Gets the code. + * + * @return the code + */ public int getCode() { return contentKeyTypeCode; } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/EncryptionOption.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/EncryptionOption.java index 9e98aecb69aab..7eb929ac60927 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/EncryptionOption.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/EncryptionOption.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 Microsoft Corporation + * Copyright 2012 Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,32 @@ * Specifies the options for encryption. */ public enum EncryptionOption { - None(0), StorageEncrypted(1), CommonEncryptionProtected(2); + /** The None. */ + None(0), + /** The Storage encrypted. */ + StorageEncrypted(1), + /** The Common encryption protected. */ + CommonEncryptionProtected(2); + + /** The encryption option code. */ private int encryptionOptionCode; + /** + * Instantiates a new encryption option. + * + * @param encryptionOptionCode + * the encryption option code + */ private EncryptionOption(int encryptionOptionCode) { this.encryptionOptionCode = encryptionOptionCode; } + /** + * Gets the code. + * + * @return the code + */ public int getCode() { return encryptionOptionCode; } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/File.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/File.java deleted file mode 100644 index f171d4a1fe576..0000000000000 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/File.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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 File { - private String id; - private String name; - private int contentFileSize; - private String parentAssetId; - private String encryptionVersion; - private String encryptionScheme; - private Boolean isEncrypted; - private String encryptionKeyId; - private String initializationVector; - private Boolean isPrimary; - private Date lastModified; - private Date created; - private String mimeType; - private String contentChecksum; - - public String getId() { - return this.id; - } - - public File setId(String id) { - this.id = id; - return this; - } - - public String getName() { - return this.name; - } - - public File setName(String name) { - this.name = name; - return this; - } - - public int getContentFileSize() { - return this.contentFileSize; - } - - public File setContentFileSize(int contentFileSize) { - this.contentFileSize = contentFileSize; - return this; - } - - public String getParentAssetId() { - return this.parentAssetId; - } - - public File setParentAssetId(String parentAssetId) { - this.parentAssetId = parentAssetId; - return this; - } - - public Date getCreated() { - return this.created; - } - - public File setCreate(Date created) { - this.created = created; - return this; - } - - public Date getLastModified() { - return this.lastModified; - } - - public File setLastModified(Date lastModified) { - this.lastModified = lastModified; - return this; - } - - public File setEncryptionVersion(String encryptionVersion) { - this.encryptionVersion = encryptionVersion; - return this; - } - - public String getEncryptionVersion() { - return this.encryptionVersion; - } - - public File setEncryptionScheme(String encryptionScheme) { - this.encryptionScheme = encryptionScheme; - return this; - } - - public String getEncryptionScheme() { - return this.encryptionScheme; - } - - public File setIsEncrypted(Boolean isEncrypted) { - this.isEncrypted = isEncrypted; - return this; - } - - public Boolean getIsEncrypted() { - return this.isEncrypted; - } - - public File setEncryptionKeyId(String encryptionKeyId) { - this.encryptionKeyId = encryptionKeyId; - return this; - } - - public String getEncryptionKeyId() { - return this.encryptionKeyId; - } - - public File setInitializationVector(String expectedInitializationVector) { - this.initializationVector = expectedInitializationVector; - return this; - } - - public String getInitializationVector() { - return this.initializationVector; - } - - public File setIsPrimary(Boolean isPrimary) { - this.isPrimary = isPrimary; - return this; - } - - public Boolean getIsPrimary() { - return this.isPrimary; - } - - public File setCreated(Date created) { - this.created = created; - return this; - } - - public File setMimeType(String mimeType) { - this.mimeType = mimeType; - return this; - } - - public String getMimeType() { - return this.mimeType; - } - - public File setContentChecksum(String contentChecksum) { - this.contentChecksum = contentChecksum; - return this; - } - - public String getContentChecksum() { - return this.contentChecksum; - } - -} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/FileInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/FileInfo.java new file mode 100644 index 0000000000000..9585a76233a67 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/FileInfo.java @@ -0,0 +1,373 @@ +/* + * Copyright 2012 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; + +/** + * The Class FileInfo. + */ +public class FileInfo { + + /** The id. */ + private String id; + + /** The name. */ + private String name; + + /** The content file size. */ + private int contentFileSize; + + /** The parent asset id. */ + private String parentAssetId; + + /** The encryption version. */ + private String encryptionVersion; + + /** The encryption scheme. */ + private String encryptionScheme; + + /** The is encrypted. */ + private Boolean isEncrypted; + + /** The encryption key id. */ + private String encryptionKeyId; + + /** The initialization vector. */ + private String initializationVector; + + /** The is primary. */ + private Boolean isPrimary; + + /** The last modified. */ + private Date lastModified; + + /** The created. */ + private Date created; + + /** The mime type. */ + private String mimeType; + + /** The content checksum. */ + private String contentChecksum; + + /** + * Gets the id. + * + * @return the id + */ + public String getId() { + return this.id; + } + + /** + * Sets the id. + * + * @param id + * the id + * @return the file info + */ + public FileInfo setId(String id) { + this.id = id; + return this; + } + + /** + * Gets the name. + * + * @return the name + */ + public String getName() { + return this.name; + } + + /** + * Sets the name. + * + * @param name + * the name + * @return the file info + */ + public FileInfo setName(String name) { + this.name = name; + return this; + } + + /** + * Gets the content file size. + * + * @return the content file size + */ + public int getContentFileSize() { + return this.contentFileSize; + } + + /** + * Sets the content file size. + * + * @param contentFileSize + * the content file size + * @return the file info + */ + public FileInfo setContentFileSize(int contentFileSize) { + this.contentFileSize = contentFileSize; + return this; + } + + /** + * Gets the parent asset id. + * + * @return the parent asset id + */ + public String getParentAssetId() { + return this.parentAssetId; + } + + /** + * Sets the parent asset id. + * + * @param parentAssetId + * the parent asset id + * @return the file info + */ + public FileInfo setParentAssetId(String parentAssetId) { + this.parentAssetId = parentAssetId; + return this; + } + + /** + * Gets the created. + * + * @return the created + */ + public Date getCreated() { + return this.created; + } + + /** + * Sets the create. + * + * @param created + * the created + * @return the file info + */ + public FileInfo setCreate(Date created) { + this.created = created; + return this; + } + + /** + * Gets the last modified. + * + * @return the last modified + */ + public Date getLastModified() { + return this.lastModified; + } + + /** + * Sets the last modified. + * + * @param lastModified + * the last modified + * @return the file info + */ + public FileInfo setLastModified(Date lastModified) { + this.lastModified = lastModified; + return this; + } + + /** + * Sets the encryption version. + * + * @param encryptionVersion + * the encryption version + * @return the file info + */ + public FileInfo setEncryptionVersion(String encryptionVersion) { + this.encryptionVersion = encryptionVersion; + return this; + } + + /** + * Gets the encryption version. + * + * @return the encryption version + */ + public String getEncryptionVersion() { + return this.encryptionVersion; + } + + /** + * Sets the encryption scheme. + * + * @param encryptionScheme + * the encryption scheme + * @return the file info + */ + public FileInfo setEncryptionScheme(String encryptionScheme) { + this.encryptionScheme = encryptionScheme; + return this; + } + + /** + * Gets the encryption scheme. + * + * @return the encryption scheme + */ + public String getEncryptionScheme() { + return this.encryptionScheme; + } + + /** + * Sets the is encrypted. + * + * @param isEncrypted + * the is encrypted + * @return the file info + */ + public FileInfo setIsEncrypted(Boolean isEncrypted) { + this.isEncrypted = isEncrypted; + return this; + } + + /** + * Gets the checks if is encrypted. + * + * @return the checks if is encrypted + */ + public Boolean getIsEncrypted() { + return this.isEncrypted; + } + + /** + * Sets the encryption key id. + * + * @param encryptionKeyId + * the encryption key id + * @return the file info + */ + public FileInfo setEncryptionKeyId(String encryptionKeyId) { + this.encryptionKeyId = encryptionKeyId; + return this; + } + + /** + * Gets the encryption key id. + * + * @return the encryption key id + */ + public String getEncryptionKeyId() { + return this.encryptionKeyId; + } + + /** + * Sets the initialization vector. + * + * @param expectedInitializationVector + * the expected initialization vector + * @return the file info + */ + public FileInfo setInitializationVector(String expectedInitializationVector) { + this.initializationVector = expectedInitializationVector; + return this; + } + + /** + * Gets the initialization vector. + * + * @return the initialization vector + */ + public String getInitializationVector() { + return this.initializationVector; + } + + /** + * Sets the is primary. + * + * @param isPrimary + * the is primary + * @return the file info + */ + public FileInfo setIsPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Gets the checks if is primary. + * + * @return the checks if is primary + */ + public Boolean getIsPrimary() { + return this.isPrimary; + } + + /** + * Sets the created. + * + * @param created + * the created + * @return the file info + */ + public FileInfo setCreated(Date created) { + this.created = created; + return this; + } + + /** + * Sets the mime type. + * + * @param mimeType + * the mime type + * @return the file info + */ + public FileInfo setMimeType(String mimeType) { + this.mimeType = mimeType; + return this; + } + + /** + * Gets the mime type. + * + * @return the mime type + */ + public String getMimeType() { + return this.mimeType; + } + + /** + * Sets the content checksum. + * + * @param contentChecksum + * the content checksum + * @return the file info + */ + public FileInfo setContentChecksum(String contentChecksum) { + this.contentChecksum = contentChecksum; + return this; + } + + /** + * Gets the content checksum. + * + * @return the content checksum + */ + public String getContentChecksum() { + return this.contentChecksum; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Locator.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Locator.java deleted file mode 100644 index 2cfa54e1a429d..0000000000000 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Locator.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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 Locator { - private String id; - private Date expirationDatetime; - private String path; - private String accessPolicyId; - private String assetId; - private Date startTime; - private LocatorType locatorType; - - public String getId() { - return this.id; - } - - public Locator setId(String id) { - this.id = id; - return this; - } - - public Locator setExpirationDateTime(Date expirationDateTime) { - this.expirationDatetime = expirationDateTime; - return this; - } - - public Date getExpirationDateTime() { - return this.expirationDatetime; - } - - public Locator setLocatorType(LocatorType locatorType) { - this.locatorType = locatorType; - return this; - } - - public LocatorType getLocatorType() { - return this.locatorType; - } - - public Locator setPath(String path) { - this.path = path; - return this; - } - - public String getPath() { - return this.path; - } - - public Locator setAccessPolicyId(String accessPolicyId) { - this.accessPolicyId = accessPolicyId; - return this; - } - - public String getAccessPolicyId() { - return this.accessPolicyId; - } - - public Locator setAssetId(String assetId) { - this.assetId = assetId; - return this; - } - - public String getAssetId() { - return this.assetId; - } - - public Locator setStartTime(Date startTime) { - this.startTime = startTime; - return this; - } - - public Date getStartTime() { - return this.startTime; - } - -} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorInfo.java new file mode 100644 index 0000000000000..c90c38aba3e85 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorInfo.java @@ -0,0 +1,193 @@ +/* + * Copyright 2012 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; + +/** + * The Class LocatorInfo. + */ +public class LocatorInfo { + + /** The id. */ + private String id; + + /** The expiration datetime. */ + private Date expirationDatetime; + + /** The path. */ + private String path; + + /** The access policy id. */ + private String accessPolicyId; + + /** The asset id. */ + private String assetId; + + /** The start time. */ + private Date startTime; + + /** The locator type. */ + private LocatorType locatorType; + + /** + * Gets the id. + * + * @return the id + */ + public String getId() { + return this.id; + } + + /** + * Sets the id. + * + * @param id + * the id + * @return the locator info + */ + public LocatorInfo setId(String id) { + this.id = id; + return this; + } + + /** + * Sets the expiration date time. + * + * @param expirationDateTime + * the expiration date time + * @return the locator info + */ + public LocatorInfo setExpirationDateTime(Date expirationDateTime) { + this.expirationDatetime = expirationDateTime; + return this; + } + + /** + * Gets the expiration date time. + * + * @return the expiration date time + */ + public Date getExpirationDateTime() { + return this.expirationDatetime; + } + + /** + * Sets the locator type. + * + * @param locatorType + * the locator type + * @return the locator info + */ + public LocatorInfo setLocatorType(LocatorType locatorType) { + this.locatorType = locatorType; + return this; + } + + /** + * Gets the locator type. + * + * @return the locator type + */ + public LocatorType getLocatorType() { + return this.locatorType; + } + + /** + * Sets the path. + * + * @param path + * the path + * @return the locator info + */ + public LocatorInfo setPath(String path) { + this.path = path; + return this; + } + + /** + * Gets the path. + * + * @return the path + */ + public String getPath() { + return this.path; + } + + /** + * Sets the access policy id. + * + * @param accessPolicyId + * the access policy id + * @return the locator info + */ + public LocatorInfo setAccessPolicyId(String accessPolicyId) { + this.accessPolicyId = accessPolicyId; + return this; + } + + /** + * Gets the access policy id. + * + * @return the access policy id + */ + public String getAccessPolicyId() { + return this.accessPolicyId; + } + + /** + * Sets the asset id. + * + * @param assetId + * the asset id + * @return the locator info + */ + public LocatorInfo setAssetId(String assetId) { + this.assetId = assetId; + return this; + } + + /** + * Gets the asset id. + * + * @return the asset id + */ + public String getAssetId() { + return this.assetId; + } + + /** + * Sets the start time. + * + * @param startTime + * the start time + * @return the locator info + */ + public LocatorInfo setStartTime(Date startTime) { + this.startTime = startTime; + return this; + } + + /** + * Gets the start time. + * + * @return the start time + */ + public Date getStartTime() { + return this.startTime; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorType.java index ef74b364fa655..3cc4a583b151d 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorType.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorType.java @@ -1,5 +1,5 @@ /** - * Copyright 2011 Microsoft Corporation + * Copyright 2012 Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +15,38 @@ package com.microsoft.windowsazure.services.media.models; +/** + * The Enum LocatorType. + */ public enum LocatorType { - None(0), SAS(1), Origin(2), WindowsAzureCDN(3); + /** The None. */ + None(0), + /** The sas. */ + SAS(1), + /** The Origin. */ + Origin(2), + /** The Windows azure cdn. */ + WindowsAzureCDN(3); + + /** The locator type code. */ private int locatorTypeCode; + /** + * Instantiates a new locator type. + * + * @param locatorTypeCode + * the locator type code + */ private LocatorType(int locatorTypeCode) { this.locatorTypeCode = locatorTypeCode; } + /** + * Gets the code. + * + * @return the code + */ public int getCode() { return this.locatorTypeCode; } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ProtectionKeyType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ProtectionKeyType.java index 88f0099e20bd9..e0ddb7911c4d2 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ProtectionKeyType.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ProtectionKeyType.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 Microsoft Corporation + * Copyright 2012 Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +15,32 @@ package com.microsoft.windowsazure.services.media.models; +/** + * The Enum ProtectionKeyType. + */ public enum ProtectionKeyType { + + /** The X509 certificate thumbprint. */ X509CertificateThumbprint(0); + /** The protection key type code. */ private int protectionKeyTypeCode; + /** + * Instantiates a new protection key type. + * + * @param protectionKeyTypeCode + * the protection key type code + */ private ProtectionKeyType(int protectionKeyTypeCode) { this.protectionKeyTypeCode = protectionKeyTypeCode; } + /** + * Gets the code. + * + * @return the code + */ public int getCode() { return protectionKeyTypeCode; } diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetInfoTest.java similarity index 60% rename from microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetTest.java rename to microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetInfoTest.java index d622d9473bb04..a1222e83d5234 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetInfoTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2011 Microsoft Corporation + * Copyright 2012 Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,16 +21,16 @@ import org.junit.Test; -public class AssetTest { +public class AssetInfoTest { @Test public void testGetSetId() { // Arrange String expectedId = "expectedId"; - Asset asset = new Asset(); + AssetInfo assetInfo = new AssetInfo(); // Act - String actualId = asset.setId(expectedId).getId(); + String actualId = assetInfo.setId(expectedId).getId(); // Assert assertEquals(expectedId, actualId); @@ -41,10 +41,10 @@ public void testGetSetId() { public void testGetSetState() { // Arrange AssetState expectedState = AssetState.Published; - Asset asset = new Asset(); + AssetInfo assetInfo = new AssetInfo(); // Act - AssetState actualState = asset.setState(expectedState).getState(); + AssetState actualState = assetInfo.setState(expectedState).getState(); // Assert assertEquals(expectedState, actualState); @@ -54,10 +54,10 @@ public void testGetSetState() { public void testGetSetCreated() { // Arrange Date expectedCreated = new Date(); - Asset asset = new Asset(); + AssetInfo assetInfo = new AssetInfo(); // Act - Date actualCreated = asset.setCreate(expectedCreated).getCreated(); + Date actualCreated = assetInfo.setCreate(expectedCreated).getCreated(); // Assert assertEquals(expectedCreated, actualCreated); @@ -68,10 +68,10 @@ public void testGetSetCreated() { public void testGetSetLastModified() { // Arrange Date expectedLastModified = new Date(); - Asset asset = new Asset(); + AssetInfo assetInfo = new AssetInfo(); // Act - Date actualLastModified = asset.setLastModified(expectedLastModified).getLastModified(); + Date actualLastModified = assetInfo.setLastModified(expectedLastModified).getLastModified(); // Assert assertEquals(expectedLastModified, actualLastModified); @@ -81,10 +81,10 @@ public void testGetSetLastModified() { public void testGetSetAlternateId() { // Arrange String expectedAlternateId = "testAlternateId"; - Asset asset = new Asset(); + AssetInfo assetInfo = new AssetInfo(); // Act - String actualAlternateId = asset.setAlternateId(expectedAlternateId).getAlternateId(); + String actualAlternateId = assetInfo.setAlternateId(expectedAlternateId).getAlternateId(); // Assert assertEquals(expectedAlternateId, actualAlternateId); @@ -94,10 +94,10 @@ public void testGetSetAlternateId() { public void testGetSetName() { // Arrange String expectedName = "testName"; - Asset asset = new Asset(); + AssetInfo assetInfo = new AssetInfo(); // Act - String actualName = asset.setName(expectedName).getName(); + String actualName = assetInfo.setName(expectedName).getName(); // Assert assertEquals(expectedName, actualName); @@ -107,10 +107,10 @@ public void testGetSetName() { public void testGetSetOptions() { // Arrange EncryptionOption expectedOptions = EncryptionOption.None; - Asset asset = new Asset(); + AssetInfo assetInfo = new AssetInfo(); // Act - EncryptionOption actualOptions = asset.setOptions(expectedOptions).getOptions(); + EncryptionOption actualOptions = assetInfo.setOptions(expectedOptions).getOptions(); // Assert assertEquals(expectedOptions, actualOptions); @@ -119,11 +119,11 @@ public void testGetSetOptions() { @Test public void testGetSetLocators() { // Arrange - Iterable expectedLocators = new ArrayList(); - Asset asset = new Asset(); + Iterable expectedLocators = new ArrayList(); + AssetInfo assetInfo = new AssetInfo(); // Act - Iterable actualLocators = asset.setLocators(expectedLocators).getLocators(); + Iterable actualLocators = assetInfo.setLocators(expectedLocators).getLocators(); // Assert assertEquals(expectedLocators, actualLocators); @@ -132,11 +132,11 @@ public void testGetSetLocators() { @Test public void testGetSetContentKeys() { // Arrange - Iterable expectedContentKeys = new ArrayList(); - Asset asset = new Asset(); + Iterable expectedContentKeys = new ArrayList(); + AssetInfo assetInfo = new AssetInfo(); // Act - Iterable actualContentKeys = asset.setContentKeys(expectedContentKeys).getContentKeys(); + Iterable actualContentKeys = assetInfo.setContentKeys(expectedContentKeys).getContentKeys(); // Assert assertEquals(expectedContentKeys, actualContentKeys); @@ -145,11 +145,11 @@ public void testGetSetContentKeys() { @Test public void testGetSetFiles() { // Arrange - Iterable expectedFiles = new ArrayList(); - Asset asset = new Asset(); + Iterable expectedFiles = new ArrayList(); + AssetInfo assetInfo = new AssetInfo(); // Act - Iterable actualFiles = asset.setFiles(expectedFiles).getFiles(); + Iterable actualFiles = assetInfo.setFiles(expectedFiles).getFiles(); // Assert assertEquals(expectedFiles, actualFiles); @@ -158,11 +158,11 @@ public void testGetSetFiles() { @Test public void testGetSetParentAsset() { // Arrange - Iterable expectedParentAssets = new ArrayList(); - Asset asset = new Asset(); + Iterable expectedParentAssets = new ArrayList(); + AssetInfo asset = new AssetInfo(); // Act - Iterable actualAssets = asset.setParentAssets(expectedParentAssets).getParentAssets(); + Iterable actualAssets = asset.setParentAssets(expectedParentAssets).getParentAssets(); // Assert assertEquals(expectedParentAssets, actualAssets); diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfoTest.java similarity index 65% rename from microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyTest.java rename to microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfoTest.java index a2cf7644b10db..eddd15aad4e1f 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfoTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2011 Microsoft Corporation + * Copyright 2012 Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,16 +20,16 @@ import org.junit.Test; -public class ContentKeyTest { +public class ContentKeyInfoTest { @Test public void testGetSetId() { // Arrange String expectedId = "expectedId"; - ContentKey contentKey = new ContentKey(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); // Act - String actualId = contentKey.setId(expectedId).getId(); + String actualId = contentKeyInfo.setId(expectedId).getId(); // Assert assertEquals(expectedId, actualId); @@ -39,10 +39,10 @@ public void testGetSetId() { public void testGetSetCreated() { // Arrange Date expectedCreated = new Date(); - ContentKey contentKey = new ContentKey(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); // Act - Date actualCreated = contentKey.setCreated(expectedCreated).getCreated(); + Date actualCreated = contentKeyInfo.setCreated(expectedCreated).getCreated(); // Assert assertEquals(expectedCreated, actualCreated); @@ -52,10 +52,10 @@ public void testGetSetCreated() { public void testGetSetLastModified() { // Arrange Date expectedLastModified = new Date(); - ContentKey contentKey = new ContentKey(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); // Act - Date actualLastModified = contentKey.setLastModified(expectedLastModified).getLastModified(); + Date actualLastModified = contentKeyInfo.setLastModified(expectedLastModified).getLastModified(); // Assert assertEquals(expectedLastModified, actualLastModified); @@ -65,10 +65,11 @@ public void testGetSetLastModified() { public void testGetSetContentKeyType() { // Arrange ContentKeyType expectedContentKeyType = ContentKeyType.ConfigurationEncryption; - ContentKey contentKey = new ContentKey(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); // Act - ContentKeyType actualContentKeyType = contentKey.setContentKeyType(expectedContentKeyType).getContentKeyType(); + ContentKeyType actualContentKeyType = contentKeyInfo.setContentKeyType(expectedContentKeyType) + .getContentKeyType(); // Assert assertEquals(expectedContentKeyType, actualContentKeyType); @@ -79,10 +80,10 @@ public void testGetSetContentKeyType() { public void testGetSetEncryptedContentKey() { // Arrange String expectedEncryptedContentKey = "testX509Certificate"; - ContentKey contentKey = new ContentKey(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); // Act - String actualEncryptedContentKey = contentKey.setEncryptedContentKey(expectedEncryptedContentKey) + String actualEncryptedContentKey = contentKeyInfo.setEncryptedContentKey(expectedEncryptedContentKey) .getEncryptedContentKey(); // Assert @@ -93,10 +94,10 @@ public void testGetSetEncryptedContentKey() { public void testGetSetName() { // Arrange String expectedName = "expectedName"; - ContentKey contentKey = new ContentKey(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); // Act - String actualName = contentKey.setName(expectedName).getName(); + String actualName = contentKeyInfo.setName(expectedName).getName(); // Assert assertEquals(expectedName, actualName); @@ -106,10 +107,10 @@ public void testGetSetName() { public void testGetSetProtectionKeyId() { // Arrange String expectedProtectionKeyId = "expectedProtectionKeyId"; - ContentKey contentKey = new ContentKey(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); // Act - String actualProtectionKeyId = contentKey.setProtectionKeyId(expectedProtectionKeyId).getProtectionKeyId(); + String actualProtectionKeyId = contentKeyInfo.setProtectionKeyId(expectedProtectionKeyId).getProtectionKeyId(); // Assert assertEquals(expectedProtectionKeyId, actualProtectionKeyId); @@ -120,10 +121,10 @@ public void testGetSetProtectionKeyId() { public void testGetSetProtectionKeyType() { // Arrange ProtectionKeyType expectedProtectionKeyType = ProtectionKeyType.X509CertificateThumbprint; - ContentKey contentKey = new ContentKey(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); // Act - ProtectionKeyType actualProtectionKeyType = contentKey.setProtectionKeyType(expectedProtectionKeyType) + ProtectionKeyType actualProtectionKeyType = contentKeyInfo.setProtectionKeyType(expectedProtectionKeyType) .getProtectionKeyType(); // Assert @@ -134,10 +135,10 @@ public void testGetSetProtectionKeyType() { public void testGetSetCheckSum() { // Arrange String expectedCheckSum = "testCheckSum"; - ContentKey contentKey = new ContentKey(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); // Act - String actualCheckSum = contentKey.setCheckSum(expectedCheckSum).getCheckSum(); + String actualCheckSum = contentKeyInfo.setCheckSum(expectedCheckSum).getCheckSum(); // Assert assertEquals(expectedCheckSum, actualCheckSum); diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/FileTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/FileInfoTest.java similarity index 66% rename from microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/FileTest.java rename to microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/FileInfoTest.java index 3a4a760cdbacd..3e32e0626a7ab 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/FileTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/FileInfoTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2011 Microsoft Corporation + * Copyright 2012 Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,13 +20,13 @@ import org.junit.Test; -public class FileTest { +public class FileInfoTest { @Test public void testGetSetId() { // Arrange String expectedId = "testId"; - File file = new File(); + FileInfo file = new FileInfo(); // Act String actualId = file.setId(expectedId).getId(); @@ -39,10 +39,10 @@ public void testGetSetId() { public void testGetSetName() { // Arrange String expectedName = "testName"; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - String actualName = file.setName(expectedName).getName(); + String actualName = fileInfo.setName(expectedName).getName(); // Assert assertEquals(expectedName, actualName); @@ -52,10 +52,10 @@ public void testGetSetName() { public void testGetSetContentFileSize() { // Arrange int expectedContentFileSize = 1234; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - int actualContentFileSize = file.setContentFileSize(expectedContentFileSize).getContentFileSize(); + int actualContentFileSize = fileInfo.setContentFileSize(expectedContentFileSize).getContentFileSize(); // Assert assertEquals(expectedContentFileSize, actualContentFileSize); @@ -66,10 +66,10 @@ public void testGetSetContentFileSize() { public void testGetSetParentAssetId() { // Arrange String expectedParentAssetId = "testParentAssetId"; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - String actualParentAssetId = file.setParentAssetId(expectedParentAssetId).getParentAssetId(); + String actualParentAssetId = fileInfo.setParentAssetId(expectedParentAssetId).getParentAssetId(); // Assert assertEquals(expectedParentAssetId, actualParentAssetId); @@ -79,10 +79,11 @@ public void testGetSetParentAssetId() { public void testGetSetEncryptionVersion() { // Arrange String expectedEncryptionVersion = "testEncryptionVersion"; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - String actualEncryptionVersion = file.setEncryptionVersion(expectedEncryptionVersion).getEncryptionVersion(); + String actualEncryptionVersion = fileInfo.setEncryptionVersion(expectedEncryptionVersion) + .getEncryptionVersion(); // Assert assertEquals(expectedEncryptionVersion, actualEncryptionVersion); @@ -92,10 +93,10 @@ public void testGetSetEncryptionVersion() { public void testGetSetEncryptionScheme() { // Arrange String expectedEncryptionScheme = "testEncryptionScheme"; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - String actualEncryptionScheme = file.setEncryptionScheme(expectedEncryptionScheme).getEncryptionScheme(); + String actualEncryptionScheme = fileInfo.setEncryptionScheme(expectedEncryptionScheme).getEncryptionScheme(); // Assert assertEquals(expectedEncryptionScheme, actualEncryptionScheme); @@ -105,10 +106,10 @@ public void testGetSetEncryptionScheme() { public void testGetSetIsEncrypted() { // Arrange Boolean expectedIsEncrypted = true; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - Boolean actualIsEncrypted = file.setIsEncrypted(expectedIsEncrypted).getIsEncrypted(); + Boolean actualIsEncrypted = fileInfo.setIsEncrypted(expectedIsEncrypted).getIsEncrypted(); // Assert assertEquals(expectedIsEncrypted, actualIsEncrypted); @@ -118,10 +119,10 @@ public void testGetSetIsEncrypted() { public void testGetSetEncryptionKeyId() { // Arrange String expectedEncryptionKeyId = "testEncryptionKeyId"; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - String actualEncryptionKeyId = file.setEncryptionKeyId(expectedEncryptionKeyId).getEncryptionKeyId(); + String actualEncryptionKeyId = fileInfo.setEncryptionKeyId(expectedEncryptionKeyId).getEncryptionKeyId(); // Assert assertEquals(expectedEncryptionKeyId, actualEncryptionKeyId); @@ -131,10 +132,10 @@ public void testGetSetEncryptionKeyId() { public void testGetSetInitializationVector() { // Arrange String expectedInitializationVector = "testInitializationVector"; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - String actualInitializationVector = file.setInitializationVector(expectedInitializationVector) + String actualInitializationVector = fileInfo.setInitializationVector(expectedInitializationVector) .getInitializationVector(); // Assert @@ -146,10 +147,10 @@ public void testGetSetInitializationVector() { public void testGetSetIsPrimary() { // Arrange Boolean expectedIsPrimary = true; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - Boolean actualIsPrimary = file.setIsPrimary(expectedIsPrimary).getIsPrimary(); + Boolean actualIsPrimary = fileInfo.setIsPrimary(expectedIsPrimary).getIsPrimary(); // Assert assertEquals(expectedIsPrimary, actualIsPrimary); @@ -159,10 +160,10 @@ public void testGetSetIsPrimary() { public void testGetSetLastModified() { // Arrange Date expectedLastModified = new Date(); - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - Date actualLastModified = file.setLastModified(expectedLastModified).getLastModified(); + Date actualLastModified = fileInfo.setLastModified(expectedLastModified).getLastModified(); // Assert assertEquals(expectedLastModified, actualLastModified); @@ -172,10 +173,10 @@ public void testGetSetLastModified() { public void testGetSetCreated() { // Arrange Date expectedCreated = new Date(); - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - Date actualCreated = file.setCreated(expectedCreated).getCreated(); + Date actualCreated = fileInfo.setCreated(expectedCreated).getCreated(); // Assert assertEquals(expectedCreated, actualCreated); @@ -185,10 +186,10 @@ public void testGetSetCreated() { public void testGetSetMimeType() { // Arrange String expectedMimeType = "testMimeType"; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - String actualMimeType = file.setMimeType(expectedMimeType).getMimeType(); + String actualMimeType = fileInfo.setMimeType(expectedMimeType).getMimeType(); // Assert assertEquals(expectedMimeType, actualMimeType); @@ -198,10 +199,10 @@ public void testGetSetMimeType() { public void testGetSetContentChecksum() { // Arrange String expectedContentChecksum = "testContentChecksum"; - File file = new File(); + FileInfo fileInfo = new FileInfo(); // Act - String actualContentChecksum = file.setContentChecksum(expectedContentChecksum).getContentChecksum(); + String actualContentChecksum = fileInfo.setContentChecksum(expectedContentChecksum).getContentChecksum(); // Assert assertEquals(expectedContentChecksum, actualContentChecksum); diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorInfoTest.java similarity index 70% rename from microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorTest.java rename to microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorInfoTest.java index c4c0da8c02f4e..c749bd1b23cb5 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorInfoTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2011 Microsoft Corporation + * Copyright 2012 Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,13 +20,13 @@ import org.junit.Test; -public class LocatorTest { +public class LocatorInfoTest { @Test public void testGetSetId() { // Arrange String expectedId = "testId"; - Locator locator = new Locator(); + LocatorInfo locator = new LocatorInfo(); // Act String actualId = locator.setId(expectedId).getId(); @@ -39,10 +39,10 @@ public void testGetSetId() { public void testGetSetExpirationDateTime() { // Arrange Date expectedExpirationDateTime = new Date(); - Locator locator = new Locator(); + LocatorInfo locatorInfo = new LocatorInfo(); // Act - Date actualExpirationDateTime = locator.setExpirationDateTime(expectedExpirationDateTime) + Date actualExpirationDateTime = locatorInfo.setExpirationDateTime(expectedExpirationDateTime) .getExpirationDateTime(); // Assert @@ -53,10 +53,10 @@ public void testGetSetExpirationDateTime() { public void testGetSetType() { // Arrange LocatorType expectedLocatorType = LocatorType.WindowsAzureCDN; - Locator locator = new Locator(); + LocatorInfo locatorInfo = new LocatorInfo(); // Act - LocatorType actualLocatorType = locator.setLocatorType(expectedLocatorType).getLocatorType(); + LocatorType actualLocatorType = locatorInfo.setLocatorType(expectedLocatorType).getLocatorType(); // Assert assertEquals(expectedLocatorType, actualLocatorType); @@ -66,10 +66,10 @@ public void testGetSetType() { public void testGetSetPath() { // Arrange String expectedPath = "testPath"; - Locator locator = new Locator(); + LocatorInfo locatorInfo = new LocatorInfo(); // Act - String actualPath = locator.setPath(expectedPath).getPath(); + String actualPath = locatorInfo.setPath(expectedPath).getPath(); // Assert assertEquals(expectedPath, actualPath); @@ -79,10 +79,10 @@ public void testGetSetPath() { public void testGetSetAccessPolicyId() { // Arrange String expectedAccessPolicyId = "testAccessPolicyId"; - Locator locator = new Locator(); + LocatorInfo locatorInfo = new LocatorInfo(); // Act - String actualAccessPolicyId = locator.setAccessPolicyId(expectedAccessPolicyId).getAccessPolicyId(); + String actualAccessPolicyId = locatorInfo.setAccessPolicyId(expectedAccessPolicyId).getAccessPolicyId(); // Assert assertEquals(expectedAccessPolicyId, actualAccessPolicyId); @@ -92,10 +92,10 @@ public void testGetSetAccessPolicyId() { public void testGetSetAssetId() { // Arrange String expectedAssetId = "testAssetId"; - Locator locator = new Locator(); + LocatorInfo locatorInfo = new LocatorInfo(); // Act - String actualAssetId = locator.setAssetId(expectedAssetId).getAssetId(); + String actualAssetId = locatorInfo.setAssetId(expectedAssetId).getAssetId(); // Assert assertEquals(expectedAssetId, actualAssetId); @@ -105,10 +105,10 @@ public void testGetSetAssetId() { public void testGetSetStartTime() { // Arrange Date expectedStartTime = new Date(); - Locator locator = new Locator(); + LocatorInfo locatorInfo = new LocatorInfo(); // Act - Date actualStartTime = locator.setStartTime(expectedStartTime).getStartTime(); + Date actualStartTime = locatorInfo.setStartTime(expectedStartTime).getStartTime(); // Assert assertEquals(expectedStartTime, actualStartTime);