diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/Exports.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/Exports.java index 791ed56f87555..b0ab8a4f5571c 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/Exports.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/Exports.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. @@ -14,15 +14,26 @@ */ package com.microsoft.windowsazure.services.media; +import java.util.Map; + +import javax.xml.bind.JAXBException; +import javax.xml.parsers.ParserConfigurationException; + import com.microsoft.windowsazure.services.core.Builder; +import com.microsoft.windowsazure.services.media.implementation.MediaContentProvider; import com.microsoft.windowsazure.services.media.implementation.MediaExceptionProcessor; import com.microsoft.windowsazure.services.media.implementation.MediaRestProxy; import com.microsoft.windowsazure.services.media.implementation.OAuthContract; import com.microsoft.windowsazure.services.media.implementation.OAuthFilter; import com.microsoft.windowsazure.services.media.implementation.OAuthRestProxy; import com.microsoft.windowsazure.services.media.implementation.OAuthTokenManager; +import com.microsoft.windowsazure.services.media.implementation.ODataEntityCollectionProvider; +import com.microsoft.windowsazure.services.media.implementation.ODataEntityProvider; import com.microsoft.windowsazure.services.media.implementation.RedirectFilter; import com.microsoft.windowsazure.services.media.implementation.ResourceLocationManager; +import com.microsoft.windowsazure.services.media.implementation.VersionHeadersFilter; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.json.JSONConfiguration; public class Exports implements Builder.Exports { @@ -39,6 +50,31 @@ public void register(Builder.Registry registry) { registry.add(OAuthFilter.class); registry.add(ResourceLocationManager.class); registry.add(RedirectFilter.class); - } + registry.add(VersionHeadersFilter.class); + + registry.alter(ClientConfig.class, new Builder.Alteration() { + @Override + public ClientConfig alter(ClientConfig instance, Builder builder, Map properties) { + instance.getProperties().put(JSONConfiguration.FEATURE_POJO_MAPPING, true); + + // Turn off auto-follow redirects, because Media Services rest calls break if it's on + instance.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, false); + + try { + instance.getSingletons().add(new ODataEntityProvider()); + instance.getSingletons().add(new ODataEntityCollectionProvider()); + instance.getSingletons().add(new MediaContentProvider()); + } + catch (JAXBException e) { + throw new RuntimeException(e); + } + catch (ParserConfigurationException e) { + throw new RuntimeException(e); + } + + return instance; + } + }); + } } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaConfiguration.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaConfiguration.java index ac7464c570018..6821f7b10fafd 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaConfiguration.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaConfiguration.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/MediaContract.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaContract.java index 3e92ac300dae0..5a5a8f2ba325b 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaContract.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaContract.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. @@ -14,7 +14,11 @@ */ package com.microsoft.windowsazure.services.media; +import java.util.List; + import com.microsoft.windowsazure.services.core.FilterableService; +import com.microsoft.windowsazure.services.core.ServiceException; +import com.microsoft.windowsazure.services.media.models.AssetInfo; /** * @@ -23,6 +27,7 @@ */ public interface MediaContract extends FilterableService { - // Will fill in as we implement the various Media Services entities + AssetInfo createAsset(String name) throws ServiceException; + List getAssets() throws ServiceException; } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaService.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaService.java index 413dae44c8d41..9cf13258bab88 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaService.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/MediaService.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/implementation/ActiveToken.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ActiveToken.java index e3c5561f7b77f..b38ee70871855 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ActiveToken.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ActiveToken.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/implementation/MediaContentProvider.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaContentProvider.java new file mode 100644 index 0000000000000..4ad8c880c6d4f --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaContentProvider.java @@ -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; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; + +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.xml.bind.JAXBException; +import javax.xml.parsers.ParserConfigurationException; + +import com.microsoft.windowsazure.services.media.implementation.content.MediaServiceDTO; +import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider; + +/** + * Class to plug into Jersey to properly serialize + * raw Media Services DTO types. + * + */ +public class MediaContentProvider extends AbstractMessageReaderWriterProvider { + private final ODataAtomMarshaller marshaller; + + /** + * Creates the instance + * + * @throws JAXBException + * @throws ParserConfigurationException + */ + public MediaContentProvider() throws JAXBException, ParserConfigurationException { + marshaller = new ODataAtomMarshaller(); + } + + @Override + public boolean isReadable(Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + // This class only does marshalling, not unmarshalling. + return false; + } + + @Override + public T readFrom(Class type, Type genericType, Annotation[] annotations, MediaType mediaType, + MultivaluedMap httpHeaders, InputStream entityStream) throws IOException, + WebApplicationException { + throw new UnsupportedOperationException(); + } + + @Override + public boolean isWriteable(Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return MediaServiceDTO.class.isAssignableFrom(type); + } + + @Override + public void writeTo(T t, Class type, Type genericType, Annotation[] annotations, MediaType mediaType, + MultivaluedMap httpHeaders, OutputStream entityStream) throws IOException, + WebApplicationException { + try { + marshaller.marshalEntry(t, entityStream); + } + catch (JAXBException e) { + throw new RuntimeException(e); + } + } +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaExceptionProcessor.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaExceptionProcessor.java index d9c3141d52064..3cde5ec2029d4 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaExceptionProcessor.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaExceptionProcessor.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,6 +15,8 @@ package com.microsoft.windowsazure.services.media.implementation; +import java.util.List; + import javax.inject.Inject; import org.apache.commons.logging.Log; @@ -24,6 +26,9 @@ import com.microsoft.windowsazure.services.core.ServiceFilter; import com.microsoft.windowsazure.services.core.utils.ServiceExceptionFactory; import com.microsoft.windowsazure.services.media.MediaContract; +import com.microsoft.windowsazure.services.media.models.AssetInfo; +import com.sun.jersey.api.client.ClientHandlerException; +import com.sun.jersey.api.client.UniformInterfaceException; /** * Wrapper implementation of MediaServicesContract that @@ -54,4 +59,29 @@ private ServiceException processCatch(ServiceException e) { return ServiceExceptionFactory.process("MediaServices", e); } + @Override + public AssetInfo createAsset(String name) throws ServiceException { + try { + return next.createAsset(name); + } + catch (UniformInterfaceException e) { + throw processCatch(new ServiceException(e)); + } + catch (ClientHandlerException e) { + throw processCatch(new ServiceException(e)); + } + } + + @Override + public List getAssets() throws ServiceException { + try { + return next.getAssets(); + } + catch (UniformInterfaceException e) { + throw processCatch(new ServiceException(e)); + } + catch (ClientHandlerException e) { + throw processCatch(new ServiceException(e)); + } + } } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaRestProxy.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaRestProxy.java index 9b1dfc25e5a60..a42fd68f25a4b 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaRestProxy.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/MediaRestProxy.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. @@ -16,31 +16,40 @@ package com.microsoft.windowsazure.services.media.implementation; import java.util.Arrays; +import java.util.List; import javax.inject.Inject; +import javax.ws.rs.core.MediaType; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.microsoft.windowsazure.services.core.ServiceException; import com.microsoft.windowsazure.services.core.ServiceFilter; import com.microsoft.windowsazure.services.core.utils.pipeline.ClientFilterAdapter; import com.microsoft.windowsazure.services.media.MediaContract; +import com.microsoft.windowsazure.services.media.implementation.content.AssetType; +import com.microsoft.windowsazure.services.media.models.AssetInfo; import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.GenericType; import com.sun.jersey.api.client.WebResource; public class MediaRestProxy implements MediaContract { private Client channel; - static Log log = LogFactory.getLog(MediaContract.class); + static Log log = LogFactory.getLog(MediaContract.class); ServiceFilter[] filters; @Inject - public MediaRestProxy(Client channel, OAuthFilter authFilter, RedirectFilter redirectFilter) { + public MediaRestProxy(Client channel, OAuthFilter authFilter, RedirectFilter redirectFilter, + VersionHeadersFilter versionHeadersFilter) { this.channel = channel; this.filters = new ServiceFilter[0]; + channel.addFilter(redirectFilter); channel.addFilter(authFilter); + channel.addFilter(versionHeadersFilter); } public MediaRestProxy(Client channel, ServiceFilter[] filters) { @@ -71,4 +80,28 @@ private WebResource getResource(String entityName) { return resource; } + @Override + public AssetInfo createAsset(String name) throws ServiceException { + WebResource resource = getResource("Assets"); + + AssetType request = new AssetType(); + request.setName(name); + + return resource.type(MediaType.APPLICATION_ATOM_XML).accept(MediaType.APPLICATION_ATOM_XML) + .post(AssetInfo.class, request); + + } + + /* (non-Javadoc) + * @see com.microsoft.windowsazure.services.media.MediaContract#getAssets() + */ + @Override + public List getAssets() throws ServiceException { + WebResource resource = getResource("Assets"); + + return resource.type(MediaType.APPLICATION_ATOM_XML).accept(MediaType.APPLICATION_ATOM_XML) + .get(new GenericType>() { + }); + + } } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthContract.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthContract.java index 7e81549642f7e..54091fff05864 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthContract.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthContract.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/implementation/OAuthFilter.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthFilter.java index 3b2e45a363b67..326db58a005f6 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthFilter.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthFilter.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/implementation/OAuthRestProxy.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthRestProxy.java index a51eae7e82c3b..6645d55eecdc9 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthRestProxy.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthRestProxy.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/implementation/OAuthTokenManager.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenManager.java index 473bd9d60bb60..913fe84830ce4 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenManager.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenManager.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. @@ -59,16 +59,17 @@ public class OAuthTokenManager { * * @param clientSecret * A String object instance that represents the client secret. + * @throws URISyntaxException * */ public OAuthTokenManager(OAuthContract contract, DateFactory dateFactory, - @Named(MediaConfiguration.OAUTH_URI) URI acsBaseUri, + @Named(MediaConfiguration.OAUTH_URI) String oauthUri, @Named(MediaConfiguration.OAUTH_CLIENT_ID) String clientId, @Named(MediaConfiguration.OAUTH_CLIENT_SECRET) String clientSecret, - @Named(MediaConfiguration.OAUTH_SCOPE) String scope) { + @Named(MediaConfiguration.OAUTH_SCOPE) String scope) throws URISyntaxException { this.contract = contract; this.dateFactory = dateFactory; - this.acsBaseUri = acsBaseUri; + this.acsBaseUri = new URI(oauthUri); this.clientId = clientId; this.clientSecret = clientSecret; this.scope = scope; diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenResponse.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenResponse.java index 42974fb52e3f5..b8a357d739f95 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenResponse.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenResponse.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/implementation/ODataAtomMarshaller.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomMarshaller.java new file mode 100644 index 0000000000000..2556c510a5ff2 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomMarshaller.java @@ -0,0 +1,119 @@ +/** + * 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; + +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; + +import com.microsoft.windowsazure.services.media.implementation.atom.ContentType; +import com.microsoft.windowsazure.services.media.implementation.atom.EntryType; +import com.microsoft.windowsazure.services.media.implementation.atom.FeedType; +import com.microsoft.windowsazure.services.media.implementation.content.AssetType; +import com.microsoft.windowsazure.services.media.implementation.content.Constants; + +/** + * A class to manage marshalling of request parameters into + * ATOM entry elements for sending to the Media Services REST + * endpoints. + * + */ +public class ODataAtomMarshaller { + private final Marshaller marshaller; + private final DocumentBuilder documentBuilder; + + public ODataAtomMarshaller() throws JAXBException, ParserConfigurationException { + JAXBContext context = JAXBContext.newInstance(getMarshalledClasses(), null); + marshaller = context.createMarshaller(); + + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + documentBuilder = dbf.newDocumentBuilder(); + } + + /** + * Convert the given content object into an ATOM entry + * (represented as a DOM document) suitable for sending + * up to the Media Services service. + * + * @param content + * The content object to send + * @return The generated DOM + * @throws JAXBException + * if content is malformed/not marshallable + */ + public Document marshalEntry(Object content) throws JAXBException { + JAXBElement entryElement = createEntry(content); + + Document doc = documentBuilder.newDocument(); + doc.setXmlStandalone(true); + + marshaller.marshal(entryElement, doc); + + return doc; + + } + + /** + * Convert the given content into an ATOM entry + * and write it to the given stream. + * + * @param content + * Content object to send + * @param stream + * Stream to write to + * @throws JAXBException + * if content is malformed/not marshallable + */ + public void marshalEntry(Object content, OutputStream stream) throws JAXBException { + marshaller.marshal(createEntry(content), stream); + } + + private JAXBElement createEntry(Object content) { + ContentType atomContent = new ContentType(); + atomContent.setType("application/xml"); + atomContent.getContent().add( + new JAXBElement(new QName(Constants.ODATA_METADATA_NS, "properties"), content.getClass(), content)); + + EntryType atomEntry = new EntryType(); + atomEntry.getEntryChildren().add( + new JAXBElement(new QName(Constants.ATOM_NS, "content"), ContentType.class, atomContent)); + + JAXBElement entryElement = new JAXBElement(new QName(Constants.ATOM_NS, "entry"), + EntryType.class, atomEntry); + + return entryElement; + } + + private static Class[] getMarshalledClasses() { + List> classes = new ArrayList>(); + classes.add(FeedType.class); + classes.add(EntryType.class); + classes.add(AssetType.class); + return classes.toArray(new Class[0]); + } +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomUnmarshaller.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomUnmarshaller.java new file mode 100644 index 0000000000000..66cecfd0a542d --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomUnmarshaller.java @@ -0,0 +1,235 @@ +/** + * 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; + +import java.io.InputStream; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.ParameterizedType; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.namespace.QName; +import javax.xml.transform.stream.StreamSource; + +import org.w3c.dom.Element; + +import com.microsoft.windowsazure.services.core.ServiceException; +import com.microsoft.windowsazure.services.media.implementation.atom.ContentType; +import com.microsoft.windowsazure.services.media.implementation.atom.EntryType; +import com.microsoft.windowsazure.services.media.implementation.atom.FeedType; +import com.microsoft.windowsazure.services.media.implementation.content.AssetType; +import com.microsoft.windowsazure.services.media.implementation.content.Constants; +import com.microsoft.windowsazure.services.media.implementation.content.ODataActionType; + +/** + * This class implements unmarshalling from OData over Atom into Java + * classes. + * + */ +public class ODataAtomUnmarshaller { + private final JAXBContext atomContext; + private final JAXBContext mediaContentContext; + private final Unmarshaller atomUnmarshaller; + private final Unmarshaller mediaContentUnmarshaller; + + /** + * @throws JAXBException + */ + public ODataAtomUnmarshaller() throws JAXBException { + atomContext = JAXBContext.newInstance(FeedType.class.getPackage().getName()); + atomUnmarshaller = atomContext.createUnmarshaller(); + mediaContentContext = JAXBContext.newInstance(AssetType.class.getPackage().getName()); + mediaContentUnmarshaller = mediaContentContext.createUnmarshaller(); + } + + /** + * Given a stream that contains XML with an atom Feed element at the root, + * unmarshal it into Java objects with the given content type in the entries. + * + * @param + * + * @param stream + * - stream containing the XML data + * @param contentType + * - Java type to unmarshal the entry contents into + * @return an instance of contentType that contains the unmarshalled data. + * @throws JAXBException + * @throws ServiceException + */ + public List unmarshalFeed(InputStream stream, Class contentType) + throws JAXBException, ServiceException { + validateNotNull(stream, "stream"); + validateNotNull(contentType, "contentType"); + + List entries = new ArrayList(); + FeedType feed = unmarshalFeed(stream); + Class marshallingContentType = getMarshallingContentType(contentType); + + for (Object feedChild : feed.getFeedChildren()) { + EntryType entry = asEntry(feedChild); + if (entry != null) { + entries.add(contentFromEntry(contentType, marshallingContentType, entry)); + } + } + return entries; + } + + /** + * Given a stream containing XML with an Atom entry element at the root, + * unmarshal it into an instance of contentType + * + * @param stream + * - stream containing XML data + * @param contentType + * - type of object to return + * @return An instance of contentType + * @throws JAXBException + * @throws ServiceException + */ + public T unmarshalEntry(InputStream stream, Class contentType) throws JAXBException, + ServiceException { + validateNotNull(stream, "stream"); + validateNotNull(contentType, "contentType"); + + Class marshallingContentType = getMarshallingContentType(contentType); + + EntryType entry = unmarshalEntry(stream); + return contentFromEntry(contentType, marshallingContentType, entry); + } + + private T contentFromEntry(Class contentType, Class marshallingContentType, + EntryType entry) throws JAXBException, ServiceException { + unmarshalODataContent(entry, contentType); + ContentType contentElement = getFirstOfType(ContentType.class, entry.getEntryChildren()); + Object contentObject = getFirstOfType(marshallingContentType, contentElement.getContent()); + return constructResultObject(contentType, entry, contentObject); + } + + private EntryType asEntry(Object o) { + if (o instanceof JAXBElement) { + JAXBElement e = (JAXBElement) o; + if (e.getDeclaredType() == EntryType.class) { + return (EntryType) e.getValue(); + } + } + return null; + } + + private void unmarshalODataContent(EntryType entry, Class contentType) throws JAXBException { + unmarshalEntryActions(entry); + unmarshalEntryContent(entry, contentType); + } + + private void unmarshalEntryActions(EntryType entry) throws JAXBException { + List children = entry.getEntryChildren(); + for (int i = 0; i < children.size(); ++i) { + Object child = children.get(i); + if (child instanceof Element) { + Element e = (Element) child; + if (qnameFromElement(e).equals(Constants.ODATA_ACTION_ELEMENT_NAME)) { + JAXBElement actionElement = mediaContentUnmarshaller.unmarshal(e, + ODataActionType.class); + children.set(i, actionElement); + } + } + } + } + + private void unmarshalEntryContent(EntryType entry, Class contentType) throws JAXBException { + Class marshallingContentType = getMarshallingContentType(contentType); + ContentType contentElement = getFirstOfType(ContentType.class, entry.getEntryChildren()); + List contentChildren = contentElement.getContent(); + for (int i = 0; i < contentChildren.size(); ++i) { + Object child = contentChildren.get(i); + if (child instanceof Element) { + Element e = (Element) child; + if (qnameFromElement(e).equals(Constants.ODATA_PROPERTIES_ELEMENT_NAME)) { + JAXBElement actualContentElement = mediaContentUnmarshaller.unmarshal(e, marshallingContentType); + contentChildren.set(i, actualContentElement); + } + } + } + } + + private T getFirstOfType(Class targetType, List collection) { + for (Object c : collection) { + if (c instanceof JAXBElement) { + JAXBElement e = (JAXBElement) c; + if (e.getDeclaredType() == targetType) { + return (T) e.getValue(); + } + } + } + return null; + } + + private T constructResultObject(Class contentType, EntryType entry, Object contentObject) + throws ServiceException { + Class marshallingType = getMarshallingContentType(contentType); + try { + Constructor resultCtor = contentType.getConstructor(EntryType.class, marshallingType); + return resultCtor.newInstance(entry, contentObject); + } + catch (IllegalArgumentException e) { + throw new ServiceException(e); + } + catch (SecurityException e) { + throw new ServiceException(e); + } + catch (InstantiationException e) { + throw new ServiceException(e); + } + catch (IllegalAccessException e) { + throw new ServiceException(e); + } + catch (InvocationTargetException e) { + throw new ServiceException(e); + } + catch (NoSuchMethodException e) { + throw new ServiceException(e); + } + } + + private EntryType unmarshalEntry(InputStream stream) throws JAXBException { + JAXBElement entryElement = atomUnmarshaller.unmarshal(new StreamSource(stream), EntryType.class); + return entryElement.getValue(); + } + + private FeedType unmarshalFeed(InputStream stream) throws JAXBException { + JAXBElement feedElement = atomUnmarshaller.unmarshal(new StreamSource(stream), FeedType.class); + return feedElement.getValue(); + } + + private static QName qnameFromElement(Element e) { + return new QName(e.getLocalName(), e.getNamespaceURI()); + } + + private static Class getMarshallingContentType(Class contentType) { + ParameterizedType pt = (ParameterizedType) contentType.getGenericSuperclass(); + return (Class) pt.getActualTypeArguments()[0]; + } + + private static void validateNotNull(Object param, String paramName) { + if (param == null) { + throw new IllegalArgumentException(paramName); + } + } +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntity.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntity.java new file mode 100644 index 0000000000000..516303a1fdf30 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntity.java @@ -0,0 +1,96 @@ +/** + * 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; + +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.List; + +import com.microsoft.windowsazure.services.media.implementation.atom.EntryType; + +/** + * Class wrapping deserialized OData entities. Allows easy + * access to entry and content types. + * + */ +public abstract class ODataEntity { + + private final EntryType entry; + private final T content; + + protected ODataEntity(EntryType entry, T content) { + this.entry = entry; + this.content = content; + } + + /** + * @return the entry + */ + protected EntryType getEntry() { + return entry; + } + + /** + * @return the content + */ + protected T getContent() { + return content; + } + + /** + * Is the given type inherited from ODataEntity + * + * @param type + * Type to check + * @return true if derived from ODataEntity + */ + public static boolean isODataEntityType(Class type) { + return ODataEntity.class.isAssignableFrom(type); + } + + /** + * Is the given type a collection of ODataEntity + * + * @param type + * Base type + * @param genericType + * Generic type + * @return true if it's List<OEntity> or derive from. + */ + public static boolean isODataEntityCollectionType(Class type, Type genericType) { + if (List.class != type) { + return false; + } + + ParameterizedType pt = (ParameterizedType) genericType; + + if (pt.getActualTypeArguments().length != 1) { + return false; + } + + Class typeClass = getCollectedType(genericType); + + return isODataEntityType(typeClass); + } + + public static Class getCollectedType(Type genericType) { + ParameterizedType pt = (ParameterizedType) genericType; + if (pt.getActualTypeArguments().length != 1) { + throw new IllegalArgumentException("genericType"); + } + return (Class) pt.getActualTypeArguments()[0]; + } +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntityCollectionProvider.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntityCollectionProvider.java new file mode 100644 index 0000000000000..b6b6eac581503 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntityCollectionProvider.java @@ -0,0 +1,84 @@ +/** + * + */ +package com.microsoft.windowsazure.services.media.implementation; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.util.List; + +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.xml.bind.JAXBException; + +import com.microsoft.windowsazure.services.core.ServiceException; +import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider; + +/** + * Jersey provider to unmarshal lists of entities from Media Services. + * + */ +public class ODataEntityCollectionProvider extends AbstractMessageReaderWriterProvider>> { + private final ODataAtomUnmarshaller unmarshaller; + + public ODataEntityCollectionProvider() throws JAXBException { + unmarshaller = new ODataAtomUnmarshaller(); + } + + @Override + public boolean isReadable(Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return ODataEntity.isODataEntityCollectionType(type, genericType); + } + + @Override + public List> readFrom(Class>> type, Type genericType, Annotation[] annotations, + MediaType mediaType, MultivaluedMap httpHeaders, InputStream entityStream) + throws IOException, WebApplicationException { + + String responseType = mediaType.getParameters().get("type"); + try { + if (responseType == null || responseType.equals("feed")) { + return unmarshaller.unmarshalFeed(entityStream, + (Class>) ODataEntity.getCollectedType(genericType)); + } + else { + throw new RuntimeException(); + } + } + catch (JAXBException e) { + throw new RuntimeException(e); + } + catch (ServiceException e) { + throw new RuntimeException(e); + } + } + + /** + * Can this type be written by this provider? + * + * @return false - we don't support writing + */ + @Override + public boolean isWriteable(Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return false; + } + + /** + * Write the given object to the stream. + * This method implementation throws, we don't support writing. + * + * @throws UnsupportedOperationException + */ + @Override + public void writeTo(List> t, Class type, Type genericType, Annotation[] annotations, + MediaType mediaType, MultivaluedMap httpHeaders, OutputStream entityStream) + throws IOException, WebApplicationException { + + throw new UnsupportedOperationException(); + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntityProvider.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntityProvider.java new file mode 100644 index 0000000000000..704e0885db0e2 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataEntityProvider.java @@ -0,0 +1,103 @@ +/** + * 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; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.util.List; + +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.xml.bind.JAXBException; +import javax.xml.parsers.ParserConfigurationException; + +import com.microsoft.windowsazure.services.core.ServiceException; +import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider; + +/** + * An implementation of {@link AbstractMessageReaderWriterProvider } that + * is used to marshal and unmarshal instances of the ODataEntity type. + * + */ +public class ODataEntityProvider extends AbstractMessageReaderWriterProvider> { + private final ODataAtomUnmarshaller unmarshaller; + + public ODataEntityProvider() throws JAXBException, ParserConfigurationException { + unmarshaller = new ODataAtomUnmarshaller(); + } + + /* (non-Javadoc) + * @see javax.ws.rs.ext.MessageBodyReader#isReadable(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType) + */ + @Override + public boolean isReadable(Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return ODataEntity.isODataEntityType(type); + } + + /* (non-Javadoc) + * @see javax.ws.rs.ext.MessageBodyReader#readFrom(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.InputStream) + */ + @Override + public ODataEntity readFrom(Class> type, Type genericType, Annotation[] annotations, + MediaType mediaType, MultivaluedMap httpHeaders, InputStream entityStream) + throws IOException, WebApplicationException { + + ODataEntity result = null; + String responseType = mediaType.getParameters().get("type"); + try { + if (responseType == null || responseType.equals("feed")) { + List> feedContents = unmarshaller.unmarshalFeed(entityStream, type); + return feedContents.get(0); + } + else if (responseType.equals("entry")) { + result = unmarshaller.unmarshalEntry(entityStream, type); + } + else { + throw new RuntimeException(); + } + } + catch (JAXBException e) { + throw new RuntimeException(e); + } + catch (ServiceException e) { + throw new RuntimeException(e); + } + + return result; + } + + /* (non-Javadoc) + * @see javax.ws.rs.ext.MessageBodyWriter#isWriteable(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType) + */ + @Override + public boolean isWriteable(Class type, Type genericType, Annotation[] annotations, MediaType mediaType) { + return false; + } + + /* (non-Javadoc) + * @see javax.ws.rs.ext.MessageBodyWriter#writeTo(java.lang.Object, java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.OutputStream) + */ + @Override + public void writeTo(ODataEntity t, Class type, Type genericType, Annotation[] annotations, + MediaType mediaType, MultivaluedMap httpHeaders, OutputStream entityStream) + throws IOException, WebApplicationException { + throw new UnsupportedOperationException(); + } +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/RedirectFilter.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/RedirectFilter.java index 15b283e78f922..f71ea6381653b 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/RedirectFilter.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/RedirectFilter.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/implementation/ResourceLocationManager.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ResourceLocationManager.java index 75b5c12ad6dc6..b030e6454196c 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ResourceLocationManager.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/ResourceLocationManager.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/implementation/VersionHeadersFilter.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/VersionHeadersFilter.java new file mode 100644 index 0000000000000..9b69c79942969 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/VersionHeadersFilter.java @@ -0,0 +1,43 @@ +/** + * 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; + +import javax.ws.rs.core.MultivaluedMap; + +import com.sun.jersey.api.client.ClientHandlerException; +import com.sun.jersey.api.client.ClientRequest; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.filter.ClientFilter; + +/** + * A small filter that adds the required Media services/OData 3 + * version headers to the request as it goes through. + * + */ +public class VersionHeadersFilter extends ClientFilter { + + /* (non-Javadoc) + * @see com.sun.jersey.api.client.filter.ClientFilter#handle(com.sun.jersey.api.client.ClientRequest) + */ + @Override + public ClientResponse handle(ClientRequest cr) throws ClientHandlerException { + MultivaluedMap headers = cr.getHeaders(); + headers.add("DataServiceVersion", "3.0"); + headers.add("MaxDataServiceVersion", "3.0"); + headers.add("x-ms-version", "1.0"); + return getNext().handle(cr); + } +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/CategoryType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/CategoryType.java new file mode 100644 index 0000000000000..3e0138fef82c8 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/CategoryType.java @@ -0,0 +1,208 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom cagegory construct is defined in section 4.2.2 of the format spec. + * + * + *

Java class for categoryType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="categoryType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <attribute name="term" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="scheme" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="label" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "categoryType") +public class CategoryType { + + @XmlAttribute(required = true) + protected String term; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String scheme; + @XmlAttribute + protected String label; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the term property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTerm() { + return term; + } + + /** + * Sets the value of the term property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTerm(String value) { + this.term = value; + } + + /** + * Gets the value of the scheme property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getScheme() { + return scheme; + } + + /** + * Sets the value of the scheme property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setScheme(String value) { + this.scheme = value; + } + + /** + * Gets the value of the label property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLabel() { + return label; + } + + /** + * Sets the value of the label property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLabel(String value) { + this.label = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/ContentType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/ContentType.java new file mode 100644 index 0000000000000..8e03e7cb2b4a8 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/ContentType.java @@ -0,0 +1,225 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom content construct is defined in section 4.1.3 of the format spec. + * + * + *

Java class for contentType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="contentType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="src" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <anyAttribute namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "contentType", propOrder = { + "content" +}) +public class ContentType { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute + protected String type; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String src; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * + * The Atom content construct is defined in section 4.1.3 of the format spec. + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Object } + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the src property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSrc() { + return src; + } + + /** + * Sets the value of the src property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSrc(String value) { + this.src = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/DateTimeType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/DateTimeType.java new file mode 100644 index 0000000000000..4232aee1748e1 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/DateTimeType.java @@ -0,0 +1,153 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.datatype.XMLGregorianCalendar; +import javax.xml.namespace.QName; + + +/** + *

Java class for dateTimeType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="dateTimeType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>dateTime">
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <anyAttribute namespace='##other'/>
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "dateTimeType", propOrder = { + "value" +}) +public class DateTimeType { + + @XmlValue + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar value; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setValue(XMLGregorianCalendar value) { + this.value = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/EntryType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/EntryType.java new file mode 100644 index 0000000000000..d3244af70517d --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/EntryType.java @@ -0,0 +1,206 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom entry construct is defined in section 4.1.2 of the format spec. + * + * + *

Java class for entryType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="entryType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded">
+ *         <element name="author" type="{http://www.w3.org/2005/Atom}personType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="category" type="{http://www.w3.org/2005/Atom}categoryType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="content" type="{http://www.w3.org/2005/Atom}contentType" minOccurs="0"/>
+ *         <element name="contributor" type="{http://www.w3.org/2005/Atom}personType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="id" type="{http://www.w3.org/2005/Atom}idType"/>
+ *         <element name="link" type="{http://www.w3.org/2005/Atom}linkType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="published" type="{http://www.w3.org/2005/Atom}dateTimeType" minOccurs="0"/>
+ *         <element name="rights" type="{http://www.w3.org/2005/Atom}textType" minOccurs="0"/>
+ *         <element name="source" type="{http://www.w3.org/2005/Atom}textType" minOccurs="0"/>
+ *         <element name="summary" type="{http://www.w3.org/2005/Atom}textType" minOccurs="0"/>
+ *         <element name="title" type="{http://www.w3.org/2005/Atom}textType"/>
+ *         <element name="updated" type="{http://www.w3.org/2005/Atom}dateTimeType"/>
+ *         <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </choice>
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <anyAttribute namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "entryType", propOrder = { + "entryChildren" +}) +public class EntryType { + + @XmlElementRefs({ + @XmlElementRef(name = "category", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "rights", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "published", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "author", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "link", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "title", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "summary", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "id", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "source", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "content", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "updated", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "contributor", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class) + }) + @XmlAnyElement(lax = true) + protected List entryChildren; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the entryChildren property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the entryChildren property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getEntryChildren().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link CategoryType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} + * {@link JAXBElement }{@code <}{@link PersonType }{@code >} + * {@link JAXBElement }{@code <}{@link LinkType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} + * {@link JAXBElement }{@code <}{@link PersonType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * {@link JAXBElement }{@code <}{@link IdType }{@code >} + * {@link JAXBElement }{@code <}{@link ContentType }{@code >} + * {@link Object } + * + * + */ + public List getEntryChildren() { + if (entryChildren == null) { + entryChildren = new ArrayList(); + } + return this.entryChildren; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/FeedType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/FeedType.java new file mode 100644 index 0000000000000..9c5ea3df46aef --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/FeedType.java @@ -0,0 +1,209 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.18 at 11:05:53 AM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom feed construct is defined in section 4.1.1 of the format spec. + * + * + *

Java class for feedType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="feedType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded" minOccurs="3">
+ *         <element name="author" type="{http://www.w3.org/2005/Atom}personType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="category" type="{http://www.w3.org/2005/Atom}categoryType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="contributor" type="{http://www.w3.org/2005/Atom}personType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="generator" type="{http://www.w3.org/2005/Atom}generatorType" minOccurs="0"/>
+ *         <element name="icon" type="{http://www.w3.org/2005/Atom}iconType" minOccurs="0"/>
+ *         <element name="id" type="{http://www.w3.org/2005/Atom}idType"/>
+ *         <element name="link" type="{http://www.w3.org/2005/Atom}linkType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="logo" type="{http://www.w3.org/2005/Atom}logoType" minOccurs="0"/>
+ *         <element name="rights" type="{http://www.w3.org/2005/Atom}textType" minOccurs="0"/>
+ *         <element name="subtitle" type="{http://www.w3.org/2005/Atom}textType" minOccurs="0"/>
+ *         <element name="title" type="{http://www.w3.org/2005/Atom}textType"/>
+ *         <element name="updated" type="{http://www.w3.org/2005/Atom}dateTimeType"/>
+ *         <element name="entry" type="{http://www.w3.org/2005/Atom}entryType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </choice>
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <anyAttribute namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "feedType", propOrder = { + "feedChildren" +}) +public class FeedType { + + @XmlElementRefs({ + @XmlElementRef(name = "updated", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "generator", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "rights", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "id", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "link", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "subtitle", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "contributor", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "entry", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "logo", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "icon", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "author", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "category", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "title", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class) + }) + @XmlAnyElement(lax = true) + protected List feedChildren; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the feedChildren property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the feedChildren property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFeedChildren().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} + * {@link JAXBElement }{@code <}{@link GeneratorType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * {@link JAXBElement }{@code <}{@link IdType }{@code >} + * {@link JAXBElement }{@code <}{@link LinkType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * {@link JAXBElement }{@code <}{@link PersonType }{@code >} + * {@link Object } + * {@link JAXBElement }{@code <}{@link EntryType }{@code >} + * {@link JAXBElement }{@code <}{@link LogoType }{@code >} + * {@link JAXBElement }{@code <}{@link IconType }{@code >} + * {@link JAXBElement }{@code <}{@link PersonType }{@code >} + * {@link JAXBElement }{@code <}{@link CategoryType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * + * + */ + public List getFeedChildren() { + if (feedChildren == null) { + feedChildren = new ArrayList(); + } + return this.feedChildren; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/GeneratorType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/GeneratorType.java new file mode 100644 index 0000000000000..08f56f2f84c75 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/GeneratorType.java @@ -0,0 +1,210 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom generator element is defined in section 4.2.4 of the format spec. + * + * + *

Java class for generatorType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="generatorType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <attribute name="uri" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute namespace='##other'/>
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "generatorType", propOrder = { + "value" +}) +public class GeneratorType { + + @XmlValue + protected String value; + @XmlAttribute + @XmlSchemaType(name = "anyURI") + protected String uri; + @XmlAttribute + protected String version; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the uri property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUri() { + return uri; + } + + /** + * Sets the value of the uri property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUri(String value) { + this.uri = value; + } + + /** + * Gets the value of the version property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getVersion() { + return version; + } + + /** + * Sets the value of the version property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setVersion(String value) { + this.version = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/IconType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/IconType.java new file mode 100644 index 0000000000000..33675d2d588a5 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/IconType.java @@ -0,0 +1,156 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom icon construct is defined in section 4.2.5 of the format spec. + * + * + *

Java class for iconType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="iconType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <anyAttribute namespace='##other'/>
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "iconType", propOrder = { + "value" +}) +public class IconType { + + @XmlValue + @XmlSchemaType(name = "anyURI") + protected String value; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/IdType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/IdType.java new file mode 100644 index 0000000000000..0633ac55a4110 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/IdType.java @@ -0,0 +1,156 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom id construct is defined in section 4.2.6 of the format spec. + * + * + *

Java class for idType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="idType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <anyAttribute namespace='##other'/>
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "idType", propOrder = { + "value" +}) +public class IdType { + + @XmlValue + @XmlSchemaType(name = "anyURI") + protected String value; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/LinkType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/LinkType.java new file mode 100644 index 0000000000000..7ea60224d7f02 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/LinkType.java @@ -0,0 +1,324 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.math.BigInteger; +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom link construct is defined in section 3.4 of the format spec. + * + * + *

Java class for linkType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="linkType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <attribute name="href" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="rel" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="hreflang" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
+ *       <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="length" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <anyAttribute namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "linkType", propOrder = { + "content" +}) +public class LinkType { + + @XmlValue + protected String content; + @XmlAttribute(required = true) + @XmlSchemaType(name = "anyURI") + protected String href; + @XmlAttribute + protected String rel; + @XmlAttribute + protected String type; + @XmlAttribute + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NMTOKEN") + protected String hreflang; + @XmlAttribute + protected String title; + @XmlAttribute + @XmlSchemaType(name = "positiveInteger") + protected BigInteger length; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * + * The Atom link construct is defined in section 3.4 of the format spec. + * + * + * @return + * possible object is + * {@link String } + * + */ + public String getContent() { + return content; + } + + /** + * Sets the value of the content property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setContent(String value) { + this.content = value; + } + + /** + * Gets the value of the href property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getHref() { + return href; + } + + /** + * Sets the value of the href property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHref(String value) { + this.href = value; + } + + /** + * Gets the value of the rel property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRel() { + return rel; + } + + /** + * Sets the value of the rel property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRel(String value) { + this.rel = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the hreflang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getHreflang() { + return hreflang; + } + + /** + * Sets the value of the hreflang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHreflang(String value) { + this.hreflang = value; + } + + /** + * Gets the value of the title property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTitle() { + return title; + } + + /** + * Sets the value of the title property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTitle(String value) { + this.title = value; + } + + /** + * Gets the value of the length property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getLength() { + return length; + } + + /** + * Sets the value of the length property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setLength(BigInteger value) { + this.length = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/LogoType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/LogoType.java new file mode 100644 index 0000000000000..443f58c771070 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/LogoType.java @@ -0,0 +1,156 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom logo construct is defined in section 4.2.8 of the format spec. + * + * + *

Java class for logoType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="logoType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <anyAttribute namespace='##other'/>
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "logoType", propOrder = { + "value" +}) +public class LogoType { + + @XmlValue + @XmlSchemaType(name = "anyURI") + protected String value; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/ObjectFactory.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/ObjectFactory.java new file mode 100644 index 0000000000000..c620b60d57564 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/ObjectFactory.java @@ -0,0 +1,556 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the com.microsoft.windowsazure.services.media.implementation.atom package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _Entry_QNAME = new QName("http://www.w3.org/2005/Atom", "entry"); + private final static QName _Feed_QNAME = new QName("http://www.w3.org/2005/Atom", "feed"); + private final static QName _PersonTypeName_QNAME = new QName("http://www.w3.org/2005/Atom", "name"); + private final static QName _PersonTypeEmail_QNAME = new QName("http://www.w3.org/2005/Atom", "email"); + private final static QName _PersonTypeUri_QNAME = new QName("http://www.w3.org/2005/Atom", "uri"); + private final static QName _EntryTypeTitle_QNAME = new QName("http://www.w3.org/2005/Atom", "title"); + private final static QName _EntryTypeCategory_QNAME = new QName("http://www.w3.org/2005/Atom", "category"); + private final static QName _EntryTypeAuthor_QNAME = new QName("http://www.w3.org/2005/Atom", "author"); + private final static QName _EntryTypeSummary_QNAME = new QName("http://www.w3.org/2005/Atom", "summary"); + private final static QName _EntryTypeId_QNAME = new QName("http://www.w3.org/2005/Atom", "id"); + private final static QName _EntryTypeContent_QNAME = new QName("http://www.w3.org/2005/Atom", "content"); + private final static QName _EntryTypeLink_QNAME = new QName("http://www.w3.org/2005/Atom", "link"); + private final static QName _EntryTypeContributor_QNAME = new QName("http://www.w3.org/2005/Atom", "contributor"); + private final static QName _EntryTypeUpdated_QNAME = new QName("http://www.w3.org/2005/Atom", "updated"); + private final static QName _EntryTypeSource_QNAME = new QName("http://www.w3.org/2005/Atom", "source"); + private final static QName _EntryTypeRights_QNAME = new QName("http://www.w3.org/2005/Atom", "rights"); + private final static QName _EntryTypePublished_QNAME = new QName("http://www.w3.org/2005/Atom", "published"); + private final static QName _FeedTypeGenerator_QNAME = new QName("http://www.w3.org/2005/Atom", "generator"); + private final static QName _FeedTypeSubtitle_QNAME = new QName("http://www.w3.org/2005/Atom", "subtitle"); + private final static QName _FeedTypeLogo_QNAME = new QName("http://www.w3.org/2005/Atom", "logo"); + private final static QName _FeedTypeIcon_QNAME = new QName("http://www.w3.org/2005/Atom", "icon"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.microsoft.windowsazure.services.media.implementation.atom + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link PersonType } + * + */ + public PersonType createPersonType() { + return new PersonType(); + } + + /** + * Create an instance of {@link EntryType } + * + */ + public EntryType createEntryType() { + return new EntryType(); + } + + /** + * Create an instance of {@link IconType } + * + */ + public IconType createIconType() { + return new IconType(); + } + + /** + * Create an instance of {@link UriType } + * + */ + public UriType createUriType() { + return new UriType(); + } + + /** + * Create an instance of {@link TextType } + * + */ + public TextType createTextType() { + return new TextType(); + } + + /** + * Create an instance of {@link FeedType } + * + */ + public FeedType createFeedType() { + return new FeedType(); + } + + /** + * Create an instance of {@link DateTimeType } + * + */ + public DateTimeType createDateTimeType() { + return new DateTimeType(); + } + + /** + * Create an instance of {@link IdType } + * + */ + public IdType createIdType() { + return new IdType(); + } + + /** + * Create an instance of {@link SourceType } + * + */ + public SourceType createSourceType() { + return new SourceType(); + } + + /** + * Create an instance of {@link LinkType } + * + */ + public LinkType createLinkType() { + return new LinkType(); + } + + /** + * Create an instance of {@link LogoType } + * + */ + public LogoType createLogoType() { + return new LogoType(); + } + + /** + * Create an instance of {@link GeneratorType } + * + */ + public GeneratorType createGeneratorType() { + return new GeneratorType(); + } + + /** + * Create an instance of {@link ContentType } + * + */ + public ContentType createContentType() { + return new ContentType(); + } + + /** + * Create an instance of {@link CategoryType } + * + */ + public CategoryType createCategoryType() { + return new CategoryType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link EntryType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "entry") + public JAXBElement createEntry(EntryType value) { + return new JAXBElement(_Entry_QNAME, EntryType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link FeedType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "feed") + public JAXBElement createFeed(FeedType value) { + return new JAXBElement(_Feed_QNAME, FeedType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "name", scope = PersonType.class) + public JAXBElement createPersonTypeName(String value) { + return new JAXBElement(_PersonTypeName_QNAME, String.class, PersonType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "email", scope = PersonType.class) + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + public JAXBElement createPersonTypeEmail(String value) { + return new JAXBElement(_PersonTypeEmail_QNAME, String.class, PersonType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link UriType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "uri", scope = PersonType.class) + public JAXBElement createPersonTypeUri(UriType value) { + return new JAXBElement(_PersonTypeUri_QNAME, UriType.class, PersonType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "title", scope = EntryType.class) + public JAXBElement createEntryTypeTitle(TextType value) { + return new JAXBElement(_EntryTypeTitle_QNAME, TextType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CategoryType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "category", scope = EntryType.class) + public JAXBElement createEntryTypeCategory(CategoryType value) { + return new JAXBElement(_EntryTypeCategory_QNAME, CategoryType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PersonType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "author", scope = EntryType.class) + public JAXBElement createEntryTypeAuthor(PersonType value) { + return new JAXBElement(_EntryTypeAuthor_QNAME, PersonType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "summary", scope = EntryType.class) + public JAXBElement createEntryTypeSummary(TextType value) { + return new JAXBElement(_EntryTypeSummary_QNAME, TextType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link IdType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "id", scope = EntryType.class) + public JAXBElement createEntryTypeId(IdType value) { + return new JAXBElement(_EntryTypeId_QNAME, IdType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ContentType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "content", scope = EntryType.class) + public JAXBElement createEntryTypeContent(ContentType value) { + return new JAXBElement(_EntryTypeContent_QNAME, ContentType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link LinkType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "link", scope = EntryType.class) + public JAXBElement createEntryTypeLink(LinkType value) { + return new JAXBElement(_EntryTypeLink_QNAME, LinkType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PersonType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "contributor", scope = EntryType.class) + public JAXBElement createEntryTypeContributor(PersonType value) { + return new JAXBElement(_EntryTypeContributor_QNAME, PersonType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "updated", scope = EntryType.class) + public JAXBElement createEntryTypeUpdated(DateTimeType value) { + return new JAXBElement(_EntryTypeUpdated_QNAME, DateTimeType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "source", scope = EntryType.class) + public JAXBElement createEntryTypeSource(TextType value) { + return new JAXBElement(_EntryTypeSource_QNAME, TextType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "rights", scope = EntryType.class) + public JAXBElement createEntryTypeRights(TextType value) { + return new JAXBElement(_EntryTypeRights_QNAME, TextType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "published", scope = EntryType.class) + public JAXBElement createEntryTypePublished(DateTimeType value) { + return new JAXBElement(_EntryTypePublished_QNAME, DateTimeType.class, EntryType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CategoryType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "category", scope = FeedType.class) + public JAXBElement createFeedTypeCategory(CategoryType value) { + return new JAXBElement(_EntryTypeCategory_QNAME, CategoryType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "title", scope = FeedType.class) + public JAXBElement createFeedTypeTitle(TextType value) { + return new JAXBElement(_EntryTypeTitle_QNAME, TextType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PersonType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "author", scope = FeedType.class) + public JAXBElement createFeedTypeAuthor(PersonType value) { + return new JAXBElement(_EntryTypeAuthor_QNAME, PersonType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link IdType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "id", scope = FeedType.class) + public JAXBElement createFeedTypeId(IdType value) { + return new JAXBElement(_EntryTypeId_QNAME, IdType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link EntryType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "entry", scope = FeedType.class) + public JAXBElement createFeedTypeEntry(EntryType value) { + return new JAXBElement(_Entry_QNAME, EntryType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PersonType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "contributor", scope = FeedType.class) + public JAXBElement createFeedTypeContributor(PersonType value) { + return new JAXBElement(_EntryTypeContributor_QNAME, PersonType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "updated", scope = FeedType.class) + public JAXBElement createFeedTypeUpdated(DateTimeType value) { + return new JAXBElement(_EntryTypeUpdated_QNAME, DateTimeType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GeneratorType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "generator", scope = FeedType.class) + public JAXBElement createFeedTypeGenerator(GeneratorType value) { + return new JAXBElement(_FeedTypeGenerator_QNAME, GeneratorType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "subtitle", scope = FeedType.class) + public JAXBElement createFeedTypeSubtitle(TextType value) { + return new JAXBElement(_FeedTypeSubtitle_QNAME, TextType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link LogoType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "logo", scope = FeedType.class) + public JAXBElement createFeedTypeLogo(LogoType value) { + return new JAXBElement(_FeedTypeLogo_QNAME, LogoType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link IconType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "icon", scope = FeedType.class) + public JAXBElement createFeedTypeIcon(IconType value) { + return new JAXBElement(_FeedTypeIcon_QNAME, IconType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link LinkType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "link", scope = FeedType.class) + public JAXBElement createFeedTypeLink(LinkType value) { + return new JAXBElement(_EntryTypeLink_QNAME, LinkType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "rights", scope = FeedType.class) + public JAXBElement createFeedTypeRights(TextType value) { + return new JAXBElement(_EntryTypeRights_QNAME, TextType.class, FeedType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "title", scope = SourceType.class) + public JAXBElement createSourceTypeTitle(TextType value) { + return new JAXBElement(_EntryTypeTitle_QNAME, TextType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CategoryType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "category", scope = SourceType.class) + public JAXBElement createSourceTypeCategory(CategoryType value) { + return new JAXBElement(_EntryTypeCategory_QNAME, CategoryType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link IconType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "icon", scope = SourceType.class) + public JAXBElement createSourceTypeIcon(IconType value) { + return new JAXBElement(_FeedTypeIcon_QNAME, IconType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PersonType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "author", scope = SourceType.class) + public JAXBElement createSourceTypeAuthor(PersonType value) { + return new JAXBElement(_EntryTypeAuthor_QNAME, PersonType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link LogoType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "logo", scope = SourceType.class) + public JAXBElement createSourceTypeLogo(LogoType value) { + return new JAXBElement(_FeedTypeLogo_QNAME, LogoType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link IdType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "id", scope = SourceType.class) + public JAXBElement createSourceTypeId(IdType value) { + return new JAXBElement(_EntryTypeId_QNAME, IdType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link LinkType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "link", scope = SourceType.class) + public JAXBElement createSourceTypeLink(LinkType value) { + return new JAXBElement(_EntryTypeLink_QNAME, LinkType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PersonType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "contributor", scope = SourceType.class) + public JAXBElement createSourceTypeContributor(PersonType value) { + return new JAXBElement(_EntryTypeContributor_QNAME, PersonType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DateTimeType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "updated", scope = SourceType.class) + public JAXBElement createSourceTypeUpdated(DateTimeType value) { + return new JAXBElement(_EntryTypeUpdated_QNAME, DateTimeType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GeneratorType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "generator", scope = SourceType.class) + public JAXBElement createSourceTypeGenerator(GeneratorType value) { + return new JAXBElement(_FeedTypeGenerator_QNAME, GeneratorType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "rights", scope = SourceType.class) + public JAXBElement createSourceTypeRights(TextType value) { + return new JAXBElement(_EntryTypeRights_QNAME, TextType.class, SourceType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TextType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "subtitle", scope = SourceType.class) + public JAXBElement createSourceTypeSubtitle(TextType value) { + return new JAXBElement(_FeedTypeSubtitle_QNAME, TextType.class, SourceType.class, value); + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/PersonType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/PersonType.java new file mode 100644 index 0000000000000..8bd21a51d5ed6 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/PersonType.java @@ -0,0 +1,179 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom person construct is defined in section 3.2 of the format spec. + * + * + *

Java class for personType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="personType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded">
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="uri" type="{http://www.w3.org/2005/Atom}uriType" minOccurs="0"/>
+ *         <element name="email" type="{http://www.w3.org/2005/Atom}emailType" minOccurs="0"/>
+ *         <any namespace='##other'/>
+ *       </choice>
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <anyAttribute namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "personType", propOrder = { + "nameOrUriOrEmail" +}) +public class PersonType { + + @XmlElementRefs({ + @XmlElementRef(name = "email", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "uri", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "name", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class) + }) + @XmlAnyElement(lax = true) + protected List nameOrUriOrEmail; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the nameOrUriOrEmail property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the nameOrUriOrEmail property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getNameOrUriOrEmail().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link String }{@code >} + * {@link Object } + * {@link JAXBElement }{@code <}{@link String }{@code >} + * {@link JAXBElement }{@code <}{@link UriType }{@code >} + * + * + */ + public List getNameOrUriOrEmail() { + if (nameOrUriOrEmail == null) { + nameOrUriOrEmail = new ArrayList(); + } + return this.nameOrUriOrEmail; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/SourceType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/SourceType.java new file mode 100644 index 0000000000000..a5f20de7ae32b --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/SourceType.java @@ -0,0 +1,206 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom source construct is defined in section 4.2.11 of the format spec. + * + * + *

Java class for sourceType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="sourceType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded">
+ *         <element name="author" type="{http://www.w3.org/2005/Atom}personType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="category" type="{http://www.w3.org/2005/Atom}categoryType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="contributor" type="{http://www.w3.org/2005/Atom}personType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="generator" type="{http://www.w3.org/2005/Atom}generatorType" minOccurs="0"/>
+ *         <element name="icon" type="{http://www.w3.org/2005/Atom}iconType" minOccurs="0"/>
+ *         <element name="id" type="{http://www.w3.org/2005/Atom}idType" minOccurs="0"/>
+ *         <element name="link" type="{http://www.w3.org/2005/Atom}linkType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="logo" type="{http://www.w3.org/2005/Atom}logoType" minOccurs="0"/>
+ *         <element name="rights" type="{http://www.w3.org/2005/Atom}textType" minOccurs="0"/>
+ *         <element name="subtitle" type="{http://www.w3.org/2005/Atom}textType" minOccurs="0"/>
+ *         <element name="title" type="{http://www.w3.org/2005/Atom}textType" minOccurs="0"/>
+ *         <element name="updated" type="{http://www.w3.org/2005/Atom}dateTimeType" minOccurs="0"/>
+ *         <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </choice>
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <anyAttribute namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "sourceType", propOrder = { + "authorOrCategoryOrContributor" +}) +public class SourceType { + + @XmlElementRefs({ + @XmlElementRef(name = "contributor", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "title", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "author", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "category", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "generator", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "logo", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "id", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "icon", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "link", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "rights", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "subtitle", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class), + @XmlElementRef(name = "updated", namespace = "http://www.w3.org/2005/Atom", type = JAXBElement.class) + }) + @XmlAnyElement(lax = true) + protected List authorOrCategoryOrContributor; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the authorOrCategoryOrContributor property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the authorOrCategoryOrContributor property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAuthorOrCategoryOrContributor().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link PersonType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * {@link JAXBElement }{@code <}{@link PersonType }{@code >} + * {@link JAXBElement }{@code <}{@link GeneratorType }{@code >} + * {@link JAXBElement }{@code <}{@link LogoType }{@code >} + * {@link JAXBElement }{@code <}{@link IdType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * {@link JAXBElement }{@code <}{@link DateTimeType }{@code >} + * {@link JAXBElement }{@code <}{@link CategoryType }{@code >} + * {@link Object } + * {@link JAXBElement }{@code <}{@link IconType }{@code >} + * {@link JAXBElement }{@code <}{@link LinkType }{@code >} + * {@link JAXBElement }{@code <}{@link TextType }{@code >} + * + * + */ + public List getAuthorOrCategoryOrContributor() { + if (authorOrCategoryOrContributor == null) { + authorOrCategoryOrContributor = new ArrayList(); + } + return this.authorOrCategoryOrContributor; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/TextType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/TextType.java new file mode 100644 index 0000000000000..6421c6ae97c96 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/TextType.java @@ -0,0 +1,206 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + * + * The Atom text construct is defined in section 3.1 of the format spec. + * + * + *

Java class for textType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="textType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <any namespace='http://www.w3.org/1999/xhtml' minOccurs="0"/>
+ *       </sequence>
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <attribute name="type">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *             <enumeration value="text"/>
+ *             <enumeration value="html"/>
+ *             <enumeration value="xhtml"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <anyAttribute namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "textType", propOrder = { + "content" +}) +public class TextType { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String type; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * + * The Atom text construct is defined in section 3.1 of the format spec. + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Object } + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/UriType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/UriType.java new file mode 100644 index 0000000000000..07c555c1dd6ee --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/UriType.java @@ -0,0 +1,152 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + + +package com.microsoft.windowsazure.services.media.implementation.atom; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; + + +/** + *

Java class for uriType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="uriType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
+ *       <attGroup ref="{http://www.w3.org/2005/Atom}commonAttributes"/>
+ *       <anyAttribute namespace='##other'/>
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "uriType", propOrder = { + "value" +}) +public class UriType { + + @XmlValue + @XmlSchemaType(name = "anyURI") + protected String value; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlSchemaType(name = "anyURI") + protected String base; + @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "language") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the base property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getBase() { + return base; + } + + /** + * Sets the value of the base property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBase(String value) { + this.base = value; + } + + /** + * Gets the value of the lang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed property on this class. + * + *

+ * the map is keyed by the name of the attribute and + * the value is the string value of the attribute. + * + * the map returned by this method is live, and you can add new attribute + * by updating the map directly. Because of this design, there's no setter. + * + * + * @return + * always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/package-info.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/package-info.java new file mode 100644 index 0000000000000..5fc88fe9c0e0d --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/package-info.java @@ -0,0 +1,9 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2012.09.17 at 02:31:28 PM PDT +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2005/Atom", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package com.microsoft.windowsazure.services.media.implementation.atom; diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/AssetType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/AssetType.java new file mode 100644 index 0000000000000..391e0c497aaa5 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/AssetType.java @@ -0,0 +1,156 @@ +/** + * 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; +import javax.xml.datatype.XMLGregorianCalendar; + +/** + * This type maps the XML returned in the odata ATOM serialization + * for Asset entities. + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +public class AssetType implements MediaServiceDTO { + + @XmlElement(name = "Id", namespace = Constants.ODATA_DATA_NS) + protected String id; + + @XmlElement(name = "State", namespace = Constants.ODATA_DATA_NS) + protected int state; + + @XmlElement(name = "Created", namespace = Constants.ODATA_DATA_NS) + protected XMLGregorianCalendar created; + + @XmlElement(name = "LastModified", namespace = Constants.ODATA_DATA_NS) + protected XMLGregorianCalendar lastModified; + + @XmlElement(name = "AlternateId", namespace = Constants.ODATA_DATA_NS) + protected String alternateId; + + @XmlElement(name = "Name", namespace = Constants.ODATA_DATA_NS) + protected String name; + + @XmlElement(name = "Options", namespace = Constants.ODATA_DATA_NS) + protected int options; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id + * the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the state + */ + public int getState() { + return state; + } + + /** + * @param state + * the state to set + */ + public void setState(int state) { + this.state = state; + } + + /** + * @return the created + */ + public XMLGregorianCalendar getCreated() { + return created; + } + + /** + * @param created + * the created to set + */ + public void setCreated(XMLGregorianCalendar created) { + this.created = created; + } + + /** + * @return the lastModified + */ + public XMLGregorianCalendar getLastModified() { + return lastModified; + } + + /** + * @param lastModified + * the lastModified to set + */ + public void setLastModified(XMLGregorianCalendar lastModified) { + this.lastModified = lastModified; + } + + /** + * @return the alternateId + */ + public String getAlternateId() { + return alternateId; + } + + /** + * @param alternateId + * the alternateId to set + */ + public void setAlternateId(String alternateId) { + this.alternateId = alternateId; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the options + */ + public int getOptions() { + return options; + } + + /** + * @param options + * the options to set + */ + public void setOptions(int options) { + this.options = options; + } +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/Constants.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/Constants.java new file mode 100644 index 0000000000000..0e004668e6ac8 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/Constants.java @@ -0,0 +1,61 @@ +/** + * 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.namespace.QName; + +/** + * This class provides a set of constants for element names + * and namespaces used throughout the serialization of + * media services entities. + */ + +public class Constants { + /** + * XML Namespace for Atom syndication format, as defined by IETF RFC 4287 + */ + public static final String ATOM_NS = "http://www.w3.org/2005/Atom"; + + /** + * XML Namespace for OData data as serialized inside Atom syndication format. + */ + public static final String ODATA_DATA_NS = "http://schemas.microsoft.com/ado/2007/08/dataservices"; + + /** + * XML Namespace for OData metadata as serialized inside Atom syndication format. + */ + public static final String ODATA_METADATA_NS = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"; + + /** + * EDM namespace for Azure Media Services entities, as defined in Media Services EDMX file. + */ + public static final String MEDIA_SERVICES_EDM_NAMESPACE = "Microsoft.Cloud.Media.Vod.Rest.Data.Models"; + + /** + * Element name for Atom content element, including namespace + */ + public static final QName ATOM_CONTENT_ELEMENT_NAME = new QName("content", ATOM_NS); + + /** + * Element name for OData action elements, including namespace + */ + public static final QName ODATA_ACTION_ELEMENT_NAME = new QName("action", ODATA_METADATA_NS); + + /** + * Element name for the metadata properties element, including namespace. + */ + public static final QName ODATA_PROPERTIES_ELEMENT_NAME = new QName("properties", ODATA_METADATA_NS); +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/CreateAssetRequest.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/CreateAssetRequest.java new file mode 100644 index 0000000000000..e93c2e7f6844d --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/CreateAssetRequest.java @@ -0,0 +1,38 @@ +/** + * 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.XmlRootElement; + +/** + * Serializable class containing the information needed to + * create an asset. + * + */ +@XmlRootElement +public class CreateAssetRequest { + public String Name; + + /** + * Empty constructor required by JaxB. + */ + public CreateAssetRequest() { + } + + public CreateAssetRequest(String name) { + Name = name; + } +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/MediaServiceDTO.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/MediaServiceDTO.java new file mode 100644 index 0000000000000..762cae0eed0b7 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/MediaServiceDTO.java @@ -0,0 +1,14 @@ +package com.microsoft.windowsazure.services.media.implementation.content; + + +/** + * Marker interface to mark types as a data transfer object + * to or from Media Services. + * + * This is a marker interface rather than an annotation so + * that it can be used as a generic type parameter or restriction. + * + */ +public interface MediaServiceDTO { + +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/ODataActionType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/ODataActionType.java new file mode 100644 index 0000000000000..569cd17d4f3f9 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/ODataActionType.java @@ -0,0 +1,91 @@ +/** + * 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.XmlAttribute; + +/** + * XML Serialization class for odata m:action elements + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +public class ODataActionType { + + @XmlAttribute(required = true) + protected String metadata; + + @XmlAttribute(required = true) + protected String target; + + @XmlAttribute(required = true) + protected String title; + + /** + * Get metadata + * + * @return the metadata + */ + public String getMetadata() { + return metadata; + } + + /** + * Set metadata + * + * @param metadata + */ + public void setMetadata(String metadata) { + this.metadata = metadata; + } + + /** + * Get target + * + * @return the target + */ + public String getTarget() { + return target; + } + + /** + * set target + * + * @param target + */ + public void setTarget(String target) { + this.target = target; + } + + /** + * Get title + * + * @return the title + */ + public String getTitle() { + return title; + } + + /** + * set title + * + * @param title + */ + public void setTitle(String title) { + this.title = title; + } +} diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/ObjectFactory.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/ObjectFactory.java new file mode 100644 index 0000000000000..d353a7d006964 --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/ObjectFactory.java @@ -0,0 +1,52 @@ +/** + * 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.XmlRegistry; + +/** + * Class used by JAXB to instantiate the types in this package. + * + */ +@XmlRegistry +public class ObjectFactory { + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: + * com.microsoft.windowsazure.services.media.implementation.atom + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link AssetType } + * + * @return a new AssetType instance. + */ + public AssetType createAssetType() { + return new AssetType(); + } + + /** + * Create an instance of {@link ODataActionType } + * + * @return a new ODataActionType instance. + */ + public ODataActionType createODataActionType() { + return new ODataActionType(); + } +} 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/AssetInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java new file mode 100644 index 0000000000000..7fc7a9c28306f --- /dev/null +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java @@ -0,0 +1,167 @@ +/** + * 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 javax.xml.datatype.XMLGregorianCalendar; + +import com.microsoft.windowsazure.services.media.implementation.ODataEntity; +import com.microsoft.windowsazure.services.media.implementation.atom.EntryType; +import com.microsoft.windowsazure.services.media.implementation.content.AssetType; + +/** + * Data about a Media Services Asset entity. + * + */ +public class AssetInfo extends ODataEntity { + + public AssetInfo(EntryType entry, AssetType content) { + super(entry, content); + } + + /** + * Get the asset id + * + * @return the id + */ + public String getId() { + return getContent().getId(); + } + + /** + * Set the id + * + * @param id + * the id + */ + public void setId(String id) { + getContent().setId(id); + } + + /** + * Get the asset name + * + * @return the name + */ + public String getName() { + return this.getContent().getName(); + } + + /** + * set the name + * + * @param name + * the name + */ + public void setName(String name) { + this.getContent().setName(name); + } + + /** + * Get the asset state + * + * @return the state + */ + public int getState() { + return getContent().getState(); + } + + /** + * Set the state + * + * @param state + * the state + */ + public void setState(int state) { + getContent().setState(state); + } + + /** + * Get the creation date + * + * @return the date + */ + public XMLGregorianCalendar getCreated() { + return this.getContent().getCreated(); + } + + /** + * Set creation date + * + * @param created + * the date + * + */ + public void setCreated(XMLGregorianCalendar created) { + getContent().setCreated(created); + } + + /** + * Get last modified date + * + * @return the date + */ + public XMLGregorianCalendar getLastModified() { + return getContent().getLastModified(); + } + + /** + * Set last modified date + * + * @param lastModified + * the date + */ + public void setLastModified(XMLGregorianCalendar lastModified) { + getContent().setLastModified(lastModified); + } + + /** + * Get the alternate id + * + * @return the id + */ + public String getAlternateId() { + return getContent().getAlternateId(); + } + + /** + * Set the alternate id + * + * @param alternateId + * the id + */ + public void setAlternateId(String alternateId) { + getContent().setAlternateId(alternateId); + } + + /** + * Get the options + * + * @return the options + */ + public int getOptions() { + return getContent().getOptions(); + } + + /** + * Set the options + * + * @param options + * the options + */ + public void setOptions(int options) { + getContent().setOptions(options); + } +} diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenManagerTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenManagerTest.java index 2cbbc85d50854..8d6733e772a93 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenManagerTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/OAuthTokenManagerTest.java @@ -54,7 +54,7 @@ public void init() throws URISyntaxException { String accountPassword = "testpassword"; String scope = "urn:WindowsAzureMediaServices"; - client = new OAuthTokenManager(contract, dateFactory, new URI(acsBaseUri), accountName, accountPassword, scope); + client = new OAuthTokenManager(contract, dateFactory, acsBaseUri, accountName, accountPassword, scope); when(dateFactory.getDate()).thenAnswer(new Answer() { @Override diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/ODataSerializationFromJerseyTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/ODataSerializationFromJerseyTest.java new file mode 100644 index 0000000000000..2c2ac5bf05e52 --- /dev/null +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/ODataSerializationFromJerseyTest.java @@ -0,0 +1,104 @@ +/** + * 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; + +import java.net.URISyntaxException; +import java.util.List; + +import javax.ws.rs.core.MediaType; + +import org.junit.Assert; +import org.junit.Test; + +import com.microsoft.windowsazure.services.core.utils.DefaultDateFactory; +import com.microsoft.windowsazure.services.media.IntegrationTestBase; +import com.microsoft.windowsazure.services.media.MediaConfiguration; +import com.microsoft.windowsazure.services.media.MediaContract; +import com.microsoft.windowsazure.services.media.MediaService; +import com.microsoft.windowsazure.services.media.implementation.content.AssetType; +import com.microsoft.windowsazure.services.media.models.AssetInfo; +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.LoggingFilter; +import com.sun.jersey.api.json.JSONConfiguration; + +public class ODataSerializationFromJerseyTest extends IntegrationTestBase { + + @Test + public void canBuildJerseyClientToCreateAnAssetWhichIsProperlyDeserialized() throws Exception { + // Build a jersey client object by hand; this is working up to the + // full integration into the media services rest proxy, but we + // need to go step by step to begin. + + ClientConfig cc = new DefaultClientConfig(); + cc.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, false); + cc.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, true); + cc.getSingletons().add(new ODataEntityProvider()); + Client c = Client.create(cc); + + c.addFilter(new LoggingFilter(System.out)); + c.addFilter(new RedirectFilter(createLocationManager())); + c.addFilter(new OAuthFilter(createTokenManager())); + c.addFilter(new VersionHeadersFilter()); + + WebResource assetResource = c.resource("Assets"); + + ODataAtomMarshaller m = new ODataAtomMarshaller(); + AssetType requestData = new AssetType(); + requestData.setName("firstTestAsset"); + requestData.setAlternateId("some external id"); + + AssetInfo newAsset = assetResource.type(MediaType.APPLICATION_ATOM_XML).accept(MediaType.APPLICATION_ATOM_XML) + .post(AssetInfo.class, m.marshalEntry(requestData)); + + Assert.assertNotNull(newAsset); + Assert.assertEquals("firstTestAsset", newAsset.getName()); + Assert.assertEquals("some external id", newAsset.getAlternateId()); + } + + private OAuthContract createOAuthContract() { + return new OAuthRestProxy(Client.create()); + } + + private OAuthTokenManager createTokenManager() throws URISyntaxException { + return new OAuthTokenManager(createOAuthContract(), new DefaultDateFactory(), + (String) config.getProperty(MediaConfiguration.OAUTH_URI), + (String) config.getProperty(MediaConfiguration.OAUTH_CLIENT_ID), + (String) config.getProperty(MediaConfiguration.OAUTH_CLIENT_SECRET), "urn:WindowsAzureMediaServices"); + } + + private ResourceLocationManager createLocationManager() throws URISyntaxException { + return new ResourceLocationManager((String) config.getProperty(MediaConfiguration.URI)); + } + + @Test + public void canCreateAssetThroughMediaServiceAPI() throws Exception { + MediaContract client = MediaService.create(config); + AssetInfo newAsset = client.createAsset("secondTestAsset"); + + Assert.assertEquals("secondTestAsset", newAsset.getName()); + } + + @Test + public void canRetrieveListOfAssets() throws Exception { + MediaContract client = MediaService.create(config); + List assets = client.getAssets(); + + Assert.assertNotNull(assets); + } +} diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/ODataSerializationTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/ODataSerializationTest.java new file mode 100644 index 0000000000000..80905eb549c3e --- /dev/null +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/implementation/ODataSerializationTest.java @@ -0,0 +1,95 @@ +/** + * 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; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.List; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.Marshaller; +import javax.xml.namespace.QName; + +import junit.framework.Assert; + +import org.junit.Test; + +import com.microsoft.windowsazure.services.media.implementation.atom.ContentType; +import com.microsoft.windowsazure.services.media.implementation.atom.EntryType; +import com.microsoft.windowsazure.services.media.implementation.content.AssetType; +import com.microsoft.windowsazure.services.media.implementation.content.Constants; +import com.microsoft.windowsazure.services.media.models.AssetInfo; + +public class ODataSerializationTest { + + private final String sampleFeedOneAsset = "\n" + + "\n" + + " https://wamsbayclus001rest-hs.cloudapp.net/api/Assets\n" + + " Assets\n" + + " 2012-08-28T18:35:15Z\n" + + " \n" + + " \n" + + " https://wamsbayclus001rest-hs.cloudapp.net/api/Assets('nb%3Acid%3AUUID%3A1f6c7bb4-8013-486e-b4c9-2e4a6842b9a6')\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " <updated>2012-08-28T18:35:15Z</updated>\n" + + " <author>\n" + + " <name />\n" + + " </author>\n" + + " <m:action metadata=\"https://wamsbayclus001rest-hs.cloudapp.net/api/$metadata#WindowsAzureMediaServices.Publish\" title=\"Publish\" target=\"https://wamsbayclus001rest-hs.cloudapp.net/api/Assets('nb%3Acid%3AUUID%3A1f6c7bb4-8013-486e-b4c9-2e4a6842b9a6')/Publish\" />\n" + + " <content type=\"application/xml\">\n" + " <m:properties>\n" + + " <d:Id>nb:cid:UUID:1f6c7bb4-8013-486e-b4c9-2e4a6842b9a6</d:Id>\n" + + " <d:State m:type=\"Edm.Int32\">0</d:State>\n" + + " <d:Created m:type=\"Edm.DateTime\">2012-08-28T18:34:06.123</d:Created>\n" + + " <d:LastModified m:type=\"Edm.DateTime\">2012-08-28T18:34:06.123</d:LastModified>\n" + + " <d:AlternateId m:null=\"true\" />\n" + " <d:Name>testAsset</d:Name>\n" + + " <d:Options m:type=\"Edm.Int32\">0</d:Options>\n" + " </m:properties>\n" + + " </content>\n" + " </entry>\n" + "</feed>"; + + @Test + public void canUnmarshallAssetFromFeed() throws Exception { + ODataAtomUnmarshaller um = new ODataAtomUnmarshaller(); + InputStream input = new ByteArrayInputStream(sampleFeedOneAsset.getBytes("UTF-8")); + List<AssetInfo> entries = um.unmarshalFeed(input, AssetInfo.class); + Assert.assertEquals(1, entries.size()); + Assert.assertEquals("nb:cid:UUID:1f6c7bb4-8013-486e-b4c9-2e4a6842b9a6", entries.get(0).getId()); + } + + @Test + public void canMarshalEntryFromJavaObject() throws Exception { + AssetType a = new AssetType(); + a.setName("testNewAsset"); + a.setOptions(0); + a.setAlternateId("some other id"); + + JAXBContext context = JAXBContext.newInstance(EntryType.class, AssetType.class); + Marshaller m = context.createMarshaller(); + + EntryType e = new EntryType(); + ContentType c = new ContentType(); + c.getContent().add(new JAXBElement(Constants.ODATA_PROPERTIES_ELEMENT_NAME, AssetType.class, a)); + e.getEntryChildren().add(new JAXBElement(Constants.ATOM_CONTENT_ELEMENT_NAME, ContentType.class, c)); + + m.marshal(new JAXBElement(new QName(Constants.ATOM_NS, "entry"), EntryType.class, e), System.out); + + } +} diff --git a/microsoft-azure-api/src/test/resources/META-INF/com.microsoft.windowsazure.properties b/microsoft-azure-api/src/test/resources/META-INF/com.microsoft.windowsazure.properties index 7739acd3e7333..a06c02e2b8496 100644 --- a/microsoft-azure-api/src/test/resources/META-INF/com.microsoft.windowsazure.properties +++ b/microsoft-azure-api/src/test/resources/META-INF/com.microsoft.windowsazure.properties @@ -10,4 +10,9 @@ queue.accountKey=%QUEUE_ACCOUNTKEY% queue.uri=http://%QUEUE_ACCOUNTNAME%.queue.core.windows.net table.accountName=%TABLE_ACCOUNTNAME% table.accountKey=%TABLE_ACCOUNTKEY% -table.uri=http://%TABLE_ACCOUNTNAME%.table.core.windows.net \ No newline at end of file +table.uri=http://%TABLE_ACCOUNTNAME%.table.core.windows.net +media.uri=%MEDIA.URI% +oauth.uri=%OAUTH.URI% +oauth.client.id=%OAUTH.CLIENT.ID% +oauth.client.secret=%OAUTH.CLIENT.SECRET% +oauth.scope=urn:WindowsAzureMediaServices \ No newline at end of file