Skip to content

Commit c685100

Browse files
committed
docs: add javadoc
1 parent 1b21fe6 commit c685100

File tree

1 file changed

+34
-0
lines changed
  • operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent

1 file changed

+34
-0
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/DependentResource.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,47 @@
55
import io.fabric8.kubernetes.api.model.HasMetadata;
66
import io.javaoperatorsdk.operator.api.reconciler.Context;
77

8+
/**
9+
* An interface to implement and provide dependent resource support.
10+
*
11+
* @param <R> the dependent resource type
12+
* @param <P> the associated primary resource type
13+
*/
814
public interface DependentResource<R, P extends HasMetadata> {
15+
16+
/**
17+
* Reconciles the dependent resource given the desired primary state
18+
*
19+
* @param primary the primary resource for which we want to reconcile the dependent state
20+
* @param context {@link Context} providing useful contextual information
21+
* @return a {@link ReconcileResult} providing information about the reconciliation result
22+
*/
923
ReconcileResult<R> reconcile(P primary, Context<P> context);
1024

25+
/**
26+
* Retrieves the dependent resource associated with the specified primary one
27+
*
28+
* @param primaryResource the primary resource for which we want to retrieve the secondary
29+
* resource
30+
* @return an {@link Optional} containing the secondary resource or {@link Optional#empty()} if it
31+
* doesn't exist
32+
*/
1133
Optional<R> getResource(P primaryResource);
1234

35+
/**
36+
* Retrieves the resource type associated with this DependentResource
37+
*
38+
* @return the resource type associated with this DependentResource
39+
*/
1340
Class<R> resourceType();
1441

42+
/**
43+
* Computes a default name for the specified DependentResource class
44+
*
45+
* @param dependentResourceClass the DependentResource class for which we want to compute a
46+
* default name
47+
* @return the default name for the specified DependentResource class
48+
*/
1549
@SuppressWarnings("rawtypes")
1650
static String defaultNameFor(Class<? extends DependentResource> dependentResourceClass) {
1751
return dependentResourceClass.getCanonicalName();

0 commit comments

Comments
 (0)