2424import io .reactivex .rxjava3 .core .Single ;
2525import org .jspecify .annotations .Nullable ;
2626
27- /** Base interface for artifact services. */
28- public interface BaseArtifactService {
27+ /**
28+ * Base interface for artifact services.
29+ *
30+ * @deprecated Use {@link ArtifactService} instead.
31+ */
32+ @ Deprecated (forRemoval = true )
33+ public interface BaseArtifactService extends ArtifactService {
2934
3035 /**
3136 * Saves an artifact.
@@ -40,55 +45,40 @@ public interface BaseArtifactService {
4045 Single <Integer > saveArtifact (
4146 String appName , String userId , String sessionId , String filename , Part artifact );
4247
43- /** Saves an artifact. */
4448 default Single <Integer > saveArtifact (SessionKey sessionKey , String filename , Part artifact ) {
4549 return saveArtifact (
4650 sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename , artifact );
4751 }
4852
49- /**
50- * Saves an artifact and returns it with fileData if available.
51- *
52- * <p>Implementations should override this default method for efficiency, as the default performs
53- * two I/O operations (save then load).
54- *
55- * @param appName the app name
56- * @param userId the user ID
57- * @param sessionId the session ID
58- * @param filename the filename
59- * @param artifact the artifact to save
60- * @return the saved artifact with fileData if available.
61- */
6253 default Single <Part > saveAndReloadArtifact (
6354 String appName , String userId , String sessionId , String filename , Part artifact ) {
6455 return saveArtifact (appName , userId , sessionId , filename , artifact )
6556 .flatMap (version -> loadArtifact (appName , userId , sessionId , filename , version ).toSingle ());
6657 }
6758
68- /** Saves an artifact and returns it with fileData if available. */
59+ @ Override
6960 default Single <Part > saveAndReloadArtifact (
7061 SessionKey sessionKey , String filename , Part artifact ) {
7162 return saveAndReloadArtifact (
7263 sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename , artifact );
7364 }
7465
75- /** Loads the latest version of an artifact from the service. */
7666 default Maybe <Part > loadArtifact (
7767 String appName , String userId , String sessionId , String filename ) {
7868 return loadArtifact (appName , userId , sessionId , filename , /* version= */ (Integer ) null );
7969 }
8070
81- /** Loads the latest version of an artifact from the service. */
71+ @ Override
8272 default Maybe <Part > loadArtifact (SessionKey sessionKey , String filename ) {
8373 return loadArtifact (sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename );
8474 }
8575
86- /** Loads a specific version of an artifact from the service. */
8776 default Maybe <Part > loadArtifact (
8877 String appName , String userId , String sessionId , String filename , int version ) {
8978 return loadArtifact (appName , userId , sessionId , filename , Integer .valueOf (version ));
9079 }
9180
81+ @ Override
9282 default Maybe <Part > loadArtifact (SessionKey sessionKey , String filename , int version ) {
9383 return loadArtifact (
9484 sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename , version );
@@ -97,46 +87,24 @@ default Maybe<Part> loadArtifact(SessionKey sessionKey, String filename, int ver
9787 Maybe <Part > loadArtifact (
9888 String appName , String userId , String sessionId , String filename , @ Nullable Integer version );
9989
100- /**
101- * Lists all the artifact filenames within a session.
102- *
103- * @param appName the app name
104- * @param userId the user ID
105- * @param sessionId the session ID
106- * @return the list artifact response containing filenames
107- */
10890 Single <ListArtifactsResponse > listArtifactKeys (String appName , String userId , String sessionId );
10991
92+ @ Override
11093 default Single <ListArtifactsResponse > listArtifactKeys (SessionKey sessionKey ) {
11194 return listArtifactKeys (sessionKey .appName (), sessionKey .userId (), sessionKey .id ());
11295 }
11396
114- /**
115- * Deletes an artifact.
116- *
117- * @param appName the app name
118- * @param userId the user ID
119- * @param sessionId the session ID
120- * @param filename the filename
121- */
12297 Completable deleteArtifact (String appName , String userId , String sessionId , String filename );
12398
99+ @ Override
124100 default Completable deleteArtifact (SessionKey sessionKey , String filename ) {
125101 return deleteArtifact (sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename );
126102 }
127103
128- /**
129- * Lists all the versions (as revision IDs) of an artifact.
130- *
131- * @param appName the app name
132- * @param userId the user ID
133- * @param sessionId the session ID
134- * @param filename the artifact filename
135- * @return A list of integer version numbers.
136- */
137104 Single <ImmutableList <Integer >> listVersions (
138105 String appName , String userId , String sessionId , String filename );
139106
107+ @ Override
140108 default Single <ImmutableList <Integer >> listVersions (SessionKey sessionKey , String filename ) {
141109 return listVersions (sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename );
142110 }
0 commit comments