diff --git a/docs/developers-guide/uml.md b/docs/developers-guide/uml.md new file mode 100644 index 0000000000000000000000000000000000000000..c3666ae1af6d479a067cea973f12e996739251ce --- /dev/null +++ b/docs/developers-guide/uml.md @@ -0,0 +1,411 @@ +# Library UML-Diagram + +This is the full UML-diagram for the Unified-Ticketing library. + +!!! tip + You most likely can't read anything embedded to the site, + please open the graphics-URL in an extra tab and zoom in. + +```plantuml + +abstract Filter { + __ generics definition __ + T extends Ticket + F extends Filter + == + - {static} logger: Logger + + # {static} addToSet(\n\tfilterName: FilterNames,\n\tmap: Map<String, Object>,\n\tnewValue: String\n) + + __ instance definition __ + # setFilters: Map<String, Object> + + + constructor() + + + withAssigneeId(id: String): F + + withAssigneeName(name: String): F + + withDescriptionContain(substring: String): F + + withDescriptionMatch(regex: String): F + + withId(id: string): F + + isOpen(): F + + isClosed(): F + + withLabel(label: String): F + + setPage(page: int): F + + setPageSize(size: int): F + + withTitleContain(substring: String): F + + withTitleMatch(regex: String): F + + + {abstract} get(): List<T> +} + +enum FilterNames { + + ASSIGNEEID + + ASSIGNEENAME + + DESCRIPTION_CONTAIN + + DESCRIPTION_MATCH + + IDS + + LABELS + + OPEN + + PAGE + + PAGINATION + + TITLE_CONTAINS + + TITLE_MATCH +} + +class Logging { + - {static} handler: Handler + - {static} mainLogger: Logger + - {static} logger: Logger + + + {static} getLogger(name: String): Logger + + {static} setFormatter(formatter: Formatter): void + + {static} setLevel(level: Level): void + + {static} test(message: String): void +} + +class RegisteredSystems <<(S, orange)>> { + - {static} logger: Logger + - {static} instance: RegisteredSystems + + # {static} getInstance(): RegisteredSystems + + __ instance definition __ + + constructor() + + + gitlab(): GitlabTicketSystemBuilder +} + +abstract Ticket { + __ generics definition __ + T \t extends Ticket + TS \t extends TicketSystem + == + - {static} logger: Logger + + __ instance definition __ + # assignees: Set<TicketAssignee> + # description: String + # id: String + # labels: Set<String> + # open: boolean + # title: String + + # updatedFields: Set<String> + # parent: TS + + # constructor(parent: TS) + + + getAssignees(): Set<? extends TicketAssignee> + + {abstract} addAssignee(identifier: String): T + + clearAssignees(): T + + {asbtract} removeAssignee(identifier: String): T + + getDescription(): String + + setDescription(description: String): T + + getId(): String + + addLabel(label: String): T + + getLabels(): Set<String> + + setLabels(labels: Set<String>): T + + setLabels(labels: String[]): T + + isOpen(): boolean + + open(): T + + close(): T + + getParent(): TS + + getTitle(): String + + setTitle(title: String): T + + + {abstract} save(): T + + + equals(o: Object): boolean + + hashCode(): int + + toString(): String +} + +enum FieldNames { + + ASSIGNEES + + DESCRIPTION + + ID + + LABELS + + OPEN + + TITLE +} + +abstract TicketAssignee { + + email: String + + id: String + + fullName: String + + username: String + + # constructor(\n\temail: String,\n\tid: String,\n\tusername: String,\n\tfullName: String\n) + + + equals(o: Object): boolean + + hashCode(): int + + toString(): String +} + +abstract TicketBuilder { + __ generics definition __ + B \t extends TicketBuilder + T \t extends Ticket + TS \t extends TicketSystem + == + - {static} logger: Logger + + __ instance definition __ + # assignees: Set<String> + # description: String + # labels: Set<String> + # title: String + + # constructor(parent: TS) + + + assignees(identifiers: String...): B + + description(description: String): B + + labels(labels: Set<String>): B + + labels(labels: String[]): B + + title(title: String): B + + + {abstract} create(): T +} + +abstract TicketSystem { + __ generics definition __ + B \t extends TicketBuilder + F \t extends Filter + T \t extends Ticket + TS \t extends TicketSystem + == + - {static} logger: Logger + + + {static} fromBuilder(): RegisteredSystems + + {static} fromUri(uri: String): TicketSystem + + __ instance definition __ + + apiKey: String + + baseUrl: String + + password: String + + username: String + + # configuration: Map<String, String> + + + constructor() + + + config(option: ConfigurationOptions, value: String): TS + + config(option: ConfigurationOptions, value: boolean): TS + + getConfigTrue(option: ConfigurationOptions): boolean + + getConfigValue(option: ConfigurationOptions): Object + + {abstract} createTicket(): TB + + {abstract} find(): F + + {abstract} getTicketById(id: String): T + + {abstract} getTicketById(id: int): T + + + {abstract} hasAssigneeSupport(): boolean + + {abstract} hasDefaultPagination(): boolean + + {abstract} hasLabelSupport(): boolean + + {abstract} hasPaginationSupport(): boolean + + {abstract} hasReturnNullOnErrorSupport(): boolean +} + +enum ConfigurationOptions { + + RETURN_NULL_ON_ERROR +} + +abstract TicketSystemBuilder { + __ generics definition __ + B \t extends TicketBuilder + TS \t extends TicketSystem + == + - {static} logger: Logger + + __ instance definition __ + + baseUrl: String + + + withBaseUrl(url: String): B + + + {abstract} build(): TS +} + +' package connections +Filter *-- FilterNames: "inner class" +TicketSystem --> RegisteredSystems: "fromBuilder()" +TicketSystem *-- ConfigurationOptions: "inner class" +Ticket *-- FieldNames: "inner class" +Ticket --> Ticket: "save()" +Ticket o-- TicketSystem: "parent" +Ticket o-- TicketAssignee +TicketSystem --> TicketBuilder: "createTicket()" +TicketBuilder --> Ticket: "create()" + +class AssertionException { + + constructor() + + constructor(msg: String) + + constructor(msg: String, cause: Throwable) + + constructor(suppressed: Throwable) +} + +class DeserializationException { + + constructor() + + constructor(msg: String) + + constructor(msg: String, cause: Throwable) + + constructor(suppressed: Throwable) +} + +class HttpRequestException { + + constructor() + + constructor(msg: String) + + constructor(msg: String, cause: Throwable) + + constructor(suppressed: Throwable) +} + +class HttpResponseException { + + constructor() + + constructor(msg: String) + + constructor(msg: String, cause: Throwable) + + constructor(suppressed: Throwable) +} + +class SerializationException { + + constructor() + + constructor(msg: String) + + constructor(msg: String, cause: Throwable) + + constructor(suppressed: Throwable) +} + +class UnifiedticketingException { + + constructor() + + constructor(msg: String) + + constructor(msg: String, cause: Throwable) + + constructor(suppressed: Throwable) +} + +class UnsupportedFunctionException { + + constructor() + + constructor(msg: String) + + constructor(msg: String, cause: Throwable) + + constructor(suppressed: Throwable) +} + +AssertionException -[hidden]down- DeserializationException +DeserializationException -[hidden]down- HttpRequestException +HttpRequestException -[hidden]down- HttpResponseException +HttpResponseException -[hidden]down- SerializationException +SerializationException -[hidden]down- UnifiedticketingException +UnifiedticketingException -[hidden]down- UnsupportedFunctionException + +class GitlabFilter { + - {static} logger: Logger + + __ instance definition __ + # parent: GitlabTicketSystem + + # getHttpClient(): OkHttpClient + + get(): List<GitlabTicket> +} + +class GitlabTicket { + - {static} logger: Logger + + # {static} fromTicketResponse(\n\tparent: GitlabTicketSystem,\n\tresponse: GitlabTicketResponse\n): GitlabTicket + + __ instance definition __ + # constructor(parent: GitLabTicketSystem) + + + addAssignee(userId: String): GitlabTicket + + addAssignee(userId: int): GitlabTicket + + removeAssignee(userId: String): GitlabTicket + + removeAssignee(userId: int): GitlabTicket + + save(): GitlabTicket + + + deepEquals(o: Object): boolean +} + +class GitlabTicketAssignee { + # constructor(id: int, fullName: String, username: String) +} + +class GitlabTicketBuilder { + - {static} logger: Logger + + __ instant definition __ + # constructor(parent: GitlabTicketSystem) + + + assignees(identifiers: String...): GitlabTicketBuilder + + assignees(identifiers: int...): GitlabTicketBuilder + + # getHttpClient(): OkHttpClient + + create(): GitlabTicket +} + +class GitlabTicketResponse { + + assignees: List<Assignee> + + description: String + + iid: int + + labels: Set<String> + + state: String + + title: String + + # constructor() +} + +class Assignee { + + id: int + + name: String + + username: String +} + +class GitlabTicketSystem { + - {static} logger: Logger + + + {static} fromUri(uri: String): GitlabTicketSystem + + __ instance definition __ + # constructor() + + createTicket(): GitlabTicketBuilder + + find(): GitlabFilter + + getTicketById(id: String): GitlabTicket + + + hasAssigneeSupport(): boolean + + hasDefaultPagination(): boolean + + hasLabelSupport(): boolean + + hasPaginationSupport(): boolean + + hasReturnNullOnErrorSupport(): boolean +} + +class GitlabTicketSystemBuilder { + - {static} logger: Logger + + __ instance definition __ + # apiKey: String + # apiVersion: String + # projectId: int + # https: boolean + + + constructor() + + + withApiKey(apiKey: String): GitlabTicketSystemBuilder + + withHttp(): GitlabTicketSystemBuilder + + withHttps(): GitlabTicketSystemBuilder + + withProjectId(projectId: int): GitlabTicketSystemBuilder + + withProjectId(projectId: String): GitlabTicketSystemBuilder + + + build(): GitlabTicketSystem +} + +' package connections +GitlabFilter o-- GitlabTicketSystem: "parent" +GitlabTicketResponse o- Assignee: "inner class" +GitlabTicketSystemBuilder --> GitlabTicketSystem: "build()" +GitlabTicketSystem --> GitlabTicketBuilder: "createTicket()" +GitlabTicketBuilder --> GitlabTicket: "create()" +GitlabTicketSystem *-- GitlabTicketResponse + +' core package connections +GitlabFilter --|> Filter +GitlabTicket --|> Ticket +GitlabTicketAssignee --|> TicketAssignee +GitlabTicketBuilder --|> TicketBuilder +GitlabTicketSystem --|> TicketSystem +GitlabTicketSystemBuilder --|> TicketSystemBuilder + +RegisteredSystems --> GitlabTicketSystemBuilder: "gitlab()" + +``` diff --git a/mkdocs.yml b/mkdocs.yml index 2d458c4c52ed9d1eef8b5ee0a53d0aba66921b5d..e3df64ad89299ebcbbbb0dfdfc4e0ef76c128f24 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -30,6 +30,7 @@ nav: - Developers Guide: - Machine Setup: 'developers-guide/machine-setup.md' - Styleguide: 'developers-guide/styleguide.md' + - UML Diagram: 'developers-guide/uml.md' - Workflow: 'developers-guide/workflow.md' theme: