Package com.microsoft.windowsazure.services.media.implementation.atom

Examples of com.microsoft.windowsazure.services.media.implementation.atom.EntryType


        ContentType contentElement = new ContentType();
        contentElement.getContent().add(
                new JAXBElement(Constants.ODATA_PROPERTIES_ELEMENT_NAME,
                        content.getClass(), content));
        entry = new EntryType();
        entry.getEntryChildren().add(
                new JAXBElement(Constants.ATOM_CONTENT_ELEMENT_NAME,
                        ContentType.class, contentElement));
    }
View Full Code Here


    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    private JAXBElement<EntryType> createEntry(Object content) {
        ContentType atomContent = new ContentType();
        EntryType atomEntry = new EntryType();

        atomContent.setType("application/xml");
        atomContent.getContent().add(
                new JAXBElement(new QName(Constants.ODATA_METADATA_NS,
                        "properties"), content.getClass(), content));

        atomEntry.getEntryChildren().add(
                new JAXBElement(new QName(Constants.ATOM_NS, "content"),
                        ContentType.class, atomContent));

        JAXBElement<EntryType> entryElement = new JAXBElement<EntryType>(
                new QName(Constants.ATOM_NS, "entry"), EntryType.class,
View Full Code Here

    private String verb;
    private EntryType entryType;

    public EntityBatchOperation() {
        this.entryType = new EntryType();
    }
View Full Code Here

    private LinkType link1;
    private LinkType link2;

    @Before
    public void setup() {
        EntryType entry = new EntryType();

        link1 = new LinkType();
        link1.setTitle("someLink");
        link1.setRel("Related/something");
        link1.setHref("some/uri/somewhere");

        link2 = new LinkType();
        link2.setTitle("someOtherLink");
        link2.setRel("Related/else");
        link2.setHref("some/other/href/somewhere");

        entry.getEntryChildren().add(
                new JAXBElement<LinkType>(linkName, LinkType.class, link1));
        entry.getEntryChildren().add(
                new JAXBElement<LinkType>(linkName, LinkType.class, link2));

        MediaProcessorType payload = new MediaProcessorType().setId("DummyId")
                .setName("Dummy Name").setVersion("0.0.0").setVendor("Contoso")
                .setSku("sku skiddo").setDescription("For testing links only");

        ContentType contentElement = new ContentType();
        contentElement.getContent().add(
                new JAXBElement<MediaProcessorType>(
                        Constants.ODATA_PROPERTIES_ELEMENT_NAME,
                        MediaProcessorType.class, payload));

        entry.getEntryChildren().add(
                new JAXBElement<ContentType>(
                        Constants.ATOM_CONTENT_ELEMENT_NAME, ContentType.class,
                        contentElement));

        info = new MediaProcessorInfo(entry, payload);
View Full Code Here

        assertEquals(lister.getUri(), expectedInputAsset);
    }

    private JobInfo createJob() {
        EntryType fakeJobEntry = new EntryType();
        addEntryLink(fakeJobEntry, Constants.ODATA_DATA_NS
                + "/related/OutputMediaAssets", expectedOutputAsset,
                "application/atom+xml;type=feed", "OutputAssets");
        addEntryLink(fakeJobEntry, Constants.ODATA_DATA_NS
                + "/related/InputMediaAssets", expectedInputAsset,
View Full Code Here

        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);
View Full Code Here

        assertEquals(lister.getUri(), expectedInputAsset);
    }

    private JobInfo createJob() {
        EntryType fakeJobEntry = new EntryType();
        addEntryLink(fakeJobEntry, Constants.ODATA_DATA_NS
                + "/related/OutputMediaAssets", expectedOutputAsset,
                "application/atom+xml;type=feed", "OutputAssets");
        addEntryLink(fakeJobEntry, Constants.ODATA_DATA_NS
                + "/related/InputMediaAssets", expectedInputAsset,
View Full Code Here

        List<T> entries = new ArrayList<T>();
        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));
            }
        }
View Full Code Here

        validateNotNull(stream, "stream");
        validateNotNull(contentType, "contentType");

        Class<?> marshallingContentType = getMarshallingContentType(contentType);

        EntryType entry = unmarshalEntry(stream);
        return contentFromEntry(contentType, marshallingContentType, entry);
    }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.media.implementation.atom.EntryType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.