Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge the master to dev for release 0.4.5 #399

Merged
merged 70 commits into from
Sep 12, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
0145df6
initial check in for affinity group.
Jun 5, 2013
6a8db2e
add management integration test.
Jun 5, 2013
27ad4dd
initial check in to support SSL.
Jun 12, 2013
6a9c1f7
adds prototype support for key store and trust store.
Jun 13, 2013
47a8e1e
intermedia checkin for affinity group support.
Jun 17, 2013
4251b73
update on service management infrastructure.
Jun 18, 2013
7a2e1d3
update on affinity group unit tests.
Jun 20, 2013
82e7af3
update management integration test.
Jun 20, 2013
f5718f0
add classes into models directory.
Jun 20, 2013
4ce3212
Merge branch 'affinitygroup' of https://github.com/gcheng/azure-sdk-f…
Jun 20, 2013
562152b
Merge branch 'affinitygroup' of https://github.com/gcheng/azure-sdk-f…
Jun 20, 2013
bed64a0
update service management configuration class.
Jun 20, 2013
0471281
modify jaxb plugin to enable generate both service management and ser…
Jun 21, 2013
6b924fa
fix a eclipse plugin issue
Jun 21, 2013
885ae1d
throw the right type of exception during initialization.
Jun 21, 2013
a6da1d5
add affinity group info factory and affinity group info list factory.
Jun 21, 2013
84eacac
adds implementation to management rest proxy.
Jun 21, 2013
a99994b
complete the logic for management rest proxy for affinity group.
Jun 21, 2013
7bcbe45
implement management exception processor.
Jun 21, 2013
b7c912d
adds Microsoft copyright headers.
Jun 22, 2013
5c3228b
update configuration to support password for management configuration.
Jun 22, 2013
f63f83f
check in community contribution.
Jun 29, 2013
1a9adee
Supports Client Certificate validation.
Jul 8, 2013
8ae3474
Gets create affinity group call success.
Jul 9, 2013
127c996
enable enviroment variable injection for service management.
Jul 9, 2013
cf62e01
get all the methods functioning.
Jul 10, 2013
6c9cad8
make all the unit tests passed.
Jul 12, 2013
17e8b82
remove dependency on google gauva.
Jul 12, 2013
7939e51
add microsoft copy right.
Jul 12, 2013
f020b1f
refactor and clean up service managmenet infrastructure code.
Jul 13, 2013
21d4be3
refactor service managment infrastructure.
Jul 14, 2013
f10daa8
clean up services.management directory.
Jul 14, 2013
3121aaa
adds user agent filter.
Jul 15, 2013
6789ac0
Merge pull request #125 from WindowsAzure/dev
Jul 15, 2013
3226710
Merge branch 'dev' of https://github.com/gcheng/azure-sdk-for-java-pr…
Jul 15, 2013
921a24e
fix warning.
Jul 17, 2013
3d6474b
put new service bus schema to the right place.
Jul 18, 2013
753e01b
address code review feedback for service management.
Jul 19, 2013
e4d705f
Merge pull request #696 from gcheng/affinitygroup
Jul 20, 2013
96d7842
Merge pull request #697 from gcheng/fixwarning
Jul 20, 2013
aa90e5e
refactor the infrastructure to allow service specific alter during IoC.
Jul 25, 2013
fa89d12
incorporated some code review feedback.
Jul 25, 2013
8dea288
Merge pull request #702 from gcheng/affinitygroup
Jul 25, 2013
f2775c4
initial check in to add job notification for media services.
Jul 30, 2013
538ccad
consolidate the create queue service into the BeforeClass method.
Jul 31, 2013
65d76fc
add list queue operation.
Jul 31, 2013
9aedc1b
interdiate checkin for job notification.
Aug 1, 2013
3c8e2d2
add NotificationEndPointIntegrationTest ...
Aug 2, 2013
18a086a
Merge pull request #704 from gcheng/deleteQueue
Aug 2, 2013
69a8214
the notification end point integration test passed.
Aug 2, 2013
d303c40
clean up the documentation for notification end point.
Aug 2, 2013
3e5d2d2
get integration test for job notification for media services working.
Aug 6, 2013
52a6610
add more unit tests for media service job notification.
Aug 8, 2013
398ad13
fix broken unit tests.
Aug 8, 2013
138b074
Merge pull request #126 from WindowsAzure/dev
Aug 8, 2013
7ccebab
design change of the option classes for service management.
Aug 8, 2013
efeabd4
let all the unit tests passed.
Aug 12, 2013
35e36bd
update the unit test for notification end point info according to code
Aug 13, 2013
b5bf1f3
Merge pull request #703 from gcheng/jobnotification
Aug 13, 2013
743ec08
Merge pull request #708 from gcheng/smfix
Aug 14, 2013
85d1211
fix a broken unit test.
Aug 14, 2013
13939c3
Merge pull request #716 from gcheng/jobnotification
Aug 14, 2013
3eb5eef
Merge pull request #727 from WindowsAzure/dev
Aug 15, 2013
fccbbd3
Merge pull request #395 from WindowsAzure/dev
Aug 15, 2013
df0da8b
update pom, readme and changelog for 0.4.5
guangyang Aug 22, 2013
bc35502
address code review feedback
guangyang Aug 22, 2013
5cfc888
Merge pull request #730 from guangyang/release
guangyang Aug 22, 2013
d712c5e
Merge branch 'release' of https://github.com/WindowsAzure/azure-sdk-f…
Sep 6, 2013
0ea3422
Merge pull request #397 from gcheng/release
Sep 6, 2013
599f8c9
Merge pull request #398 from WindowsAzure/release
Sep 6, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
2013.08.26 Version 0.4.5
* Added support for managing affinity groups
* Added support for Media Services job notification

