-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SHIBUI-704 Implemented schema definition
- Loading branch information
Showing
4 changed files
with
823 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
ui/src/app/metadata/domain/model/providers/dynamic-http-metadata-provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { BaseMetadataProvider } from './base-metadata-provider'; | ||
|
||
export interface DynamicHttpMetadataProvider extends BaseMetadataProvider { | ||
id: string; | ||
metadataURL: string; | ||
dynamicMetadataResolverAttributes: DynamicMetadataResolverAttributes; | ||
httpMetadataResolverAttributes: HttpMetadataResolverAttributes; | ||
maxConnectionsTotal: number; | ||
maxConnectionsPerRoute: number; | ||
supportedContentTypes: string[]; | ||
} | ||
|
||
export interface DynamicMetadataResolverAttributes { | ||
refreshDelayFactor: number; | ||
minCacheDuration: string; | ||
maxCacheDuration: string; | ||
maxIdleEntityData: string; | ||
removeIdleEntityData: boolean; | ||
cleanupTaskInterval: string; | ||
|
||
persistentCacheManagerRef: string; | ||
persistentCacheManagerDirectory: string; | ||
persistentCacheKeyGeneratorRef: string; | ||
initializeFromPersistentCacheInBackground: boolean; | ||
backgroundInitializationFromCacheDelay: string; | ||
initializationFromCachePredicateRef: string; | ||
} | ||
|
||
export interface HttpMetadataResolverAttributes { | ||
httpClientRef; | ||
connectionRequestTimeout: string; | ||
connectionTimeout: string; | ||
socketTimeout: string; | ||
disregardTLSCertificate: boolean; | ||
tlsTrustEngineRef: string; | ||
httpClientSecurityParametersRef: string; | ||
proxyHost: string; | ||
proxyPort: string; | ||
proxyUser: string; | ||
proxyPassword: string; | ||
httpCaching: HttpCachingType; | ||
httpCacheDirectory: string; | ||
httpMaxCacheEntries: number; | ||
httpMaxCacheEntrySize: number; | ||
} | ||
|
||
export enum HttpCachingType { | ||
NONE = 'none', | ||
FILE = 'file', | ||
MEMORY = 'memory' | ||
} |
133 changes: 133 additions & 0 deletions
133
ui/src/app/metadata/provider/model/dynamic-http.provider.form.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import { Wizard } from '../../../wizard/model'; | ||
import { DynamicHttpMetadataProvider } from '../../domain/model/providers/dynamic-http-metadata-provider'; | ||
import { BaseMetadataProviderEditor } from './base.provider.form'; | ||
import UriValidator from '../../../shared/validation/uri.validator'; | ||
|
||
export const DynamicHttpMetadataProviderWizard: Wizard<DynamicHttpMetadataProvider> = { | ||
...BaseMetadataProviderEditor, | ||
label: 'DynamicHttpMetadataProvider', | ||
type: 'DynamicHttpMetadataResolver', | ||
getValidators(namesList: string[] = [], xmlIdList: string[] = []): any { | ||
const validators = BaseMetadataProviderEditor.getValidators(namesList); | ||
validators['/xmlId'] = (value, property, form) => { | ||
const err = xmlIdList.indexOf(value) > -1 ? { | ||
code: 'INVALID_ID', | ||
path: `#${property.path}`, | ||
message: 'message.id-unique', | ||
params: [value] | ||
} : null; | ||
return err; | ||
}; | ||
validators['/metadataURL'] = (value, property, form) => { | ||
return !UriValidator.isUri(value) ? { | ||
code: 'INVALID_URI', | ||
path: `#${property.path}`, | ||
message: 'message.uri-valid-format', | ||
params: [value] | ||
} : null; | ||
}; | ||
|
||
return validators; | ||
}, | ||
steps: [ | ||
{ | ||
id: 'common', | ||
label: 'label.common-attributes', | ||
index: 2, | ||
initialValues: [], | ||
schema: 'assets/schema/provider/dynamic-http.schema.json', | ||
fields: [ | ||
'xmlId', | ||
'metadataURL', | ||
'requireValidMetadata', | ||
'failFastInitialization' | ||
] | ||
}, | ||
{ | ||
id: 'dynamic', | ||
label: 'label.dynamic-attributes', | ||
index: 3, | ||
initialValues: [], | ||
schema: 'assets/schema/provider/dynamic-http.schema.json', | ||
fields: [ | ||
'dynamicMetadataResolverAttributes' | ||
] | ||
}, | ||
{ | ||
id: 'plugins', | ||
label: 'label.metadata-filter-plugins', | ||
index: 4, | ||
initialValues: [ | ||
{ key: 'metadataFilters', value: [] } | ||
], | ||
schema: 'assets/schema/provider/dynamic-http.schema.json', | ||
fields: [ | ||
'metadataFilters' | ||
] | ||
}, | ||
{ | ||
id: 'summary', | ||
label: 'label.finished', | ||
index: 5, | ||
initialValues: [], | ||
schema: 'assets/schema/provider/dynamic-http.schema.json', | ||
fields: [ | ||
'enabled' | ||
] | ||
} | ||
] | ||
}; | ||
|
||
|
||
export const DynamicHttpMetadataProviderEditor: Wizard<DynamicHttpMetadataProvider> = { | ||
...DynamicHttpMetadataProviderWizard, | ||
steps: [ | ||
{ | ||
id: 'common', | ||
label: 'label.common-attributes', | ||
index: 1, | ||
initialValues: [], | ||
schema: 'assets/schema/provider/dynamic-http.schema.json', | ||
fields: [ | ||
'enabled', | ||
'xmlId', | ||
'metadataURL', | ||
'requireValidMetadata', | ||
'failFastInitialization' | ||
] | ||
}, | ||
{ | ||
id: 'dynamic', | ||
label: 'label.dynamic-attributes', | ||
index: 3, | ||
initialValues: [], | ||
schema: 'assets/schema/provider/dynamic-http.schema.json', | ||
fields: [ | ||
'dynamicMetadataResolverAttributes' | ||
] | ||
}, | ||
{ | ||
id: 'plugins', | ||
label: 'label.metadata-filter-plugins', | ||
index: 4, | ||
initialValues: [ | ||
{ key: 'metadataFilters', value: [] } | ||
], | ||
schema: 'assets/schema/provider/dynamic-http.schema.json', | ||
fields: [ | ||
'metadataFilters' | ||
] | ||
}, | ||
{ | ||
id: 'advanced', | ||
label: 'label.advanced-settings', | ||
index: 4, | ||
initialValues: [], | ||
locked: true, | ||
schema: 'assets/schema/provider/filebacked-http-advanced.schema.json', | ||
fields: [ | ||
'httpMetadataResolverAttributes' | ||
] | ||
} | ||
] | ||
}; |
Oops, something went wrong.