forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Asset, ContentKey, File and Locator classes.
- Loading branch information
Albert Cheng
committed
Aug 26, 2012
1 parent
af16f0e
commit b2c91d1
Showing
13 changed files
with
1,297 additions
and
0 deletions.
There are no files selected for viewing
132 changes: 132 additions & 0 deletions
132
...osoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
117 changes: 117 additions & 0 deletions
117
...-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
...re-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...-api/src/main/java/com/microsoft/windowsazure/services/media/models/EncryptionOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.