[ISSUE-114] Add comprehensive JavaDoc and documentation to CFTunnels #115

Merged
hitanshu merged 14 commits from Dave/CFTunnels:ISSUE-114 into main 2026-04-18 13:28:28 +00:00
Showing only changes of commit 6bf138ea7a - Show all commits

View File

@ -8,6 +8,26 @@ import lombok.Setter;
import java.util.UUID;
/**
* JPA Entity representing a Cloudflare Tunnel configuration.
*
* <p>This entity stores the locally cached configuration of a Cloudflare Tunnel,
* linking the tunnel's unique identifier from Cloudflare with its local
* environment name for easier reference and management.</p>
*
* <p>The entity is uniquely constrained by tunnel ID and environment name,
* ensuring only one configuration exists per tunnel per environment.</p>
*
* <p><b>Database Table:</b> {@code tunnels}</p>
*
* <p><b>Relationships:</b></p>
* <ul>
* <li>One Tunnel has many Mappings (via tunnel_id foreign key)</li>
* </ul>
*
* @see Mapping
* @see Request
*/
@Entity
@Getter
@Setter
@ -16,13 +36,32 @@ import java.util.UUID;
@Table(name = "tunnels")
public class Tunnel {
/**
* Unique identifier for the tunnel (UUID).
*
* <p>This corresponds to the Cloudflare-assigned tunnel ID
* and serves as the primary key for this entity.</p>
*/
@Id
@Column(columnDefinition = "uuid", insertable = false, updatable = false, nullable = false)
private UUID id;
/**
* Environment name associated with this tunnel configuration.
*
* <p>Examples: "production", "staging", "development"</p>
* <p>Each tunnel can be configured for multiple environments.</p>
*/
@Column(length = 10, unique = true, nullable = false)
private String environment;
/**
* Display name of the tunnel as configured in Cloudflare.
*
* <p>This is the user-friendly name assigned to the tunnel
* when it was created in Cloudflare Zero Trust Dashboard
* or via the Cloudflare API.</p>
*/
@Column(length = 50, unique = true, nullable = false)
private String name;
}