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

Examples of com.microsoft.windowsazure.services.media.implementation.content.LocatorRestType


         * @see com.microsoft.windowsazure.services.media.entityoperations.
         * EntityCreateOperation#getRequestContents()
         */
        @Override
        public Object getRequestContents() {
            return new LocatorRestType().setId(id)
                    .setAccessPolicyId(accessPolicyId).setAssetId(assetId)
                    .setStartTime(startDateTime).setType(locatorType.getCode())
                    .setBaseUri(baseUri)
                    .setContentAccessComponent(contentAccessComponent)
                    .setPath(path);
View Full Code Here


         * @see com.microsoft.windowsazure.services.media.entityoperations.
         * EntityUpdateOperation#getRequestContents()
         */
        @Override
        public Object getRequestContents() {
            return new LocatorRestType().setStartTime(startDateTime);
        }
View Full Code Here

        assertEquals("Locators", creator.getUri());
    }

    @Test
    public void createLocatorHasCorrectPayload() throws Exception {
        LocatorRestType locatorType = (LocatorRestType) Locator.create(
                exampleAccessPolicyId, exampleAssetId, LocatorType.SAS)
                .getRequestContents();

        assertEquals(exampleAssetId, locatorType.getAssetId());
        assertEquals(exampleAccessPolicyId, locatorType.getAccessPolicyId());
        assertEquals(LocatorType.SAS.getCode(), locatorType.getType()
                .intValue());
        assertNull(locatorType.getStartTime());
        assertNull(locatorType.getExpirationDateTime());
    }
View Full Code Here

        EntityCreateOperation<LocatorInfo> creator = Locator.create(
                exampleAccessPolicyId, exampleAssetId, LocatorType.SAS)
                .setStartDateTime(now);

        LocatorRestType locatorType = (LocatorRestType) creator
                .getRequestContents();

        assertEquals(exampleAssetId, locatorType.getAssetId());
        assertEquals(exampleAccessPolicyId, locatorType.getAccessPolicyId());
        assertEquals(LocatorType.SAS.getCode(), locatorType.getType()
                .intValue());
        assertEquals(now, locatorType.getStartTime());
    }
View Full Code Here

        EntityCreateOperation<LocatorInfo> creator = Locator.create(
                exampleAccessPolicyId, exampleAssetId, LocatorType.SAS)
                .setPath(expectedPath);

        LocatorRestType locatorType = (LocatorRestType) creator
                .getRequestContents();

        assertEquals(expectedPath, locatorType.getPath());

    }
View Full Code Here

        EntityCreateOperation<LocatorInfo> creator = Locator.create(
                exampleAccessPolicyId, exampleAssetId, LocatorType.SAS)
                .setBaseUri(expectedBaseUri);

        LocatorRestType locatorType = (LocatorRestType) creator
                .getRequestContents();

        assertEquals(expectedBaseUri, locatorType.getBaseUri());

    }
View Full Code Here

        EntityCreateOperation<LocatorInfo> creator = Locator.create(
                exampleAccessPolicyId, exampleAssetId, LocatorType.SAS)
                .setContentAccessComponent(expectedContentAccessComponent);

        LocatorRestType locatorType = (LocatorRestType) creator
                .getRequestContents();

        assertEquals(expectedContentAccessComponent,
                locatorType.getContentAccessComponent());

    }
View Full Code Here

        Date tenMinutesAgo = new Date(now.getTime() - 10 * 60 * 1000);

        EntityUpdateOperation updater = Locator.update(exampleLocatorId)
                .setStartDateTime(tenMinutesAgo);

        LocatorRestType payload = (LocatorRestType) updater
                .getRequestContents();

        assertEquals(tenMinutesAgo, payload.getStartTime());
    }
View Full Code Here

    @Test
    public void testGetSetId() {
        // Arrange
        String expectedId = "testId";
        LocatorInfo locator = new LocatorInfo(null,
                new LocatorRestType().setId(expectedId));

        // Act
        String actualId = locator.getId();

        // Assert
View Full Code Here

    @Test
    public void testGetSetExpirationDateTime() {
        // Arrange
        Date expectedExpirationDateTime = new Date();
        LocatorInfo locatorInfo = new LocatorInfo(null,
                new LocatorRestType()
                        .setExpirationDateTime(expectedExpirationDateTime));

        // Act
        Date actualExpirationDateTime = locatorInfo.getExpirationDateTime();
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.media.implementation.content.LocatorRestType

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.