Permalink
Browse files

Merge branch 'dev' of https://github.com/gcheng/azure-sdk-for-java-pr

…into processresponse
  • Loading branch information...
Albert Cheng
Albert Cheng committed Jan 3, 2013
2 parents 1dc4905 + a882a64 commit 02cf9f94ce2c45c328c2627da8b49f46f28003af
Showing with 1,403 additions and 151 deletions.
  1. +6 −0 microsoft-azure-api/pom.xml
  2. +0 −2 ...re-api/src/main/java/com/microsoft/windowsazure/services/media/WritableBlobContainerContract.java
  3. +3 −3 ...c/main/java/com/microsoft/windowsazure/services/media/implementation/MediaExceptionProcessor.java
  4. +80 −0 ...c/main/java/com/microsoft/windowsazure/services/media/implementation/content/ErrorDetailType.java
  5. +45 −23 ...-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/TaskType.java
  6. +1 −1 ...c/main/java/com/microsoft/windowsazure/services/media/implementation/entities/EntityContract.java
  7. +2 −3 ...ervices/media/implementation/entities/{EntityCreationOperation.java → EntityCreateOperation.java}
  8. +1 −0 .../main/java/com/microsoft/windowsazure/services/media/implementation/entities/EntityOperation.java
  9. +2 −2 .../main/java/com/microsoft/windowsazure/services/media/implementation/entities/EntityRestProxy.java
  10. +3 −3 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AccessPolicy.java
  11. +3 −3 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Asset.java
  12. +2 −2 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetFile.java
  13. +37 −4 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKey.java
  14. +0 −1 ...soft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfo.java
  15. +0 −1 ...soft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyType.java
  16. +59 −0 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ErrorDetail.java
  17. +4 −8 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Job.java
  18. +5 −21 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Locator.java
  19. +0 −12 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/Task.java
  20. +14 −2 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/TaskInfo.java
  21. +31 −17 microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/TaskState.java
  22. +115 −0 microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/EncryptionHelper.java
  23. +209 −0 ...-azure-api/src/test/java/com/microsoft/windowsazure/services/media/EncryptionIntegrationTest.java
  24. +24 −0 microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/JobIntegrationTest.java
  25. +13 −26 ...ft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/LocatorIntegrationTests.java
  26. +2 −2 ...re-api/src/test/java/com/microsoft/windowsazure/services/media/models/AccessPolicyEntityTest.java
  27. +2 −2 ...azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetFileEntityTest.java
  28. +2 −2 ...zure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyEntityTest.java
  29. +89 −0 ...osoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/JobEntityTest.java
  30. +134 −0 microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/JobInfoTest.java
  31. +8 −11 ...t-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorEntityTest.java
  32. +50 −0 ...e-api/src/test/java/com/microsoft/windowsazure/services/media/models/ProtectionKeyEntityTest.java
  33. +184 −0 ...soft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/TaskEntityTest.java
  34. +273 −0 microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/TaskInfoTest.java
  35. BIN microsoft-azure-api/src/test/resources/media/SmallWMV.wmv
