Skip to content

Commit

Permalink
reformat portability-spi-cloud directory (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
seehamrun authored Mar 6, 2018
1 parent edcbc05 commit bed68ab
Show file tree
Hide file tree
Showing 12 changed files with 462 additions and 430 deletions.
Empty file.
4 changes: 2 additions & 2 deletions portability-spi-cloud/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
dependencies {
compile project(':portability-types-transfer')
compile project(':portability-api-launcher')
compile ("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
compile("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
compile("com.google.auto.value:auto-value:${autoValueVersion}")
}

sourceSets {
main {
java {
// Includes generated AutoValue_ classes (build/classes/java) as source
srcDirs = ['build/classes/java','src/main/java']
srcDirs = ['build/classes/java', 'src/main/java']
}
}
test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@
import org.dataportabilityproject.api.launcher.AbstractExtension;
import org.dataportabilityproject.spi.cloud.storage.JobStore;

/**
* Cloud extensions implement this interface to be loaded in either a gateway or worker process.
*/
/** Cloud extensions implement this interface to be loaded in either a gateway or worker process. */
public interface CloudExtension extends AbstractExtension {

/**
* Returns the {@link JobStore} provided by the extension.
*/
JobStore getJobStore();

/** Returns the {@link JobStore} provided by the extension. */
JobStore getJobStore();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/
/**
* Defines the data portability client SPI. Extensions use this module to implement custom functionality for the system.
* Defines the data portability client SPI. Extensions use this module to implement custom
* functionality for the system.
*/
package org.dataportabilityproject.spi.cloud;
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
/**
* Object storage in buckets.
*
* This class is intended to be implemented by extensions that support storage in various back-end
* services.
* <p>This class is intended to be implemented by extensions that support storage in various
* back-end services.
*/
public interface BucketStore {
// Get an app credential (i.e. app key or secret). Each implementation may have its own convention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Crypto key management.
*
* This class is intended to be implemented by extensions that support key management in various
* <p>This class is intended to be implemented by extensions that support key management in various
* back-end services.
*/
public interface CryptoKeyStore {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,127 +11,121 @@
/**
* A store for {@link PortabilityJob}s.
*
* This class is intended to be implemented by extensions that support storage in various back-end
* services.
* <p>This class is intended to be implemented by extensions that support storage in various
* back-end services.
*/
public interface JobStore {

/**
* Inserts a new {@link LegacyPortabilityJob} keyed by its job ID in the store.
*
* <p>To update an existing {@link LegacyPortabilityJob} instead, use {@link #update}.
*
* @throws IOException if a job already exists for {@code job}'s ID, or if there was a different
* problem inserting the job.
*/
@Deprecated
default void create(UUID jobId, LegacyPortabilityJob job) throws IOException {
throw new UnsupportedOperationException(
"This shouldn't be called any more from the new, modular code");
}

/**
* Inserts a new {@link PortabilityJob} keyed by its job ID in the store.
*
* <p>To update an existing {@link PortabilityJob} instead, use {@link #update}.
*
* @throws IOException if a job already exists for {@code job}'s ID, or if there was a different
* problem inserting the job.
*/
void createJob(UUID jobId, PortabilityJob job) throws IOException;

/**
* Atomically updates the entry for {@code job}'s ID to {@code job}, and verifies that it
* previously existed in {@code previousState}.
*
* @throws IOException if the job was not in the expected state in the store, or there was
* another problem updating it.
*/
@Deprecated
default void update(UUID jobId, LegacyPortabilityJob job, JobAuthorization.State previousState)
throws IOException {
throw new UnsupportedOperationException(
"This shouldn't be called any more from the new, modular code");
}

/**
* Atomically updates the entry for {@code job}'s ID to {@code job}.
*
* @throws IOException if the job was not in the expected state in the store, or there was
* another problem updating it.
*/
void updateJob(UUID jobId, PortabilityJob job) throws IOException;

/**
* Removes the {@link LegacyPortabilityJob} in the store keyed by {@code jobId}.
*
* @throws IOException if the job doesn't exist, or there was a different problem deleting it.
*/
void remove(UUID jobId) throws IOException;

/**
* Returns the job for the id or null if not found.
*
* @param jobId the job id
*/
PortabilityJob findJob(UUID jobId);

/**
* Finds the {@link LegacyPortabilityJob} keyed by {@code jobId} in the store, or null if none
* found.
*/
@Deprecated
default LegacyPortabilityJob find(UUID jobId) {
throw new UnsupportedOperationException(
"This shouldn't be called any more from the new, modular code");
}

/**
* Finds the {@link LegacyPortabilityJob} keyed by {@code jobId} in the store, and verify it is
* in state {@code jobState}.
*/
@Deprecated
default LegacyPortabilityJob find(UUID jobId, JobAuthorization.State jobState) {
throw new UnsupportedOperationException(
"This shouldn't be called any more from the new, modular code");
}

/**
* Gets the ID of the first {@link LegacyPortabilityJob} in state {@code jobState} in the store,
* or null if none found.
*/
UUID findFirst(JobAuthorization.State jobState);

default <T extends DataModel> void create(UUID jobId, T model) {
throw new UnsupportedOperationException();
}

/**
* Updates the given model instance associated with a job.
*/
default <T extends DataModel> void update(UUID jobId, T model) {
throw new UnsupportedOperationException();
}

/**
* Returns a model instance for the id of the given type or null if not found.
*/
default <T extends DataModel> T findData(Class<T> type, UUID id) {
throw new UnsupportedOperationException();
}

/**
* Removes the data model instance.
*/
default void removeData(UUID id) {
throw new UnsupportedOperationException();
}

default void create(UUID jobId, String key, InputStream stream) {
throw new UnsupportedOperationException();
}

default InputStream getStream(UUID jobId, String key) {
throw new UnsupportedOperationException();
}
/**
* Inserts a new {@link LegacyPortabilityJob} keyed by its job ID in the store.
*
* <p>To update an existing {@link LegacyPortabilityJob} instead, use {@link #update}.
*
* @throws IOException if a job already exists for {@code job}'s ID, or if there was a different
* problem inserting the job.
*/
@Deprecated
default void create(UUID jobId, LegacyPortabilityJob job) throws IOException {
throw new UnsupportedOperationException(
"This shouldn't be called any more from the new, modular code");
}

/**
* Inserts a new {@link PortabilityJob} keyed by its job ID in the store.
*
* <p>To update an existing {@link PortabilityJob} instead, use {@link #update}.
*
* @throws IOException if a job already exists for {@code job}'s ID, or if there was a different
* problem inserting the job.
*/
void createJob(UUID jobId, PortabilityJob job) throws IOException;

/**
* Atomically updates the entry for {@code job}'s ID to {@code job}, and verifies that it
* previously existed in {@code previousState}.
*
* @throws IOException if the job was not in the expected state in the store, or there was another
* problem updating it.
*/
@Deprecated
default void update(UUID jobId, LegacyPortabilityJob job, JobAuthorization.State previousState)
throws IOException {
throw new UnsupportedOperationException(
"This shouldn't be called any more from the new, modular code");
}

/**
* Atomically updates the entry for {@code job}'s ID to {@code job}.
*
* @throws IOException if the job was not in the expected state in the store, or there was another
* problem updating it.
*/
void updateJob(UUID jobId, PortabilityJob job) throws IOException;

/**
* Removes the {@link LegacyPortabilityJob} in the store keyed by {@code jobId}.
*
* @throws IOException if the job doesn't exist, or there was a different problem deleting it.
*/
void remove(UUID jobId) throws IOException;

/**
* Returns the job for the id or null if not found.
*
* @param jobId the job id
*/
PortabilityJob findJob(UUID jobId);

/**
* Finds the {@link LegacyPortabilityJob} keyed by {@code jobId} in the store, or null if none
* found.
*/
@Deprecated
default LegacyPortabilityJob find(UUID jobId) {
throw new UnsupportedOperationException(
"This shouldn't be called any more from the new, modular code");
}

/**
* Finds the {@link LegacyPortabilityJob} keyed by {@code jobId} in the store, and verify it is in
* state {@code jobState}.
*/
@Deprecated
default LegacyPortabilityJob find(UUID jobId, JobAuthorization.State jobState) {
throw new UnsupportedOperationException(
"This shouldn't be called any more from the new, modular code");
}

/**
* Gets the ID of the first {@link LegacyPortabilityJob} in state {@code jobState} in the store,
* or null if none found.
*/
UUID findFirst(JobAuthorization.State jobState);

default <T extends DataModel> void create(UUID jobId, T model) {
throw new UnsupportedOperationException();
}

/** Updates the given model instance associated with a job. */
default <T extends DataModel> void update(UUID jobId, T model) {
throw new UnsupportedOperationException();
}

/** Returns a model instance for the id of the given type or null if not found. */
default <T extends DataModel> T findData(Class<T> type, UUID id) {
throw new UnsupportedOperationException();
}

/** Removes the data model instance. */
default void removeData(UUID id) {
throw new UnsupportedOperationException();
}

default void create(UUID jobId, String key, InputStream stream) {
throw new UnsupportedOperationException();
}

default InputStream getStream(UUID jobId, String key) {
throw new UnsupportedOperationException();
}
}
Loading

0 comments on commit bed68ab

Please sign in to comment.