2525import org .jspecify .annotations .Nullable ;
2626
2727/** Base interface for artifact services. */
28- public interface BaseArtifactService {
28+ @ Deprecated (forRemoval = true )
29+ public interface BaseArtifactService extends ArtifactService {
2930
3031 /**
3132 * Saves an artifact.
@@ -40,55 +41,40 @@ public interface BaseArtifactService {
4041 Single <Integer > saveArtifact (
4142 String appName , String userId , String sessionId , String filename , Part artifact );
4243
43- /** Saves an artifact. */
4444 default Single <Integer > saveArtifact (SessionKey sessionKey , String filename , Part artifact ) {
4545 return saveArtifact (
4646 sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename , artifact );
4747 }
4848
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- */
6249 default Single <Part > saveAndReloadArtifact (
6350 String appName , String userId , String sessionId , String filename , Part artifact ) {
6451 return saveArtifact (appName , userId , sessionId , filename , artifact )
6552 .flatMap (version -> loadArtifact (appName , userId , sessionId , filename , version ).toSingle ());
6653 }
6754
68- /** Saves an artifact and returns it with fileData if available. */
55+ @ Override
6956 default Single <Part > saveAndReloadArtifact (
7057 SessionKey sessionKey , String filename , Part artifact ) {
7158 return saveAndReloadArtifact (
7259 sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename , artifact );
7360 }
7461
75- /** Loads the latest version of an artifact from the service. */
7662 default Maybe <Part > loadArtifact (
7763 String appName , String userId , String sessionId , String filename ) {
7864 return loadArtifact (appName , userId , sessionId , filename , /* version= */ (Integer ) null );
7965 }
8066
81- /** Loads the latest version of an artifact from the service. */
67+ @ Override
8268 default Maybe <Part > loadArtifact (SessionKey sessionKey , String filename ) {
8369 return loadArtifact (sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename );
8470 }
8571
86- /** Loads a specific version of an artifact from the service. */
8772 default Maybe <Part > loadArtifact (
8873 String appName , String userId , String sessionId , String filename , int version ) {
8974 return loadArtifact (appName , userId , sessionId , filename , Integer .valueOf (version ));
9075 }
9176
77+ @ Override
9278 default Maybe <Part > loadArtifact (SessionKey sessionKey , String filename , int version ) {
9379 return loadArtifact (
9480 sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename , version );
@@ -97,46 +83,24 @@ default Maybe<Part> loadArtifact(SessionKey sessionKey, String filename, int ver
9783 Maybe <Part > loadArtifact (
9884 String appName , String userId , String sessionId , String filename , @ Nullable Integer version );
9985
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- */
10886 Single <ListArtifactsResponse > listArtifactKeys (String appName , String userId , String sessionId );
10987
88+ @ Override
11089 default Single <ListArtifactsResponse > listArtifactKeys (SessionKey sessionKey ) {
11190 return listArtifactKeys (sessionKey .appName (), sessionKey .userId (), sessionKey .id ());
11291 }
11392
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- */
12293 Completable deleteArtifact (String appName , String userId , String sessionId , String filename );
12394
95+ @ Override
12496 default Completable deleteArtifact (SessionKey sessionKey , String filename ) {
12597 return deleteArtifact (sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename );
12698 }
12799
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- */
137100 Single <ImmutableList <Integer >> listVersions (
138101 String appName , String userId , String sessionId , String filename );
139102
103+ @ Override
140104 default Single <ImmutableList <Integer >> listVersions (SessionKey sessionKey , String filename ) {
141105 return listVersions (sessionKey .appName (), sessionKey .userId (), sessionKey .id (), filename );
142106 }
0 commit comments