@@ -104,6 +104,12 @@
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk16</artifactId>
+ <version>1.46</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -35,8 +35,6 @@
/**
* Creates a block blob from a content stream.
*
- * @param container
- * A {@link String} containing the name of the container to create the blob in.
* @param blob
* A {@link String} containing the name of the blob to create. A blob name can contain any combination of
* characters, but reserved URL characters must be properly escaped. A blob name must be at least one
@@ -26,7 +26,7 @@
import com.microsoft.windowsazure.services.media.MediaContract;
import com.microsoft.windowsazure.services.media.WritableBlobContainerContract;
import com.microsoft.windowsazure.services.media.implementation.entities.EntityActionOperation;
-import com.microsoft.windowsazure.services.media.implementation.entities.EntityCreationOperation;
+import com.microsoft.windowsazure.services.media.implementation.entities.EntityCreateOperation;
import com.microsoft.windowsazure.services.media.implementation.entities.EntityDeleteOperation;
import com.microsoft.windowsazure.services.media.implementation.entities.EntityGetOperation;
import com.microsoft.windowsazure.services.media.implementation.entities.EntityListOperation;
@@ -92,10 +92,10 @@ private ServiceException processCatch(ServiceException e) {
}
/* (non-Javadoc)
- * @see com.microsoft.windowsazure.services.media.implementation.entities.EntityContract#create(com.microsoft.windowsazure.services.media.implementation.entities.EntityCreationOperation)
+ * @see com.microsoft.windowsazure.services.media.implementation.entities.EntityContract#create(com.microsoft.windowsazure.services.media.implementation.entities.EntityCreateOperation)
*/
@Override
- public <T> T create(EntityCreationOperation<T> creator) throws ServiceException {
+ public <T> T create(EntityCreateOperation<T> creator) throws ServiceException {
try {
return service.create(creator);
}
@@ -0,0 +1,80 @@
+/**
+ * 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.implementation.content;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * This type maps the XML returned in the odata ATOM serialization
+ * for ErrorDetail entities.
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+public class ErrorDetailType implements MediaServiceDTO {
+
+ /** The code. */
+ @XmlElement(name = "Code", namespace = Constants.ODATA_DATA_NS)
+ protected String code;
+
+ /** The message. */
+ @XmlElement(name = "Message", namespace = Constants.ODATA_DATA_NS)
+ protected String message;
+
+ /**
+ * Gets the code.
+ *
+ * @return the code
+ */
+ public String getCode() {
+ return code;
+ }
+
+ /**
+ * Sets the code.
+ *
+ * @param code
+ * the id to set
+ * @return the error detail type
+ */
+ public ErrorDetailType setCode(String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Gets the message.
+ *
+ * @return the message
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the message.
+ *
+ * @param message
+ * the message to set
+ * @return the error detail type
+ */
+ public ErrorDetailType setMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+}
@@ -21,6 +21,7 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
/**
* This type maps the XML returned in the odata ATOM serialization
@@ -39,8 +40,9 @@
@XmlElement(name = "EndTime", namespace = Constants.ODATA_DATA_NS)
protected Date endTime;
- @XmlElement(name = "ErrorDetails", namespace = Constants.ODATA_DATA_NS)
- protected String errorDetails;
+ @XmlElementWrapper(name = "ErrorDetails", namespace = Constants.ODATA_DATA_NS)
+ @XmlElement(name = "element", namespace = Constants.ODATA_DATA_NS)
+ protected List<ErrorDetailType> errorDetails;
@XmlElement(name = "MediaProcessorId", namespace = Constants.ODATA_DATA_NS)
protected String mediaProcessorId;
@@ -92,159 +94,179 @@ public String getId() {
return id;
}
- public void setId(String id) {
+ public TaskType setId(String id) {
this.id = id;
+ return this;
}
public String getConfiguration() {
return configuration;
}
- public void setConfiguration(String configuration) {
+ public TaskType setConfiguration(String configuration) {
this.configuration = configuration;
+ return this;
}
public Date getEndTime() {
return endTime;
}
- public void setEndTime(Date endTime) {
+ public TaskType setEndTime(Date endTime) {
this.endTime = endTime;
+ return this;
}
- public String getErrorDetails() {
+ public List<ErrorDetailType> getErrorDetails() {
return errorDetails;
}
- public void setErrorDetails(String errorDetails) {
+ public TaskType setErrorDetails(List<ErrorDetailType> errorDetails) {
this.errorDetails = errorDetails;
+ return this;
}
public String getMediaProcessorId() {
return mediaProcessorId;
}
- public void setMediaProcessorId(String mediaProcessorId) {
+ public TaskType setMediaProcessorId(String mediaProcessorId) {
this.mediaProcessorId = mediaProcessorId;
+ return this;
}
public String getName() {
return name;
}
- public void setName(String name) {
+ public TaskType setName(String name) {
this.name = name;
+ return this;
}
public String getPerfMessage() {
return perfMessage;
}
- public void setPerfMessage(String perfMessage) {
+ public TaskType setPerfMessage(String perfMessage) {
this.perfMessage = perfMessage;
+ return this;
}
public Integer getPriority() {
return priority;
}
- public void setPriority(Integer priority) {
+ public TaskType setPriority(Integer priority) {
this.priority = priority;
+ return this;
}
public Double getProgress() {
return progress;
}
- public void setProgress(Double progress) {
+ public TaskType setProgress(Double progress) {
this.progress = progress;
+ return this;
}
public Double getRunningDuration() {
return runningDuration;
}
- public void setRunningDuration(Double runningDuration) {
+ public TaskType setRunningDuration(Double runningDuration) {
this.runningDuration = runningDuration;
+ return this;
}
public Date getStartTime() {
return startTime;
}
- public void setStartTime(Date startTime) {
+ public TaskType setStartTime(Date startTime) {
this.startTime = startTime;
+ return this;
}
public Integer getState() {
return state;
}
- public void setState(Integer state) {
+ public TaskType setState(Integer state) {
this.state = state;
+ return this;
}
public String getTaskBody() {
return taskBody;
}
- public void setTaskBody(String taskBody) {
+ public TaskType setTaskBody(String taskBody) {
this.taskBody = taskBody;
+ return this;
}
public Integer getOptions() {
return options;
}
- public void setOptions(Integer options) {
+ public TaskType setOptions(Integer options) {
this.options = options;
+ return this;
}
public String getEncryptionKeyId() {
return encryptionKeyId;
}
- public void setEncryptionKeyId(String encryptionKeyId) {
+ public TaskType setEncryptionKeyId(String encryptionKeyId) {
this.encryptionKeyId = encryptionKeyId;
+ return this;
}
public String getEncryptionScheme() {
return encryptionScheme;
}
- public void setEncryptionScheme(String encryptionScheme) {
+ public TaskType setEncryptionScheme(String encryptionScheme) {
this.encryptionScheme = encryptionScheme;
+ return this;
}
public String getEncryptionVersion() {
return encryptionVersion;
}
- public void setEncryptionVersion(String encryptionVersion) {
+ public TaskType setEncryptionVersion(String encryptionVersion) {
this.encryptionVersion = encryptionVersion;
+ return this;
}
public String getInitializationVector() {
return initializationVector;
}
- public void setInitializationVector(String initializationVector) {
+ public TaskType setInitializationVector(String initializationVector) {
this.initializationVector = initializationVector;
+ return this;
}
public List<String> getOutputMediaAssets() {
return outputMediaAssets;
}
- public void setOutputMediaAssets(List<String> outputMediaAssets) {
+ public TaskType setOutputMediaAssets(List<String> outputMediaAssets) {
this.outputMediaAssets = outputMediaAssets;
+ return this;
}
public List<String> getInputMediaAssets() {
return inputMediaAssets;
}
- public void setInputMediaAssets(List<String> inputMediaAssets) {
+ public TaskType setInputMediaAssets(List<String> inputMediaAssets) {
this.inputMediaAssets = inputMediaAssets;
+ return this;
}
}
@@ -34,7 +34,7 @@
* @return
* The created entity
*/
- public abstract <T> T create(EntityCreationOperation<T> creator) throws ServiceException;
+ public abstract <T> T create(EntityCreateOperation<T> creator) throws ServiceException;
/**
* Retrieve an existing entity by id
@@ -17,14 +17,13 @@
import com.microsoft.windowsazure.services.core.ServiceException;
-// TODO: Auto-generated Javadoc
/**
- * The Interface EntityCreationOperation.
+ * The Interface EntityCreateOperation.
*
* @param <T>
* the generic type
*/
-public interface EntityCreationOperation<T> extends EntityOperationSingleResult<T> {
+public interface EntityCreateOperation<T> extends EntityOperationSingleResult<T> {
/**
* Get the object to be sent to the server containing
@@ -25,6 +25,7 @@
* Supplies the current proxy information to the action.
*
* @param proxyData
+ * @return
*/
void setProxyData(EntityProxyData proxyData);
@@ -103,11 +103,11 @@ private Builder getResource(EntityOperation operation) throws ServiceException {
}
/* (non-Javadoc)
- * @see com.microsoft.windowsazure.services.media.implementation.entities.EntityContract#create(com.microsoft.windowsazure.services.media.implementation.entities.EntityCreationOperation)
+ * @see com.microsoft.windowsazure.services.media.implementation.entities.EntityContract#create(com.microsoft.windowsazure.services.media.implementation.entities.EntityCreateOperation)
*/
@SuppressWarnings("unchecked")
@Override
- public <T> T create(EntityCreationOperation<T> creator) throws ServiceException {
+ public <T> T create(EntityCreateOperation<T> creator) throws ServiceException {
creator.setProxyData(createProxyData());
Object rawResponse = getResource(creator).post(creator.getResponseClass(), creator.getRequestContents());
Object processedResponse = creator.processResponse(rawResponse);
Oops, something went wrong.

0 comments on commit 02cf9f9

Please sign in to comment.