target
stringlengths 20
113k
| src_fm
stringlengths 11
86.3k
| src_fm_fc
stringlengths 21
86.4k
| src_fm_fc_co
stringlengths 30
86.4k
| src_fm_fc_ms
stringlengths 42
86.8k
| src_fm_fc_ms_ff
stringlengths 43
86.8k
|
---|---|---|---|---|---|
@Betamax(tape = "dataSets_shouldThrowDriverExceptionForAssingRepresentation") @Test(expected = DriverException.class) public void shouldThrowDriverExceptionForAssingRepresentation() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000015"; String cloudId = "1DZ6HTS415W"; String representationName = "schema66"; String versionId = "b929f090-994a-11e3-bfe1-1c6f653f6012"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.assignRepresentationToDataSet(providerId, dataSetId, cloudId, representationName, versionId); } | public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldThrowRepresentationNotExistsForAssingRepresentation") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsForAssingRepresentation() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000016"; String cloudId = "1DZ6HTS415W"; String representationName = "noSuchSchema"; String versionId = null; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.assignRepresentationToDataSet(providerId, dataSetId, cloudId, representationName, versionId); } | public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldThrowDataSetNotExistsForAssingRepresentation") @Test(expected = DataSetNotExistsException.class) public void shouldThrowDataSetNotExistsForAssingRepresentation() throws MCSException { String providerId = "Provider001"; String dataSetId = "noSuchDataSet"; String cloudId = "1DZ6HTS415W"; String representationName = "schema66"; String versionId = null; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.assignRepresentationToDataSet(providerId, dataSetId, cloudId, representationName, versionId); } | public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public void assignRepresentationToDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId); Form form = getForm(cloudId, representationName, version); Response response = null; try { response = target.request().post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldUnassignRepresentation") @Test public void shouldUnassignRepresentation() throws MCSException { String providerId = "Provider002"; String dataSetId = "dataset000002"; String cloudId = "1DZ6HTS415W"; String representationName = "schema66"; String representationVersion = "66404040-0307-11e6-a5cb-0050568c62b8"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.unassignRepresentationFromDataSet(providerId, dataSetId, cloudId, representationName, representationVersion); assertEquals(TestUtils.howManyThisRepresentationVersion(instance, providerId, dataSetId, representationName, null), 0); } | public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldUnassignNotAssignedRepresentation") @Test public void shouldUnassignNotAssignedRepresentation() throws MCSException { String providerId = "Provider002"; String dataSetId = "dataset000002"; String cloudId = "1DZ6HTS415W"; String representationName = "schema66"; String representationVersion = "66404040-0307-11e6-a5cb-0050568c62b8"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); assertEquals(TestUtils.howManyThisRepresentationVersion(instance, providerId, dataSetId, representationName, null), 0); instance.unassignRepresentationFromDataSet(providerId, dataSetId, cloudId, representationName, representationVersion); } | public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Test public void moreLikeThisTest() throws IndexerException, IOException { boolean ok = false; int i = 0; do { try { XContentBuilder mapping = XContentFactory.jsonBuilder().startObject().startObject("type1").startObject("properties") .startObject("field3").field("type", "string").field("term_vector", "yes") .endObject().endObject().endObject().endObject(); ElasticsearchAssertions.assertAcked(prepareCreate("test").addMapping("type1", mapping)); client().prepareIndex("test", "type1", "7").setSource("field3", "my phrase").execute().actionGet(); client().prepareIndex("test", "type1", "8").setSource("field3", "my dog and phrase").execute().actionGet(); client().prepareIndex("test", "type1", "9").setSource("field3", "my dog and cat").execute().actionGet(); client().prepareIndex("test", "type1", "10").setSource("field3", "my dog and your cat").execute().actionGet(); client().prepareIndex("test", "type1", "11").setSource("field3", "my cat and dog").execute().actionGet(); client().prepareIndex("test", "type1", "12").setSource("field3", "another text").execute().actionGet(); refresh(); Elasticsearch es = new Elasticsearch(client(), "test", "type1"); SearchResult result; String[] fields3 = {"field3", IndexFields.RAW_TEXT.toString()}; result = es.getMoreLikeThis("9",fields3, 20, 1, 1, 20, 1, 20, 10, 0, true); assertTrue(result.getTotalHits() == 5); result = es.getMoreLikeThis("9",fields3, 20, 1, 1, 20, 1, 20, 10, 0, false); assertTrue(result.getTotalHits() == 4); result = es.getMoreLikeThis("9", null, 20, 1, 1, 20, 1, 20, 10, 0, false); assertTrue(result.getTotalHits() == 4); result = es.getMoreLikeThis("9", null, 20, 1, 1, 20, 1, 20, -2, 0, false); assertTrue(result.getTotalHits() == 0); result = es.getMoreLikeThis("", null, 20, 1, 1, 20, 1, 20, 10, 0, false); assertTrue(result.getTotalHits() == 0); result = es.getMoreLikeThis(null, null, 20, 1, 1, 20, 1, 20, 10, 0, false); assertTrue(result.getTotalHits() == 0); ok=true; break; } catch(Exception ex) { i++; } }while(i<4); if(!ok) { fail(); } } | @Override public SearchResult getMoreLikeThis(String documentId) throws ConnectionException, IndexerException { return getMoreLikeThis(documentId, null, MAX_QUERY_TERMS, MIN_TERM_FREQ, MIN_DOC_FREQ, MAX_DOC_FREQ, MIN_WORD_LENGTH, MAX_WORD_LENGTH, PAGE_SIZE, 0, false); } | Elasticsearch implements Indexer { @Override public SearchResult getMoreLikeThis(String documentId) throws ConnectionException, IndexerException { return getMoreLikeThis(documentId, null, MAX_QUERY_TERMS, MIN_TERM_FREQ, MIN_DOC_FREQ, MAX_DOC_FREQ, MIN_WORD_LENGTH, MAX_WORD_LENGTH, PAGE_SIZE, 0, false); } } | Elasticsearch implements Indexer { @Override public SearchResult getMoreLikeThis(String documentId) throws ConnectionException, IndexerException { return getMoreLikeThis(documentId, null, MAX_QUERY_TERMS, MIN_TERM_FREQ, MIN_DOC_FREQ, MAX_DOC_FREQ, MIN_WORD_LENGTH, MAX_WORD_LENGTH, PAGE_SIZE, 0, false); } Elasticsearch(IndexerInformations ii); Elasticsearch(String clasterAddresses, String index, String type); protected Elasticsearch(Client client, String index, String type); } | Elasticsearch implements Indexer { @Override public SearchResult getMoreLikeThis(String documentId) throws ConnectionException, IndexerException { return getMoreLikeThis(documentId, null, MAX_QUERY_TERMS, MIN_TERM_FREQ, MIN_DOC_FREQ, MAX_DOC_FREQ, MIN_WORD_LENGTH, MAX_WORD_LENGTH, PAGE_SIZE, 0, false); } Elasticsearch(IndexerInformations ii); Elasticsearch(String clasterAddresses, String index, String type); protected Elasticsearch(Client client, String index, String type); @Override Object getIndexer(); @Override SupportedIndexers getIndexerName(); @Override IndexerInformations getIndexerInformations(); @Override IndexedDocument getDocument(String documentId); @Override SearchResult getMoreLikeThis(String documentId); @Override SearchResult getMoreLikeThis(String documentId, int size, int timeout); @Override SearchResult getMoreLikeThis(String documentId, String[] fields); @Override SearchResult getMoreLikeThis(String documentId, String[] fields, int size, int timeout); @Override SearchResult getMoreLikeThis(String documentId, String[] fields, int maxQueryTerms, int minTermFreq,
int minDocFreq, int maxDocFreq, int minWordLength, int maxWordLength, int size, int timeout, Boolean includeItself); @Override SearchResult search(String text, String[] fields); @Override SearchResult search(String text, String[] fields, int size, int timeout); @Override SearchResult searchFullText(String text); @Override SearchResult searchFullText(String text, int size, int timeout); @Override SearchResult searchPhraseInFullText(String text, int slop); @Override SearchResult searchPhrase(String text, String field, int slop); @Override SearchResult searchPhrase(String text, String field, int slop, int size, int timeout); @Override SearchResult advancedSearch(String query); @Override SearchResult advancedSearch(String query, int size, int timeout); @Override SearchResult advancedSearch(String query, Map<String, Object> parameters); @Override SearchResult advancedSearch(String query, Map<String, Object> parameters, int size, int timeout); @Override void insert(String data); @Override void insert(Map<String, Object> data); @Override void insert(String documentId, String data); @Override void insert(String documentId, Map<String, Object> data); @Override void update(String documentId, String data); @Override void update(String documentId, Map<String, Object> data); @Override void delete(String documentId); @Override SearchResult getNextPage(String scrollId, Object context); } | Elasticsearch implements Indexer { @Override public SearchResult getMoreLikeThis(String documentId) throws ConnectionException, IndexerException { return getMoreLikeThis(documentId, null, MAX_QUERY_TERMS, MIN_TERM_FREQ, MIN_DOC_FREQ, MAX_DOC_FREQ, MIN_WORD_LENGTH, MAX_WORD_LENGTH, PAGE_SIZE, 0, false); } Elasticsearch(IndexerInformations ii); Elasticsearch(String clasterAddresses, String index, String type); protected Elasticsearch(Client client, String index, String type); @Override Object getIndexer(); @Override SupportedIndexers getIndexerName(); @Override IndexerInformations getIndexerInformations(); @Override IndexedDocument getDocument(String documentId); @Override SearchResult getMoreLikeThis(String documentId); @Override SearchResult getMoreLikeThis(String documentId, int size, int timeout); @Override SearchResult getMoreLikeThis(String documentId, String[] fields); @Override SearchResult getMoreLikeThis(String documentId, String[] fields, int size, int timeout); @Override SearchResult getMoreLikeThis(String documentId, String[] fields, int maxQueryTerms, int minTermFreq,
int minDocFreq, int maxDocFreq, int minWordLength, int maxWordLength, int size, int timeout, Boolean includeItself); @Override SearchResult search(String text, String[] fields); @Override SearchResult search(String text, String[] fields, int size, int timeout); @Override SearchResult searchFullText(String text); @Override SearchResult searchFullText(String text, int size, int timeout); @Override SearchResult searchPhraseInFullText(String text, int slop); @Override SearchResult searchPhrase(String text, String field, int slop); @Override SearchResult searchPhrase(String text, String field, int slop, int size, int timeout); @Override SearchResult advancedSearch(String query); @Override SearchResult advancedSearch(String query, int size, int timeout); @Override SearchResult advancedSearch(String query, Map<String, Object> parameters); @Override SearchResult advancedSearch(String query, Map<String, Object> parameters, int size, int timeout); @Override void insert(String data); @Override void insert(Map<String, Object> data); @Override void insert(String documentId, String data); @Override void insert(String documentId, Map<String, Object> data); @Override void update(String documentId, String data); @Override void update(String documentId, Map<String, Object> data); @Override void delete(String documentId); @Override SearchResult getNextPage(String scrollId, Object context); } |
@Betamax(tape = "dataSets_shouldUnassignRepresentationWithVersion") @Test public void shouldUnassignRepresentationWithVersion() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000023"; String cloudId = "1DZ6HTS415W"; String representationName = "schema66"; String representationVersion = "66404040-0307-11e6-a5cb-0050568c62b8"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.unassignRepresentationFromDataSet(providerId, dataSetId, cloudId, representationName, representationVersion); assertEquals(TestUtils.howManyThisRepresentationVersion(instance, providerId, dataSetId, representationName, null), 0); } | public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldUnassignNonExistingRepresentation") @Test public void shouldUnassignNonExistingRepresentation() throws MCSException { String providerId = "Provider002"; String dataSetId = "dataset000007"; String cloudId = "1DZ6HTS415W"; String representationName = "noSuchSchema"; String representationVersion = "66404040-0307-11e6-a5cb-0050568c62b8"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.unassignRepresentationFromDataSet(providerId, dataSetId, cloudId, representationName, representationVersion); } | public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldThrowDriverExceptionForUnassingRepresentation") @Test(expected = DriverException.class) public void shouldThrowDriverExceptionForUnassingRepresentation() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset000058"; String cloudId = "1DZ6HTS415W"; String representationName = "schema77"; String representationVersion = "66404040-0307-11e6-a5cb-0050568c62b8"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.unassignRepresentationFromDataSet(providerId, dataSetId, cloudId, representationName, representationVersion); } | public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldThrowDataSetNotExistsForUnassingRepresentation") @Test(expected = DataSetNotExistsException.class) public void shouldThrowDataSetNotExistsForUnassingRepresentation() throws MCSException { String providerId = "Provider002"; String dataSetId = "noSuchDataSet"; String cloudId = "1DZ6HTS415W"; String representationName = "schema77"; String representationVersion = "66404040-0307-11e6-a5cb-0050568c62b8"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); instance.unassignRepresentationFromDataSet(providerId, dataSetId, cloudId, representationName, representationVersion); } | public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public void unassignRepresentationFromDataSet( String providerId, String dataSetId, String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_ASSIGNMENTS) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(VERSION, version); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldProvideDataSetIterator") @Test public void shouldProvideDataSetIterator() throws MCSException { String providerId = "Provider001"; int numberOfDataSets = 200; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); DataSetIterator iterator = instance.getDataSetIteratorForProvider(providerId); assertNotNull(iterator); int counter = 0; while (iterator.hasNext()) { counter++; assertNotNull(iterator.next()); } assertEquals(counter, numberOfDataSets); } | public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldProvideEmptyDataSetIteratorWhenNoSuchProvider") @Test public void shouldProvideEmptyDataSetIteratorWhenNoSuchProvider() throws MCSException { String providerId = "noSuchProvider"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); DataSetIterator iterator = instance.getDataSetIteratorForProvider(providerId); assertNotNull(iterator); assertEquals(iterator.hasNext(), false); } | public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldProvideDataSetIteratorThatThrowsNoSuchElementException") @Test(expected = NoSuchElementException.class) public void shouldProvideDataSetIteratorThatThrowsNoSuchElementException() throws MCSException { String providerId = "Provider001"; int numberOfDataSets = 200; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); DataSetIterator iterator = instance.getDataSetIteratorForProvider(providerId); assertNotNull(iterator); for (int i = 0; i < numberOfDataSets; i++) { try { assertNotNull(iterator.next()); } catch (NoSuchElementException ex) { assert false : "NoSuchElementException thrown in unexpected place."; } } iterator.next(); } | public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldProvideDataSetIteratorThatThrowsDriverException") @Test(expected = DriverException.class) public void shouldProvideDataSetIteratorThatThrowsDriverException() throws MCSException { String providerId = "Provider001"; int numberOfDataSets = 200; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); DataSetIterator iterator = instance.getDataSetIteratorForProvider(providerId); iterator.next(); } | public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public DataSetIterator getDataSetIteratorForProvider(String providerId) { return new DataSetIterator(this, providerId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldProvideRepresentationIterator") @Test public void shouldProvideRepresentationIterator() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset3"; int numberOfRepresentations = 200; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); RepresentationIterator iterator = instance.getRepresentationIterator(providerId, dataSetId); assertNotNull(iterator); int counter = 0; while (iterator.hasNext()) { counter++; assertNotNull(iterator.next()); } assertEquals(counter, numberOfRepresentations); } | public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldProvideRepresentationIteratorThatThrowsDataSetNotExistsExceptionWhenNoDataSet") @Test(expected = DataSetNotExistsException.class) public void shouldProvideRepresentationIteratorThatThrowsExceptionWhenNoDataSet() throws Exception, Throwable { String providerId = "Provider001"; String dataSetId = "noSuchDataSet"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); RepresentationIterator iterator = instance.getRepresentationIterator(providerId, dataSetId); assertNotNull(iterator); try { iterator.hasNext(); } catch (DriverException e) { throw e.getCause(); } } | public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Test public void testCreateCloudUser() throws Exception { Mockito.doReturn(new User(username, password)).when(authenticationService).getUser(username); mockMvc.perform(post("/create-user") .param(AASParamConstants.P_USER_NAME, username) .param(AASParamConstants.P_PASS_TOKEN, password)) .andExpect(status().isOk()); } | @PostMapping(value = "/create-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") public ResponseEntity<String> createCloudUser( @RequestParam(AASParamConstants.P_USER_NAME) String username, @RequestParam(AASParamConstants.P_PASS_TOKEN) String password) throws DatabaseConnectionException, UserExistsException, InvalidUsernameException, InvalidPasswordException { authenticationService.createUser(new User(username, password)); return ResponseEntity.ok("Cloud user was created!"); } | AuthenticationResource { @PostMapping(value = "/create-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") public ResponseEntity<String> createCloudUser( @RequestParam(AASParamConstants.P_USER_NAME) String username, @RequestParam(AASParamConstants.P_PASS_TOKEN) String password) throws DatabaseConnectionException, UserExistsException, InvalidUsernameException, InvalidPasswordException { authenticationService.createUser(new User(username, password)); return ResponseEntity.ok("Cloud user was created!"); } } | AuthenticationResource { @PostMapping(value = "/create-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") public ResponseEntity<String> createCloudUser( @RequestParam(AASParamConstants.P_USER_NAME) String username, @RequestParam(AASParamConstants.P_PASS_TOKEN) String password) throws DatabaseConnectionException, UserExistsException, InvalidUsernameException, InvalidPasswordException { authenticationService.createUser(new User(username, password)); return ResponseEntity.ok("Cloud user was created!"); } } | AuthenticationResource { @PostMapping(value = "/create-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") public ResponseEntity<String> createCloudUser( @RequestParam(AASParamConstants.P_USER_NAME) String username, @RequestParam(AASParamConstants.P_PASS_TOKEN) String password) throws DatabaseConnectionException, UserExistsException, InvalidUsernameException, InvalidPasswordException { authenticationService.createUser(new User(username, password)); return ResponseEntity.ok("Cloud user was created!"); } @PostMapping(value = "/create-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") ResponseEntity<String> createCloudUser(
@RequestParam(AASParamConstants.P_USER_NAME) String username,
@RequestParam(AASParamConstants.P_PASS_TOKEN) String password); @PostMapping(value = "/delete-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") ResponseEntity<String> deleteCloudUser(
@RequestParam(AASParamConstants.P_USER_NAME) String username); @PostMapping(value = "/update-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") ResponseEntity<String> updateCloudUser(
@RequestParam(AASParamConstants.P_USER_NAME) String username,
@RequestParam(AASParamConstants.P_PASS_TOKEN) String password); } | AuthenticationResource { @PostMapping(value = "/create-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") public ResponseEntity<String> createCloudUser( @RequestParam(AASParamConstants.P_USER_NAME) String username, @RequestParam(AASParamConstants.P_PASS_TOKEN) String password) throws DatabaseConnectionException, UserExistsException, InvalidUsernameException, InvalidPasswordException { authenticationService.createUser(new User(username, password)); return ResponseEntity.ok("Cloud user was created!"); } @PostMapping(value = "/create-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") ResponseEntity<String> createCloudUser(
@RequestParam(AASParamConstants.P_USER_NAME) String username,
@RequestParam(AASParamConstants.P_PASS_TOKEN) String password); @PostMapping(value = "/delete-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") ResponseEntity<String> deleteCloudUser(
@RequestParam(AASParamConstants.P_USER_NAME) String username); @PostMapping(value = "/update-user", produces = {MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE}) @PreAuthorize("hasRole('ROLE_ADMIN')") ResponseEntity<String> updateCloudUser(
@RequestParam(AASParamConstants.P_USER_NAME) String username,
@RequestParam(AASParamConstants.P_PASS_TOKEN) String password); } |
@Betamax(tape = "dataSets_shouldProvideRepresentationIteratorThatThrowsDataSetNotExistsExceptionWhenNoProvider") @Test(expected = DataSetNotExistsException.class) public void shouldProvideRepresentationIteratorThatThrowsExceptionWhenNoProvider() throws MCSException, Throwable { String providerId = "noSuchProvider"; String dataSetId = "dataset3"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); RepresentationIterator iterator = instance.getRepresentationIterator(providerId, dataSetId); assertNotNull(iterator); try { iterator.hasNext(); } catch (DriverException e) { throw e.getCause(); } } | public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldProvideRepresentationIteratorThatThrowsNoSuchElementException") @Test(expected = NoSuchElementException.class) public void shouldProvideRepresentationIteratorThatThrowsNoSuchElementException() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset3"; int numberOfRepresentations = 200; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); RepresentationIterator iterator = instance.getRepresentationIterator(providerId, dataSetId); assertNotNull(iterator); for (int i = 0; i < numberOfRepresentations; i++) { try { assertNotNull(iterator.next()); } catch (NoSuchElementException ex) { assert false : "NoSuchElementException thrown in unexpected place."; } } iterator.next(); } | public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldProvideRepresentationIteratorThatThrowsDriverException") @Test(expected = DriverException.class) public void shouldProvideRepresentationIteratorThatThrowsDriverException() throws MCSException { String providerId = "Provider001"; String dataSetId = "dataset3"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); RepresentationIterator iterator = instance.getRepresentationIterator(providerId, dataSetId); iterator.next(); } | public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public RepresentationIterator getRepresentationIterator(String providerId, String dataSetId) { return new RepresentationIterator(this, providerId, dataSetId); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldRetrieveDataSetCloudIdsByRepresentationFirstChunk") @Test public void shouldRetrieveDataSetCloudIdsByRepresentationFirstChunk() throws MCSException { String providerId = "provider"; String dataSet = "dataset"; String representationName = "representation"; String dateFrom = "2016-08-21T11:08:28.059"; int resultSize = 5; String startFrom = "005a00100015000870726f76696465720000076461746173657400003d000e726570726573656e746174696f6e00000800000156b1580d280000087265766973696f6e000007636c6f75645f350000097075626c6973686564007ffffffa76a6db9eb099834f7db2bad6a99690e10003"; DataSetServiceClient instance = new DataSetServiceClient("http: ResultSlice<CloudVersionRevisionResponse> result = instance.getDataSetCloudIdsByRepresentationChunk(dataSet, providerId, representationName, dateFrom, "published", null); assertNotNull(result.getResults()); assertEquals(result.getResults().size(), resultSize); assertEquals(result.getNextSlice(), startFrom); } | public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldRetrieveDataSetCloudIdsByRepresentationAllChunks") @Test public void shouldRetrieveDataSetCloudIdsByRepresentationAllChunks() throws MCSException { String providerId = "provider"; String dataSet = "dataset"; String representationName = "representation"; String dateFrom = "2016-08-21T11:08:28.059"; int resultSize = 5; String startFrom = null; DataSetServiceClient instance = new DataSetServiceClient("http: ResultSlice<CloudVersionRevisionResponse> result = instance.getDataSetCloudIdsByRepresentationChunk(dataSet, providerId, representationName, dateFrom, "published", startFrom); while (result.getNextSlice() != null) { assertNotNull(result.getResults()); assertEquals(result.getResults().size(), resultSize); startFrom = result.getNextSlice(); result = instance.getDataSetCloudIdsByRepresentationChunk(dataSet, providerId, representationName, dateFrom, "published", startFrom); } assertNotNull(result.getResults()); assertTrue(result.getResults().size() <= resultSize); } | public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_BY_REPRESENTATION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .queryParam(ParamConstants.F_DATE_FROM, dateFrom) .queryParam(ParamConstants.F_TAG, tag); if (startFrom != null) { target = target.queryParam(ParamConstants.F_START_FROM, startFrom); } return prepareResultSliceResponse(target); } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldRetrieveCloudIdsForSpecificRevision") @Test public void shouldRetrieveCloudIdsForSpecificRevision() throws MCSException { String providerId = "LFT"; String dataSetId = "set1"; String representationName = "t1"; String revisionName = "IMPORT"; String revisionProviderId = "EU"; String revisionTimestamp = "2017-01-09T08:16:47.824"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); List<CloudTagsResponse> cloudIds = instance.getDataSetRevisions(providerId, dataSetId, representationName, revisionName, revisionProviderId, revisionTimestamp); assertThat(cloudIds.size(), is(2)); CloudTagsResponse cid = cloudIds.get(0); assertThat(cid.getCloudId(), is("A2YCHGEFD4UV4UIEAWDUJHWJNZWXNOURWCQORIG7MCQASTB62OSQ")); assertTrue(cid.isAcceptance()); assertFalse(cid.isDeleted()); assertFalse(cid.isPublished()); cid = cloudIds.get(1); assertThat(cid.getCloudId(), is("V7UYW5HK2YVQH7HN67W4ZRXBKLXLEY2HRIICIWAFTDVHEFZE5SPQ")); assertFalse(cid.isAcceptance()); assertFalse(cid.isDeleted()); assertTrue(cid.isPublished()); } | public List<CloudTagsResponse> getDataSetRevisions( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp) throws MCSException { List<CloudTagsResponse> resultList = new ArrayList<>(); ResultSlice<CloudTagsResponse> resultSlice; String startFrom = null; do { resultSlice = getDataSetRevisionsChunk(providerId, dataSetId, representationName, revisionName, revisionProviderId, revisionTimestamp, startFrom, null); if (resultSlice == null || resultSlice.getResults() == null) { throw new DriverException("Getting cloud ids and revision tags: result chunk obtained but is empty."); } resultList.addAll(resultSlice.getResults()); startFrom = resultSlice.getNextSlice(); } while (resultSlice.getNextSlice() != null); return resultList; } | DataSetServiceClient extends MCSClient { public List<CloudTagsResponse> getDataSetRevisions( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp) throws MCSException { List<CloudTagsResponse> resultList = new ArrayList<>(); ResultSlice<CloudTagsResponse> resultSlice; String startFrom = null; do { resultSlice = getDataSetRevisionsChunk(providerId, dataSetId, representationName, revisionName, revisionProviderId, revisionTimestamp, startFrom, null); if (resultSlice == null || resultSlice.getResults() == null) { throw new DriverException("Getting cloud ids and revision tags: result chunk obtained but is empty."); } resultList.addAll(resultSlice.getResults()); startFrom = resultSlice.getNextSlice(); } while (resultSlice.getNextSlice() != null); return resultList; } } | DataSetServiceClient extends MCSClient { public List<CloudTagsResponse> getDataSetRevisions( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp) throws MCSException { List<CloudTagsResponse> resultList = new ArrayList<>(); ResultSlice<CloudTagsResponse> resultSlice; String startFrom = null; do { resultSlice = getDataSetRevisionsChunk(providerId, dataSetId, representationName, revisionName, revisionProviderId, revisionTimestamp, startFrom, null); if (resultSlice == null || resultSlice.getResults() == null) { throw new DriverException("Getting cloud ids and revision tags: result chunk obtained but is empty."); } resultList.addAll(resultSlice.getResults()); startFrom = resultSlice.getNextSlice(); } while (resultSlice.getNextSlice() != null); return resultList; } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public List<CloudTagsResponse> getDataSetRevisions( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp) throws MCSException { List<CloudTagsResponse> resultList = new ArrayList<>(); ResultSlice<CloudTagsResponse> resultSlice; String startFrom = null; do { resultSlice = getDataSetRevisionsChunk(providerId, dataSetId, representationName, revisionName, revisionProviderId, revisionTimestamp, startFrom, null); if (resultSlice == null || resultSlice.getResults() == null) { throw new DriverException("Getting cloud ids and revision tags: result chunk obtained but is empty."); } resultList.addAll(resultSlice.getResults()); startFrom = resultSlice.getNextSlice(); } while (resultSlice.getNextSlice() != null); return resultList; } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public List<CloudTagsResponse> getDataSetRevisions( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp) throws MCSException { List<CloudTagsResponse> resultList = new ArrayList<>(); ResultSlice<CloudTagsResponse> resultSlice; String startFrom = null; do { resultSlice = getDataSetRevisionsChunk(providerId, dataSetId, representationName, revisionName, revisionProviderId, revisionTimestamp, startFrom, null); if (resultSlice == null || resultSlice.getResults() == null) { throw new DriverException("Getting cloud ids and revision tags: result chunk obtained but is empty."); } resultList.addAll(resultSlice.getResults()); startFrom = resultSlice.getNextSlice(); } while (resultSlice.getNextSlice() != null); return resultList; } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldRetrievCloudIdsChunkForSpecificRevision") @Test public void shouldRetrievCloudIdsChunkForSpecificRevision() throws MCSException { String providerId = "LFT"; String dataSetId = "set1"; String representationName = "t1"; String revisionName = "IMPORT"; String revisionProviderId = "EU"; String revisionTimestamp = "2017-01-09T08:16:47.824"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); ResultSlice<CloudTagsResponse> cloudIds = instance.getDataSetRevisionsChunk(providerId, dataSetId, representationName, revisionName, revisionProviderId, revisionTimestamp, null, null); assertThat(cloudIds.getNextSlice(), nullValue()); assertThat(cloudIds.getResults().size(), is(2)); CloudTagsResponse cid = cloudIds.getResults().get(0); assertThat(cid.getCloudId(), is("A2YCHGEFD4UV4UIEAWDUJHWJNZWXNOURWCQORIG7MCQASTB62OSQ")); assertTrue(cid.isAcceptance()); assertFalse(cid.isDeleted()); assertFalse(cid.isPublished()); cid = cloudIds.getResults().get(1); assertThat(cid.getCloudId(), is("V7UYW5HK2YVQH7HN67W4ZRXBKLXLEY2HRIICIWAFTDVHEFZE5SPQ")); assertFalse(cid.isAcceptance()); assertFalse(cid.isDeleted()); assertTrue(cid.isPublished()); } | public ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp, String startFrom, Integer limit) throws MCSException { WebTarget target = client.target(baseUrl) .path(DATA_SET_REVISIONS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(REVISION_NAME, revisionName) .resolveTemplate(REVISION_PROVIDER_ID, revisionProviderId) .queryParam(F_REVISION_TIMESTAMP, revisionTimestamp) .queryParam(F_START_FROM, startFrom); target = target.queryParam(F_LIMIT, limit != null ? limit : 0); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(ResultSlice.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp, String startFrom, Integer limit) throws MCSException { WebTarget target = client.target(baseUrl) .path(DATA_SET_REVISIONS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(REVISION_NAME, revisionName) .resolveTemplate(REVISION_PROVIDER_ID, revisionProviderId) .queryParam(F_REVISION_TIMESTAMP, revisionTimestamp) .queryParam(F_START_FROM, startFrom); target = target.queryParam(F_LIMIT, limit != null ? limit : 0); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(ResultSlice.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp, String startFrom, Integer limit) throws MCSException { WebTarget target = client.target(baseUrl) .path(DATA_SET_REVISIONS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(REVISION_NAME, revisionName) .resolveTemplate(REVISION_PROVIDER_ID, revisionProviderId) .queryParam(F_REVISION_TIMESTAMP, revisionTimestamp) .queryParam(F_START_FROM, startFrom); target = target.queryParam(F_LIMIT, limit != null ? limit : 0); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(ResultSlice.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp, String startFrom, Integer limit) throws MCSException { WebTarget target = client.target(baseUrl) .path(DATA_SET_REVISIONS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(REVISION_NAME, revisionName) .resolveTemplate(REVISION_PROVIDER_ID, revisionProviderId) .queryParam(F_REVISION_TIMESTAMP, revisionTimestamp) .queryParam(F_START_FROM, startFrom); target = target.queryParam(F_LIMIT, limit != null ? limit : 0); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(ResultSlice.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk( String providerId, String dataSetId, String representationName, String revisionName, String revisionProviderId, String revisionTimestamp, String startFrom, Integer limit) throws MCSException { WebTarget target = client.target(baseUrl) .path(DATA_SET_REVISIONS_RESOURCE) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(REVISION_NAME, revisionName) .resolveTemplate(REVISION_PROVIDER_ID, revisionProviderId) .queryParam(F_REVISION_TIMESTAMP, revisionTimestamp) .queryParam(F_START_FROM, startFrom); target = target.queryParam(F_LIMIT, limit != null ? limit : 0); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(ResultSlice.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Betamax(tape = "dataSets_shouldRetrieveLatelyTaggedRecordsVersion") @Test public void shouldReturnSpecificVersion() throws MCSException { String providerId = "provider"; String dataSetId = "dataset"; String cloudId = "cloudId"; String representationName = "representation"; String revisionName = "revision"; String revisionProviderId = "revisionProvider"; DataSetServiceClient instance = new DataSetServiceClient(baseUrl); String version = instance.getLatelyTaggedRecords(dataSetId, providerId, cloudId, representationName, revisionName, revisionProviderId); assertNotNull(version); assertEquals(version, "ef240330-f783-11e6-a0f6-1c6f653f9042"); } | public String getLatelyTaggedRecords( String dataSetId, String providerId, String cloudId, String representationName, String revisionName, String revisionProviderId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_LATELY_REVISIONED_VERSION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(REVISION_NAME, revisionName) .queryParam(REVISION_PROVIDER_ID, revisionProviderId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(String.class); } else if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { return null; } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } | DataSetServiceClient extends MCSClient { public String getLatelyTaggedRecords( String dataSetId, String providerId, String cloudId, String representationName, String revisionName, String revisionProviderId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_LATELY_REVISIONED_VERSION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(REVISION_NAME, revisionName) .queryParam(REVISION_PROVIDER_ID, revisionProviderId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(String.class); } else if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { return null; } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } } | DataSetServiceClient extends MCSClient { public String getLatelyTaggedRecords( String dataSetId, String providerId, String cloudId, String representationName, String revisionName, String revisionProviderId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_LATELY_REVISIONED_VERSION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(REVISION_NAME, revisionName) .queryParam(REVISION_PROVIDER_ID, revisionProviderId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(String.class); } else if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { return null; } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | DataSetServiceClient extends MCSClient { public String getLatelyTaggedRecords( String dataSetId, String providerId, String cloudId, String representationName, String revisionName, String revisionProviderId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_LATELY_REVISIONED_VERSION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(REVISION_NAME, revisionName) .queryParam(REVISION_PROVIDER_ID, revisionProviderId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(String.class); } else if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { return null; } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } | DataSetServiceClient extends MCSClient { public String getLatelyTaggedRecords( String dataSetId, String providerId, String cloudId, String representationName, String revisionName, String revisionProviderId) throws MCSException { WebTarget target = client .target(this.baseUrl) .path(DATA_SET_LATELY_REVISIONED_VERSION) .resolveTemplate(PROVIDER_ID, providerId) .resolveTemplate(DATA_SET_ID, dataSetId) .queryParam(CLOUD_ID, cloudId) .queryParam(REPRESENTATION_NAME, representationName) .queryParam(REVISION_NAME, revisionName) .queryParam(REVISION_PROVIDER_ID, revisionProviderId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Status.OK.getStatusCode()) { return response.readEntity(String.class); } else if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { return null; } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { if (response != null) { response.close(); } } } DataSetServiceClient(String baseUrl); DataSetServiceClient(String baseUrl, final String authorization); DataSetServiceClient(String baseUrl, final String username, final String password); DataSetServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); ResultSlice<DataSet> getDataSetsForProviderChunk(String providerId, String startFrom); List<DataSet> getDataSetsForProvider(String providerId); DataSetIterator getDataSetIteratorForProvider(String providerId); URI createDataSet(String providerId, String dataSetId, String description); ResultSlice<Representation> getDataSetRepresentationsChunk(
String providerId, String dataSetId, String startFrom); List<Representation> getDataSetRepresentations(String providerId, String dataSetId); RepresentationIterator getRepresentationIterator(String providerId, String dataSetId); void updateDescriptionOfDataSet(String providerId, String dataSetId, String description); void deleteDataSet(String providerId, String dataSetId); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); void assignRepresentationToDataSet(
String providerId, String dataSetId, String cloudId, String representationName,
String version, String key, String value); void unassignRepresentationFromDataSet(
String providerId, String dataSetId, String cloudId, String representationName, String version); ResultSlice<CloudTagsResponse> getDataSetRevisionsChunk(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp,
String startFrom, Integer limit); List<CloudTagsResponse> getDataSetRevisions(
String providerId, String dataSetId, String representationName,
String revisionName, String revisionProviderId, String revisionTimestamp); ResultSlice<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentationChunk(String dataSetId, String providerId, String representationName, String dateFrom, String tag, String startFrom); List<CloudVersionRevisionResponse> getDataSetCloudIdsByRepresentation(String dataSetId, String providerId,
String representationName, String dateFrom, String tag); ResultSlice<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevisionChunk(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted, String startFrom); List<CloudIdAndTimestampResponse> getLatestDataSetCloudIdByRepresentationAndRevision(
String dataSetId, String providerId, String revisionProvider, String revisionName,
String representationName, Boolean isDeleted); String getLatelyTaggedRecords(
String dataSetId, String providerId, String cloudId, String representationName,
String revisionName, String revisionProviderId); void useAuthorizationHeader(final String headerValue); void close(); } |
@Test(expected = DriverException.class) public void shouldThrowDriverExceptionWhenNullErrorInfoPassed() { ErrorInfo errorInfo = null; MCSExceptionProvider.generateException(errorInfo); } | public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } |
@Test(expected = DriverException.class) public void shouldThrowDriverExceptionWhenUnknownErrorInfoCodePassed() { ErrorInfo errorInfo = new ErrorInfo("THIS_IS_REALLY_WRONG_CODE", null); MCSExceptionProvider.generateException(errorInfo); } | public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } |
@Test(expected = UserDoesNotExistException.class) public void testUserDoesNotExist() throws Exception { service.getUser("test2"); } | @Override public User getUser(String userName) throws DatabaseConnectionException, UserDoesNotExistException { return userDao.getUser(userName); } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public User getUser(String userName) throws DatabaseConnectionException, UserDoesNotExistException { return userDao.getUser(userName); } } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public User getUser(String userName) throws DatabaseConnectionException, UserDoesNotExistException { return userDao.getUser(userName); } CassandraAuthenticationService(); CassandraAuthenticationService(CassandraUserDAO userDao); } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public User getUser(String userName) throws DatabaseConnectionException, UserDoesNotExistException { return userDao.getUser(userName); } CassandraAuthenticationService(); CassandraAuthenticationService(CassandraUserDAO userDao); @Override UserDetails loadUserByUsername(final String userName); @Override User getUser(String userName); @Override void createUser(final User user); @Override void updateUser(final User user); @Override void deleteUser(final String userName); } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public User getUser(String userName) throws DatabaseConnectionException, UserDoesNotExistException { return userDao.getUser(userName); } CassandraAuthenticationService(); CassandraAuthenticationService(CassandraUserDAO userDao); @Override UserDetails loadUserByUsername(final String userName); @Override User getUser(String userName); @Override void createUser(final User user); @Override void updateUser(final User user); @Override void deleteUser(final String userName); } |
@Test @Parameters(method = "statusCodes") public void shouldReturnCorrectException(Throwable ex, String errorCode) { ErrorInfo errorInfo = new ErrorInfo(errorCode, "details"); MCSException exception = MCSExceptionProvider.generateException(errorInfo); Assert.assertEquals(ex.getClass(), exception.getClass()); assertThat(exception.getMessage(), is(errorInfo.getDetails())); } | public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } |
@Test public void shouldReturnRecordNotExistsException() { ErrorInfo errorInfo = new ErrorInfo(McsErrorCode.RECORD_NOT_EXISTS.toString(), "details"); MCSException exception = MCSExceptionProvider.generateException(errorInfo); assertTrue(exception instanceof RecordNotExistsException); assertThat(exception.getMessage(), is("There is no record with provided global id: " + errorInfo.getDetails())); } | public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } |
@Test(expected = DriverException.class) public void shouldThrowDriverException() { ErrorInfo errorInfo = new ErrorInfo(McsErrorCode.OTHER.toString(), "details"); MCSExceptionProvider.generateException(errorInfo); } | public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } | MCSExceptionProvider { public static MCSException generateException(ErrorInfo errorInfo) { if (errorInfo == null) { throw new DriverException("Null errorInfo passed to generating exception."); } McsErrorCode errorCode; try { errorCode = McsErrorCode.valueOf(errorInfo.getErrorCode()); } catch (IllegalArgumentException e) { throw new DriverException("Unknown errorCode returned from service.", e); } String details = errorInfo.getDetails(); switch (errorCode) { case ACCESS_DENIED_OR_OBJECT_DOES_NOT_EXIST_EXCEPTION: return new AccessDeniedOrObjectDoesNotExistException(details); case CANNOT_MODIFY_PERSISTENT_REPRESENTATION: return new CannotModifyPersistentRepresentationException(details); case DATASET_ALREADY_EXISTS: return new DataSetAlreadyExistsException(details); case DATASET_NOT_EXISTS: return new DataSetNotExistsException(details); case FILE_ALREADY_EXISTS: return new FileAlreadyExistsException(details); case FILE_NOT_EXISTS: return new FileNotExistsException(details); case PROVIDER_NOT_EXISTS: return new ProviderNotExistsException(details); case RECORD_NOT_EXISTS: return new RecordNotExistsException(details); case REPRESENTATION_NOT_EXISTS: return new RepresentationNotExistsException(details); case VERSION_NOT_EXISTS: return new VersionNotExistsException(details); case FILE_CONTENT_HASH_MISMATCH: return new FileContentHashMismatchException(details); case REPRESENTATION_ALREADY_IN_SET: return new RepresentationAlreadyInSet(details); case CANNOT_PERSIST_EMPTY_REPRESENTATION: return new CannotPersistEmptyRepresentationException(details); case WRONG_CONTENT_RANGE: return new WrongContentRangeException(details); case OTHER: throw new DriverException(details); default: return new MCSException(details); } } private MCSExceptionProvider(); static MCSException generateException(ErrorInfo errorInfo); } |
@Betamax(tape = "files/shouldGetFileWithoutRange") @Test public void shouldGetFileWithoutRange() throws UnsupportedEncodingException, MCSException, IOException { byte[] contentBytes = MODIFIED_FILE_CONTENTS.getBytes("UTF-8"); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); InputStream responseStream = instance.getFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, TEST_VERSION, UPLOADED_FILE_NAME); assertNotNull(responseStream); byte[] responseBytes = ByteStreams.toByteArray(responseStream); assertArrayEquals("Content is incorrect", contentBytes, responseBytes); String responseChecksum = Hashing.md5().hashBytes(responseBytes).toString(); assertEquals("Checksum is incorrect", contentChecksum, responseChecksum); } | public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowWrongContentRangeExceptionForGetFileWithRangeWhenIncorrectFormat") @Test(expected = WrongContentRangeException.class) public void shouldThrowWrongContentRangeExceptionForGetFileWithRangeWhenIncorrectFormat() throws UnsupportedEncodingException, MCSException, IOException { int rangeStart = 1; int rangeEnd = 4; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); String range = String.format("bytese=%d-%d", rangeStart, rangeEnd); instance.getFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, TEST_VERSION, unmovableFileName, range); } | public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowWrongContentRangeExceptionForGetFileWithRangeWhenIncorrectRangeValues") @Test(expected = WrongContentRangeException.class) public void shouldThrowWrongContentRangeExceptionForGetFileWithRangeWhenIncorrectRangeValues() throws UnsupportedEncodingException, MCSException, IOException { int rangeStart = 1; int rangeEnd = 50; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); String range = String.format("bytese=%d-%d", rangeStart, rangeEnd); instance.getFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, TEST_VERSION, unmovableFileName, range); } | public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForGetFileWithoutRange") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForGetFileWithoutRange() throws UnsupportedEncodingException, MCSException, IOException { String incorrectFileName = "edefc11e-1c5f-4a71-adb6-28efdd7b3b00"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.getFile(cloudId, representationName, version, incorrectFileName); } | public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowRepresentationNotExistsForGetFileWithoutRangeWhenIncorrectCloudId") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsForGetFileWithoutRangeWhenIncorrectCloudId() throws UnsupportedEncodingException, MCSException, IOException { String incorrectCloudId = "7MZWQJF8P99"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.getFile(incorrectCloudId, representationName, version, unmovableFileName); } | public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForGetFileWithoutRangeWhenIncorrectRepresentationName") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForGetFileWithoutRangeWhenIncorrectRepresentationName() throws UnsupportedEncodingException, MCSException, IOException { String incorrectRepresentationName = "schema_000101"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.getFile(cloudId, incorrectRepresentationName, version, unmovableFileName); } | public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForGetFileWithoutRangeWhenIncorrectVersion") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForGetFileWithoutRangeWhenIncorrectVersion() throws UnsupportedEncodingException, MCSException, IOException { String incorrectVersion = "8a64f9b0-98b6-11e3-b072-50e549e85200"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.getFile(cloudId, representationName, incorrectVersion, unmovableFileName); } | public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public InputStream getFile(String cloudId, String representationName, String version, String fileName) throws MCSException, IOException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Builder requset = target.request(); Response response = null; try { response = requset.get(); return handleReadFileResponse(response); } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Test(expected = UserDoesNotExistException.class) public void testDeleteUser() throws Exception { dao.createUser(new SpringUser("test3", "test3")); service.deleteUser("test3"); service.getUser("test3"); } | @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } CassandraAuthenticationService(); CassandraAuthenticationService(CassandraUserDAO userDao); } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } CassandraAuthenticationService(); CassandraAuthenticationService(CassandraUserDAO userDao); @Override UserDetails loadUserByUsername(final String userName); @Override User getUser(String userName); @Override void createUser(final User user); @Override void updateUser(final User user); @Override void deleteUser(final String userName); } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } CassandraAuthenticationService(); CassandraAuthenticationService(CassandraUserDAO userDao); @Override UserDetails loadUserByUsername(final String userName); @Override User getUser(String userName); @Override void createUser(final User user); @Override void updateUser(final User user); @Override void deleteUser(final String userName); } |
@Test public void shouldSuccessfullyRemoveNotifications() { doNothing().when(subTaskInfoDAO).removeNotifications(eq(TASK_ID)); removerImpl.removeNotifications(TASK_ID); verify(subTaskInfoDAO, times(1)).removeNotifications((eq(TASK_ID))); } | @Override public void removeNotifications(long taskId) { int retries = DEFAULT_RETRIES; while (true) { try { subTaskInfoDAO.removeNotifications(taskId); break; } catch (Exception e) { if (retries-- > 0) { LOGGER.warn("Error while removing the logs. Retries left: " + retries); waitForTheNextCall(); } else { LOGGER.error("Error while removing the logs."); throw e; } } } } | RemoverImpl implements Remover { @Override public void removeNotifications(long taskId) { int retries = DEFAULT_RETRIES; while (true) { try { subTaskInfoDAO.removeNotifications(taskId); break; } catch (Exception e) { if (retries-- > 0) { LOGGER.warn("Error while removing the logs. Retries left: " + retries); waitForTheNextCall(); } else { LOGGER.error("Error while removing the logs."); throw e; } } } } } | RemoverImpl implements Remover { @Override public void removeNotifications(long taskId) { int retries = DEFAULT_RETRIES; while (true) { try { subTaskInfoDAO.removeNotifications(taskId); break; } catch (Exception e) { if (retries-- > 0) { LOGGER.warn("Error while removing the logs. Retries left: " + retries); waitForTheNextCall(); } else { LOGGER.error("Error while removing the logs."); throw e; } } } } RemoverImpl(String hosts, int port, String keyspaceName, String userName, String password); RemoverImpl(CassandraSubTaskInfoDAO subTaskInfoDAO, CassandraTaskErrorsDAO taskErrorDAO, CassandraNodeStatisticsDAO cassandraNodeStatisticsDAO); } | RemoverImpl implements Remover { @Override public void removeNotifications(long taskId) { int retries = DEFAULT_RETRIES; while (true) { try { subTaskInfoDAO.removeNotifications(taskId); break; } catch (Exception e) { if (retries-- > 0) { LOGGER.warn("Error while removing the logs. Retries left: " + retries); waitForTheNextCall(); } else { LOGGER.error("Error while removing the logs."); throw e; } } } } RemoverImpl(String hosts, int port, String keyspaceName, String userName, String password); RemoverImpl(CassandraSubTaskInfoDAO subTaskInfoDAO, CassandraTaskErrorsDAO taskErrorDAO, CassandraNodeStatisticsDAO cassandraNodeStatisticsDAO); @Override void removeNotifications(long taskId); @Override void removeErrorReports(long taskId); @Override void removeStatistics(long taskId); } | RemoverImpl implements Remover { @Override public void removeNotifications(long taskId) { int retries = DEFAULT_RETRIES; while (true) { try { subTaskInfoDAO.removeNotifications(taskId); break; } catch (Exception e) { if (retries-- > 0) { LOGGER.warn("Error while removing the logs. Retries left: " + retries); waitForTheNextCall(); } else { LOGGER.error("Error while removing the logs."); throw e; } } } } RemoverImpl(String hosts, int port, String keyspaceName, String userName, String password); RemoverImpl(CassandraSubTaskInfoDAO subTaskInfoDAO, CassandraTaskErrorsDAO taskErrorDAO, CassandraNodeStatisticsDAO cassandraNodeStatisticsDAO); @Override void removeNotifications(long taskId); @Override void removeErrorReports(long taskId); @Override void removeStatistics(long taskId); } |
@Betamax(tape = "files/shouldUploadFile") @Test public void shouldUploadFile() throws UnsupportedEncodingException, MCSException, IOException { String contentString = UPLOADED_FILE_CONTENTS; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); URI uri = instance.uploadFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, TEST_VERSION, contentStream, mediaType); System.out.println(uri); assertNotNull(uri); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowRepresentationNotExistsExceptionForUploadFileWhenIncorrectCloudId") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsExceptionForUploadFileWhenIncorrectCloudId() throws MCSException, IOException { String contentString = "Test_123456789_"; String incorrectCloudId = "7MZWQJS8P84"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.uploadFile(incorrectCloudId, representationName, version, contentStream, mediaType); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowRepresentationNotExistsExceptionForUploadFileWhenIncorrectRepresentationName") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsExceptionForUploadFileWhenIncorrectRepresentationName() throws MCSException, IOException { String contentString = "Test_123456789_"; String incorrectRepresentationName = "schema_000101"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.uploadFile(cloudId, incorrectRepresentationName, version, contentStream, mediaType); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowRepresentationNotExistsExceptionForUploadFileWhenIncorrectVersion") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsExceptionForUploadFileWhenIncorrectVersion() throws MCSException, IOException { String contentString = "Test_123456789_"; String incorrectVersion = "8a64f9b0-98b6-11e3-b072-50e549e85200"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.uploadFile(cloudId, representationName, incorrectVersion, contentStream, mediaType); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowCannotModifyPersistentRepresentationExceptionForUploadFile") @Test(expected = CannotModifyPersistentRepresentationException.class) public void shouldThrowCannotModifyPersistentRepresentationExceptionForUploadFile() throws MCSException, IOException { String contentString = "Test_123456789_"; String persistedVersion = "80441ab0-a38d-11e3-8614-50e549e85271"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.uploadFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, PERSISTED_VERSION, contentStream, mediaType); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldUploadFileWithChecksum") @Test public void shouldUploadFileWithChecksum() throws UnsupportedEncodingException, MCSException, IOException { String contentString = "Test_123456789_1"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); URI uri = instance.uploadFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, TEST_VERSION, contentStream, mediaType, contentChecksum); assertNotNull(uri); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowRepresentationNotExistsExceptionForUploadFileWithChecksumWhenIncorrectCloudId") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsExceptionForUploadFileWithChecksumWhenIncorrectCloudId() throws UnsupportedEncodingException, MCSException, IOException { String incorrectCloudId = "7MZWQJF8P00"; String contentString = "Test_123456789_1"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.uploadFile(incorrectCloudId, representationName, version, contentStream, mediaType, contentChecksum); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowRepresentationNotExistsExceptionForUploadFileWithChecksumWhenIncorrectRepresentationName") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsExceptionForUploadFileWithChecksumWhenIncorrectRepresentationName() throws UnsupportedEncodingException, MCSException, IOException { String incorrectRepresentationName = "schema_000101"; String contentString = "Test_123456789_1"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.uploadFile(cloudId, incorrectRepresentationName, version, contentStream, mediaType, contentChecksum); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowRepresentationNotExistsExceptionForUploadFileWithChecksumWhenIncorrectVersion") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsExceptionForUploadFileWithChecksumWhenIncorrectVersion() throws UnsupportedEncodingException, MCSException, IOException { String incorrectVersion = "8a64f9b0-98b6-11e3-b072-50e549e85200"; String contentString = "Test_123456789_1"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.uploadFile(cloudId, representationName, incorrectVersion, contentStream, mediaType, contentChecksum); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowCannotModifyPersistentRepresentationExceptionForUploadFileWithChecksum") @Test(expected = CannotModifyPersistentRepresentationException.class) public void shouldThrowCannotModifyPersistentRepresentationExceptionForUploadFileWithChecksum() throws UnsupportedEncodingException, MCSException, IOException { String persistedVersion = "80441ab0-a38d-11e3-8614-50e549e85271"; String contentString = "Test_123456789_1"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.uploadFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, PERSISTED_VERSION, contentStream, mediaType, contentChecksum); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Test(expected = UserDoesNotExistException.class) public void testDeleteUserException() throws Exception { service.deleteUser("test4"); } | @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } CassandraAuthenticationService(); CassandraAuthenticationService(CassandraUserDAO userDao); } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } CassandraAuthenticationService(); CassandraAuthenticationService(CassandraUserDAO userDao); @Override UserDetails loadUserByUsername(final String userName); @Override User getUser(String userName); @Override void createUser(final User user); @Override void updateUser(final User user); @Override void deleteUser(final String userName); } | CassandraAuthenticationService implements UserDetailsService, AuthenticationService { @Override public void deleteUser(final String userName) throws DatabaseConnectionException, UserDoesNotExistException { userDao.deleteUser(userName); } CassandraAuthenticationService(); CassandraAuthenticationService(CassandraUserDAO userDao); @Override UserDetails loadUserByUsername(final String userName); @Override User getUser(String userName); @Override void createUser(final User user); @Override void updateUser(final User user); @Override void deleteUser(final String userName); } |
@Betamax(tape = "files/shouldThrowIOExceptionForUploadFile") @Test(expected = IOException.class) public void shouldThrowIOExceptionForUploadFile() throws UnsupportedEncodingException, MCSException, IOException { String contentString = "Test_123456789_1"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); String incorrectContentChecksum = contentChecksum.substring(1) + "0"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.uploadFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, TEST_VERSION, contentStream, mediaType, incorrectContentChecksum); } | public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI uploadFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILES_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); multipart .field(ParamConstants.F_FILE_MIME, mediaType) .bodyPart(new StreamDataBodyPart(ParamConstants.F_FILE_DATA, data, MediaType.APPLICATION_OCTET_STREAM)); Builder request = target.request(); response = request.post(Entity.entity(multipart, multipart.getMediaType())); return handleResponse(expectedMd5, response, Status.CREATED.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldModifyFile") @Test public void shouldModifyFile() throws UnsupportedEncodingException, IOException, MCSException { String contentString = MODIFIED_FILE_CONTENTS; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); URI uri = instance.modyfiyFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, TEST_VERSION, contentStream, mediaType, MODIFIED_FILE_NAME, contentChecksum); assertNotNull(uri); } | public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForModifyFileWhenIncorrectCloudId") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForModifyFileWhenIncorrectCloudId() throws UnsupportedEncodingException, IOException, MCSException { String incorrectCloudId = "12c068c9-461d-484e-878f-099c5fca4400"; String contentString = "Test_123456789_123456"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.modyfiyFile(incorrectCloudId, representationName, version, contentStream, mediaType, modyfiedFileName, contentChecksum); } | public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForModifyFileWhenIncorrectRepresentationName") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForModifyFileWhenIncorrectRepresentationName() throws UnsupportedEncodingException, IOException, MCSException { String incorrectRepresentationName = "schema_000101"; String contentString = "Test_123456789_123456"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.modyfiyFile(cloudId, incorrectRepresentationName, version, contentStream, mediaType, modyfiedFileName, contentChecksum); } | public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForModifyFileWhenIncorrectVersion") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForModifyFileWhenIncorrectVersion() throws UnsupportedEncodingException, IOException, MCSException { String incorrectVersion = "8a64f9b0-98b6-11e3-b072-50e549e85200"; String contentString = "Test_123456789_123456"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.modyfiyFile(cloudId, representationName, incorrectVersion, contentStream, mediaType, modyfiedFileName, contentChecksum); } | public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowIOExceptionForModifyFile") @Test(expected = IOException.class) public void shouldThrowIOExceptionForModifyFile() throws UnsupportedEncodingException, IOException, MCSException { String contentString = "Test_123456789_123456"; byte[] contentBytes = contentString.getBytes("UTF-8"); InputStream contentStream = new ByteArrayInputStream(contentBytes); String contentChecksum = Hashing.md5().hashBytes(contentBytes).toString(); String incorrectContentChecksum = contentChecksum.substring(1) + "0"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.modyfiyFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, TEST_VERSION, contentStream, mediaType, MODIFIED_FILE_NAME, incorrectContentChecksum); } | public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public URI modyfiyFile(String cloudId, String representationName, String version, InputStream data, String mediaType, String fileName, String expectedMd5) throws IOException, MCSException { Response response = null; FormDataMultiPart multipart = new FormDataMultiPart(); try { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); response = target.request().put(Entity.entity(data, mediaType)); return handleResponse(expectedMd5, response, Status.NO_CONTENT.getStatusCode()); } finally { closeOpenResources(data, multipart, response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldDeleteFile") public void shouldDeleteFile() throws MCSException { FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.deleteFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, TEST_VERSION, UPLOADED_FILE_CONTENTS); Response response = BuildWebTarget(cloudId, representationName, version, deletedFileName).request().get(); assertEquals("", Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); } | public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteFileWhenIncorrectCloudId") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteFileWhenIncorrectCloudId() throws MCSException { String incorrectCloudId = "7MZWQJF8P99"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.deleteFile(incorrectCloudId, representationName, version, deletedFileName); } | public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteFileWhenIncorrectRepresentationName") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteFileWhenIncorrectRepresentationName() throws MCSException { String incorrectRepresentationName = "schema_000101"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.deleteFile(cloudId, incorrectRepresentationName, version, deletedFileName); } | public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteFileWhenIncorrectVersion") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteFileWhenIncorrectVersion() throws MCSException { String incorrectVersion = "8a64f9b0-98b6-11e3-b072-50e549e85200"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.deleteFile(cloudId, representationName, incorrectVersion, deletedFileName); } | public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Test(expected = NotFoundException.class) public void testCreateAndRetrieve() throws Exception { TestingAuthenticationToken auth = new TestingAuthenticationToken(creator, creator); auth.setAuthenticated(true); SecurityContextHolder.getContext().setAuthentication(auth); ObjectIdentity obj = new ObjectIdentityImpl(testKey, testValue); MutableAcl acl = mutableAclService.createAcl(obj); acl.insertAce(0, BasePermission.READ, new PrincipalSid(creator), true); acl.insertAce(1, BasePermission.WRITE, new PrincipalSid(creator), true); acl.insertAce(2, BasePermission.DELETE, new PrincipalSid(creator), true); acl.insertAce(3, BasePermission.ADMINISTRATION, new PrincipalSid(creator), true); mutableAclService.updateAcl(acl); Acl readAcl = mutableAclService.readAclById(obj); Assert.assertTrue(acl.getEntries().size() == readAcl.getEntries().size()); mutableAclService.readAclById(new ObjectIdentityImpl(testKey, creator)); } | @Override public Acl readAclById(ObjectIdentity object) throws NotFoundException { return readAclById(object, null); } | CassandraAclService implements AclService { @Override public Acl readAclById(ObjectIdentity object) throws NotFoundException { return readAclById(object, null); } } | CassandraAclService implements AclService { @Override public Acl readAclById(ObjectIdentity object) throws NotFoundException { return readAclById(object, null); } CassandraAclService(AclRepository aclRepository, AclCache aclCache, PermissionGrantingStrategy grantingStrategy,
AclAuthorizationStrategy aclAuthorizationStrategy, PermissionFactory permissionFactory); } | CassandraAclService implements AclService { @Override public Acl readAclById(ObjectIdentity object) throws NotFoundException { return readAclById(object, null); } CassandraAclService(AclRepository aclRepository, AclCache aclCache, PermissionGrantingStrategy grantingStrategy,
AclAuthorizationStrategy aclAuthorizationStrategy, PermissionFactory permissionFactory); @Override List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity); @Override Acl readAclById(ObjectIdentity object); @Override Acl readAclById(ObjectIdentity object, List<Sid> sids); @Override Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects); @Override Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids); } | CassandraAclService implements AclService { @Override public Acl readAclById(ObjectIdentity object) throws NotFoundException { return readAclById(object, null); } CassandraAclService(AclRepository aclRepository, AclCache aclCache, PermissionGrantingStrategy grantingStrategy,
AclAuthorizationStrategy aclAuthorizationStrategy, PermissionFactory permissionFactory); @Override List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity); @Override Acl readAclById(ObjectIdentity object); @Override Acl readAclById(ObjectIdentity object, List<Sid> sids); @Override Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects); @Override Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids); } |
@Betamax(tape = "files/shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteFile") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteFile() throws MCSException { String notExistDeletedFileName = "d64b423b-1018-4526-ab4b-3539261ff000"; FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.deleteFile(cloudId, representationName, version, notExistDeletedFileName); } | public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "files/shouldThrowCannotModifyPersistentRepresentationExceptionForDeleteFile") @Test(expected = CannotModifyPersistentRepresentationException.class) public void shouldThrowCannotModifyPersistentRepresentationExceptionForDeleteFile() throws MCSException, UnsupportedEncodingException { FileServiceClient instance = new FileServiceClient(baseUrl, username, password); instance.deleteFile(TEST_CLOUD_ID, TEST_REPRESENTATION_NAME, "eb5c0a60-4306-11e4-8576-00163eefc9c8", DELETED_FILE_NAME); } | public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } | FileServiceClient extends MCSClient { public void deleteFile(String cloudId, String representationName, String version, String fileName) throws MCSException { WebTarget target = client .target(baseUrl) .path(FILE_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(FILE_NAME, fileName); Response response = null; try { response = target.request().delete(); if (response.getStatus() != Response.Status.NO_CONTENT.getStatusCode()) { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } FileServiceClient(String baseUrl); FileServiceClient(String baseUrl, final String username, final String password); FileServiceClient(String baseUrl, final String authorizationHeader); FileServiceClient(String baseUrl, final String authorizationHeader,
final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); InputStream getFile(String cloudId, String representationName,
String version, String fileName); InputStream getFile(String cloudId, String representationName, String version,
String fileName, String range); InputStream getFile(String fileUrl); InputStream getFile(String fileUrl,String key,String value); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String expectedMd5); URI uploadFile(String cloudId, String representationName, String version,
InputStream data, String mediaType); URI uploadFile(String cloudId, String representationName, String version, String fileName,
InputStream data, String mediaType); @Deprecated URI uploadFile(String versionUrl, InputStream data, String mediaType); URI modyfiyFile(String cloudId, String representationName, String version,
InputStream data, String mediaType, String fileName, String expectedMd5); URI modifyFile(String fileUrl, InputStream data, String mediaType); void deleteFile(String cloudId, String representationName, String version, String fileName); URI getFileUri(String cloudId, String representationName, String version, String fileName); static Map<String, String> parseFileUri(String uri); void useAuthorizationHeader(final String authorizationHeader); void close(); } |
@Betamax(tape = "records_shouldRetrieveRecord") @Test public void shouldRetrieveRecord() throws MCSException { RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); Record record = instance.getRecord(CLOUD_ID); assertNotNull(record); assertEquals(CLOUD_ID, record.getCloudId()); } | public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRecordNotExistsForGetRecord") @Test(expected = RecordNotExistsException.class) public void shouldThrowRecordNotExistsForGetRecord() throws MCSException { String cloudId = "noSuchRecord"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.getRecord(cloudId); } | public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Record getRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(Record.class); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRecordNotExistsForDeleteRecord") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRecordNotExistsForDeleteRecord() throws MCSException { String cloudId = "noSuchRecord"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.deleteRecord(cloudId); } | public void deleteRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); handleDeleteRequest(request); } | RecordServiceClient extends MCSClient { public void deleteRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); handleDeleteRequest(request); } } | RecordServiceClient extends MCSClient { public void deleteRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public void deleteRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public void deleteRecord(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(RECORDS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldRetrieveRepresentations") @Test public void shouldRetrieveRepresentations() throws MCSException { RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); List<Representation> representationList = instance .getRepresentations(CLOUD_ID); assertNotNull(representationList); assertEquals(representationList.size(), 2); for (Representation representation : representationList) { assertEquals(CLOUD_ID, representation.getCloudId()); assertTrue(representation.isPersistent()); } } | public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRecordNotExistsForGetRepresentations") @Test(expected = RecordNotExistsException.class) public void shouldThrowRecordNotExistsForGetRepresentations() throws MCSException { String cloudId = "noSuchRecord"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.getRepresentations(cloudId); } | public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldRetrieveLastPersistentRepresentationForRepresentationName") @Test public void shouldRetrieveLastPersistentRepresentationForRepresentationName() throws MCSException { RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); Representation representation = instance.getRepresentation(CLOUD_ID, REPRESENTATION_NAME); assertNotNull(representation); assertTrue(representation.isPersistent()); } | public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForGetRepresentationForRepresentationNameWhenNoRepresentationName") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsForGetRepresentationForRepresentationNameWhenNoRepresentationName() throws MCSException { String cloudId = "7MZWQJF8P84"; String representationName = "noSuchSchema"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.getRepresentation(cloudId, representationName); } | public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForGetRepresentationForRepresentationNameWhenNoPersistent") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsForGetRepresentationForRepresentationNameWhenNoPersistent() throws MCSException { String cloudId = "GWV0RHNSSGJ"; String representationName = "schema1"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.getRepresentation(cloudId, representationName); } | public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Test(expected = IllegalArgumentException.class) public void testFindAclListEmpty() { service.findAcls(new ArrayList<AclObjectIdentity>()); } | @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } | CassandraAclRepository implements AclRepository { @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } } | CassandraAclRepository implements AclRepository { @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } CassandraAclRepository(CassandraConnectionProvider provider, boolean initSchema); CassandraAclRepository(Session session, String keyspace); CassandraAclRepository(Session session, String keyspace, boolean initSchema); } | CassandraAclRepository implements AclRepository { @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } CassandraAclRepository(CassandraConnectionProvider provider, boolean initSchema); CassandraAclRepository(Session session, String keyspace); CassandraAclRepository(Session session, String keyspace, boolean initSchema); @Override Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup); @Override AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId); @Override List<AclObjectIdentity> findAclObjectIdentityChildren(AclObjectIdentity objectId); @Override void deleteAcls(List<AclObjectIdentity> objectIdsToDelete); @Override void saveAcl(AclObjectIdentity aoi); @Override void updateAcl(AclObjectIdentity aoi, List<AclEntry> entries); void createAoisTable(); void createChilrenTable(); void createAclsTable(); } | CassandraAclRepository implements AclRepository { @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } CassandraAclRepository(CassandraConnectionProvider provider, boolean initSchema); CassandraAclRepository(Session session, String keyspace); CassandraAclRepository(Session session, String keyspace, boolean initSchema); @Override Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup); @Override AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId); @Override List<AclObjectIdentity> findAclObjectIdentityChildren(AclObjectIdentity objectId); @Override void deleteAcls(List<AclObjectIdentity> objectIdsToDelete); @Override void saveAcl(AclObjectIdentity aoi); @Override void updateAcl(AclObjectIdentity aoi, List<AclEntry> entries); void createAoisTable(); void createChilrenTable(); void createAclsTable(); } |
@Betamax(tape = "records_shouldThrowRecordNotExistsForCreateRepresentation") @Test(expected = RecordNotExistsException.class) public void shouldThrowRecordNotExistsForCreateRepresentation() throws MCSException { String cloudId = "noSuchRecord"; String representationName = "schema_000001"; String providerId = "Provider001"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.createRepresentation(cloudId, representationName, providerId); } | public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } | RecordServiceClient extends MCSClient { public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } } | RecordServiceClient extends MCSClient { public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowProviderNotExistsForCreateRepresentation") @Test(expected = ProviderNotExistsException.class) public void shouldThrowProviderNotExistsForCreateRepresentation() throws MCSException { String cloudId = "7MZWQJF8P84"; String representationName = "schema_000001"; String providerId = "noSuchProvider"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.createRepresentation(cloudId, representationName, providerId); } | public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } | RecordServiceClient extends MCSClient { public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } } | RecordServiceClient extends MCSClient { public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI createRepresentation(String cloudId, String representationName, String providerId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Form form = new Form(); form.param(PROVIDER_ID, providerId); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForDeleteRepresentationNameWhenNoRepresentationName") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsForDeleteRepresentationNameWhenNoRepresentationName() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "noSuchSchema"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.deleteRepresentation(cloudId, representationName); } | public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForDeleteRepresentationNameWhenNoRecord") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsForDeleteRepresentationNameWhenNoRecord() throws MCSException { String cloudId = "noSuchRecord"; String representationName = "schema1"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.deleteRepresentation(cloudId, representationName); } | public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldRetrieveSchemaVersions") @Test public void shouldRetrieveSchemaVersions() throws RepresentationNotExistsException, MCSException { RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); List<Representation> result = instance.getRepresentations(CLOUD_ID, REPRESENTATION_NAME); assertNotNull(result); assertThat(result.size(), greaterThan(1)); for (Representation representation : result) { assertEquals(CLOUD_ID, representation.getCloudId()); assertEquals(REPRESENTATION_NAME, representation.getRepresentationName()); } } | public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForGetRepresentationNameVersionsWhenNoRepresentationName") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsForGetRepresentationNameVersionsWhenNoRepresentationName() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "noSuchSchema"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.getRepresentations(cloudId, representationName); } | public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForGetRepresentationNameVersionsWhenNoRecord") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsForGetRepresentationNameVersionsWhenNoRecord() throws MCSException { String cloudId = "noSuchRecord"; String representationName = "schema1"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.getRepresentations(cloudId, representationName); } | public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public List<Representation> getRepresentations(String cloudId) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATIONS_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId); Response response = null; try { response = target.request().get(); if (response.getStatus() == Response.Status.OK.getStatusCode()) { return response.readEntity(new GenericType<List<Representation>>() { }); } ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldRetrieveRepresentationVersion") @Test public void shouldRetrieveRepresentationVersion() throws MCSException { RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); Representation representation = instance.getRepresentation(CLOUD_ID, REPRESENTATION_NAME, VERSION); assertNotNull(representation); assertEquals(CLOUD_ID, representation.getCloudId()); assertEquals(REPRESENTATION_NAME, representation.getRepresentationName()); assertEquals(VERSION, representation.getVersion()); } | public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Ignore @Test public void shouldRetrieveLatestRepresentationVersion() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "schema22"; String version = "LATEST"; String versionCode = "88edb4d0-a2ef-11e3-89f5-1c6f653f6012"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); Representation representationLatest = instance.getRepresentation( cloudId, representationName, version); assertNotNull(representationLatest); assertEquals(cloudId, representationLatest.getCloudId()); assertEquals(representationName, representationLatest.getRepresentationName()); assertEquals(versionCode, representationLatest.getVersion()); Representation representation = instance.getRepresentation(cloudId, representationName); } | public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForGetRepresentationVersionWhenNoRecord") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsForGetRepresentationVersionWhenNoRecord() throws MCSException { String cloudId = "noSuchRecord"; String representationName = "schema22"; String version = "74cc8410-a2d9-11e3-8a55-1c6f653f6012"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.getRepresentation(cloudId, representationName, version); } | public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Test(expected = IllegalArgumentException.class) public void testFindNullAclList() { service.findAcls(null); } | @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } | CassandraAclRepository implements AclRepository { @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } } | CassandraAclRepository implements AclRepository { @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } CassandraAclRepository(CassandraConnectionProvider provider, boolean initSchema); CassandraAclRepository(Session session, String keyspace); CassandraAclRepository(Session session, String keyspace, boolean initSchema); } | CassandraAclRepository implements AclRepository { @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } CassandraAclRepository(CassandraConnectionProvider provider, boolean initSchema); CassandraAclRepository(Session session, String keyspace); CassandraAclRepository(Session session, String keyspace, boolean initSchema); @Override Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup); @Override AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId); @Override List<AclObjectIdentity> findAclObjectIdentityChildren(AclObjectIdentity objectId); @Override void deleteAcls(List<AclObjectIdentity> objectIdsToDelete); @Override void saveAcl(AclObjectIdentity aoi); @Override void updateAcl(AclObjectIdentity aoi, List<AclEntry> entries); void createAoisTable(); void createChilrenTable(); void createAclsTable(); } | CassandraAclRepository implements AclRepository { @Override public Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup) { assertAclObjectIdentityList(objectIdsToLookup); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAcls: objectIdentities: " + objectIdsToLookup); } List<String> ids = new ArrayList<>(objectIdsToLookup.size()); for (AclObjectIdentity entry : objectIdsToLookup) { ids.add(entry.getRowId()); } ResultSet resultSet = session.execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); Map<AclObjectIdentity, Set<AclEntry>> resultMap = new HashMap<>(); for (Row row : resultSet.all()) { resultMap.put(convertToAclObjectIdentity(row, true), new TreeSet<>(new Comparator<AclEntry>() { @Override public int compare(AclEntry o1, AclEntry o2) { return Integer.compare(o1.getOrder(), o2.getOrder()); } })); } resultSet = session.execute(QueryBuilder.select().all().from(keyspace, ACL_TABLE) .where(QueryBuilder.in("id", ids.toArray())).setConsistencyLevel(ConsistencyLevel.QUORUM)); for (Row row : resultSet.all()) { String aoiId = row.getString("id"); AclEntry aclEntry = new AclEntry(); aclEntry.setAuditFailure(row.getBool("isAuditFailure")); aclEntry.setAuditSuccess(row.getBool("isAuditSuccess")); aclEntry.setGranting(row.getBool("isGranting")); aclEntry.setMask(row.getInt("mask")); aclEntry.setOrder(row.getInt("aclOrder")); aclEntry.setSid(row.getString("sid")); aclEntry.setSidPrincipal(row.getBool("isSidPrincipal")); aclEntry.setId(aoiId + ":" + aclEntry.getSid() + ":" + aclEntry.getOrder()); for (Entry<AclObjectIdentity, Set<AclEntry>> entry : resultMap.entrySet()) { if (entry.getKey().getRowId().equals(aoiId)) { entry.getValue().add(aclEntry); break; } } } if (LOG.isDebugEnabled()) { LOG.debug("END findAcls: objectIdentities: " + resultMap.keySet() + ", aclEntries: " + resultMap.values()); } return resultMap; } CassandraAclRepository(CassandraConnectionProvider provider, boolean initSchema); CassandraAclRepository(Session session, String keyspace); CassandraAclRepository(Session session, String keyspace, boolean initSchema); @Override Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup); @Override AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId); @Override List<AclObjectIdentity> findAclObjectIdentityChildren(AclObjectIdentity objectId); @Override void deleteAcls(List<AclObjectIdentity> objectIdsToDelete); @Override void saveAcl(AclObjectIdentity aoi); @Override void updateAcl(AclObjectIdentity aoi, List<AclEntry> entries); void createAoisTable(); void createChilrenTable(); void createAclsTable(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForGetRepresentationVersionWhenNoRepresentationName") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsForGetRepresentationVersionWhenNoRepresentationName() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "noSuchSchema"; String version = "74cc8410-a2d9-11e3-8a55-1c6f653f6012"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.getRepresentation(cloudId, representationName, version); } | public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForGetRepresentationVersionWhenNoSuchVersion") @Test(expected = RepresentationNotExistsException.class) public void shouldThrowRepresentationNotExistsForGetRepresentationVersionWhenNoSuchVersion() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "schema22"; String version = "74cc8410-a2d9-11e3-8a55-1c6f653f6013"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.getRepresentation(cloudId, representationName, version); } | public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public Representation getRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); Response response = null; try { response = request.get(); if (response.getStatus() == Response.Status.OK.getStatusCode() || response.getStatus() == Response.Status.TEMPORARY_REDIRECT.getStatusCode()) { return response.readEntity(Representation.class); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForDeleteRepresentationVersionWhenNoRecord") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsForDeleteRepresentationVersionWhenNoRecord() throws MCSException { String cloudId = "noSuchRecord"; String representationName = "schema22"; String version = "74cc8410-a2d9-11e3-8a55-1c6f653f6012"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.deleteRepresentation(cloudId, representationName, version); } | public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForDeleteRepresentationVersionWhenNoRepresentationName") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsForDeleteRepresentationVersionWhenNoRepresentationName() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "noSuchSchema"; String version = "74cc8410-a2d9-11e3-8a55-1c6f653f6012"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.deleteRepresentation(cloudId, representationName, version); } | public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForDeleteRepresentationVersionWhenNoSuchVersion") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsForDeleteRepresentationVersionWhenNoSuchVersion() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "schema22"; String version = "74cc8410-a2d9-11e3-8a55-1c6f653f6013"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.deleteRepresentation(cloudId, representationName, version); } | public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteRepresentationVersionWhenInvalidVersion") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForDeleteRepresentationVersionWhenInvalidVersion() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "schema22"; String version = "noSuchVersion"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.deleteRepresentation(cloudId, representationName, version); } | public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public void deleteRepresentation(String cloudId, String representationName) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_RESOURCE) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName); Builder request = target.request(); handleDeleteRequest(request); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForCopyRepresentationWhenNoRecord") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsForCopyRepresentationWhenNoRecord() throws MCSException { String cloudId = "noSuchRecord"; String representationName = "schema22"; String version = "88edb4d0-a2ef-11e3-89f5-1c6f653f6012"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.copyRepresentation(cloudId, representationName, version); } | public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForCopyRepresentationWhenNoRepresentationName") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsForCopyRepresentationWhenNoRepresentationName() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "noSuchSchema"; String version = "88edb4d0-a2ef-11e3-89f5-1c6f653f6012"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.copyRepresentation(cloudId, representationName, version); } | public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsForCopyRepresentationVersionWhenNoSuchVersion") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsForCopyRepresentationVersionWhenNoSuchVersion() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "schema22"; String version = "88edb4d0-a2ef-11e3-89f5-1c6f653f6013"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.copyRepresentation(cloudId, representationName, version); } | public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowAccessDeniedForCopyRepresentationVersionWhenInvalidVersion") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedForCopyRepresentationVersionWhenInvalidVersion() throws MCSException { String cloudId = "J93T5R6615H"; String representationName = "schema22"; String version = "noSuchVersion"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.copyRepresentation(cloudId, representationName, version); } | public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI copyRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_COPY) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Builder request = target.request(); Response response = null; try { response = request.post(Entity.entity(new Form(), MediaType.APPLICATION_FORM_URLENCODED_TYPE)); if (response.getStatus() == Response.Status.CREATED.getStatusCode()) { return response.getLocation(); } else { ErrorInfo errorInfo = response.readEntity(ErrorInfo.class); throw MCSExceptionProvider.generateException(errorInfo); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Test(expected = IllegalArgumentException.class) public void testFindNullAcl() { service.findAclObjectIdentity(null); } | @Override public AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId) { assertAclObjectIdentity(objectId); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAclObjectIdentity: objectIdentity: " + objectId); } Row row = session .execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.eq("id", objectId.getRowId())).setConsistencyLevel(ConsistencyLevel.QUORUM)) .one(); AclObjectIdentity objectIdentity = convertToAclObjectIdentity(row, true); if (LOG.isDebugEnabled()) { LOG.debug("END findAclObjectIdentity: objectIdentity: " + objectIdentity); } return objectIdentity; } | CassandraAclRepository implements AclRepository { @Override public AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId) { assertAclObjectIdentity(objectId); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAclObjectIdentity: objectIdentity: " + objectId); } Row row = session .execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.eq("id", objectId.getRowId())).setConsistencyLevel(ConsistencyLevel.QUORUM)) .one(); AclObjectIdentity objectIdentity = convertToAclObjectIdentity(row, true); if (LOG.isDebugEnabled()) { LOG.debug("END findAclObjectIdentity: objectIdentity: " + objectIdentity); } return objectIdentity; } } | CassandraAclRepository implements AclRepository { @Override public AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId) { assertAclObjectIdentity(objectId); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAclObjectIdentity: objectIdentity: " + objectId); } Row row = session .execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.eq("id", objectId.getRowId())).setConsistencyLevel(ConsistencyLevel.QUORUM)) .one(); AclObjectIdentity objectIdentity = convertToAclObjectIdentity(row, true); if (LOG.isDebugEnabled()) { LOG.debug("END findAclObjectIdentity: objectIdentity: " + objectIdentity); } return objectIdentity; } CassandraAclRepository(CassandraConnectionProvider provider, boolean initSchema); CassandraAclRepository(Session session, String keyspace); CassandraAclRepository(Session session, String keyspace, boolean initSchema); } | CassandraAclRepository implements AclRepository { @Override public AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId) { assertAclObjectIdentity(objectId); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAclObjectIdentity: objectIdentity: " + objectId); } Row row = session .execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.eq("id", objectId.getRowId())).setConsistencyLevel(ConsistencyLevel.QUORUM)) .one(); AclObjectIdentity objectIdentity = convertToAclObjectIdentity(row, true); if (LOG.isDebugEnabled()) { LOG.debug("END findAclObjectIdentity: objectIdentity: " + objectIdentity); } return objectIdentity; } CassandraAclRepository(CassandraConnectionProvider provider, boolean initSchema); CassandraAclRepository(Session session, String keyspace); CassandraAclRepository(Session session, String keyspace, boolean initSchema); @Override Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup); @Override AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId); @Override List<AclObjectIdentity> findAclObjectIdentityChildren(AclObjectIdentity objectId); @Override void deleteAcls(List<AclObjectIdentity> objectIdsToDelete); @Override void saveAcl(AclObjectIdentity aoi); @Override void updateAcl(AclObjectIdentity aoi, List<AclEntry> entries); void createAoisTable(); void createChilrenTable(); void createAclsTable(); } | CassandraAclRepository implements AclRepository { @Override public AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId) { assertAclObjectIdentity(objectId); if (LOG.isDebugEnabled()) { LOG.debug("BEGIN findAclObjectIdentity: objectIdentity: " + objectId); } Row row = session .execute(QueryBuilder.select().all().from(keyspace, AOI_TABLE) .where(QueryBuilder.eq("id", objectId.getRowId())).setConsistencyLevel(ConsistencyLevel.QUORUM)) .one(); AclObjectIdentity objectIdentity = convertToAclObjectIdentity(row, true); if (LOG.isDebugEnabled()) { LOG.debug("END findAclObjectIdentity: objectIdentity: " + objectIdentity); } return objectIdentity; } CassandraAclRepository(CassandraConnectionProvider provider, boolean initSchema); CassandraAclRepository(Session session, String keyspace); CassandraAclRepository(Session session, String keyspace, boolean initSchema); @Override Map<AclObjectIdentity, Set<AclEntry>> findAcls(List<AclObjectIdentity> objectIdsToLookup); @Override AclObjectIdentity findAclObjectIdentity(AclObjectIdentity objectId); @Override List<AclObjectIdentity> findAclObjectIdentityChildren(AclObjectIdentity objectId); @Override void deleteAcls(List<AclObjectIdentity> objectIdsToDelete); @Override void saveAcl(AclObjectIdentity aoi); @Override void updateAcl(AclObjectIdentity aoi, List<AclEntry> entries); void createAoisTable(); void createChilrenTable(); void createAclsTable(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsExceptionForPersistRepresentationWhenNoRecord") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsExceptionForPersistRepresentationWhenNoRecord() throws MCSException, IOException { String cloudId = "noSuchRecord"; String representationName = "schema33"; String version = "fece3cb0-a5fb-11e3-b4a7-50e549e85271"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.persistRepresentation(cloudId, representationName, version); } | public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsExceptionForPersistRepresentationWhenNoRepresentationName") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsExceptionForPersistRepresentationWhenNoRepresentationName() throws MCSException, IOException { String cloudId = "J93T5R6615H"; String representationName = "noSuchSchema"; String version = "fece3cb0-a5fb-11e3-b4a7-50e549e85271"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.persistRepresentation(cloudId, representationName, version); } | public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowRepresentationNotExistsExceptionForPersistRepresentationWhenNoSuchVersion") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowRepresentationNotExistsExceptionForPersistRepresentationWhenNoSuchVersion() throws MCSException, IOException { String cloudId = "J93T5R6615H"; String representationName = "schema33"; String version = "fece3cb0-a5fb-11e3-b4a7-50e549e85204"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.persistRepresentation(cloudId, representationName, version); } | public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Betamax(tape = "records_shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForPersistRepresentationVersionWhenInvalidVersion") @Test(expected = AccessDeniedOrObjectDoesNotExistException.class) public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionForPersistRepresentationVersionWhenInvalidVersion() throws MCSException, IOException { String cloudId = "J93T5R6615H"; String representationName = "schema33"; String version = "noSuchVersion"; RecordServiceClient instance = new RecordServiceClient(baseUrl, username, password); instance.persistRepresentation(cloudId, representationName, version); } | public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public URI persistRepresentation(String cloudId, String representationName, String version) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_VERSION_PERSIST) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version); Form form = new Form(); Builder request = target.request(); Response response = null; return handleRepresentationResponse(form, request, response); } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
@Test(expected = AccessDeniedOrObjectDoesNotExistException.class) @Betamax(tape = "records_shouldThrowAccessDeniedOrObjectDoesNotExistExceptionWhileTryingToUpdatePermissions") public void shouldThrowAccessDeniedOrObjectDoesNotExistExceptionWhileTryingToUpdatePermissions() throws MCSException, IOException { RecordServiceClient client = new RecordServiceClient("http: client.grantPermissionsToVersion(CLOUD_ID, REPRESENTATION_NAME, VERSION, "user", Permission.READ); } | public void grantPermissionsToVersion(String cloudId, String representationName, String version, String userName, Permission permission) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_PERMISSION) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(PERMISSION, permission.getValue()) .resolveTemplate(USER_NAME, userName); Builder request = target.request(); Response response = null; try { response = request.post(null); if(response.getStatus() == Response.Status.NOT_MODIFIED.getStatusCode()) { throw new MCSException("Permissions not modified"); } else if (response.getStatus() != Response.Status.OK.getStatusCode()) { throwException(response); } } finally { closeResponse(response); } } | RecordServiceClient extends MCSClient { public void grantPermissionsToVersion(String cloudId, String representationName, String version, String userName, Permission permission) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_PERMISSION) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(PERMISSION, permission.getValue()) .resolveTemplate(USER_NAME, userName); Builder request = target.request(); Response response = null; try { response = request.post(null); if(response.getStatus() == Response.Status.NOT_MODIFIED.getStatusCode()) { throw new MCSException("Permissions not modified"); } else if (response.getStatus() != Response.Status.OK.getStatusCode()) { throwException(response); } } finally { closeResponse(response); } } } | RecordServiceClient extends MCSClient { public void grantPermissionsToVersion(String cloudId, String representationName, String version, String userName, Permission permission) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_PERMISSION) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(PERMISSION, permission.getValue()) .resolveTemplate(USER_NAME, userName); Builder request = target.request(); Response response = null; try { response = request.post(null); if(response.getStatus() == Response.Status.NOT_MODIFIED.getStatusCode()) { throw new MCSException("Permissions not modified"); } else if (response.getStatus() != Response.Status.OK.getStatusCode()) { throwException(response); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); } | RecordServiceClient extends MCSClient { public void grantPermissionsToVersion(String cloudId, String representationName, String version, String userName, Permission permission) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_PERMISSION) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(PERMISSION, permission.getValue()) .resolveTemplate(USER_NAME, userName); Builder request = target.request(); Response response = null; try { response = request.post(null); if(response.getStatus() == Response.Status.NOT_MODIFIED.getStatusCode()) { throw new MCSException("Permissions not modified"); } else if (response.getStatus() != Response.Status.OK.getStatusCode()) { throwException(response); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } | RecordServiceClient extends MCSClient { public void grantPermissionsToVersion(String cloudId, String representationName, String version, String userName, Permission permission) throws MCSException { WebTarget target = client .target(baseUrl) .path(REPRESENTATION_PERMISSION) .resolveTemplate(CLOUD_ID, cloudId) .resolveTemplate(REPRESENTATION_NAME, representationName) .resolveTemplate(VERSION, version) .resolveTemplate(PERMISSION, permission.getValue()) .resolveTemplate(USER_NAME, userName); Builder request = target.request(); Response response = null; try { response = request.post(null); if(response.getStatus() == Response.Status.NOT_MODIFIED.getStatusCode()) { throw new MCSException("Permissions not modified"); } else if (response.getStatus() != Response.Status.OK.getStatusCode()) { throwException(response); } } finally { closeResponse(response); } } RecordServiceClient(String baseUrl); RecordServiceClient(String baseUrl, final int connectTimeoutInMillis, final int readTimeoutInMillis); RecordServiceClient(String baseUrl, final String username, final String password); RecordServiceClient(String baseUrl, final String authorizationHeader); RecordServiceClient(String baseUrl, final String authorizationHeader, final String username, final String password,
final int connectTimeoutInMillis, final int readTimeoutInMillis); void useAuthorizationHeader(final String authorizationHeader); Record getRecord(String cloudId); void deleteRecord(String cloudId); List<Representation> getRepresentations(String cloudId); Representation getRepresentation(String cloudId, String representationName); URI createRepresentation(String cloudId, String representationName, String providerId); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String fileName,
String mediaType,
String key, String value); URI createRepresentation(String cloudId,
String representationName,
String providerId,
InputStream data,
String mediaType); void deleteRepresentation(String cloudId, String representationName); List<Representation> getRepresentations(String cloudId, String representationName); Representation getRepresentation(String cloudId, String representationName, String version); Representation getRepresentation(String cloudId, String representationName,
String version, String key, String value); void deleteRepresentation(String cloudId, String representationName, String version); void deleteRepresentation(String cloudId, String representationName, String version,
String key, String value); URI copyRepresentation(String cloudId, String representationName, String version); URI persistRepresentation(String cloudId, String representationName, String version); void grantPermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void revokePermissionsToVersion(String cloudId, String representationName, String version,
String userName, Permission permission); void permitVersion(String cloudId, String representationName, String version); List<Representation> getRepresentationsByRevision(
String cloudId, String representationName, String revisionName,
String revisionProviderId, String revisionTimestamp); List<Representation> getRepresentationsByRevision(
String cloudId,
String representationName,
String revisionName,
String revisionProviderId,
String revisionTimestamp,
String key,
String value); void close(); } |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.