Skip to content

Commit

Permalink
Merge branch 'dev' into remove_storage
Browse files Browse the repository at this point in the history
Conflicts:
	microsoft-azure-api-media/src/main/resources/META-INF/services/com.microsoft.windowsazure.services.core.Builder$Exports
	microsoft-azure-api-parent/pom.xml
	microsoft-azure-api-storage/src/main/resources/META-INF/services/com.microsoft.windowsazure.services.core.Builder$Exports
  • Loading branch information
Andre Rodrigues committed Dec 17, 2013
2 parents e1c0a15 + a742050 commit f729149
Show file tree
Hide file tree
Showing 216 changed files with 19,725 additions and 1,793 deletions.
38 changes: 37 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# Azure Tooling #
node_modules

# Eclipse #
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# Other Tooling #
.classpath
.project
target
node_modules
.idea
*.iml

# Mac OS #
.DS_Store
.DS_Store?

# Windows #
Thumbs.db
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ public String getRawResponseBody() {
public static ServiceException createFromXml(HttpRequest httpRequest, String requestContent, HttpResponse httpResponse, HttpEntity entity)
{
try {
// TODO: actually implement this
ServiceException serviceException = new ServiceException();
serviceException.setErrorMessage(EntityUtils.toString(entity));
return serviceException;
}
catch (IOException e) {
return new ServiceException();
}
}

public static ServiceException createFromJson(HttpRequest httpRequest, String requestContent, HttpResponse httpResponse, HttpEntity entity)
{
try {
// TODO: actually implement this
ServiceException serviceException = new ServiceException();
serviceException.setErrorMessage(EntityUtils.toString(entity));
return serviceException;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Copyright 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.core;

import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;

public class TimeSpan8601Converter {
public static String format(Duration duration) {
return duration.toString();
}

public static Duration parse(String duration) {
try {
DatatypeFactory factory = DatatypeFactory.newInstance();
return factory.newDuration(duration);
}
catch (DatatypeConfigurationException e)
{
String msg = String.format("The value \"%s\" is not a valid ISO8601 duration.", duration);
throw new IllegalArgumentException(msg, e);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
com.microsoft.windowsazure.services.blob.Exports
com.microsoft.windowsazure.services.queue.Exports
com.microsoft.windowsazure.services.table.Exports
com.microsoft.windowsazure.services.serviceBus.Exports
com.microsoft.windowsazure.services.serviceBus.implementation.Exports
com.microsoft.windowsazure.services.core.utils.Exports
com.microsoft.windowsazure.services.core.utils.pipeline.Exports
com.microsoft.windowsazure.services.media.Exports
com.microsoft.windowsazure.services.management.Exports
com.microsoft.windowsazure.services.core.utils.pipeline.Exports
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Copyright 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.core;

import static org.junit.Assert.*;

import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
import org.junit.Test;

public class TimeSpan8601ConverterTests {
@Test
public void formatShouldWork() throws Exception {
DatatypeFactory dataTypeFactory = DatatypeFactory.newInstance();
Duration duration = dataTypeFactory.newDurationDayTime(true, 0, 3, 10, 2);
String durationString = TimeSpan8601Converter.format(duration);

assertEquals("P0DT3H10M2S", durationString);
}

@Test
public void parseShouldWork() throws Exception {
Duration duration = TimeSpan8601Converter.parse("P0DT3H10M2S");

assertEquals(0, duration.getDays());
assertEquals(3, duration.getHours());
assertEquals(10, duration.getMinutes());
assertEquals(2, duration.getSeconds());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Map.Entry;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
Expand Down Expand Up @@ -270,7 +270,7 @@ public OperationResponse beginChangingConfigurationByName(String serviceName, St
if (parameters.getExtendedProperties() != null)
{
Element extendedPropertiesDictionaryElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ExtendedProperties");
for (Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
for (Map.Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
{
String extendedPropertiesKey = entry.getKey();
String extendedPropertiesValue = entry.getValue();
Expand Down Expand Up @@ -505,7 +505,7 @@ public OperationResponse beginChangingConfigurationBySlot(String serviceName, De
if (parameters.getExtendedProperties() != null)
{
Element extendedPropertiesDictionaryElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ExtendedProperties");
for (Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
for (Map.Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
{
String extendedPropertiesKey = entry.getKey();
String extendedPropertiesValue = entry.getValue();
Expand Down Expand Up @@ -764,7 +764,7 @@ public OperationResponse beginCreating(String serviceName, DeploymentSlot deploy
if (parameters.getExtendedProperties() != null)
{
Element extendedPropertiesDictionaryElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ExtendedProperties");
for (Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
for (Map.Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
{
String extendedPropertiesKey = entry.getKey();
String extendedPropertiesValue = entry.getValue();
Expand Down Expand Up @@ -1977,7 +1977,7 @@ public OperationResponse beginUpgradingByName(String serviceName, String deploym
if (parameters.getExtendedProperties() != null)
{
Element extendedPropertiesDictionaryElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ExtendedProperties");
for (Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
for (Map.Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
{
String extendedPropertiesKey = entry.getKey();
String extendedPropertiesValue = entry.getValue();
Expand Down Expand Up @@ -2271,7 +2271,7 @@ public OperationResponse beginUpgradingBySlot(String serviceName, DeploymentSlot
if (parameters.getExtendedProperties() != null)
{
Element extendedPropertiesDictionaryElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ExtendedProperties");
for (Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
for (Map.Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
{
String extendedPropertiesKey = entry.getKey();
String extendedPropertiesValue = entry.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Map.Entry;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
Expand Down Expand Up @@ -675,7 +675,7 @@ public OperationResponse create(HostedServiceCreateParameters parameters) throws
if (parameters.getExtendedProperties() != null)
{
Element extendedPropertiesDictionaryElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ExtendedProperties");
for (Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
for (Map.Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
{
String extendedPropertiesKey = entry.getKey();
String extendedPropertiesValue = entry.getValue();
Expand Down Expand Up @@ -3240,7 +3240,7 @@ public OperationResponse update(String serviceName, HostedServiceUpdateParameter
if (parameters.getExtendedProperties() != null)
{
Element extendedPropertiesDictionaryElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "ExtendedProperties");
for (Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
for (Map.Entry<String, String> entry : parameters.getExtendedProperties().entrySet())
{
String extendedPropertiesKey = entry.getKey();
String extendedPropertiesValue = entry.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
Expand Down Expand Up @@ -210,7 +211,9 @@ public VirtualMachineImageCreateResponse create(VirtualMachineImageCreateParamet
if (parameters.getPublishedDate() != null)
{
Element publishedDateElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublishedDate");
publishedDateElement.appendChild(requestDoc.createTextNode(parameters.getPublishedDate().toString()));
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmZ");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
publishedDateElement.appendChild(requestDoc.createTextNode(simpleDateFormat.format(parameters.getPublishedDate().getTime())));
oSImageElement.appendChild(publishedDateElement);
}

Expand Down Expand Up @@ -386,9 +389,9 @@ public VirtualMachineImageCreateResponse create(VirtualMachineImageCreateParamet
if (publishedDateElement2 != null && (publishedDateElement2.getTextContent() != null && publishedDateElement2.getTextContent().isEmpty() != true) == false)
{
Calendar publishedDateInstance;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
Calendar calendar = Calendar.getInstance();
calendar.setTime(simpleDateFormat.parse(publishedDateElement2.getTextContent()));
calendar.setTime(simpleDateFormat2.parse(publishedDateElement2.getTextContent()));
publishedDateInstance = calendar;
result.setPublishedDate(publishedDateInstance);
}
Expand Down Expand Up @@ -1183,7 +1186,9 @@ public VirtualMachineImageUpdateResponse update(String imageName, VirtualMachine
if (parameters.getPublishedDate() != null)
{
Element publishedDateElement = requestDoc.createElementNS("http://schemas.microsoft.com/windowsazure", "PublishedDate");
publishedDateElement.appendChild(requestDoc.createTextNode(parameters.getPublishedDate().toString()));
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmZ");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
publishedDateElement.appendChild(requestDoc.createTextNode(simpleDateFormat.format(parameters.getPublishedDate().getTime())));
oSImageElement.appendChild(publishedDateElement);
}

Expand Down Expand Up @@ -1355,9 +1360,9 @@ public VirtualMachineImageUpdateResponse update(String imageName, VirtualMachine
if (publishedDateElement2 != null && (publishedDateElement2.getTextContent() != null && publishedDateElement2.getTextContent().isEmpty() != true) == false)
{
Calendar publishedDateInstance;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
Calendar calendar = Calendar.getInstance();
calendar.setTime(simpleDateFormat.parse(publishedDateElement2.getTextContent()));
calendar.setTime(simpleDateFormat2.parse(publishedDateElement2.getTextContent()));
publishedDateInstance = calendar;
result.setPublishedDate(publishedDateInstance);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* An access control rule for a public endpoint
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* Parameters supplied to the Rollback Update Or Upgrade operation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* Parameters supplied to the Update Deployment Status operation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* Optional. Contains properties that specify a domain to which the virtual
* machine will be joined. This element is only used with the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* Contains properties that specify the endpoint settings which the Windows
* Azure load balancer uses to monitor the availability of this virtual machine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* Parameters supplied to the Create Service Certificate operation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* Contains upgrade details of the deployment.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* Parameters supplied to the Capture Virtual Machine operation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* The parameters required for shutting down the virtual machine
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

package com.microsoft.windowsazure.management.compute.models;


/**
* Contains the type and certificate information for the listener.
*/
Expand Down
Loading

0 comments on commit f729149

Please sign in to comment.