2013.07.03 Version 0.4.4
* Windows Azure China environemnt support
* Windows Azure China environment support
* Service Bus metadata support updated to the latest version
* Rich Odata entity query support for Service Bus Queue/Topic/Subscription
* Added support for Service Bus message forwarding
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ This project provides a client library in Java that makes it easy to consume Win
* Create/Read/Update/Delete assets
* Create/Read/Update/Delete/Rebind content keys
* Create/Read/Update/Cancel/Delete jobs
* Add/Get job notifications
* Create/Read/Update/Delete notification endpoints
* Service Management
* Manage affinity groups
* Service Runtime
* Retrieve information about the state of your Azure Compute instances

Expand All @@ -59,7 +63,7 @@ within your project you can also have them installed by the Java package manager
<dependency>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
<version>0.4.4</version>
<version>0.4.5</version>
</dependency>
```

Expand Down
32 changes: 30 additions & 2 deletions microsoft-azure-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
<version>0.4.4</version>
<version>0.4.5</version>
<packaging>jar</packaging>

<name>Microsoft Windows Azure Client API</name>
Expand Down Expand Up @@ -134,7 +134,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
Expand All @@ -146,10 +146,38 @@
<version>0.8.3</version>
<executions>
<execution>
<id>serviceBus</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generateDirectory>target/generated-sources/xjc</generateDirectory>
<schemaDirectory>src/main/resources/serviceBus</schemaDirectory>
<schemaIncludes>
<include>servicebus-atom.xsd</include>
</schemaIncludes>
<generatePackage>com.microsoft.windowsazure.services.serviceBus.implementation</generatePackage>
<removeOldOutput>false</removeOldOutput>
<forceRegenerate>true</forceRegenerate>
</configuration>
</execution>
<execution>
<id>management</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generateDirectory>target/generated-sources/xjc</generateDirectory>
<schemaDirectory>src/main/resources/management/</schemaDirectory>
<schemaIncludes>
<include>schemas.microsoft.com.windowsazure.xsd</include>
</schemaIncludes>
<generatePackage>com.microsoft.windowsazure.services.management.implementation</generatePackage>
<removeOldOutput>false</removeOldOutput>
<forceRegenerate>true</forceRegenerate>
</configuration>
</execution>
</executions>
<configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
* 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
* 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.
* 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 java.util.Map;

public interface Builder {

public abstract <T> T build(String profile, Class<T> service, Map<String, Object> properties);
public abstract <S, T> T build(String profile, Class<S> service, Class<T> instance, Map<String, Object> properties);

public interface Factory<T> {
T create(String profile, Builder builder, Map<String, Object> properties);
<S> T create(String profile, Class<S> service, Builder builder, Map<String, Object> properties);
}

public interface Alteration<T> {
T alter(T instance, Builder builder, Map<String, Object> properties);
T alter(String profile, T instance, Builder builder, Map<String, Object> properties);
}

public interface Registry {
Expand All @@ -35,7 +35,7 @@ public interface Registry {

<T> Registry add(Factory<T> factory);

<T> void alter(Class<T> service, Alteration<T> alteration);
<S, T> void alter(Class<S> service, Class<T> instance, Alteration<T> alteration);
}

public interface Exports {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ public static Configuration load() throws IOException {
}

public <T> T create(Class<T> service) {
return builder.build("", service, properties);
return builder.build("", service, service, properties);
}

public <T> T create(String profile, Class<T> service) {
return builder.build(profile, service, properties);
return builder.build(profile, service, service, properties);
}

public Builder getBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* 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
* 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.
* 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;

Expand All @@ -30,11 +30,11 @@

public class DefaultBuilder implements Builder, Builder.Registry {
Map<Class<?>, Factory<?>> factories;
Map<Class<?>, List<Alteration<?>>> alterations;
Map<Class<?>, Map<Class<?>, List<Alteration<?>>>> alterations;

public DefaultBuilder() {
factories = new HashMap<Class<?>, Factory<?>>();
alterations = new HashMap<Class<?>, List<Alteration<?>>>();
alterations = new HashMap<Class<?>, Map<Class<?>, List<Alteration<?>>>>();
}

public static DefaultBuilder create() {
Expand All @@ -51,6 +51,7 @@ void addFactory(Class<?> service, Factory<?> factory) {
factories.put(service, factory);
}

@Override
public <T> Builder.Registry add(Class<T> service) {
return add(service, service);
}
Expand Down Expand Up @@ -84,15 +85,17 @@ Constructor<?> findInjectConstructor(Class<?> implementation) {
return withoutInject;
}

@Override
public <T, TImpl> Builder.Registry add(Class<T> service, final Class<TImpl> implementation) {
final Constructor<?> ctor = findInjectConstructor(implementation);
final Class<?>[] parameterTypes = ctor.getParameterTypes();
final Annotation[][] parameterAnnotations = ctor.getParameterAnnotations();

addFactory(service, new Builder.Factory<T>() {
@Override
@SuppressWarnings("unchecked")
public T create(String profile, Builder builder, Map<String, Object> properties) {
Object[] initargs = new Object[parameterTypes.length];
public <S> T create(String profile, Class<S> service, Builder builder, Map<String, Object> properties) {
Object[] initializationArguments = new Object[parameterTypes.length];
for (int i = 0; i != parameterTypes.length; ++i) {

boolean located = false;
Expand All @@ -103,10 +106,10 @@ public T create(String profile, Builder builder, Map<String, Object> properties)
boolean probeProperties = fullName != null && fullName != "";
int startingIndex = 0;
while (!located && probeProperties) {
String probeName = fullName.substring(startingIndex);
if (!located && named != null && properties.containsKey(probeName)) {
String nameProbe = fullName.substring(startingIndex);
if (!located && named != null && properties.containsKey(nameProbe)) {
located = true;
initargs[i] = properties.get(probeName);
initializationArguments[i] = properties.get(nameProbe);
}
else {
startingIndex = fullName.indexOf('.', startingIndex) + 1;
Expand All @@ -118,12 +121,12 @@ public T create(String profile, Builder builder, Map<String, Object> properties)

if (!located) {
located = true;
initargs[i] = builder.build(fullName, parameterTypes[i], properties);
initializationArguments[i] = builder.build(fullName, service, parameterTypes[i], properties);
}
}

try {
return (T) ctor.newInstance(initargs);
return (T) ctor.newInstance(initializationArguments);
}
catch (InstantiationException e) {
throw new ConfigurationException(e);
Expand Down Expand Up @@ -158,6 +161,7 @@ protected String findNamedAnnotation(Annotation[] annotations) {
return null;
}

@Override
public <T> Registry add(Factory<T> factory) {
for (Type genericInterface : factory.getClass().getGenericInterfaces()) {
ParameterizedType parameterizedType = (ParameterizedType) genericInterface;
Expand All @@ -169,27 +173,35 @@ public <T> Registry add(Factory<T> factory) {
return this;
}

@Override
@SuppressWarnings("unchecked")
public <T> T build(String profile, Class<T> service, Map<String, Object> properties) {
Factory<T> factory = (Factory<T>) factories.get(service);
public <S, T> T build(String profile, Class<S> service, Class<T> instanceClass, Map<String, Object> properties) {
Factory<T> factory = (Factory<T>) factories.get(instanceClass);
if (factory == null) {
throw new RuntimeException("Service or property not registered: " + profile + " " + service.getName());
}
T instance = factory.create(profile, this, properties);
List<Alteration<?>> alterationList = alterations.get(service);
if (alterationList != null) {
for (Alteration<?> alteration : alterationList) {
instance = ((Alteration<T>) alteration).alter(instance, this, properties);
T instance = factory.create(profile, service, this, properties);
Map<Class<?>, List<Alteration<?>>> alterationMap = alterations.get(service);
if (alterationMap != null) {
List<Alteration<?>> alterationList = alterationMap.get(instanceClass);
if (alterationList != null) {
for (Alteration<?> alteration : alterationList) {
instance = ((Alteration<T>) alteration).alter(profile, instance, this, properties);
}
}
}
return instance;
}

public <T> void alter(Class<T> service, Alteration<T> alteration) {
@Override
public <S, T> void alter(Class<S> service, Class<T> instance, Alteration<T> alteration) {
if (!this.alterations.containsKey(service)) {
this.alterations.put(service, new ArrayList<Alteration<?>>());
this.alterations.put(service, new HashMap<Class<?>, List<Alteration<?>>>());
}
if (!this.alterations.get(service).containsKey(instance)) {
this.alterations.get(service).put(instance, new ArrayList<Alteration<?>>());
}
this.alterations.get(service).add(alteration);
this.alterations.get(service).get(instance).add(alteration);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
package com.microsoft.windowsazure.services.core.utils.pipeline;

import static com.microsoft.windowsazure.services.core.utils.ExportUtils.*;

import java.util.Map;

import com.microsoft.windowsazure.services.core.Builder;
Expand All @@ -23,17 +25,16 @@
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;

import static com.microsoft.windowsazure.services.core.utils.ExportUtils.getPropertyIfExists;

public class Exports implements Builder.Exports {

@Override
public void register(Registry registry) {
registry.add(new Builder.Factory<ClientConfig>() {
@Override
public ClientConfig create(String profile, Builder builder, Map<String, Object> properties) {
public <S> ClientConfig create(String profile, Class<S> service, Builder builder,
Map<String, Object> properties) {
ClientConfig clientConfig = new DefaultClientConfig();
ClientConfigSettings settings = builder.build(profile, ClientConfigSettings.class, properties);
ClientConfigSettings settings = builder.build(profile, service, ClientConfigSettings.class, properties);
settings.applyConfig(clientConfig);
return clientConfig;
}
Expand All @@ -42,20 +43,22 @@ public ClientConfig create(String profile, Builder builder, Map<String, Object>
registry.add(new Builder.Factory<ClientConfigSettings>() {

@Override
public ClientConfigSettings create(String profile, Builder builder, Map<String, Object> properties) {
public <S> ClientConfigSettings create(String profile, Class<S> service, Builder builder,
Map<String, Object> properties) {
Object connectTimeout = getPropertyIfExists(profile, properties, Configuration.PROPERTY_CONNECT_TIMEOUT);
Object readTimeout = getPropertyIfExists(profile, properties, Configuration.PROPERTY_READ_TIMEOUT);

return new ClientConfigSettings(connectTimeout, readTimeout, getPropertyIfExists(profile, properties,
Configuration.PROPERTY_LOG_HTTP_REQUESTS) != null);
}

});

registry.add(new Builder.Factory<Client>() {
@Override
public Client create(String profile, Builder builder, Map<String, Object> properties) {
ClientConfig clientConfig = builder.build(profile, ClientConfig.class, properties);
ClientConfigSettings settings = builder.build(profile, ClientConfigSettings.class, properties);
public <S> Client create(String profile, Class<S> service, Builder builder, Map<String, Object> properties) {
ClientConfig clientConfig = builder.build(profile, service, ClientConfig.class, properties);
ClientConfigSettings settings = builder.build(profile, service, ClientConfigSettings.class, properties);
Client client = Client.create(clientConfig);
settings.applyConfig(client);
return client;
Expand All @@ -64,9 +67,10 @@ public Client create(String profile, Builder builder, Map<String, Object> proper

registry.add(new Builder.Factory<HttpURLConnectionClient>() {
@Override
public HttpURLConnectionClient create(String profile, Builder builder, Map<String, Object> properties) {
ClientConfig clientConfig = builder.build(profile, ClientConfig.class, properties);
ClientConfigSettings settings = builder.build(profile, ClientConfigSettings.class, properties);
public <S> HttpURLConnectionClient create(String profile, Class<S> service, Builder builder,
Map<String, Object> properties) {
ClientConfig clientConfig = builder.build(profile, service, ClientConfig.class, properties);
ClientConfigSettings settings = builder.build(profile, service, ClientConfigSettings.class, properties);
HttpURLConnectionClient client = HttpURLConnectionClient.create(clientConfig);
settings.applyConfig(client);
return client;
Expand Down
Loading