Skip to content

Commit

Permalink
Merge pull request Azure#49 from gcheng/locatorupdate
Browse files Browse the repository at this point in the history
Locatorupdate according to latest info
  • Loading branch information
Albert Cheng committed Dec 4, 2012
2 parents 2c2b23c + 766ef32 commit 4157475
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ public enum LocatorType {
/** The sas. */
SAS(1),
/** The Origin. */
Origin(2),
/** The third party locator. */
ThirdParty(3);
OnDemandOrigin(2);

/** The locator type code. */
private int locatorTypeCode;
Expand Down Expand Up @@ -67,9 +65,7 @@ public static LocatorType fromCode(int type) {
case 1:
return LocatorType.SAS;
case 2:
return LocatorType.Origin;
case 3:
return LocatorType.ThirdParty;
return LocatorType.OnDemandOrigin;
default:
throw new InvalidParameterException("type");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void instanceSetup() throws Exception {
@Test
public void createLocatorSuccess() throws ServiceException {
// Arrange
LocatorType locatorType = LocatorType.Origin;
LocatorType locatorType = LocatorType.SAS;
Date expectedExpirationDateTime = calculateDefaultExpectedExpDate(accessPolicyInfoRead, assetInfo);

// Act
Expand Down Expand Up @@ -229,7 +229,7 @@ public void listLocatorsWithOptions() throws ServiceException {
@Test
public void updateLocatorSuccess() throws ServiceException {
// Arrange
LocatorType locatorType = LocatorType.Origin;
LocatorType locatorType = LocatorType.OnDemandOrigin;
LocatorInfo locatorInfo = service.create(Locator.create(accessPolicyInfoRead.getId(), assetInfo.getId(),
locatorType));

Expand All @@ -252,7 +252,7 @@ public void updateLocatorSuccess() throws ServiceException {
@Test
public void updateLocatorNoChangesSuccess() throws ServiceException {
// Arrange
LocatorType locatorType = LocatorType.Origin;
LocatorType locatorType = LocatorType.OnDemandOrigin;
Date expirationDateTime = new Date();
expirationDateTime.setTime(expirationDateTime.getTime() + tenMinutesInMS);
Date startTime = new Date();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testGetSetExpirationDateTime() {
@Test
public void testGetSetType() {
// Arrange
LocatorType expectedLocatorType = LocatorType.Origin;
LocatorType expectedLocatorType = LocatorType.SAS;
LocatorInfo locatorInfo = new LocatorInfo();

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
import com.microsoft.windowsazure.services.media.models.AccessPolicyInfo;
import com.microsoft.windowsazure.services.media.models.AccessPolicyPermission;
import com.microsoft.windowsazure.services.media.models.Asset;
import com.microsoft.windowsazure.services.media.models.AssetFileInfo;
import com.microsoft.windowsazure.services.media.models.AssetInfo;
import com.microsoft.windowsazure.services.media.models.EncryptionOption;
import com.microsoft.windowsazure.services.media.models.AssetFileInfo;
import com.microsoft.windowsazure.services.media.models.ListResult;
import com.microsoft.windowsazure.services.media.models.Locator;
import com.microsoft.windowsazure.services.media.models.LocatorInfo;
Expand Down Expand Up @@ -278,14 +278,14 @@ public void cancelJob(JobInfo job) throws InterruptedException {
public List<URL> createOriginUrlsForStreamingContent(AssetInfo asset, int availabilityWindowInMinutes)
throws ServiceException, MalformedURLException {
return createOriginUrlsForStreamingContentWorker(asset, availabilityWindowInMinutes, true, "",
LocatorType.Origin);
LocatorType.OnDemandOrigin);
}

// Deliver
public List<URL> createOriginUrlsForAppleHLSContent(AssetInfo asset, int availabilityWindowInMinutes)
throws ServiceException, MalformedURLException {
return createOriginUrlsForStreamingContentWorker(asset, availabilityWindowInMinutes, true,
"(format=m3u8-aapl)", LocatorType.Origin);
"(format=m3u8-aapl)", LocatorType.OnDemandOrigin);
}

// Deliver
Expand Down

0 comments on commit 4157475

Please sign in to comment.