Package com.microsoft.windowsazure.services.media.models

Examples of com.microsoft.windowsazure.services.media.models.JobInfo


        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        InputStream inputStream = response.getEntityInputStream();
        ReaderWriter.writeTo(inputStream, byteArrayOutputStream);
        response.setEntityInputStream(new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray()));
        JobInfo jobInfo;

        List<DataSource> parts = parseParts(response.getEntityInputStream(),
                response.getHeaders().getFirst("Content-Type"));

        if (parts.size() == 0 || parts.size() > entityBatchOperations.size()) {
View Full Code Here


    }

    // Process
    public boolean isJobFinished(JobInfo initialJobInfo)
            throws ServiceException {
        JobInfo currentJob = service.get(Job.get(initialJobInfo.getId()));
        System.out.println(currentJob.getState());
        switch (currentJob.getState()) {
        case Finished:
        case Canceled:
        case Error:
            return true;
        default:
View Full Code Here

                                + "<inputAsset>JobInputAsset(0)</inputAsset>"
                                + "<outputAsset>JobOutputAsset(0)</outputAsset>"
                                + "</taskBody>")
                .setConfiguration("H.264 256k DSL CBR")
                .setName("My encoding Task");
        JobInfo jobInfo = service.create(Job.create().setName(jobName)
                .addInputMediaAsset(originalAsset.getId())
                .addTaskCreator(taskCreator));

        // Act
        ListResult<AssetInfo> outputAssets = service.list(Asset.list(jobInfo
                .getOutputAssetsLink()));
        assertEquals(1, outputAssets.size());
        AssetInfo childAsset = outputAssets.get(0);

        LinkInfo<AssetInfo> parentAssetLink = childAsset.getParentAssetsLink();
View Full Code Here

                .setEncryptionVersion(encryptionVersion)
                .setInitializationVector(initializationVector);
        jobCreator.addTaskCreator(taskCreator);

        // Act
        JobInfo job = service.create(jobCreator);
        List<TaskInfo> taskInfos = service.list(Task.list(job.getTasksLink()));

        // Assert
        assertEquals("taskInfos count", 1, taskInfos.size());
        verifyTaskPropertiesJustStarted("taskInfo", mediaProcessorId, options,
                taskBody, configuration, name, jobPriority, encryptionKeyId,
View Full Code Here

            taskCreators.add(taskCreator);
            jobCreator.addTaskCreator(taskCreator);
        }

        // Act
        JobInfo job = service.create(jobCreator);
        List<TaskInfo> taskInfos = service.list(Task.list(job.getTasksLink()));

        // Assert
        assertEquals("taskInfos count", taskCreators.size(), taskInfos.size());
        for (int i = 0; i < taskCreators.size(); i++) {
            verifyTaskPropertiesJustStartedNoEncryption("taskInfo",
View Full Code Here

        CreateBatchOperation taskCreator = Task
                .create(mediaProcessorId, taskBody)
                .setConfiguration(configuration).setName(name);
        jobCreator.addTaskCreator(taskCreator);

        JobInfo jobInfo = service.create(jobCreator);

        // Act
        service.action(Job.cancel(jobInfo.getId()));
        JobInfo cancellingJobInfo = service.get(Job.get(jobInfo.getId()));
        while (cancellingJobInfo.getState() == JobState.Canceling) {
            Thread.sleep(2000);
            cancellingJobInfo = service.get(Job.get(jobInfo.getId()));
        }

        // Assert
        List<TaskInfo> taskInfos = service.list(Task.list(cancellingJobInfo
                .getTasksLink()));
        for (TaskInfo taskInfo : taskInfos) {
            verifyTaskPropertiesNoEncryption("canceled task", mediaProcessorId,
                    TaskOption.None, taskBody, configuration, name, 3,
                    null, null, 0.0, 0.0, null, TaskState.Canceled,
View Full Code Here

        Date lastModified = new Date();
        Date stateTime = null;
        Date endTime = null;

        // Act
        JobInfo actualJob = service.create(Job.create().setName(name)
                .setPriority(priority).addInputMediaAsset(assetInfo.getId())
                .addTaskCreator(getTaskCreator(0)));

        // Assert
        verifyJobProperties("actualJob", name, priority, duration, state,
View Full Code Here

                .addInputMediaAsset(assetInfo.getId())
                .addTaskCreator(getTaskCreator(0))
                .addJobNotificationSubscription(jobNotificationSubcription);

        // Act
        JobInfo actualJob = service.create(creator);

        // Assert
        JobInfo pendingJobInfo = service.get(Job.get(actualJob.getId()));
        int retryCounter = 0;
        while (pendingJobInfo.getState() != JobState.Error
                && retryCounter < 100) {
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
            }
View Full Code Here

        List<CreateBatchOperation> tasks = new ArrayList<CreateBatchOperation>();
        tasks.add(getTaskCreator(0));
        tasks.add(getTaskCreator(1));

        // Act
        JobInfo actualJob = service.create(Job.create().setName(name)
                .setPriority(priority).addInputMediaAsset(assetInfo.getId())
                .addTaskCreator(tasks.get(0)).addTaskCreator(tasks.get(1)));

        // Assert
        verifyJobProperties("actualJob", name, priority, duration, state,
View Full Code Here

        Date lastModified = new Date();
        Date stateTime = null;
        Date endTime = null;

        // Act
        JobInfo actualJob = service.get(Job.get(jobId));

        // Assert
        verifyJobProperties("actualJob", name, priority, duration, state,
                templateId, created, lastModified, stateTime, endTime, 1,
                actualJob);
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.media.models.JobInfo

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.