From 3258643d72abf7266eab32dd676307837d6f96d8 Mon Sep 17 00:00:00 2001 From: tharindu1st Date: Wed, 15 Nov 2023 09:02:37 +0530 Subject: [PATCH] remove unused code --- adapter/internal/adapter/adapter.go | 5 - adapter/internal/discovery/xds/marshaller.go | 181 --- adapter/internal/discovery/xds/server.go | 125 +- .../discovery/protocol/server/v3/server.go | 55 - common-controller/go.mod | 2 +- .../internal/cache/subscriptionDataStore.go | 6 +- .../internal/operator/constant/constant.go | 26 +- .../controllers/cp/application_controller.go | 28 +- .../cp/applicationmapping_controller.go | 14 +- .../controllers/cp/subscription_controller.go | 6 +- .../internal/server/event_server.go | 5 +- .../internal/utils/event_utils.go | 72 +- .../apk/enforcer/config/ConfigHolder.java | 17 +- .../RevokedTokenDiscoveryClient.java | 223 --- .../scheduler/XdsSchedulerManager.java | 35 +- .../discovery/subscription/APIOrBuilder.java | 46 - .../ApplicationKeyMappingList.java | 778 --------- .../ApplicationKeyMappingListOrBuilder.java | 33 - .../ApplicationKeyMappingListProto.java | 58 - .../subscription/ApplicationList.java | 778 --------- .../ApplicationListOrBuilder.java | 33 - .../subscription/ApplicationListProto.java | 57 - .../subscription/ApplicationMappingList.java | 778 --------- .../ApplicationMappingListOrBuilder.java | 33 - .../ApplicationMappingListProto.java | 57 - .../subscription/ApplicationPolicy.java | 831 ---------- .../subscription/ApplicationPolicyList.java | 778 --------- .../ApplicationPolicyListOrBuilder.java | 33 - .../ApplicationPolicyListProto.java | 57 - .../ApplicationPolicyOrBuilder.java | 45 - .../subscription/ApplicationPolicyProto.java | 54 - .../AuthenticationOptionOrBuilder.java | 57 - .../discovery/subscription/Environment.java | 833 ---------- .../subscription/EnvironmentOrBuilder.java | 45 - .../discovery/subscription/OAuth2.java | 770 --------- .../subscription/OAuth2OrBuilder.java | 33 - .../subscription/SecuritySchemes.java | 607 ------- .../SecuritySchemesOrBuilder.java | 24 - .../subscription/SubscriptionList.java | 778 --------- .../SubscriptionListOrBuilder.java | 33 - .../subscription/SubscriptionListProto.java | 57 - .../subscription/SubscriptionPolicy.java | 1429 ----------------- .../subscription/SubscriptionPolicyList.java | 778 --------- .../SubscriptionPolicyListOrBuilder.java | 33 - .../SubscriptionPolicyListProto.java | 58 - .../SubscriptionPolicyOrBuilder.java | 99 -- .../subscription/SubscriptionPolicyProto.java | 58 - .../wso2/apk/enforcer/models/Application.java | 28 + .../apk/enforcer/models/SubscribedAPI.java | 9 + .../jwt/validator/RevokedJWTDataHolder.java | 3 - .../subscription/EventingGrpcClient.java | 172 ++ .../subscription/SubscriptionDataStore.java | 23 +- .../SubscriptionDataStoreImpl.java | 138 +- .../org/wso2/apk/enforcer/util/GRPCUtils.java | 6 + .../org/wso2/apk/enforcer/util/TLSUtils.java | 28 + .../gateway-runtime-deployment.yaml | 3 +- helm-charts/values.yaml | 4 +- 57 files changed, 532 insertions(+), 10823 deletions(-) delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/RevokedTokenDiscoveryClient.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/APIOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicy.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/AuthenticationOptionOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Environment.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EnvironmentOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2OrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemes.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemesOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicy.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyList.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListProto.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyOrBuilder.java delete mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyProto.java create mode 100644 gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java diff --git a/adapter/internal/adapter/adapter.go b/adapter/internal/adapter/adapter.go index 56621e1d8..7330f0835 100644 --- a/adapter/internal/adapter/adapter.go +++ b/adapter/internal/adapter/adapter.go @@ -29,7 +29,6 @@ import ( "github.com/wso2/apk/adapter/internal/operator" apiservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/api" configservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/config" - keymanagerservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/keymgt" subscriptionservice "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/subscription" wso2_server "github.com/wso2/apk/adapter/pkg/discovery/protocol/server/v3" "github.com/wso2/apk/adapter/pkg/health" @@ -120,10 +119,6 @@ func runManagementServer(conf *config.Config, server xdsv3.Server, enforcerServe configservice.RegisterConfigDiscoveryServiceServer(grpcServer, enforcerServer) apiservice.RegisterApiDiscoveryServiceServer(grpcServer, enforcerServer) subscriptionservice.RegisterApiListDiscoveryServiceServer(grpcServer, enforcerAPIDsSrv) - subscriptionservice.RegisterApplicationPolicyDiscoveryServiceServer(grpcServer, enforcerAppPolicyDsSrv) - subscriptionservice.RegisterSubscriptionPolicyDiscoveryServiceServer(grpcServer, enforcerSubPolicyDsSrv) - keymanagerservice.RegisterKMDiscoveryServiceServer(grpcServer, enforcerKeyManagerDsSrv) - keymanagerservice.RegisterRevokedTokenDiscoveryServiceServer(grpcServer, enforcerRevokedTokenDsSrv) subscriptionservice.RegisterJWTIssuerDiscoveryServiceServer(grpcServer, enforcerJwtIssuerDsSrv) // register health service healthservice.RegisterHealthServer(grpcServer, &health.Server{}) diff --git a/adapter/internal/discovery/xds/marshaller.go b/adapter/internal/discovery/xds/marshaller.go index dadd39dec..fac287266 100644 --- a/adapter/internal/discovery/xds/marshaller.go +++ b/adapter/internal/discovery/xds/marshaller.go @@ -18,14 +18,11 @@ package xds import ( - "encoding/json" - "fmt" "strconv" "github.com/wso2/apk/adapter/config" logger "github.com/wso2/apk/adapter/internal/loggers" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/config/enforcer" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/keymgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" "github.com/wso2/apk/adapter/pkg/eventhub/types" ) @@ -33,16 +30,6 @@ import ( var ( // APIListMap has the following mapping label -> apiUUID -> API (Metadata) APIListMap map[string]map[string]*subscription.APIs - // SubscriptionMap contains the subscriptions recieved from API Manager Control Plane - SubscriptionMap map[int32]*subscription.Subscription - // ApplicationMap contains the applications recieved from API Manager Control Plane - ApplicationMap map[string]*subscription.Application - // ApplicationKeyMappingMap contains the application key mappings recieved from API Manager Control Plane - ApplicationKeyMappingMap map[string]*subscription.ApplicationKeyMapping - // ApplicationPolicyMap contains the application policies recieved from API Manager Control Plane - ApplicationPolicyMap map[int32]*subscription.ApplicationPolicy - // SubscriptionPolicyMap contains the subscription policies recieved from API Manager Control Plane - SubscriptionPolicyMap map[int32]*subscription.SubscriptionPolicy ) // EventType is a enum to distinguish Create, Update and Delete Events @@ -188,30 +175,6 @@ func marshalAnalyticsPublishers(config config.Config) []*enforcer.AnalyticsPubli return resolvedAnalyticsPublishers } -// marshalSubscriptionMapToList converts the data into SubscriptionList proto type -func marshalSubscriptionMapToList(subscriptionMap map[int32]*subscription.Subscription) *subscription.SubscriptionList { - subscriptions := []*subscription.Subscription{} - for _, sub := range subscriptionMap { - subscriptions = append(subscriptions, sub) - } - - return &subscription.SubscriptionList{ - List: subscriptions, - } -} - -// marshalApplicationMapToList converts the data into ApplicationList proto type -func marshalApplicationMapToList(appMap map[string]*subscription.Application) *subscription.ApplicationList { - applications := []*subscription.Application{} - for _, app := range appMap { - applications = append(applications, app) - } - - return &subscription.ApplicationList{ - List: applications, - } -} - // marshalAPIListMapToList converts the data into APIList proto type func marshalAPIListMapToList(apiMap map[string]*subscription.APIs) *subscription.APIList { apis := []*subscription.APIs{} @@ -224,125 +187,6 @@ func marshalAPIListMapToList(apiMap map[string]*subscription.APIs) *subscription } } -// marshalApplicationPolicyMapToList converts the data into ApplicationPolicyList proto type -func marshalApplicationPolicyMapToList(appPolicyMap map[int32]*subscription.ApplicationPolicy) *subscription.ApplicationPolicyList { - applicationPolicies := []*subscription.ApplicationPolicy{} - for _, policy := range appPolicyMap { - applicationPolicies = append(applicationPolicies, policy) - } - - return &subscription.ApplicationPolicyList{ - List: applicationPolicies, - } -} - -// marshalSubscriptionPolicyMapToList converts the data into SubscriptionPolicyList proto type -func marshalSubscriptionPolicyMapToList(subPolicyMap map[int32]*subscription.SubscriptionPolicy) *subscription.SubscriptionPolicyList { - subscriptionPolicies := []*subscription.SubscriptionPolicy{} - - for _, policy := range subPolicyMap { - subscriptionPolicies = append(subscriptionPolicies, policy) - } - - return &subscription.SubscriptionPolicyList{ - List: subscriptionPolicies, - } -} - -// marshalKeyMappingMapToList converts the data into ApplicationKeyMappingList proto type -func marshalKeyMappingMapToList(keyMappingMap map[string]*subscription.ApplicationKeyMapping) *subscription.ApplicationKeyMappingList { - applicationKeyMappings := []*subscription.ApplicationKeyMapping{} - - for _, keyMapping := range keyMappingMap { - // TODO: (VirajSalaka) tenant domain check missing - applicationKeyMappings = append(applicationKeyMappings, keyMapping) - } - - return &subscription.ApplicationKeyMappingList{ - List: applicationKeyMappings, - } -} - -// MarshalKeyManager converts the data into KeyManager proto type -func MarshalKeyManager(keyManager *types.KeyManager) *keymgt.KeyManagerConfig { - configList, err := json.Marshal(keyManager.Configuration) - configuration := string(configList) - if err == nil { - newKeyManager := &keymgt.KeyManagerConfig{ - Name: keyManager.Name, - Type: keyManager.Type, - Enabled: keyManager.Enabled, - TenantDomain: keyManager.TenantDomain, - Configuration: configuration, - } - return newKeyManager - } - logger.LoggerXds.Debugf("Error happens while marshaling key manager data for " + fmt.Sprint(keyManager.Name)) - return nil -} - -// MarshalMultipleApplicationPolicies is used to update the applicationPolicies during the startup where -// multiple application policies are pulled at once. And then it returns the ApplicationPolicyList. -func MarshalMultipleApplicationPolicies(policies *types.ApplicationPolicyList) *subscription.ApplicationPolicyList { - resourceMap := make(map[int32]*subscription.ApplicationPolicy) - for item := range policies.List { - policy := policies.List[item] - appPolicy := marshalApplicationPolicy(&policy) - resourceMap[policy.ID] = appPolicy - logger.LoggerXds.Infof("appPolicy Entry is added : %v", appPolicy) - } - ApplicationPolicyMap = resourceMap - return marshalApplicationPolicyMapToList(ApplicationPolicyMap) -} - -// MarshalApplicationPolicyEventAndReturnList handles the Application Policy Event corresponding to the event received -// from message broker. And then it returns the ApplicationPolicyList. -func MarshalApplicationPolicyEventAndReturnList(policy *types.ApplicationPolicy, eventType EventType) *subscription.ApplicationPolicyList { - if eventType == DeleteEvent { - delete(ApplicationPolicyMap, policy.ID) - logger.LoggerXds.Infof("Application Policy: %s is deleted.", policy.Name) - } else { - appPolicy := marshalApplicationPolicy(policy) - ApplicationPolicyMap[policy.ID] = appPolicy - if eventType == UpdateEvent { - logger.LoggerSvcDiscovery.Infof("Application Policy: %s is updated.", appPolicy.Name) - } else { - logger.LoggerSvcDiscovery.Infof("Application Policy: %s is added.", appPolicy.Name) - } - } - return marshalApplicationPolicyMapToList(ApplicationPolicyMap) -} - -// MarshalMultipleSubscriptionPolicies is used to update the subscriptionPolicies during the startup where -// multiple subscription policies are pulled at once. And then it returns the SubscriptionPolicyList. -func MarshalMultipleSubscriptionPolicies(policies *types.SubscriptionPolicyList) *subscription.SubscriptionPolicyList { - resourceMap := make(map[int32]*subscription.SubscriptionPolicy) - for item := range policies.List { - policy := policies.List[item] - resourceMap[policy.ID] = marshalSubscriptionPolicy(&policy) - } - SubscriptionPolicyMap = resourceMap - return marshalSubscriptionPolicyMapToList(SubscriptionPolicyMap) -} - -// MarshalSubscriptionPolicyEventAndReturnList handles the Subscription Policy Event corresponding to the event received -// from message broker. And then it returns the subscriptionPolicyList. -func MarshalSubscriptionPolicyEventAndReturnList(policy *types.SubscriptionPolicy, eventType EventType) *subscription.SubscriptionPolicyList { - if eventType == DeleteEvent { - delete(ApplicationPolicyMap, policy.ID) - logger.LoggerXds.Infof("Application Policy: %s is deleted.", policy.Name) - } else { - subPolicy := marshalSubscriptionPolicy(policy) - SubscriptionPolicyMap[policy.ID] = subPolicy - if eventType == UpdateEvent { - logger.LoggerSvcDiscovery.Infof("Subscription Policy: %s is updated.", subPolicy.Name) - } else { - logger.LoggerSvcDiscovery.Infof("Subscription Policy: %s is added.", subPolicy.Name) - } - } - return marshalSubscriptionPolicyMapToList(SubscriptionPolicyMap) -} - // MarshalAPIMetataAndReturnList updates the internal APIListMap and returns the XDS compatible APIList. // apiList is the internal APIList object (For single API, this would contain a List with just one API) // initialAPIUUIDListMap is assigned during startup when global adapter is associated. This would be empty otherwise. @@ -422,31 +266,6 @@ func marshalAPIMetadata(api *types.API) *subscription.APIs { } } -func marshalApplicationPolicy(policy *types.ApplicationPolicy) *subscription.ApplicationPolicy { - return &subscription.ApplicationPolicy{ - Id: policy.ID, - TenantId: policy.TenantID, - Name: policy.Name, - QuotaType: policy.QuotaType, - } -} - -func marshalSubscriptionPolicy(policy *types.SubscriptionPolicy) *subscription.SubscriptionPolicy { - return &subscription.SubscriptionPolicy{ - Id: policy.ID, - Name: policy.Name, - QuotaType: policy.QuotaType, - GraphQLMaxComplexity: policy.GraphQLMaxComplexity, - GraphQLMaxDepth: policy.GraphQLMaxDepth, - RateLimitCount: policy.RateLimitCount, - RateLimitTimeUnit: policy.RateLimitTimeUnit, - StopOnQuotaReach: policy.StopOnQuotaReach, - TenantId: policy.TenantID, - TenantDomain: policy.TenantDomain, - Timestamp: policy.TimeStamp, - } -} - // CheckIfAPIMetadataIsAlreadyAvailable returns true only if the API Metadata for the given API UUID // is already available func CheckIfAPIMetadataIsAlreadyAvailable(apiUUID, label string) bool { diff --git a/adapter/internal/discovery/xds/server.go b/adapter/internal/discovery/xds/server.go index faa0e09be..0cc2d476f 100644 --- a/adapter/internal/discovery/xds/server.go +++ b/adapter/internal/discovery/xds/server.go @@ -77,13 +77,9 @@ type EnvoyGatewayConfig struct { // EnforcerInternalAPI struct use to hold enforcer resources type EnforcerInternalAPI struct { - configs []types.Resource - keyManagers []types.Resource - apiList []types.Resource - applicationPolicies []types.Resource - subscriptionPolicies []types.Resource - revokedTokens []types.Resource - jwtIssuers []types.Resource + configs []types.Resource + apiList []types.Resource + jwtIssuers []types.Resource } var ( @@ -91,15 +87,15 @@ var ( mutexForXdsUpdate sync.Mutex mutexForInternalMapUpdate sync.Mutex - cache envoy_cachev3.SnapshotCache - enforcerCache wso2_cache.SnapshotCache - enforcerJwtIssuerCache wso2_cache.SnapshotCache - enforcerAPICache wso2_cache.SnapshotCache - enforcerApplicationPolicyCache wso2_cache.SnapshotCache - enforcerSubscriptionPolicyCache wso2_cache.SnapshotCache - enforcerKeyManagerCache wso2_cache.SnapshotCache - enforcerRevokedTokensCache wso2_cache.SnapshotCache - enforcerThrottleDataCache wso2_cache.SnapshotCache + cache envoy_cachev3.SnapshotCache + enforcerCache wso2_cache.SnapshotCache + enforcerJwtIssuerCache wso2_cache.SnapshotCache + enforcerAPICache wso2_cache.SnapshotCache + enforcerApplicationPolicyCache wso2_cache.SnapshotCache + enforcerSubscriptionPolicyCache wso2_cache.SnapshotCache + enforcerKeyManagerCache wso2_cache.SnapshotCache + enforcerRevokedTokensCache wso2_cache.SnapshotCache + enforcerThrottleDataCache wso2_cache.SnapshotCache orgAPIMap map[string]map[string]*EnvoyInternalAPI // organizationID -> Vhost:API_UUID -> EnvoyInternalAPI struct map @@ -121,8 +117,6 @@ var ( isReady = false ) -var void struct{} - const ( commonEnforcerLabel string = "commonEnforcerLabel" maxRandomInt int = 999999999 @@ -596,46 +590,6 @@ func UpdateEnforcerAPIList(label string, apis *subscription.APIList) { logger.LoggerXds.Infof("New API List cache update for the label: " + label + " version: " + fmt.Sprint(version)) } -// UpdateEnforcerApplicationPolicies sets new update to the enforcer's Application Policies -func UpdateEnforcerApplicationPolicies(applicationPolicies *subscription.ApplicationPolicyList) { - logger.LoggerXds.Debug("Updating Enforcer Application Policy Cache") - label := commonEnforcerLabel - applicationPolicyList := append(enforcerLabelMap[label].applicationPolicies, applicationPolicies) - - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.ApplicationPolicyListType: applicationPolicyList, - }) - snap.Consistent() - - errSetSnap := enforcerApplicationPolicyCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - logger.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].subscriptionPolicies = applicationPolicyList - logger.LoggerXds.Infof("New Application Policy cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - -// UpdateEnforcerSubscriptionPolicies sets new update to the enforcer's Subscription Policies -func UpdateEnforcerSubscriptionPolicies(subscriptionPolicies *subscription.SubscriptionPolicyList) { - logger.LoggerXds.Debug("Updating Enforcer Subscription Policy Cache") - label := commonEnforcerLabel - subscriptionPolicyList := append(enforcerLabelMap[label].subscriptionPolicies, subscriptionPolicies) - - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.SubscriptionPolicyListType: subscriptionPolicyList, - }) - snap.Consistent() - - errSetSnap := enforcerSubscriptionPolicyCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - logger.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].subscriptionPolicies = subscriptionPolicyList - logger.LoggerXds.Infof("New Subscription Policy cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - // UpdateXdsCacheWithLock uses mutex and lock to avoid different go routines updating XDS at the same time func UpdateXdsCacheWithLock(label string, endpoints []types.Resource, clusters []types.Resource, routes []types.Resource, listeners []types.Resource) bool { @@ -690,59 +644,6 @@ func ExtractUUIDFromAPIIdentifier(id string) (string, error) { return "", err } -// GenerateAndUpdateKeyManagerList converts the data into KeyManager proto type -func GenerateAndUpdateKeyManagerList() { - var keyManagerConfigList = make([]types.Resource, 0) - for item := range KeyManagerList { - keyManager := KeyManagerList[item] - kmConfig := MarshalKeyManager(&keyManager) - if kmConfig != nil { - keyManagerConfigList = append(keyManagerConfigList, kmConfig) - } - } - UpdateEnforcerKeyManagers(keyManagerConfigList) -} - -// UpdateEnforcerKeyManagers Sets new update to the enforcer's configuration -func UpdateEnforcerKeyManagers(keyManagerConfigList []types.Resource) { - logger.LoggerXds.Debug("Updating Key Manager Cache") - label := commonEnforcerLabel - - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.KeyManagerType: keyManagerConfigList, - }) - snap.Consistent() - - errSetSnap := enforcerKeyManagerCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - logger.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].keyManagers = keyManagerConfigList - logger.LoggerXds.Infof("New key manager cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - -// UpdateEnforcerRevokedTokens method update the revoked tokens -// in the enforcer -func UpdateEnforcerRevokedTokens(revokedTokens []types.Resource) { - logger.LoggerXds.Debug("Updating enforcer cache for revoked tokens") - label := commonEnforcerLabel - tokens := append(enforcerLabelMap[label].revokedTokens, revokedTokens...) - - version, _ := crand.Int(crand.Reader, maxRandomBigInt()) - snap, _ := wso2_cache.NewSnapshot(fmt.Sprint(version), map[wso2_resource.Type][]types.Resource{ - wso2_resource.RevokedTokensType: revokedTokens, - }) - snap.Consistent() - - errSetSnap := enforcerRevokedTokensCache.SetSnapshot(context.Background(), label, snap) - if errSetSnap != nil { - logger.LoggerXds.ErrorC(logging.PrintError(logging.Error1414, logging.MAJOR, "Error while setting the snapshot : %v", errSetSnap.Error())) - } - enforcerLabelMap[label].revokedTokens = tokens - logger.LoggerXds.Infof("New Revoked token cache update for the label: " + label + " version: " + fmt.Sprint(version)) -} - // RemoveAPICacheForEnv will remove all the internal mappings for a specific environment func RemoveAPICacheForEnv(adapterInternalAPI model.AdapterInternalAPI, envType string) { vHostIdentifier := GetvHostsIdentifier(adapterInternalAPI.UUID, envType) @@ -757,7 +658,7 @@ func RemoveAPICacheForEnv(adapterInternalAPI model.AdapterInternalAPI, envType s } } } - } + } } // RemoveAPIFromOrgAPIMap removes api from orgAPI map diff --git a/adapter/pkg/discovery/protocol/server/v3/server.go b/adapter/pkg/discovery/protocol/server/v3/server.go index 23877b7b6..1332178d9 100644 --- a/adapter/pkg/discovery/protocol/server/v3/server.go +++ b/adapter/pkg/discovery/protocol/server/v3/server.go @@ -25,9 +25,7 @@ import ( streamv3 "github.com/envoyproxy/go-control-plane/pkg/server/stream/v3" xdsv3 "github.com/envoyproxy/go-control-plane/pkg/server/v3" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/api" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/config" - "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/keymgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/subscription" "github.com/wso2/apk/adapter/pkg/discovery/protocol/resource/v3" "github.com/wso2/apk/adapter/pkg/discovery/protocol/server/sotw/v3" @@ -39,18 +37,8 @@ import ( type Server interface { config.ConfigDiscoveryServiceServer api.ApiDiscoveryServiceServer - subscription.SubscriptionDiscoveryServiceServer - subscription.ApplicationDiscoveryServiceServer subscription.ApiListDiscoveryServiceServer - subscription.ApplicationPolicyDiscoveryServiceServer subscription.JWTIssuerDiscoveryServiceServer - subscription.SubscriptionPolicyDiscoveryServiceServer - subscription.ApplicationKeyMappingDiscoveryServiceServer - subscription.ApplicationMappingDiscoveryServiceServer - keymgt.KMDiscoveryServiceServer - keymgt.RevokedTokenDiscoveryServiceServer - apkmgt.APKMgtDiscoveryServiceServer - rest.Server envoy_sotw.Server envoy_delta.Server @@ -70,17 +58,8 @@ func NewServerAdvanced(restServer rest.Server, sotwServer envoy_sotw.Server, del type server struct { config.UnimplementedConfigDiscoveryServiceServer api.UnimplementedApiDiscoveryServiceServer - subscription.UnimplementedSubscriptionDiscoveryServiceServer - subscription.UnimplementedApplicationDiscoveryServiceServer subscription.UnimplementedJWTIssuerDiscoveryServiceServer subscription.UnimplementedApiListDiscoveryServiceServer - subscription.UnimplementedApplicationPolicyDiscoveryServiceServer - subscription.UnimplementedSubscriptionPolicyDiscoveryServiceServer - subscription.UnimplementedApplicationKeyMappingDiscoveryServiceServer - subscription.UnimplementedApplicationMappingDiscoveryServiceServer - keymgt.UnimplementedKMDiscoveryServiceServer - keymgt.UnimplementedRevokedTokenDiscoveryServiceServer - apkmgt.UnimplementedAPKMgtDiscoveryServiceServer rest rest.Server sotw envoy_sotw.Server delta envoy_delta.Server @@ -98,45 +77,11 @@ func (s *server) StreamApis(stream api.ApiDiscoveryService_StreamApisServer) err return s.StreamHandler(stream, resource.APIType) } -func (s *server) StreamSubscriptions(stream subscription.SubscriptionDiscoveryService_StreamSubscriptionsServer) error { - return s.StreamHandler(stream, resource.SubscriptionListType) -} func (s *server) StreamApiList(stream subscription.ApiListDiscoveryService_StreamApiListServer) error { return s.StreamHandler(stream, resource.APIListType) } -func (s *server) StreamApplications(stream subscription.ApplicationDiscoveryService_StreamApplicationsServer) error { - return s.StreamHandler(stream, resource.ApplicationListType) -} - -func (s *server) StreamApplicationPolicies(stream subscription.ApplicationPolicyDiscoveryService_StreamApplicationPoliciesServer) error { - return s.StreamHandler(stream, resource.ApplicationPolicyListType) -} - -func (s *server) StreamSubscriptionPolicies(stream subscription.SubscriptionPolicyDiscoveryService_StreamSubscriptionPoliciesServer) error { - return s.StreamHandler(stream, resource.SubscriptionPolicyListType) -} - -func (s *server) StreamApplicationKeyMappings(stream subscription.ApplicationKeyMappingDiscoveryService_StreamApplicationKeyMappingsServer) error { - return s.StreamHandler(stream, resource.ApplicationKeyMappingListType) -} - -func (s *server) StreamApplicationMappings(stream subscription.ApplicationMappingDiscoveryService_StreamApplicationMappingsServer) error { - return s.StreamHandler(stream, resource.ApplicationMappingListType) -} - -func (s *server) StreamKeyManagers(stream keymgt.KMDiscoveryService_StreamKeyManagersServer) error { - return s.StreamHandler(stream, resource.KeyManagerType) -} - -func (s *server) StreamTokens(stream keymgt.RevokedTokenDiscoveryService_StreamTokensServer) error { - return s.StreamHandler(stream, resource.RevokedTokensType) -} - -func (s *server) StreamAPKMgtApplications(stream apkmgt.APKMgtDiscoveryService_StreamAPKMgtApplicationsServer) error { - return s.StreamHandler(stream, resource.APKMgtApplicationType) -} func (s *server)StreamJWTIssuers(stream subscription.JWTIssuerDiscoveryService_StreamJWTIssuersServer) error { return s.StreamHandler(stream, resource.JWTIssuerListType) } diff --git a/common-controller/go.mod b/common-controller/go.mod index 41f019e42..f13833977 100644 --- a/common-controller/go.mod +++ b/common-controller/go.mod @@ -68,7 +68,7 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.3.0 // direct github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect diff --git a/common-controller/internal/cache/subscriptionDataStore.go b/common-controller/internal/cache/subscriptionDataStore.go index 7e4ab9abd..2ed931957 100644 --- a/common-controller/internal/cache/subscriptionDataStore.go +++ b/common-controller/internal/cache/subscriptionDataStore.go @@ -100,7 +100,7 @@ func (ods *SubscriptionDataStore) GetApplicationMappingFromStore(name types.Name func (ods *SubscriptionDataStore) DeleteApplicationFromStore(name types.NamespacedName) { ods.mu.Lock() defer ods.mu.Unlock() - logger.Debug("Deleting application from cache") + logger.Info("Deleting application from cache") delete(ods.applicationStore, name) } @@ -108,7 +108,7 @@ func (ods *SubscriptionDataStore) DeleteApplicationFromStore(name types.Namespac func (ods *SubscriptionDataStore) DeleteSubscriptionFromStore(name types.NamespacedName) { ods.mu.Lock() defer ods.mu.Unlock() - logger.Debug("Deleting subscription from cache") + logger.Info("Deleting subscription from cache") delete(ods.subscriptionStore, name) } @@ -116,6 +116,6 @@ func (ods *SubscriptionDataStore) DeleteSubscriptionFromStore(name types.Namespa func (ods *SubscriptionDataStore) DeleteApplicationMappingFromStore(name types.NamespacedName) { ods.mu.Lock() defer ods.mu.Unlock() - logger.Debug("Deleting application mapping from cache") + logger.Info("Deleting application mapping from cache") delete(ods.applicationMappingStore, name) } diff --git a/common-controller/internal/operator/constant/constant.go b/common-controller/internal/operator/constant/constant.go index a9bb47769..db35de637 100644 --- a/common-controller/internal/operator/constant/constant.go +++ b/common-controller/internal/operator/constant/constant.go @@ -32,19 +32,21 @@ const ( Delete string = "DELETED" ) +// Subscriprion events related constants const ( - APPLICATION_CREATED string = "APPLICATION_CREATED" - APPLICATION_UPDATED string = "APPLICATION_UPDATED" - APPLICATION_DELETED string = "APPLICATION_DELETED" - SUBSCRIPTION_CREATED string = "SUBSCRIPTION_CREATED" - SUBSCRIPTION_UPDATED string = "SUBSCRIPTION_UPDATED" - SUBSCRIPTION_DELETED string = "SUBSCRIPTION_DELETED" - APPLICATION_MAPPING_CREATED string = "APPLICATION_MAPPING_CREATED" - APPLICATION_MAPPING_UPDATED string = "APPLICATION_MAPPING_UPDATED" - APPLICATION_MAPPING_DELETED string = "APPLICATION_MAPPING_DELETED" - APPLICATION_KEY_MAPPING_CREATED string = "APPLICATION_KEY_MAPPING_CREATED" - APPLICATION_KEY_MAPPING_UPDATED string = "APPLICATION_KEY_MAPPING_UPDATED" - APPLICATION_KEY_MAPPING_DELETED string = "APPLICATION_KEY_MAPPING_DELETED" + ApplicationCreated string = "APPLICATION_CREATED" + ApplicationUpdated string = "APPLICATION_UPDATED" + ApplicationDeleted string = "APPLICATION_DELETED" + SubscriptionCreated string = "SUBSCRIPTION_CREATED" + SubscriptionUpdated string = "SUBSCRIPTION_UPDATED" + SubscriptionDeleted string = "SUBSCRIPTION_DELETED" + ApplicationMappingCreated string = "APPLICATION_MAPPING_CREATED" + ApplicationMappingUpdated string = "APPLICATION_MAPPING_UPDATED" + ApplicationMappingDeleted string = "APPLICATION_MAPPING_DELETED" + ApplicationKeyMappingCreated string = "APPLICATION_KEY_MAPPING_CREATED" + ApplicationKeyMappingUpdated string = "APPLICATION_KEY_MAPPING_UPDATED" + ApplicationKeyMappingDeleted string = "APPLICATION_KEY_MAPPING_DELETED" + AllEvnts string = "ALL_EVENTS" ) // Environment variable names and default values diff --git a/common-controller/internal/operator/controllers/cp/application_controller.go b/common-controller/internal/operator/controllers/cp/application_controller.go index 9c681ee92..7a0fd47c4 100644 --- a/common-controller/internal/operator/controllers/cp/application_controller.go +++ b/common-controller/internal/operator/controllers/cp/application_controller.go @@ -88,7 +88,7 @@ func (applicationReconciler *ApplicationReconciler) Reconcile(ctx context.Contex applicationKey := req.NamespacedName var applicationList = new(cpv1alpha2.ApplicationList) - loggers.LoggerAPKOperator.Debugf("Reconciling application: %v", applicationKey.String()) + loggers.LoggerAPKOperator.Infof("Reconciling application: %v", applicationKey.String()) if err := applicationReconciler.client.List(ctx, applicationList); err != nil { return reconcile.Result{}, fmt.Errorf("failed to get applications %s/%s", applicationKey.Namespace, applicationKey.Name) @@ -97,24 +97,28 @@ func (applicationReconciler *ApplicationReconciler) Reconcile(ctx context.Contex if err := applicationReconciler.client.Get(ctx, req.NamespacedName, &application); err != nil { if k8error.IsNotFound(err) { applicationSpec, found := applicationReconciler.ods.GetApplicationFromStore(applicationKey) + loggers.LoggerAPKOperator.Infof("Application cr not available in k8s") + loggers.LoggerAPKOperator.Infof("cached Application spec: %v,%v", applicationSpec, found) if found { utils.SendAppDeletionEvent(applicationKey.Name, applicationSpec) applicationReconciler.ods.DeleteApplicationFromStore(applicationKey) - return ctrl.Result{}, nil } else { - loggers.LoggerAPKOperator.Debugf("Application %s/%s does not exist in k8s", applicationKey.Namespace, applicationKey.Name) + loggers.LoggerAPKOperator.Infof("Application %s/%s does not exist in k8s", applicationKey.Namespace, applicationKey.Name) } - } else { - applicationSpec, found := applicationReconciler.ods.GetApplicationFromStore(applicationKey) - if found { - // update - utils.SendAppUpdateEvent(applicationKey.Name, applicationSpec, application.Spec) + } + } else { + loggers.LoggerAPKOperator.Infof("Application cr available in k8s") + applicationSpec, found := applicationReconciler.ods.GetApplicationFromStore(applicationKey) + if found { + // update + loggers.LoggerAPKOperator.Infof("Application in ods") + utils.SendAppUpdateEvent(applicationKey.Name, applicationSpec, application.Spec) - } else { - utils.SendAddApplicationEvent(application) - } - applicationReconciler.ods.AddorUpdateApplicationToStore(applicationKey, application.Spec) + } else { + loggers.LoggerAPKOperator.Infof("Application in ods consider as update") + utils.SendAddApplicationEvent(application) } + applicationReconciler.ods.AddorUpdateApplicationToStore(applicationKey, application.Spec) } sendAppUpdates(applicationList) return ctrl.Result{}, nil diff --git a/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go b/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go index 837aa57fc..fc395bc83 100644 --- a/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go +++ b/common-controller/internal/operator/controllers/cp/applicationmapping_controller.go @@ -94,22 +94,22 @@ func (r *ApplicationMappingReconciler) Reconcile(ctx context.Context, req ctrl.R return reconcile.Result{}, fmt.Errorf("failed to get application mappings %s/%s", applicationMappingKey.Namespace, applicationMappingKey.Name) } + sendUpdates(applicationMappingList) var applicationMapping cpv1alpha2.ApplicationMapping if err := r.client.Get(ctx, req.NamespacedName, &applicationMapping); err != nil { if k8error.IsNotFound(err) { applicationMapping, found := r.ods.GetApplicationMappingFromStore(applicationMappingKey) - if !found { - loggers.LoggerAPKOperator.Debugf("Application mapping %s/%s not found. Ignoring since object must be deleted", applicationMappingKey.Namespace, applicationMappingKey.Name) - } else { + if found { utils.SendDeleteApplicationMappingEvent(applicationMappingKey.Name, applicationMapping) r.ods.DeleteApplicationMappingFromStore(applicationMappingKey) - return ctrl.Result{}, nil + } else { + loggers.LoggerAPKOperator.Debugf("Application mapping %s/%s not found. Ignoring since object must be deleted", applicationMappingKey.Namespace, applicationMappingKey.Name) } - } else { - utils.SendCreateApplicationMappingEvent(applicationMapping) } + } else { + utils.SendCreateApplicationMappingEvent(applicationMapping) + r.ods.AddorUpdateApplicationMappingToStore(applicationMappingKey, applicationMapping.Spec) } - sendUpdates(applicationMappingList) return ctrl.Result{}, nil } diff --git a/common-controller/internal/operator/controllers/cp/subscription_controller.go b/common-controller/internal/operator/controllers/cp/subscription_controller.go index 0933b37ff..2d62c4d1c 100644 --- a/common-controller/internal/operator/controllers/cp/subscription_controller.go +++ b/common-controller/internal/operator/controllers/cp/subscription_controller.go @@ -107,10 +107,10 @@ func (subscriptionReconciler *SubscriptionReconciler) Reconcile(ctx context.Cont subscriptionReconciler.ods.DeleteSubscriptionFromStore(subscriptionKey) return ctrl.Result{}, nil } - } else { - utils.SendAddSubscriptionEvent(subscription) - subscriptionReconciler.ods.AddorUpdateSubscriptionToStore(subscriptionKey, subscription.Spec) } + } else { + utils.SendAddSubscriptionEvent(subscription) + subscriptionReconciler.ods.AddorUpdateSubscriptionToStore(subscriptionKey, subscription.Spec) } return ctrl.Result{}, nil } diff --git a/common-controller/internal/server/event_server.go b/common-controller/internal/server/event_server.go index 16aa18e3f..e9cae33f4 100644 --- a/common-controller/internal/server/event_server.go +++ b/common-controller/internal/server/event_server.go @@ -4,6 +4,7 @@ import ( "log" apkmgt "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" + "github.com/wso2/apk/common-controller/internal/loggers" utils "github.com/wso2/apk/common-controller/internal/utils" "google.golang.org/grpc/metadata" ) @@ -18,12 +19,14 @@ func (s EventServer) StreamEvents(req *apkmgt.Request, srv apkmgt.EventStreamSer // Read metadata from the request context md, ok := metadata.FromIncomingContext(srv.Context()) if !ok { - log.Printf("missing metadata") + loggers.LoggerAPKOperator.Errorf("error : %v", "Failed to get metadata from the request context") return nil // Handle the case where metadata is not present } enforcerID := md.Get("enforcer-uuid") + loggers.LoggerAPKOperator.Debugf("Enforcer ID : %v", enforcerID[0]) utils.AddClientConnection(enforcerID[0], srv) + utils.SendInitialEvent(srv) for { if srv.Context().Done() == nil { utils.DeleteClientConnection(enforcerID[0]) diff --git a/common-controller/internal/utils/event_utils.go b/common-controller/internal/utils/event_utils.go index 4adc378ac..68fe3f495 100644 --- a/common-controller/internal/utils/event_utils.go +++ b/common-controller/internal/utils/event_utils.go @@ -3,6 +3,8 @@ package utils import ( time "time" + "github.com/google/uuid" + apkmgt "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/service/apkmgt" "github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription" "github.com/wso2/apk/common-controller/internal/loggers" cpv1alpha2 "github.com/wso2/apk/common-controller/internal/operator/apis/cp/v1alpha2" @@ -15,7 +17,7 @@ func SendAppDeletionEvent(applicationUUID string, applicationSpec cpv1alpha2.App milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: applicationUUID, - Type: constants.APPLICATION_DELETED, + Type: constants.ApplicationDeleted, TimeStamp: milliseconds, Application: &subscription.Application{ Uuid: applicationUUID, @@ -25,7 +27,7 @@ func SendAppDeletionEvent(applicationUUID string, applicationSpec cpv1alpha2.App Attributes: applicationSpec.Attributes, }, } - sendEvent(event) + sendEvent(&event) } // SendAppUpdateEvent sends an application update event to the enforcer @@ -34,7 +36,7 @@ func SendAppUpdateEvent(applicationUUID string, oldApplicationSpec cpv1alpha2.Ap milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: applicationUUID, - Type: constants.APPLICATION_UPDATED, + Type: constants.ApplicationUpdated, TimeStamp: milliseconds, Application: &subscription.Application{ Uuid: applicationUUID, @@ -44,9 +46,10 @@ func SendAppUpdateEvent(applicationUUID string, oldApplicationSpec cpv1alpha2.Ap Attributes: newApplicationSpec.Attributes, }, } - sendEvent(event) - SendDeleteApplicationKeyMappingEvent(applicationUUID, oldApplicationSpec) - SendApplicationKeyMappingEvent(applicationUUID, newApplicationSpec) + loggers.LoggerAPKOperator.Infof("Sending event to all clients: %v", &event) + sendEvent(&event) + sendDeleteApplicationKeyMappingEvent(applicationUUID, oldApplicationSpec) + sendApplicationKeyMappingEvent(applicationUUID, newApplicationSpec) } // SendAddApplicationEvent sends an application creation event to the enforcer @@ -55,7 +58,7 @@ func SendAddApplicationEvent(application cpv1alpha2.Application) { milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: application.ObjectMeta.Name, - Type: constants.APPLICATION_CREATED, + Type: constants.ApplicationCreated, TimeStamp: milliseconds, Application: &subscription.Application{ Uuid: application.ObjectMeta.Name, @@ -65,7 +68,8 @@ func SendAddApplicationEvent(application cpv1alpha2.Application) { Attributes: application.Spec.Attributes, }, } - sendEvent(event) + sendEvent(&event) + sendApplicationKeyMappingEvent(application.ObjectMeta.Name, application.Spec) } // SendAddSubscriptionEvent sends an subscription creation event to the enforcer @@ -74,7 +78,7 @@ func SendAddSubscriptionEvent(sub cpv1alpha2.Subscription) { milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: sub.ObjectMeta.Name, - Type: constants.SUBSCRIPTION_CREATED, + Type: constants.SubscriptionCreated, TimeStamp: milliseconds, Subscription: &subscription.Subscription{ Uuid: sub.ObjectMeta.Name, @@ -86,7 +90,7 @@ func SendAddSubscriptionEvent(sub cpv1alpha2.Subscription) { }, }, } - sendEvent(event) + sendEvent(&event) } // SendDeleteSubscriptionEvent sends an subscription deletion event to the enforcer @@ -95,7 +99,7 @@ func SendDeleteSubscriptionEvent(subscriptionUUID string, subscriptionSpec cpv1a milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: subscriptionUUID, - Type: constants.SUBSCRIPTION_DELETED, + Type: constants.SubscriptionDeleted, TimeStamp: milliseconds, Subscription: &subscription.Subscription{ Uuid: subscriptionUUID, @@ -107,7 +111,7 @@ func SendDeleteSubscriptionEvent(subscriptionUUID string, subscriptionSpec cpv1a }, }, } - sendEvent(event) + sendEvent(&event) } // SendCreateApplicationMappingEvent sends an application mapping event to the enforcer @@ -116,7 +120,7 @@ func SendCreateApplicationMappingEvent(applicationMapping cpv1alpha2.Application milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: applicationMapping.ObjectMeta.Name, - Type: constants.APPLICATION_MAPPING_CREATED, + Type: constants.ApplicationMappingCreated, TimeStamp: milliseconds, ApplicationMapping: &subscription.ApplicationMapping{ Uuid: applicationMapping.ObjectMeta.Name, @@ -124,7 +128,7 @@ func SendCreateApplicationMappingEvent(applicationMapping cpv1alpha2.Application SubscriptionRef: applicationMapping.Spec.SubscriptionRef, }, } - sendEvent(event) + sendEvent(&event) } // SendDeleteApplicationMappingEvent sends an application mapping deletion event to the enforcer @@ -133,7 +137,7 @@ func SendDeleteApplicationMappingEvent(applicationMappingUUID string, applicatio milliseconds := currentTime.UnixNano() / int64(time.Millisecond) event := subscription.Event{ Uuid: applicationMappingUUID, - Type: constants.APPLICATION_DELETED, + Type: constants.ApplicationMappingDeleted, TimeStamp: milliseconds, ApplicationMapping: &subscription.ApplicationMapping{ Uuid: applicationMappingUUID, @@ -141,9 +145,9 @@ func SendDeleteApplicationMappingEvent(applicationMappingUUID string, applicatio SubscriptionRef: applicationMappingSpec.SubscriptionRef, }, } - sendEvent(event) + sendEvent(&event) } -func SendDeleteApplicationKeyMappingEvent(applicationUUID string, applicationKeyMapping cpv1alpha2.ApplicationSpec) { +func sendDeleteApplicationKeyMappingEvent(applicationUUID string, applicationKeyMapping cpv1alpha2.ApplicationSpec) { currentTime := time.Now() milliseconds := currentTime.UnixNano() / int64(time.Millisecond) var oauth2SecurityScheme = applicationKeyMapping.SecuritySchemes.OAuth2 @@ -151,7 +155,7 @@ func SendDeleteApplicationKeyMappingEvent(applicationUUID string, applicationKey for _, env := range oauth2SecurityScheme.Environments { event := subscription.Event{ Uuid: applicationUUID, - Type: constants.APPLICATION_KEY_MAPPING_DELETED, + Type: constants.ApplicationKeyMappingDeleted, TimeStamp: milliseconds, ApplicationKeyMapping: &subscription.ApplicationKeyMapping{ ApplicationUUID: applicationUUID, @@ -161,11 +165,11 @@ func SendDeleteApplicationKeyMappingEvent(applicationUUID string, applicationKey EnvID: env.EnvID, }, } - sendEvent(event) + sendEvent(&event) } } } -func SendApplicationKeyMappingEvent(applicationUUID string, applicationSpec cpv1alpha2.ApplicationSpec) { +func sendApplicationKeyMappingEvent(applicationUUID string, applicationSpec cpv1alpha2.ApplicationSpec) { currentTime := time.Now() milliseconds := currentTime.UnixNano() / int64(time.Millisecond) var oauth2SecurityScheme = applicationSpec.SecuritySchemes.OAuth2 @@ -173,7 +177,7 @@ func SendApplicationKeyMappingEvent(applicationUUID string, applicationSpec cpv1 for _, env := range oauth2SecurityScheme.Environments { event := subscription.Event{ Uuid: applicationUUID, - Type: constants.APPLICATION_KEY_MAPPING_CREATED, + Type: constants.ApplicationKeyMappingCreated, TimeStamp: milliseconds, ApplicationKeyMapping: &subscription.ApplicationKeyMapping{ ApplicationUUID: applicationUUID, @@ -183,17 +187,31 @@ func SendApplicationKeyMappingEvent(applicationUUID string, applicationSpec cpv1 EnvID: env.EnvID, }, } - sendEvent(event) + sendEvent(&event) } } } -func sendEvent(event subscription.Event) { - for clientId, stream := range GetAllClientConnections() { - err := stream.Send(&event) +func sendEvent(event *subscription.Event) { + loggers.LoggerAPKOperator.Infof("Sending event to all clients: %v", event) + for clientID, stream := range GetAllClientConnections() { + err := stream.Send(event) if err != nil { - loggers.LoggerAPK.Errorf("Error sending event to client %s: %v", clientId, err) + loggers.LoggerAPKOperator.Errorf("Error sending event to client %s: %v", clientID, err) } else { - loggers.LoggerAPK.Debugf("Event sent to client %s", clientId) + loggers.LoggerAPKOperator.Infof("Event sent to client %s", clientID) } } } + +// SendInitialEvent sends initial event to the enforcer +func SendInitialEvent(srv apkmgt.EventStreamService_StreamEventsServer) { + currentTime := time.Now() + milliseconds := currentTime.UnixNano() / int64(time.Millisecond) + + event := subscription.Event{ + Uuid: uuid.New().String(), + Type: constants.AllEvnts, + TimeStamp: milliseconds, + } + srv.Send(&event) +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java index ace948920..4c53888ae 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/config/ConfigHolder.java @@ -66,11 +66,9 @@ import java.io.IOException; import java.lang.reflect.Field; -import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; -import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.security.interfaces.RSAPublicKey; @@ -109,18 +107,9 @@ private ConfigHolder() { } private void loadKeyStore() { - - try { - Certificate cert = - TLSUtils.getCertificateFromFile(getEnvVarConfig().getEnforcerPublicKeyPath()); - Key key = JWTUtils.getPrivateKey(getEnvVarConfig().getEnforcerPrivateKeyPath()); - keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - keyStore.load(null, null); - keyStore.setKeyEntry("client-keys", key, null, new Certificate[]{cert}); - } catch (EnforcerException | CertificateException | IOException | KeyStoreException | - NoSuchAlgorithmException e) { - logger.error("Error occurred while configuring KeyStore", e); - } + String certPath = getEnvVarConfig().getEnforcerPublicKeyPath(); + String keyPath = getEnvVarConfig().getEnforcerPrivateKeyPath(); + keyStore = TLSUtils.getKeyStore(certPath, keyPath); } public static ConfigHolder getInstance() { diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/RevokedTokenDiscoveryClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/RevokedTokenDiscoveryClient.java deleted file mode 100644 index 93c5b026d..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/RevokedTokenDiscoveryClient.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.wso2.apk.enforcer.discovery; - -import com.google.protobuf.Any; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.rpc.Status; -import io.envoyproxy.envoy.config.core.v3.Node; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest; -import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; -import io.grpc.stub.StreamObserver; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.keymgt.RevokedToken; -import org.wso2.apk.enforcer.discovery.service.keymgt.RevokedTokenDiscoveryServiceGrpc; -import org.wso2.apk.enforcer.config.ConfigHolder; -import org.wso2.apk.enforcer.constants.AdapterConstants; -import org.wso2.apk.enforcer.constants.Constants; -import org.wso2.apk.enforcer.discovery.common.XDSCommonUtils; -import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; -import org.wso2.apk.enforcer.security.jwt.validator.RevokedJWTDataHolder; -import org.wso2.apk.enforcer.util.GRPCUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Client to communicate with API discovery service at the adapter. - */ -public class RevokedTokenDiscoveryClient implements Runnable { - - private static RevokedTokenDiscoveryClient instance; - private ManagedChannel channel; - private RevokedTokenDiscoveryServiceGrpc.RevokedTokenDiscoveryServiceStub stub; - private static final Logger logger = LogManager.getLogger(RevokedTokenDiscoveryClient.class); - private final RevokedJWTDataHolder revokedJWTDataHolder; - private StreamObserver reqObserver; - private static final Logger log = LogManager.getLogger(RevokedTokenDiscoveryClient.class); - private final String host; - private final String hostname; - private final int port; - /** - * This is a reference to the latest received response from the ADS. - *

- * Usage: When ack/nack a DiscoveryResponse this value is used to identify the - * latest received DiscoveryResponse which may not have been acked/nacked so far. - *

- */ - private DiscoveryResponse latestReceived; - /** - * This is a reference to the latest acked response from the ADS. - *

- * Usage: When nack a DiscoveryResponse this value is used to find the latest - * successfully processed DiscoveryResponse. Information sent in the nack request - * will contain information about this response value. - *

- */ - private DiscoveryResponse latestACKed; - /** - * Node struct for the discovery client - */ - private final Node node; - - private RevokedTokenDiscoveryClient(String host, String hostname, int port) { - this.host = host; - this.hostname = hostname; - this.port = port; - this.revokedJWTDataHolder = RevokedJWTDataHolder.getInstance(); - initConnection(); - // Since revoked tokens should be received by every enforcer, adapter creates a - // common snapshot for revoked tokens. Hence each enforces requests data using the - // common enforcer label to avoid redundent snapshots - this.node = XDSCommonUtils.generateXDSNode(AdapterConstants.COMMON_ENFORCER_LABEL); - this.latestACKed = DiscoveryResponse.getDefaultInstance(); - } - - private void initConnection() { - if (GRPCUtils.isReInitRequired(channel)) { - if (channel != null && !channel.isShutdown()) { - channel.shutdownNow(); - do { - try { - channel.awaitTermination(100, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - log.error("Revoked tokens discovery channel shutdown wait was interrupted", e); - } - } while (!channel.isShutdown()); - } - this.channel = GRPCUtils.createSecuredChannel(log, host, port, hostname); - this.stub = RevokedTokenDiscoveryServiceGrpc.newStub(channel); - } else if (channel.getState(true) == ConnectivityState.READY) { - XdsSchedulerManager.getInstance().stopRevokedTokenDiscoveryScheduling(); - } - } - - public static RevokedTokenDiscoveryClient getInstance() { - if (instance == null) { - String adsHost = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHost(); - String adsHostname = ConfigHolder.getInstance().getEnvVarConfig().getAdapterHostname(); - int adsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getAdapterXdsPort()); - instance = new RevokedTokenDiscoveryClient(adsHost, adsHostname, adsPort); - } - return instance; - } - - public void run() { - initConnection(); - watchRevokedTokens(); - } - - public void watchRevokedTokens() { - // TODO: (Praminda) implement a deadline with retries - int maxSize = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getXdsMaxMsgSize()); - reqObserver = stub.withMaxInboundMessageSize(maxSize).streamTokens(new StreamObserver<>() { - @Override - public void onNext(DiscoveryResponse response) { - logger.info("Revoked token event received with version : " + response.getVersionInfo()); - XdsSchedulerManager.getInstance().stopRevokedTokenDiscoveryScheduling(); - latestReceived = response; - try { - List tokens = handleResponse(response); - handleRevokedTokens(tokens); - // TODO: (Praminda) fix recursive ack on ack failure - ack(); - } catch (Exception e) { - logger.info(e); - // catching generic error here to wrap any grpc communication errors in the runtime - onError(e); - } - } - - @Override - public void onError(Throwable throwable) { - logger.error("Error occurred during revoked token discovery", throwable); - XdsSchedulerManager.getInstance().startRevokedTokenDiscoveryScheduling(); - nack(throwable); - } - - @Override - public void onCompleted() { - logger.info("Completed receiving revoke tokens"); - } - }); - - try { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setTypeUrl(Constants.REVOKED_TOKEN_TYPE_URL).build(); - reqObserver.onNext(req); - logger.debug("Sent Discovery request for type url: " + Constants.REVOKED_TOKEN_TYPE_URL); - - } catch (Exception e) { - logger.error("Unexpected error occurred in revoked token discovery service", e); - reqObserver.onError(e); - } - } - - /** - * Send acknowledgement of successfully processed DiscoveryResponse from the xDS server. - * This is part of the xDS communication protocol. - */ - private void ack() { - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestReceived.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.REVOKED_TOKEN_TYPE_URL).build(); - reqObserver.onNext(req); - latestACKed = latestReceived; - } - - private void nack(Throwable e) { - if (latestReceived == null) { - return; - } - DiscoveryRequest req = DiscoveryRequest.newBuilder() - .setNode(node) - .setVersionInfo(latestACKed.getVersionInfo()) - .setResponseNonce(latestReceived.getNonce()) - .setTypeUrl(Constants.REVOKED_TOKEN_TYPE_URL) - .setErrorDetail(Status.newBuilder().setMessage(e.getMessage())) - .build(); - reqObserver.onNext(req); - } - - private void handleRevokedTokens(List tokens) { - for (RevokedToken revokedToken : tokens) { - revokedJWTDataHolder.addRevokedJWTToMap(revokedToken.getJti(), revokedToken.getExpirytime()); - } - } - - private List handleResponse(DiscoveryResponse response) throws InvalidProtocolBufferException { - List apis = new ArrayList<>(); - for (Any res : response.getResourcesList()) { - apis.add(res.unpack(RevokedToken.class)); - } - return apis; - } - - public void shutdown() throws InterruptedException { - channel.shutdown().awaitTermination(5, TimeUnit.SECONDS); - } -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java index 5440c8bda..aeff25ec6 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/scheduler/XdsSchedulerManager.java @@ -23,7 +23,7 @@ import org.wso2.apk.enforcer.discovery.ApiListDiscoveryClient; import org.wso2.apk.enforcer.discovery.ConfigDiscoveryClient; import org.wso2.apk.enforcer.discovery.JWTIssuerDiscoveryClient; -import org.wso2.apk.enforcer.discovery.RevokedTokenDiscoveryClient; +import org.wso2.apk.enforcer.subscription.EventingGrpcClient; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -38,19 +38,22 @@ public class XdsSchedulerManager { private static int retryPeriod; private static volatile XdsSchedulerManager instance; private static ScheduledExecutorService discoveryClientScheduler; + private static ScheduledExecutorService eventingScheduler; private ScheduledFuture apiDiscoveryScheduledFuture; private ScheduledFuture apiDiscoveryListScheduledFuture; private ScheduledFuture jwtIssuerDiscoveryScheduledFuture; - private ScheduledFuture revokedTokenDiscoveryScheduledFuture; + private ScheduledFuture eventingScheduledFuture; private ScheduledFuture configDiscoveryScheduledFuture; public static XdsSchedulerManager getInstance() { + if (instance == null) { synchronized (XdsSchedulerManager.class) { if (instance == null) { instance = new XdsSchedulerManager(); discoveryClientScheduler = Executors.newSingleThreadScheduledExecutor(); + eventingScheduler = Executors.newSingleThreadScheduledExecutor(); retryPeriod = Integer.parseInt(EnvVarConfig.getInstance().getXdsRetryPeriod()); } } @@ -59,6 +62,7 @@ public static XdsSchedulerManager getInstance() { } public synchronized void startAPIDiscoveryScheduling() { + if (apiDiscoveryScheduledFuture == null || apiDiscoveryScheduledFuture.isDone()) { apiDiscoveryScheduledFuture = discoveryClientScheduler .scheduleWithFixedDelay(ApiDiscoveryClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); @@ -66,12 +70,14 @@ public synchronized void startAPIDiscoveryScheduling() { } public synchronized void stopAPIDiscoveryScheduling() { + if (apiDiscoveryScheduledFuture != null && !apiDiscoveryScheduledFuture.isDone()) { apiDiscoveryScheduledFuture.cancel(false); } } public synchronized void startAPIListDiscoveryScheduling() { + if (apiDiscoveryListScheduledFuture == null || apiDiscoveryListScheduledFuture.isDone()) { apiDiscoveryListScheduledFuture = discoveryClientScheduler .scheduleWithFixedDelay(ApiListDiscoveryClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); @@ -79,6 +85,7 @@ public synchronized void startAPIListDiscoveryScheduling() { } public synchronized void stopAPIListDiscoveryScheduling() { + if (apiDiscoveryListScheduledFuture != null && !apiDiscoveryListScheduledFuture.isDone()) { apiDiscoveryListScheduledFuture.cancel(false); } @@ -92,27 +99,30 @@ public synchronized void startJWTIssuerDiscoveryScheduling() { } } + public synchronized void startEventScheduling() { + + if (eventingScheduledFuture == null || eventingScheduledFuture.isDone()) { + eventingScheduledFuture = eventingScheduler + .scheduleWithFixedDelay(EventingGrpcClient.getInstance(), 1, retryPeriod, TimeUnit.SECONDS); + } + } + public synchronized void stopJWTIssuerDiscoveryScheduling() { + if (jwtIssuerDiscoveryScheduledFuture != null && !jwtIssuerDiscoveryScheduledFuture.isDone()) { jwtIssuerDiscoveryScheduledFuture.cancel(false); } } - public synchronized void startRevokedTokenDiscoveryScheduling() { - if (revokedTokenDiscoveryScheduledFuture == null || revokedTokenDiscoveryScheduledFuture.isDone()) { - revokedTokenDiscoveryScheduledFuture = discoveryClientScheduler - .scheduleWithFixedDelay(RevokedTokenDiscoveryClient.getInstance(), 1, retryPeriod, - TimeUnit.SECONDS); - } - } + public synchronized void stopEventStreamScheduling() { - public synchronized void stopRevokedTokenDiscoveryScheduling() { - if (revokedTokenDiscoveryScheduledFuture != null && !revokedTokenDiscoveryScheduledFuture.isDone()) { - revokedTokenDiscoveryScheduledFuture.cancel(false); + if (eventingScheduledFuture != null && !eventingScheduledFuture.isDone()) { + eventingScheduledFuture.cancel(false); } } public synchronized void startConfigDiscoveryScheduling() { + if (configDiscoveryScheduledFuture == null || configDiscoveryScheduledFuture.isDone()) { configDiscoveryScheduledFuture = discoveryClientScheduler .scheduleWithFixedDelay(ConfigDiscoveryClient.getInstance(), 1, retryPeriod, @@ -121,6 +131,7 @@ public synchronized void startConfigDiscoveryScheduling() { } public synchronized void stopConfigDiscoveryScheduling() { + if (configDiscoveryScheduledFuture != null && !configDiscoveryScheduledFuture.isDone()) { configDiscoveryScheduledFuture.cancel(false); } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/APIOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/APIOrBuilder.java deleted file mode 100644 index 23721994a..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/APIOrBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface APIOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.API) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * repeated string versions = 2; - * @return A list containing the versions. - */ - java.util.List - getVersionsList(); - /** - * repeated string versions = 2; - * @return The count of versions. - */ - int getVersionsCount(); - /** - * repeated string versions = 2; - * @param index The index of the element to return. - * @return The versions at the given index. - */ - java.lang.String getVersions(int index); - /** - * repeated string versions = 2; - * @param index The index of the value to return. - * @return The bytes of the versions at the given index. - */ - com.google.protobuf.ByteString - getVersionsBytes(int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingList.java deleted file mode 100644 index bce9b946a..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_key_mapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationKeyMappingList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationKeyMappingList} - */ -public final class ApplicationKeyMappingList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationKeyMappingList) - ApplicationKeyMappingListOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationKeyMappingList.newBuilder() to construct. - private ApplicationKeyMappingList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationKeyMappingList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationKeyMappingList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationKeyMappingList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationKeyMappingList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationKeyMappingList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationKeyMappingList) - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingListProto.internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationKeyMappingList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationKeyMappingList) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationKeyMappingList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationKeyMappingList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListOrBuilder.java deleted file mode 100644 index 463dc8bb8..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_key_mapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationKeyMappingListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationKeyMappingList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping getList(int index); - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.ApplicationKeyMapping list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListProto.java deleted file mode 100644 index 15a7e285a..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationKeyMappingListProto.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_key_mapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationKeyMappingListProto { - private ApplicationKeyMappingListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n>wso2/discovery/subscription/applicatio" + - "n_key_mapping_list.proto\022\033wso2.discovery" + - ".subscription\0329wso2/discovery/subscripti" + - "on/application_key_mapping.proto\"]\n\031Appl" + - "icationKeyMappingList\022@\n\004list\030\002 \003(\01322.ws" + - "o2.discovery.subscription.ApplicationKey" + - "MappingB\241\001\n,org.wso2.apk.enforcer.discov" + - "ery.subscriptionB\036ApplicationKeyMappingL" + - "istProtoP\001ZOgithub.com/envoyproxy/go-con" + - "trol-plane/wso2/discovery/subscription;s" + - "ubscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationKeyMappingList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMappingProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationList.java deleted file mode 100644 index 26a00a637..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationList} - */ -public final class ApplicationList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationList) - ApplicationListOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationList.newBuilder() to construct. - private ApplicationList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Application.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Application getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationList other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationList) - org.wso2.apk.enforcer.discovery.subscription.ApplicationListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationListProto.internal_static_wso2_discovery_subscription_ApplicationList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationList build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationList result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Application getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.Application value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.Application.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.Application value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.Application value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.Application.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.Application.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Application.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Application.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Application.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.Application.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Application, org.wso2.apk.enforcer.discovery.subscription.Application.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationList) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListOrBuilder.java deleted file mode 100644 index bf2c5f5f0..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.Application getList(int index); - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.Application list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListProto.java deleted file mode 100644 index 92a66d4e5..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationListProto.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationListProto { - private ApplicationListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n2wso2/discovery/subscription/applicatio" + - "n_list.proto\022\033wso2.discovery.subscriptio" + - "n\032-wso2/discovery/subscription/applicati" + - "on.proto\"I\n\017ApplicationList\0226\n\004list\030\002 \003(" + - "\0132(.wso2.discovery.subscription.Applicat" + - "ionB\227\001\n,org.wso2.apk.enforcer.discovery." + - "subscriptionB\024ApplicationListProtoP\001ZOgi" + - "thub.com/envoyproxy/go-control-plane/wso" + - "2/discovery/subscription;subscriptionb\006p" + - "roto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_ApplicationList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingList.java deleted file mode 100644 index de67b9d94..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/applicationmapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationMappingList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationMappingList} - */ -public final class ApplicationMappingList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationMappingList) - ApplicationMappingListOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationMappingList.newBuilder() to construct. - private ApplicationMappingList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationMappingList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationMappingList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationMappingList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationMappingList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationMappingList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationMappingList) - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingListProto.internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping, org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationMappingList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationMappingList) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationMappingList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationMappingList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListOrBuilder.java deleted file mode 100644 index 2aed5e587..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/applicationmapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationMappingListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationMappingList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping getList(int index); - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.ApplicationMapping list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListProto.java deleted file mode 100644 index 9e3e5715a..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationMappingListProto.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/applicationmapping_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationMappingListProto { - private ApplicationMappingListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationMappingList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n9wso2/discovery/subscription/applicatio" + - "nmapping_list.proto\022\033wso2.discovery.subs" + - "cription\0324wso2/discovery/subscription/ap" + - "plicationmapping.proto\"W\n\026ApplicationMap" + - "pingList\022=\n\004list\030\002 \003(\0132/.wso2.discovery." + - "subscription.ApplicationMappingB\236\001\n,org." + - "wso2.apk.enforcer.discovery.subscription" + - "B\033ApplicationMappingListProtoP\001ZOgithub." + - "com/envoyproxy/go-control-plane/wso2/dis" + - "covery/subscription;subscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationMappingList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationMappingList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.ApplicationMappingProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicy.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicy.java deleted file mode 100644 index 5251d1eb2..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicy.java +++ /dev/null @@ -1,831 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationPolicy data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationPolicy} - */ -public final class ApplicationPolicy extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationPolicy) - ApplicationPolicyOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationPolicy.newBuilder() to construct. - private ApplicationPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationPolicy() { - name_ = ""; - quotaType_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationPolicy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationPolicy( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - id_ = input.readInt32(); - break; - } - case 16: { - - tenantId_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - quotaType_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private int id_; - /** - * int32 id = 1; - * @return The id. - */ - @java.lang.Override - public int getId() { - return id_; - } - - public static final int TENANTID_FIELD_NUMBER = 2; - private int tenantId_; - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - @java.lang.Override - public int getTenantId() { - return tenantId_; - } - - public static final int NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object name_; - /** - * string name = 3; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 3; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int QUOTATYPE_FIELD_NUMBER = 4; - private volatile java.lang.Object quotaType_; - /** - * string quotaType = 4; - * @return The quotaType. - */ - @java.lang.Override - public java.lang.String getQuotaType() { - java.lang.Object ref = quotaType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - quotaType_ = s; - return s; - } - } - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getQuotaTypeBytes() { - java.lang.Object ref = quotaType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - quotaType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (id_ != 0) { - output.writeInt32(1, id_); - } - if (tenantId_ != 0) { - output.writeInt32(2, tenantId_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); - } - if (!getQuotaTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, quotaType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, id_); - } - if (tenantId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, tenantId_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); - } - if (!getQuotaTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, quotaType_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy) obj; - - if (getId() - != other.getId()) return false; - if (getTenantId() - != other.getTenantId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getQuotaType() - .equals(other.getQuotaType())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId(); - hash = (37 * hash) + TENANTID_FIELD_NUMBER; - hash = (53 * hash) + getTenantId(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + QUOTATYPE_FIELD_NUMBER; - hash = (53 * hash) + getQuotaType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationPolicy data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationPolicy} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationPolicy) - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0; - - tenantId_ = 0; - - name_ = ""; - - quotaType_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy(this); - result.id_ = id_; - result.tenantId_ = tenantId_; - result.name_ = name_; - result.quotaType_ = quotaType_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.getDefaultInstance()) return this; - if (other.getId() != 0) { - setId(other.getId()); - } - if (other.getTenantId() != 0) { - setTenantId(other.getTenantId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getQuotaType().isEmpty()) { - quotaType_ = other.quotaType_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int id_ ; - /** - * int32 id = 1; - * @return The id. - */ - @java.lang.Override - public int getId() { - return id_; - } - /** - * int32 id = 1; - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(int value) { - - id_ = value; - onChanged(); - return this; - } - /** - * int32 id = 1; - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = 0; - onChanged(); - return this; - } - - private int tenantId_ ; - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - @java.lang.Override - public int getTenantId() { - return tenantId_; - } - /** - * int32 tenantId = 2; - * @param value The tenantId to set. - * @return This builder for chaining. - */ - public Builder setTenantId(int value) { - - tenantId_ = value; - onChanged(); - return this; - } - /** - * int32 tenantId = 2; - * @return This builder for chaining. - */ - public Builder clearTenantId() { - - tenantId_ = 0; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 3; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 3; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 3; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 3; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 3; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object quotaType_ = ""; - /** - * string quotaType = 4; - * @return The quotaType. - */ - public java.lang.String getQuotaType() { - java.lang.Object ref = quotaType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - quotaType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - public com.google.protobuf.ByteString - getQuotaTypeBytes() { - java.lang.Object ref = quotaType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - quotaType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string quotaType = 4; - * @param value The quotaType to set. - * @return This builder for chaining. - */ - public Builder setQuotaType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - quotaType_ = value; - onChanged(); - return this; - } - /** - * string quotaType = 4; - * @return This builder for chaining. - */ - public Builder clearQuotaType() { - - quotaType_ = getDefaultInstance().getQuotaType(); - onChanged(); - return this; - } - /** - * string quotaType = 4; - * @param value The bytes for quotaType to set. - * @return This builder for chaining. - */ - public Builder setQuotaTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - quotaType_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationPolicy) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationPolicy) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationPolicy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationPolicy(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyList.java deleted file mode 100644 index dc6879b5e..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * ApplicationPolicyList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationPolicyList} - */ -public final class ApplicationPolicyList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.ApplicationPolicyList) - ApplicationPolicyListOrBuilder { -private static final long serialVersionUID = 0L; - // Use ApplicationPolicyList.newBuilder() to construct. - private ApplicationPolicyList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ApplicationPolicyList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ApplicationPolicyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ApplicationPolicyList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList other = (org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * ApplicationPolicyList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.ApplicationPolicyList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.ApplicationPolicyList) - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.class, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyListProto.internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList build() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList result = new org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.ApplicationPolicyList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.ApplicationPolicyList) - private static final org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ApplicationPolicyList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ApplicationPolicyList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListOrBuilder.java deleted file mode 100644 index 8d6e2c3ed..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationPolicyListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationPolicyList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicy getList(int index); - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.ApplicationPolicy list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListProto.java deleted file mode 100644 index 57539daa8..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyListProto.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationPolicyListProto { - private ApplicationPolicyListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationPolicyList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n9wso2/discovery/subscription/applicatio" + - "n_policy_list.proto\022\033wso2.discovery.subs" + - "cription\0324wso2/discovery/subscription/ap" + - "plication_policy.proto\"U\n\025ApplicationPol" + - "icyList\022<\n\004list\030\002 \003(\0132..wso2.discovery.s" + - "ubscription.ApplicationPolicyB\235\001\n,org.ws" + - "o2.apk.enforcer.discovery.subscriptionB\032" + - "ApplicationPolicyListProtoP\001ZOgithub.com" + - "/envoyproxy/go-control-plane/wso2/discov" + - "ery/subscription;subscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationPolicyList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationPolicyList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.ApplicationPolicyProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyOrBuilder.java deleted file mode 100644 index f8f865692..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyOrBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface ApplicationPolicyOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.ApplicationPolicy) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 id = 1; - * @return The id. - */ - int getId(); - - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - int getTenantId(); - - /** - * string name = 3; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 3; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string quotaType = 4; - * @return The quotaType. - */ - java.lang.String getQuotaType(); - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - com.google.protobuf.ByteString - getQuotaTypeBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyProto.java deleted file mode 100644 index 9d7e5df09..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/ApplicationPolicyProto.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class ApplicationPolicyProto { - private ApplicationPolicyProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_ApplicationPolicy_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n4wso2/discovery/subscription/applicatio" + - "n_policy.proto\022\033wso2.discovery.subscript" + - "ion\"R\n\021ApplicationPolicy\022\n\n\002id\030\001 \001(\005\022\020\n\010" + - "tenantId\030\002 \001(\005\022\014\n\004name\030\003 \001(\t\022\021\n\tquotaTyp" + - "e\030\004 \001(\tB\231\001\n,org.wso2.apk.enforcer.discov" + - "ery.subscriptionB\026ApplicationPolicyProto" + - "P\001ZOgithub.com/envoyproxy/go-control-pla" + - "ne/wso2/discovery/subscription;subscript" + - "ionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_ApplicationPolicy_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_ApplicationPolicy_descriptor, - new java.lang.String[] { "Id", "TenantId", "Name", "QuotaType", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/AuthenticationOptionOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/AuthenticationOptionOrBuilder.java deleted file mode 100644 index 4e8065e1c..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/AuthenticationOptionOrBuilder.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface AuthenticationOptionOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.AuthenticationOption) - com.google.protobuf.MessageOrBuilder { - - /** - * string type = 1; - * @return The type. - */ - java.lang.String getType(); - /** - * string type = 1; - * @return The bytes for type. - */ - com.google.protobuf.ByteString - getTypeBytes(); - - /** - *
-   * MTLS mTLS = 3;
-   * BasicAuth basicAuth = 4;
-   * APIKey apiKey = 5;
-   * IPRange IPRange = 6;
-   * 
- * - * .wso2.discovery.subscription.OAuth2 oAuth2 = 2; - * @return Whether the oAuth2 field is set. - */ - boolean hasOAuth2(); - /** - *
-   * MTLS mTLS = 3;
-   * BasicAuth basicAuth = 4;
-   * APIKey apiKey = 5;
-   * IPRange IPRange = 6;
-   * 
- * - * .wso2.discovery.subscription.OAuth2 oAuth2 = 2; - * @return The oAuth2. - */ - org.wso2.apk.enforcer.discovery.subscription.OAuth2 getOAuth2(); - /** - *
-   * MTLS mTLS = 3;
-   * BasicAuth basicAuth = 4;
-   * APIKey apiKey = 5;
-   * IPRange IPRange = 6;
-   * 
- * - * .wso2.discovery.subscription.OAuth2 oAuth2 = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder getOAuth2OrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Environment.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Environment.java deleted file mode 100644 index d2774073f..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/Environment.java +++ /dev/null @@ -1,833 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - * Protobuf type {@code wso2.discovery.subscription.Environment} - */ -public final class Environment extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.Environment) - EnvironmentOrBuilder { -private static final long serialVersionUID = 0L; - // Use Environment.newBuilder() to construct. - private Environment(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Environment() { - envID_ = ""; - applicationIdentifier_ = ""; - keyType_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Environment(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Environment( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - envID_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - applicationIdentifier_ = s; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - keyType_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Environment.class, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder.class); - } - - public static final int ENVID_FIELD_NUMBER = 1; - private volatile java.lang.Object envID_; - /** - * string envID = 1; - * @return The envID. - */ - @java.lang.Override - public java.lang.String getEnvID() { - java.lang.Object ref = envID_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - envID_ = s; - return s; - } - } - /** - * string envID = 1; - * @return The bytes for envID. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getEnvIDBytes() { - java.lang.Object ref = envID_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - envID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int APPLICATIONIDENTIFIER_FIELD_NUMBER = 2; - private volatile java.lang.Object applicationIdentifier_; - /** - * string applicationIdentifier = 2; - * @return The applicationIdentifier. - */ - @java.lang.Override - public java.lang.String getApplicationIdentifier() { - java.lang.Object ref = applicationIdentifier_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationIdentifier_ = s; - return s; - } - } - /** - * string applicationIdentifier = 2; - * @return The bytes for applicationIdentifier. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getApplicationIdentifierBytes() { - java.lang.Object ref = applicationIdentifier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationIdentifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int KEYTYPE_FIELD_NUMBER = 3; - private volatile java.lang.Object keyType_; - /** - * string keyType = 3; - * @return The keyType. - */ - @java.lang.Override - public java.lang.String getKeyType() { - java.lang.Object ref = keyType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keyType_ = s; - return s; - } - } - /** - * string keyType = 3; - * @return The bytes for keyType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getKeyTypeBytes() { - java.lang.Object ref = keyType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - keyType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getEnvIDBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, envID_); - } - if (!getApplicationIdentifierBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, applicationIdentifier_); - } - if (!getKeyTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, keyType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getEnvIDBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, envID_); - } - if (!getApplicationIdentifierBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, applicationIdentifier_); - } - if (!getKeyTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, keyType_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.Environment)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.Environment other = (org.wso2.apk.enforcer.discovery.subscription.Environment) obj; - - if (!getEnvID() - .equals(other.getEnvID())) return false; - if (!getApplicationIdentifier() - .equals(other.getApplicationIdentifier())) return false; - if (!getKeyType() - .equals(other.getKeyType())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENVID_FIELD_NUMBER; - hash = (53 * hash) + getEnvID().hashCode(); - hash = (37 * hash) + APPLICATIONIDENTIFIER_FIELD_NUMBER; - hash = (53 * hash) + getApplicationIdentifier().hashCode(); - hash = (37 * hash) + KEYTYPE_FIELD_NUMBER; - hash = (53 * hash) + getKeyType().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.Environment parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.Environment prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.subscription.Environment} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.Environment) - org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.Environment.class, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.Environment.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - envID_ = ""; - - applicationIdentifier_ = ""; - - keyType_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_Environment_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.Environment.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment build() { - org.wso2.apk.enforcer.discovery.subscription.Environment result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.Environment result = new org.wso2.apk.enforcer.discovery.subscription.Environment(this); - result.envID_ = envID_; - result.applicationIdentifier_ = applicationIdentifier_; - result.keyType_ = keyType_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.Environment) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.Environment)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.Environment other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.Environment.getDefaultInstance()) return this; - if (!other.getEnvID().isEmpty()) { - envID_ = other.envID_; - onChanged(); - } - if (!other.getApplicationIdentifier().isEmpty()) { - applicationIdentifier_ = other.applicationIdentifier_; - onChanged(); - } - if (!other.getKeyType().isEmpty()) { - keyType_ = other.keyType_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.Environment parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.Environment) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object envID_ = ""; - /** - * string envID = 1; - * @return The envID. - */ - public java.lang.String getEnvID() { - java.lang.Object ref = envID_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - envID_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string envID = 1; - * @return The bytes for envID. - */ - public com.google.protobuf.ByteString - getEnvIDBytes() { - java.lang.Object ref = envID_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - envID_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string envID = 1; - * @param value The envID to set. - * @return This builder for chaining. - */ - public Builder setEnvID( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - envID_ = value; - onChanged(); - return this; - } - /** - * string envID = 1; - * @return This builder for chaining. - */ - public Builder clearEnvID() { - - envID_ = getDefaultInstance().getEnvID(); - onChanged(); - return this; - } - /** - * string envID = 1; - * @param value The bytes for envID to set. - * @return This builder for chaining. - */ - public Builder setEnvIDBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - envID_ = value; - onChanged(); - return this; - } - - private java.lang.Object applicationIdentifier_ = ""; - /** - * string applicationIdentifier = 2; - * @return The applicationIdentifier. - */ - public java.lang.String getApplicationIdentifier() { - java.lang.Object ref = applicationIdentifier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - applicationIdentifier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string applicationIdentifier = 2; - * @return The bytes for applicationIdentifier. - */ - public com.google.protobuf.ByteString - getApplicationIdentifierBytes() { - java.lang.Object ref = applicationIdentifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - applicationIdentifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string applicationIdentifier = 2; - * @param value The applicationIdentifier to set. - * @return This builder for chaining. - */ - public Builder setApplicationIdentifier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - applicationIdentifier_ = value; - onChanged(); - return this; - } - /** - * string applicationIdentifier = 2; - * @return This builder for chaining. - */ - public Builder clearApplicationIdentifier() { - - applicationIdentifier_ = getDefaultInstance().getApplicationIdentifier(); - onChanged(); - return this; - } - /** - * string applicationIdentifier = 2; - * @param value The bytes for applicationIdentifier to set. - * @return This builder for chaining. - */ - public Builder setApplicationIdentifierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - applicationIdentifier_ = value; - onChanged(); - return this; - } - - private java.lang.Object keyType_ = ""; - /** - * string keyType = 3; - * @return The keyType. - */ - public java.lang.String getKeyType() { - java.lang.Object ref = keyType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keyType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string keyType = 3; - * @return The bytes for keyType. - */ - public com.google.protobuf.ByteString - getKeyTypeBytes() { - java.lang.Object ref = keyType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - keyType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string keyType = 3; - * @param value The keyType to set. - * @return This builder for chaining. - */ - public Builder setKeyType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - keyType_ = value; - onChanged(); - return this; - } - /** - * string keyType = 3; - * @return This builder for chaining. - */ - public Builder clearKeyType() { - - keyType_ = getDefaultInstance().getKeyType(); - onChanged(); - return this; - } - /** - * string keyType = 3; - * @param value The bytes for keyType to set. - * @return This builder for chaining. - */ - public Builder setKeyTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - keyType_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.Environment) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.Environment) - private static final org.wso2.apk.enforcer.discovery.subscription.Environment DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.Environment(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.Environment getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Environment parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Environment(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EnvironmentOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EnvironmentOrBuilder.java deleted file mode 100644 index 97f621f50..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/EnvironmentOrBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface EnvironmentOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.Environment) - com.google.protobuf.MessageOrBuilder { - - /** - * string envID = 1; - * @return The envID. - */ - java.lang.String getEnvID(); - /** - * string envID = 1; - * @return The bytes for envID. - */ - com.google.protobuf.ByteString - getEnvIDBytes(); - - /** - * string applicationIdentifier = 2; - * @return The applicationIdentifier. - */ - java.lang.String getApplicationIdentifier(); - /** - * string applicationIdentifier = 2; - * @return The bytes for applicationIdentifier. - */ - com.google.protobuf.ByteString - getApplicationIdentifierBytes(); - - /** - * string keyType = 3; - * @return The keyType. - */ - java.lang.String getKeyType(); - /** - * string keyType = 3; - * @return The bytes for keyType. - */ - com.google.protobuf.ByteString - getKeyTypeBytes(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2.java deleted file mode 100644 index 5e40ba2b2..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2.java +++ /dev/null @@ -1,770 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - * Protobuf type {@code wso2.discovery.subscription.OAuth2} - */ -public final class OAuth2 extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.OAuth2) - OAuth2OrBuilder { -private static final long serialVersionUID = 0L; - // Use OAuth2.newBuilder() to construct. - private OAuth2(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private OAuth2() { - environments_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new OAuth2(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private OAuth2( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - environments_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - environments_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Environment.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - environments_ = java.util.Collections.unmodifiableList(environments_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.OAuth2.class, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder.class); - } - - public static final int ENVIRONMENTS_FIELD_NUMBER = 1; - private java.util.List environments_; - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public java.util.List getEnvironmentsList() { - return environments_; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public java.util.List - getEnvironmentsOrBuilderList() { - return environments_; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public int getEnvironmentsCount() { - return environments_.size(); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Environment getEnvironments(int index) { - return environments_.get(index); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder getEnvironmentsOrBuilder( - int index) { - return environments_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < environments_.size(); i++) { - output.writeMessage(1, environments_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < environments_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, environments_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.OAuth2)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.OAuth2 other = (org.wso2.apk.enforcer.discovery.subscription.OAuth2) obj; - - if (!getEnvironmentsList() - .equals(other.getEnvironmentsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getEnvironmentsCount() > 0) { - hash = (37 * hash) + ENVIRONMENTS_FIELD_NUMBER; - hash = (53 * hash) + getEnvironmentsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.OAuth2 prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.subscription.OAuth2} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.OAuth2) - org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.OAuth2.class, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.OAuth2.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getEnvironmentsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (environmentsBuilder_ == null) { - environments_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - environmentsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_OAuth2_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 build() { - org.wso2.apk.enforcer.discovery.subscription.OAuth2 result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.OAuth2 result = new org.wso2.apk.enforcer.discovery.subscription.OAuth2(this); - int from_bitField0_ = bitField0_; - if (environmentsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - environments_ = java.util.Collections.unmodifiableList(environments_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.environments_ = environments_; - } else { - result.environments_ = environmentsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.OAuth2) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.OAuth2)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.OAuth2 other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance()) return this; - if (environmentsBuilder_ == null) { - if (!other.environments_.isEmpty()) { - if (environments_.isEmpty()) { - environments_ = other.environments_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEnvironmentsIsMutable(); - environments_.addAll(other.environments_); - } - onChanged(); - } - } else { - if (!other.environments_.isEmpty()) { - if (environmentsBuilder_.isEmpty()) { - environmentsBuilder_.dispose(); - environmentsBuilder_ = null; - environments_ = other.environments_; - bitField0_ = (bitField0_ & ~0x00000001); - environmentsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEnvironmentsFieldBuilder() : null; - } else { - environmentsBuilder_.addAllMessages(other.environments_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.OAuth2 parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.OAuth2) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List environments_ = - java.util.Collections.emptyList(); - private void ensureEnvironmentsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - environments_ = new java.util.ArrayList(environments_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Environment, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder, org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder> environmentsBuilder_; - - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public java.util.List getEnvironmentsList() { - if (environmentsBuilder_ == null) { - return java.util.Collections.unmodifiableList(environments_); - } else { - return environmentsBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public int getEnvironmentsCount() { - if (environmentsBuilder_ == null) { - return environments_.size(); - } else { - return environmentsBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.Environment getEnvironments(int index) { - if (environmentsBuilder_ == null) { - return environments_.get(index); - } else { - return environmentsBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder setEnvironments( - int index, org.wso2.apk.enforcer.discovery.subscription.Environment value) { - if (environmentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvironmentsIsMutable(); - environments_.set(index, value); - onChanged(); - } else { - environmentsBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder setEnvironments( - int index, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder builderForValue) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - environments_.set(index, builderForValue.build()); - onChanged(); - } else { - environmentsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addEnvironments(org.wso2.apk.enforcer.discovery.subscription.Environment value) { - if (environmentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvironmentsIsMutable(); - environments_.add(value); - onChanged(); - } else { - environmentsBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addEnvironments( - int index, org.wso2.apk.enforcer.discovery.subscription.Environment value) { - if (environmentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEnvironmentsIsMutable(); - environments_.add(index, value); - onChanged(); - } else { - environmentsBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addEnvironments( - org.wso2.apk.enforcer.discovery.subscription.Environment.Builder builderForValue) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - environments_.add(builderForValue.build()); - onChanged(); - } else { - environmentsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addEnvironments( - int index, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder builderForValue) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - environments_.add(index, builderForValue.build()); - onChanged(); - } else { - environmentsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder addAllEnvironments( - java.lang.Iterable values) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, environments_); - onChanged(); - } else { - environmentsBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder clearEnvironments() { - if (environmentsBuilder_ == null) { - environments_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - environmentsBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public Builder removeEnvironments(int index) { - if (environmentsBuilder_ == null) { - ensureEnvironmentsIsMutable(); - environments_.remove(index); - onChanged(); - } else { - environmentsBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.Environment.Builder getEnvironmentsBuilder( - int index) { - return getEnvironmentsFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder getEnvironmentsOrBuilder( - int index) { - if (environmentsBuilder_ == null) { - return environments_.get(index); } else { - return environmentsBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public java.util.List - getEnvironmentsOrBuilderList() { - if (environmentsBuilder_ != null) { - return environmentsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(environments_); - } - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.Environment.Builder addEnvironmentsBuilder() { - return getEnvironmentsFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.Environment.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.Environment.Builder addEnvironmentsBuilder( - int index) { - return getEnvironmentsFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.Environment.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - public java.util.List - getEnvironmentsBuilderList() { - return getEnvironmentsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Environment, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder, org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder> - getEnvironmentsFieldBuilder() { - if (environmentsBuilder_ == null) { - environmentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Environment, org.wso2.apk.enforcer.discovery.subscription.Environment.Builder, org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder>( - environments_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - environments_ = null; - } - return environmentsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.OAuth2) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.OAuth2) - private static final org.wso2.apk.enforcer.discovery.subscription.OAuth2 DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.OAuth2(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.OAuth2 getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public OAuth2 parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new OAuth2(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2OrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2OrBuilder.java deleted file mode 100644 index 186f562e2..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/OAuth2OrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface OAuth2OrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.OAuth2) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - java.util.List - getEnvironmentsList(); - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - org.wso2.apk.enforcer.discovery.subscription.Environment getEnvironments(int index); - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - int getEnvironmentsCount(); - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - java.util.List - getEnvironmentsOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.Environment environments = 1; - */ - org.wso2.apk.enforcer.discovery.subscription.EnvironmentOrBuilder getEnvironmentsOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemes.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemes.java deleted file mode 100644 index 6653eb815..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemes.java +++ /dev/null @@ -1,607 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - * Protobuf type {@code wso2.discovery.subscription.SecuritySchemes} - */ -public final class SecuritySchemes extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.SecuritySchemes) - SecuritySchemesOrBuilder { -private static final long serialVersionUID = 0L; - // Use SecuritySchemes.newBuilder() to construct. - private SecuritySchemes(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SecuritySchemes() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SecuritySchemes(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SecuritySchemes( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder subBuilder = null; - if (oAuth2_ != null) { - subBuilder = oAuth2_.toBuilder(); - } - oAuth2_ = input.readMessage(org.wso2.apk.enforcer.discovery.subscription.OAuth2.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(oAuth2_); - oAuth2_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.class, org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.Builder.class); - } - - public static final int OAUTH2_FIELD_NUMBER = 1; - private org.wso2.apk.enforcer.discovery.subscription.OAuth2 oAuth2_; - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return Whether the oAuth2 field is set. - */ - @java.lang.Override - public boolean hasOAuth2() { - return oAuth2_ != null; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return The oAuth2. - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 getOAuth2() { - return oAuth2_ == null ? org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance() : oAuth2_; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder getOAuth2OrBuilder() { - return getOAuth2(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (oAuth2_ != null) { - output.writeMessage(1, getOAuth2()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (oAuth2_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getOAuth2()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes other = (org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes) obj; - - if (hasOAuth2() != other.hasOAuth2()) return false; - if (hasOAuth2()) { - if (!getOAuth2() - .equals(other.getOAuth2())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasOAuth2()) { - hash = (37 * hash) + OAUTH2_FIELD_NUMBER; - hash = (53 * hash) + getOAuth2().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code wso2.discovery.subscription.SecuritySchemes} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.SecuritySchemes) - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemesOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.class, org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (oAuth2Builder_ == null) { - oAuth2_ = null; - } else { - oAuth2_ = null; - oAuth2Builder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.ApplicationProto.internal_static_wso2_discovery_subscription_SecuritySchemes_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes build() { - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes result = new org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes(this); - if (oAuth2Builder_ == null) { - result.oAuth2_ = oAuth2_; - } else { - result.oAuth2_ = oAuth2Builder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes.getDefaultInstance()) return this; - if (other.hasOAuth2()) { - mergeOAuth2(other.getOAuth2()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private org.wso2.apk.enforcer.discovery.subscription.OAuth2 oAuth2_; - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.OAuth2, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder, org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder> oAuth2Builder_; - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return Whether the oAuth2 field is set. - */ - public boolean hasOAuth2() { - return oAuth2Builder_ != null || oAuth2_ != null; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return The oAuth2. - */ - public org.wso2.apk.enforcer.discovery.subscription.OAuth2 getOAuth2() { - if (oAuth2Builder_ == null) { - return oAuth2_ == null ? org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance() : oAuth2_; - } else { - return oAuth2Builder_.getMessage(); - } - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public Builder setOAuth2(org.wso2.apk.enforcer.discovery.subscription.OAuth2 value) { - if (oAuth2Builder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - oAuth2_ = value; - onChanged(); - } else { - oAuth2Builder_.setMessage(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public Builder setOAuth2( - org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder builderForValue) { - if (oAuth2Builder_ == null) { - oAuth2_ = builderForValue.build(); - onChanged(); - } else { - oAuth2Builder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public Builder mergeOAuth2(org.wso2.apk.enforcer.discovery.subscription.OAuth2 value) { - if (oAuth2Builder_ == null) { - if (oAuth2_ != null) { - oAuth2_ = - org.wso2.apk.enforcer.discovery.subscription.OAuth2.newBuilder(oAuth2_).mergeFrom(value).buildPartial(); - } else { - oAuth2_ = value; - } - onChanged(); - } else { - oAuth2Builder_.mergeFrom(value); - } - - return this; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public Builder clearOAuth2() { - if (oAuth2Builder_ == null) { - oAuth2_ = null; - onChanged(); - } else { - oAuth2_ = null; - oAuth2Builder_ = null; - } - - return this; - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder getOAuth2Builder() { - - onChanged(); - return getOAuth2FieldBuilder().getBuilder(); - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - public org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder getOAuth2OrBuilder() { - if (oAuth2Builder_ != null) { - return oAuth2Builder_.getMessageOrBuilder(); - } else { - return oAuth2_ == null ? - org.wso2.apk.enforcer.discovery.subscription.OAuth2.getDefaultInstance() : oAuth2_; - } - } - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.OAuth2, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder, org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder> - getOAuth2FieldBuilder() { - if (oAuth2Builder_ == null) { - oAuth2Builder_ = new com.google.protobuf.SingleFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.OAuth2, org.wso2.apk.enforcer.discovery.subscription.OAuth2.Builder, org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder>( - getOAuth2(), - getParentForChildren(), - isClean()); - oAuth2_ = null; - } - return oAuth2Builder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.SecuritySchemes) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.SecuritySchemes) - private static final org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SecuritySchemes parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SecuritySchemes(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SecuritySchemes getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemesOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemesOrBuilder.java deleted file mode 100644 index 2c568b7ce..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SecuritySchemesOrBuilder.java +++ /dev/null @@ -1,24 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/application.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SecuritySchemesOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.SecuritySchemes) - com.google.protobuf.MessageOrBuilder { - - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return Whether the oAuth2 field is set. - */ - boolean hasOAuth2(); - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - * @return The oAuth2. - */ - org.wso2.apk.enforcer.discovery.subscription.OAuth2 getOAuth2(); - /** - * .wso2.discovery.subscription.OAuth2 oAuth2 = 1; - */ - org.wso2.apk.enforcer.discovery.subscription.OAuth2OrBuilder getOAuth2OrBuilder(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionList.java deleted file mode 100644 index 96c2b94bc..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * SubscriptionList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionList} - */ -public final class SubscriptionList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.SubscriptionList) - SubscriptionListOrBuilder { -private static final long serialVersionUID = 0L; - // Use SubscriptionList.newBuilder() to construct. - private SubscriptionList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SubscriptionList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SubscriptionList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SubscriptionList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.Subscription.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.Subscription getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList other = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.SubscriptionList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * SubscriptionList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.SubscriptionList) - org.wso2.apk.enforcer.discovery.subscription.SubscriptionListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionListProto.internal_static_wso2_discovery_subscription_SubscriptionList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionList build() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList result = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.SubscriptionList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.SubscriptionList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.SubscriptionList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.Subscription value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.Subscription value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.Subscription value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.Subscription.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.Subscription, org.wso2.apk.enforcer.discovery.subscription.Subscription.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.SubscriptionList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.SubscriptionList) - private static final org.wso2.apk.enforcer.discovery.subscription.SubscriptionList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SubscriptionList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SubscriptionList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListOrBuilder.java deleted file mode 100644 index 111fcc514..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SubscriptionListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.SubscriptionList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.Subscription getList(int index); - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.Subscription list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.SubscriptionOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListProto.java deleted file mode 100644 index ee1a7a7a1..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionListProto.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class SubscriptionListProto { - private SubscriptionListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_SubscriptionList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_SubscriptionList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n3wso2/discovery/subscription/subscripti" + - "on_list.proto\022\033wso2.discovery.subscripti" + - "on\032.wso2/discovery/subscription/subscrip" + - "tion.proto\"K\n\020SubscriptionList\0227\n\004list\030\002" + - " \003(\0132).wso2.discovery.subscription.Subsc" + - "riptionB\230\001\n,org.wso2.apk.enforcer.discov" + - "ery.subscriptionB\025SubscriptionListProtoP" + - "\001ZOgithub.com/envoyproxy/go-control-plan" + - "e/wso2/discovery/subscription;subscripti" + - "onb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_SubscriptionList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_SubscriptionList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_SubscriptionList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.SubscriptionProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicy.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicy.java deleted file mode 100644 index e08ae8e06..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicy.java +++ /dev/null @@ -1,1429 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * SubscriptionPolicy data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionPolicy} - */ -public final class SubscriptionPolicy extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.SubscriptionPolicy) - SubscriptionPolicyOrBuilder { -private static final long serialVersionUID = 0L; - // Use SubscriptionPolicy.newBuilder() to construct. - private SubscriptionPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SubscriptionPolicy() { - name_ = ""; - quotaType_ = ""; - rateLimitTimeUnit_ = ""; - tenantDomain_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SubscriptionPolicy(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SubscriptionPolicy( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - id_ = input.readInt32(); - break; - } - case 16: { - - tenantId_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - quotaType_ = s; - break; - } - case 40: { - - graphQLMaxComplexity_ = input.readInt32(); - break; - } - case 48: { - - graphQLMaxDepth_ = input.readInt32(); - break; - } - case 56: { - - rateLimitCount_ = input.readInt32(); - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - rateLimitTimeUnit_ = s; - break; - } - case 72: { - - stopOnQuotaReach_ = input.readBool(); - break; - } - case 82: { - java.lang.String s = input.readStringRequireUtf8(); - - tenantDomain_ = s; - break; - } - case 88: { - - timestamp_ = input.readInt64(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private int id_; - /** - * int32 id = 1; - * @return The id. - */ - @java.lang.Override - public int getId() { - return id_; - } - - public static final int TENANTID_FIELD_NUMBER = 2; - private int tenantId_; - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - @java.lang.Override - public int getTenantId() { - return tenantId_; - } - - public static final int NAME_FIELD_NUMBER = 3; - private volatile java.lang.Object name_; - /** - * string name = 3; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 3; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int QUOTATYPE_FIELD_NUMBER = 4; - private volatile java.lang.Object quotaType_; - /** - * string quotaType = 4; - * @return The quotaType. - */ - @java.lang.Override - public java.lang.String getQuotaType() { - java.lang.Object ref = quotaType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - quotaType_ = s; - return s; - } - } - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getQuotaTypeBytes() { - java.lang.Object ref = quotaType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - quotaType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int GRAPHQLMAXCOMPLEXITY_FIELD_NUMBER = 5; - private int graphQLMaxComplexity_; - /** - * int32 graphQLMaxComplexity = 5; - * @return The graphQLMaxComplexity. - */ - @java.lang.Override - public int getGraphQLMaxComplexity() { - return graphQLMaxComplexity_; - } - - public static final int GRAPHQLMAXDEPTH_FIELD_NUMBER = 6; - private int graphQLMaxDepth_; - /** - * int32 graphQLMaxDepth = 6; - * @return The graphQLMaxDepth. - */ - @java.lang.Override - public int getGraphQLMaxDepth() { - return graphQLMaxDepth_; - } - - public static final int RATELIMITCOUNT_FIELD_NUMBER = 7; - private int rateLimitCount_; - /** - * int32 rateLimitCount = 7; - * @return The rateLimitCount. - */ - @java.lang.Override - public int getRateLimitCount() { - return rateLimitCount_; - } - - public static final int RATELIMITTIMEUNIT_FIELD_NUMBER = 8; - private volatile java.lang.Object rateLimitTimeUnit_; - /** - * string rateLimitTimeUnit = 8; - * @return The rateLimitTimeUnit. - */ - @java.lang.Override - public java.lang.String getRateLimitTimeUnit() { - java.lang.Object ref = rateLimitTimeUnit_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rateLimitTimeUnit_ = s; - return s; - } - } - /** - * string rateLimitTimeUnit = 8; - * @return The bytes for rateLimitTimeUnit. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRateLimitTimeUnitBytes() { - java.lang.Object ref = rateLimitTimeUnit_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - rateLimitTimeUnit_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int STOPONQUOTAREACH_FIELD_NUMBER = 9; - private boolean stopOnQuotaReach_; - /** - * bool stopOnQuotaReach = 9; - * @return The stopOnQuotaReach. - */ - @java.lang.Override - public boolean getStopOnQuotaReach() { - return stopOnQuotaReach_; - } - - public static final int TENANTDOMAIN_FIELD_NUMBER = 10; - private volatile java.lang.Object tenantDomain_; - /** - * string tenantDomain = 10; - * @return The tenantDomain. - */ - @java.lang.Override - public java.lang.String getTenantDomain() { - java.lang.Object ref = tenantDomain_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tenantDomain_ = s; - return s; - } - } - /** - * string tenantDomain = 10; - * @return The bytes for tenantDomain. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTenantDomainBytes() { - java.lang.Object ref = tenantDomain_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tenantDomain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_FIELD_NUMBER = 11; - private long timestamp_; - /** - * int64 timestamp = 11; - * @return The timestamp. - */ - @java.lang.Override - public long getTimestamp() { - return timestamp_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (id_ != 0) { - output.writeInt32(1, id_); - } - if (tenantId_ != 0) { - output.writeInt32(2, tenantId_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); - } - if (!getQuotaTypeBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, quotaType_); - } - if (graphQLMaxComplexity_ != 0) { - output.writeInt32(5, graphQLMaxComplexity_); - } - if (graphQLMaxDepth_ != 0) { - output.writeInt32(6, graphQLMaxDepth_); - } - if (rateLimitCount_ != 0) { - output.writeInt32(7, rateLimitCount_); - } - if (!getRateLimitTimeUnitBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, rateLimitTimeUnit_); - } - if (stopOnQuotaReach_ != false) { - output.writeBool(9, stopOnQuotaReach_); - } - if (!getTenantDomainBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, tenantDomain_); - } - if (timestamp_ != 0L) { - output.writeInt64(11, timestamp_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, id_); - } - if (tenantId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, tenantId_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); - } - if (!getQuotaTypeBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, quotaType_); - } - if (graphQLMaxComplexity_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, graphQLMaxComplexity_); - } - if (graphQLMaxDepth_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(6, graphQLMaxDepth_); - } - if (rateLimitCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, rateLimitCount_); - } - if (!getRateLimitTimeUnitBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, rateLimitTimeUnit_); - } - if (stopOnQuotaReach_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(9, stopOnQuotaReach_); - } - if (!getTenantDomainBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, tenantDomain_); - } - if (timestamp_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(11, timestamp_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy other = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy) obj; - - if (getId() - != other.getId()) return false; - if (getTenantId() - != other.getTenantId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (!getQuotaType() - .equals(other.getQuotaType())) return false; - if (getGraphQLMaxComplexity() - != other.getGraphQLMaxComplexity()) return false; - if (getGraphQLMaxDepth() - != other.getGraphQLMaxDepth()) return false; - if (getRateLimitCount() - != other.getRateLimitCount()) return false; - if (!getRateLimitTimeUnit() - .equals(other.getRateLimitTimeUnit())) return false; - if (getStopOnQuotaReach() - != other.getStopOnQuotaReach()) return false; - if (!getTenantDomain() - .equals(other.getTenantDomain())) return false; - if (getTimestamp() - != other.getTimestamp()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId(); - hash = (37 * hash) + TENANTID_FIELD_NUMBER; - hash = (53 * hash) + getTenantId(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + QUOTATYPE_FIELD_NUMBER; - hash = (53 * hash) + getQuotaType().hashCode(); - hash = (37 * hash) + GRAPHQLMAXCOMPLEXITY_FIELD_NUMBER; - hash = (53 * hash) + getGraphQLMaxComplexity(); - hash = (37 * hash) + GRAPHQLMAXDEPTH_FIELD_NUMBER; - hash = (53 * hash) + getGraphQLMaxDepth(); - hash = (37 * hash) + RATELIMITCOUNT_FIELD_NUMBER; - hash = (53 * hash) + getRateLimitCount(); - hash = (37 * hash) + RATELIMITTIMEUNIT_FIELD_NUMBER; - hash = (53 * hash) + getRateLimitTimeUnit().hashCode(); - hash = (37 * hash) + STOPONQUOTAREACH_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getStopOnQuotaReach()); - hash = (37 * hash) + TENANTDOMAIN_FIELD_NUMBER; - hash = (53 * hash) + getTenantDomain().hashCode(); - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTimestamp()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * SubscriptionPolicy data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionPolicy} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.SubscriptionPolicy) - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0; - - tenantId_ = 0; - - name_ = ""; - - quotaType_ = ""; - - graphQLMaxComplexity_ = 0; - - graphQLMaxDepth_ = 0; - - rateLimitCount_ = 0; - - rateLimitTimeUnit_ = ""; - - stopOnQuotaReach_ = false; - - tenantDomain_ = ""; - - timestamp_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy build() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy result = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy(this); - result.id_ = id_; - result.tenantId_ = tenantId_; - result.name_ = name_; - result.quotaType_ = quotaType_; - result.graphQLMaxComplexity_ = graphQLMaxComplexity_; - result.graphQLMaxDepth_ = graphQLMaxDepth_; - result.rateLimitCount_ = rateLimitCount_; - result.rateLimitTimeUnit_ = rateLimitTimeUnit_; - result.stopOnQuotaReach_ = stopOnQuotaReach_; - result.tenantDomain_ = tenantDomain_; - result.timestamp_ = timestamp_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.getDefaultInstance()) return this; - if (other.getId() != 0) { - setId(other.getId()); - } - if (other.getTenantId() != 0) { - setTenantId(other.getTenantId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getQuotaType().isEmpty()) { - quotaType_ = other.quotaType_; - onChanged(); - } - if (other.getGraphQLMaxComplexity() != 0) { - setGraphQLMaxComplexity(other.getGraphQLMaxComplexity()); - } - if (other.getGraphQLMaxDepth() != 0) { - setGraphQLMaxDepth(other.getGraphQLMaxDepth()); - } - if (other.getRateLimitCount() != 0) { - setRateLimitCount(other.getRateLimitCount()); - } - if (!other.getRateLimitTimeUnit().isEmpty()) { - rateLimitTimeUnit_ = other.rateLimitTimeUnit_; - onChanged(); - } - if (other.getStopOnQuotaReach() != false) { - setStopOnQuotaReach(other.getStopOnQuotaReach()); - } - if (!other.getTenantDomain().isEmpty()) { - tenantDomain_ = other.tenantDomain_; - onChanged(); - } - if (other.getTimestamp() != 0L) { - setTimestamp(other.getTimestamp()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int id_ ; - /** - * int32 id = 1; - * @return The id. - */ - @java.lang.Override - public int getId() { - return id_; - } - /** - * int32 id = 1; - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(int value) { - - id_ = value; - onChanged(); - return this; - } - /** - * int32 id = 1; - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = 0; - onChanged(); - return this; - } - - private int tenantId_ ; - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - @java.lang.Override - public int getTenantId() { - return tenantId_; - } - /** - * int32 tenantId = 2; - * @param value The tenantId to set. - * @return This builder for chaining. - */ - public Builder setTenantId(int value) { - - tenantId_ = value; - onChanged(); - return this; - } - /** - * int32 tenantId = 2; - * @return This builder for chaining. - */ - public Builder clearTenantId() { - - tenantId_ = 0; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 3; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 3; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 3; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 3; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 3; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object quotaType_ = ""; - /** - * string quotaType = 4; - * @return The quotaType. - */ - public java.lang.String getQuotaType() { - java.lang.Object ref = quotaType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - quotaType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - public com.google.protobuf.ByteString - getQuotaTypeBytes() { - java.lang.Object ref = quotaType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - quotaType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string quotaType = 4; - * @param value The quotaType to set. - * @return This builder for chaining. - */ - public Builder setQuotaType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - quotaType_ = value; - onChanged(); - return this; - } - /** - * string quotaType = 4; - * @return This builder for chaining. - */ - public Builder clearQuotaType() { - - quotaType_ = getDefaultInstance().getQuotaType(); - onChanged(); - return this; - } - /** - * string quotaType = 4; - * @param value The bytes for quotaType to set. - * @return This builder for chaining. - */ - public Builder setQuotaTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - quotaType_ = value; - onChanged(); - return this; - } - - private int graphQLMaxComplexity_ ; - /** - * int32 graphQLMaxComplexity = 5; - * @return The graphQLMaxComplexity. - */ - @java.lang.Override - public int getGraphQLMaxComplexity() { - return graphQLMaxComplexity_; - } - /** - * int32 graphQLMaxComplexity = 5; - * @param value The graphQLMaxComplexity to set. - * @return This builder for chaining. - */ - public Builder setGraphQLMaxComplexity(int value) { - - graphQLMaxComplexity_ = value; - onChanged(); - return this; - } - /** - * int32 graphQLMaxComplexity = 5; - * @return This builder for chaining. - */ - public Builder clearGraphQLMaxComplexity() { - - graphQLMaxComplexity_ = 0; - onChanged(); - return this; - } - - private int graphQLMaxDepth_ ; - /** - * int32 graphQLMaxDepth = 6; - * @return The graphQLMaxDepth. - */ - @java.lang.Override - public int getGraphQLMaxDepth() { - return graphQLMaxDepth_; - } - /** - * int32 graphQLMaxDepth = 6; - * @param value The graphQLMaxDepth to set. - * @return This builder for chaining. - */ - public Builder setGraphQLMaxDepth(int value) { - - graphQLMaxDepth_ = value; - onChanged(); - return this; - } - /** - * int32 graphQLMaxDepth = 6; - * @return This builder for chaining. - */ - public Builder clearGraphQLMaxDepth() { - - graphQLMaxDepth_ = 0; - onChanged(); - return this; - } - - private int rateLimitCount_ ; - /** - * int32 rateLimitCount = 7; - * @return The rateLimitCount. - */ - @java.lang.Override - public int getRateLimitCount() { - return rateLimitCount_; - } - /** - * int32 rateLimitCount = 7; - * @param value The rateLimitCount to set. - * @return This builder for chaining. - */ - public Builder setRateLimitCount(int value) { - - rateLimitCount_ = value; - onChanged(); - return this; - } - /** - * int32 rateLimitCount = 7; - * @return This builder for chaining. - */ - public Builder clearRateLimitCount() { - - rateLimitCount_ = 0; - onChanged(); - return this; - } - - private java.lang.Object rateLimitTimeUnit_ = ""; - /** - * string rateLimitTimeUnit = 8; - * @return The rateLimitTimeUnit. - */ - public java.lang.String getRateLimitTimeUnit() { - java.lang.Object ref = rateLimitTimeUnit_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - rateLimitTimeUnit_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string rateLimitTimeUnit = 8; - * @return The bytes for rateLimitTimeUnit. - */ - public com.google.protobuf.ByteString - getRateLimitTimeUnitBytes() { - java.lang.Object ref = rateLimitTimeUnit_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - rateLimitTimeUnit_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string rateLimitTimeUnit = 8; - * @param value The rateLimitTimeUnit to set. - * @return This builder for chaining. - */ - public Builder setRateLimitTimeUnit( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - rateLimitTimeUnit_ = value; - onChanged(); - return this; - } - /** - * string rateLimitTimeUnit = 8; - * @return This builder for chaining. - */ - public Builder clearRateLimitTimeUnit() { - - rateLimitTimeUnit_ = getDefaultInstance().getRateLimitTimeUnit(); - onChanged(); - return this; - } - /** - * string rateLimitTimeUnit = 8; - * @param value The bytes for rateLimitTimeUnit to set. - * @return This builder for chaining. - */ - public Builder setRateLimitTimeUnitBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - rateLimitTimeUnit_ = value; - onChanged(); - return this; - } - - private boolean stopOnQuotaReach_ ; - /** - * bool stopOnQuotaReach = 9; - * @return The stopOnQuotaReach. - */ - @java.lang.Override - public boolean getStopOnQuotaReach() { - return stopOnQuotaReach_; - } - /** - * bool stopOnQuotaReach = 9; - * @param value The stopOnQuotaReach to set. - * @return This builder for chaining. - */ - public Builder setStopOnQuotaReach(boolean value) { - - stopOnQuotaReach_ = value; - onChanged(); - return this; - } - /** - * bool stopOnQuotaReach = 9; - * @return This builder for chaining. - */ - public Builder clearStopOnQuotaReach() { - - stopOnQuotaReach_ = false; - onChanged(); - return this; - } - - private java.lang.Object tenantDomain_ = ""; - /** - * string tenantDomain = 10; - * @return The tenantDomain. - */ - public java.lang.String getTenantDomain() { - java.lang.Object ref = tenantDomain_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tenantDomain_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string tenantDomain = 10; - * @return The bytes for tenantDomain. - */ - public com.google.protobuf.ByteString - getTenantDomainBytes() { - java.lang.Object ref = tenantDomain_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - tenantDomain_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string tenantDomain = 10; - * @param value The tenantDomain to set. - * @return This builder for chaining. - */ - public Builder setTenantDomain( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tenantDomain_ = value; - onChanged(); - return this; - } - /** - * string tenantDomain = 10; - * @return This builder for chaining. - */ - public Builder clearTenantDomain() { - - tenantDomain_ = getDefaultInstance().getTenantDomain(); - onChanged(); - return this; - } - /** - * string tenantDomain = 10; - * @param value The bytes for tenantDomain to set. - * @return This builder for chaining. - */ - public Builder setTenantDomainBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tenantDomain_ = value; - onChanged(); - return this; - } - - private long timestamp_ ; - /** - * int64 timestamp = 11; - * @return The timestamp. - */ - @java.lang.Override - public long getTimestamp() { - return timestamp_; - } - /** - * int64 timestamp = 11; - * @param value The timestamp to set. - * @return This builder for chaining. - */ - public Builder setTimestamp(long value) { - - timestamp_ = value; - onChanged(); - return this; - } - /** - * int64 timestamp = 11; - * @return This builder for chaining. - */ - public Builder clearTimestamp() { - - timestamp_ = 0L; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.SubscriptionPolicy) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.SubscriptionPolicy) - private static final org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SubscriptionPolicy parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SubscriptionPolicy(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyList.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyList.java deleted file mode 100644 index bcddf227c..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyList.java +++ /dev/null @@ -1,778 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -/** - *
- * SubscriptionPolicyList data model
- * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionPolicyList} - */ -public final class SubscriptionPolicyList extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:wso2.discovery.subscription.SubscriptionPolicyList) - SubscriptionPolicyListOrBuilder { -private static final long serialVersionUID = 0L; - // Use SubscriptionPolicyList.newBuilder() to construct. - private SubscriptionPolicyList(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SubscriptionPolicyList() { - list_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SubscriptionPolicyList(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SubscriptionPolicyList( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - list_.add( - input.readMessage(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.Builder.class); - } - - public static final int LIST_FIELD_NUMBER = 2; - private java.util.List list_; - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public java.util.List getListList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public java.util.List - getListOrBuilderList() { - return list_; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public int getListCount() { - return list_.size(); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getList(int index) { - return list_.get(index); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder getListOrBuilder( - int index) { - return list_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < list_.size(); i++) { - output.writeMessage(2, list_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < list_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, list_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList)) { - return super.equals(obj); - } - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList other = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList) obj; - - if (!getListList() - .equals(other.getListList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getListCount() > 0) { - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getListList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * SubscriptionPolicyList data model
-   * 
- * - * Protobuf type {@code wso2.discovery.subscription.SubscriptionPolicyList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:wso2.discovery.subscription.SubscriptionPolicyList) - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.class, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.Builder.class); - } - - // Construct using org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getListFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - listBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyListProto.internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList getDefaultInstanceForType() { - return org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.getDefaultInstance(); - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList build() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList buildPartial() { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList result = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList(this); - int from_bitField0_ = bitField0_; - if (listBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - list_ = java.util.Collections.unmodifiableList(list_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.list_ = list_; - } else { - result.list_ = listBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList) { - return mergeFrom((org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList other) { - if (other == org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList.getDefaultInstance()) return this; - if (listBuilder_ == null) { - if (!other.list_.isEmpty()) { - if (list_.isEmpty()) { - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureListIsMutable(); - list_.addAll(other.list_); - } - onChanged(); - } - } else { - if (!other.list_.isEmpty()) { - if (listBuilder_.isEmpty()) { - listBuilder_.dispose(); - listBuilder_ = null; - list_ = other.list_; - bitField0_ = (bitField0_ & ~0x00000001); - listBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getListFieldBuilder() : null; - } else { - listBuilder_.addAllMessages(other.list_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List list_ = - java.util.Collections.emptyList(); - private void ensureListIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - list_ = new java.util.ArrayList(list_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder> listBuilder_; - - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public java.util.List getListList() { - if (listBuilder_ == null) { - return java.util.Collections.unmodifiableList(list_); - } else { - return listBuilder_.getMessageList(); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public int getListCount() { - if (listBuilder_ == null) { - return list_.size(); - } else { - return listBuilder_.getCount(); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getList(int index) { - if (listBuilder_ == null) { - return list_.get(index); - } else { - return listBuilder_.getMessage(index); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.set(index, value); - onChanged(); - } else { - listBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder setList( - int index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.set(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addList(org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(value); - onChanged(); - } else { - listBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureListIsMutable(); - list_.add(index, value); - onChanged(); - } else { - listBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addList( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addList( - int index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder builderForValue) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.add(index, builderForValue.build()); - onChanged(); - } else { - listBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder addAllList( - java.lang.Iterable values) { - if (listBuilder_ == null) { - ensureListIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, list_); - onChanged(); - } else { - listBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder clearList() { - if (listBuilder_ == null) { - list_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - listBuilder_.clear(); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public Builder removeList(int index) { - if (listBuilder_ == null) { - ensureListIsMutable(); - list_.remove(index); - onChanged(); - } else { - listBuilder_.remove(index); - } - return this; - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder getListBuilder( - int index) { - return getListFieldBuilder().getBuilder(index); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder getListOrBuilder( - int index) { - if (listBuilder_ == null) { - return list_.get(index); } else { - return listBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public java.util.List - getListOrBuilderList() { - if (listBuilder_ != null) { - return listBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(list_); - } - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder addListBuilder() { - return getListFieldBuilder().addBuilder( - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder addListBuilder( - int index) { - return getListFieldBuilder().addBuilder( - index, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.getDefaultInstance()); - } - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - public java.util.List - getListBuilderList() { - return getListFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder> - getListFieldBuilder() { - if (listBuilder_ == null) { - listBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy.Builder, org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder>( - list_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - list_ = null; - } - return listBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:wso2.discovery.subscription.SubscriptionPolicyList) - } - - // @@protoc_insertion_point(class_scope:wso2.discovery.subscription.SubscriptionPolicyList) - private static final org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList(); - } - - public static org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SubscriptionPolicyList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SubscriptionPolicyList(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListOrBuilder.java deleted file mode 100644 index 6340a52d5..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SubscriptionPolicyListOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.SubscriptionPolicyList) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - java.util.List - getListList(); - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicy getList(int index); - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - int getListCount(); - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - java.util.List - getListOrBuilderList(); - /** - * repeated .wso2.discovery.subscription.SubscriptionPolicy list = 2; - */ - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyOrBuilder getListOrBuilder( - int index); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListProto.java deleted file mode 100644 index c5d1304c3..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyListProto.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy_list.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class SubscriptionPolicyListProto { - private SubscriptionPolicyListProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n:wso2/discovery/subscription/subscripti" + - "on_policy_list.proto\022\033wso2.discovery.sub" + - "scription\0325wso2/discovery/subscription/s" + - "ubscription_policy.proto\"W\n\026Subscription" + - "PolicyList\022=\n\004list\030\002 \003(\0132/.wso2.discover" + - "y.subscription.SubscriptionPolicyB\236\001\n,or" + - "g.wso2.apk.enforcer.discovery.subscripti" + - "onB\033SubscriptionPolicyListProtoP\001ZOgithu" + - "b.com/envoyproxy/go-control-plane/wso2/d" + - "iscovery/subscription;subscriptionb\006prot" + - "o3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.getDescriptor(), - }); - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_SubscriptionPolicyList_descriptor, - new java.lang.String[] { "List", }); - org.wso2.apk.enforcer.discovery.subscription.SubscriptionPolicyProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyOrBuilder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyOrBuilder.java deleted file mode 100644 index 68b563f5f..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyOrBuilder.java +++ /dev/null @@ -1,99 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public interface SubscriptionPolicyOrBuilder extends - // @@protoc_insertion_point(interface_extends:wso2.discovery.subscription.SubscriptionPolicy) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 id = 1; - * @return The id. - */ - int getId(); - - /** - * int32 tenantId = 2; - * @return The tenantId. - */ - int getTenantId(); - - /** - * string name = 3; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 3; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - * string quotaType = 4; - * @return The quotaType. - */ - java.lang.String getQuotaType(); - /** - * string quotaType = 4; - * @return The bytes for quotaType. - */ - com.google.protobuf.ByteString - getQuotaTypeBytes(); - - /** - * int32 graphQLMaxComplexity = 5; - * @return The graphQLMaxComplexity. - */ - int getGraphQLMaxComplexity(); - - /** - * int32 graphQLMaxDepth = 6; - * @return The graphQLMaxDepth. - */ - int getGraphQLMaxDepth(); - - /** - * int32 rateLimitCount = 7; - * @return The rateLimitCount. - */ - int getRateLimitCount(); - - /** - * string rateLimitTimeUnit = 8; - * @return The rateLimitTimeUnit. - */ - java.lang.String getRateLimitTimeUnit(); - /** - * string rateLimitTimeUnit = 8; - * @return The bytes for rateLimitTimeUnit. - */ - com.google.protobuf.ByteString - getRateLimitTimeUnitBytes(); - - /** - * bool stopOnQuotaReach = 9; - * @return The stopOnQuotaReach. - */ - boolean getStopOnQuotaReach(); - - /** - * string tenantDomain = 10; - * @return The tenantDomain. - */ - java.lang.String getTenantDomain(); - /** - * string tenantDomain = 10; - * @return The bytes for tenantDomain. - */ - com.google.protobuf.ByteString - getTenantDomainBytes(); - - /** - * int64 timestamp = 11; - * @return The timestamp. - */ - long getTimestamp(); -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyProto.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyProto.java deleted file mode 100644 index db9ded6e6..000000000 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/discovery/subscription/SubscriptionPolicyProto.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: wso2/discovery/subscription/subscription_policy.proto - -package org.wso2.apk.enforcer.discovery.subscription; - -public final class SubscriptionPolicyProto { - private SubscriptionPolicyProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_wso2_discovery_subscription_SubscriptionPolicy_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n5wso2/discovery/subscription/subscripti" + - "on_policy.proto\022\033wso2.discovery.subscrip" + - "tion\"\200\002\n\022SubscriptionPolicy\022\n\n\002id\030\001 \001(\005\022" + - "\020\n\010tenantId\030\002 \001(\005\022\014\n\004name\030\003 \001(\t\022\021\n\tquota" + - "Type\030\004 \001(\t\022\034\n\024graphQLMaxComplexity\030\005 \001(\005" + - "\022\027\n\017graphQLMaxDepth\030\006 \001(\005\022\026\n\016rateLimitCo" + - "unt\030\007 \001(\005\022\031\n\021rateLimitTimeUnit\030\010 \001(\t\022\030\n\020" + - "stopOnQuotaReach\030\t \001(\010\022\024\n\014tenantDomain\030\n" + - " \001(\t\022\021\n\ttimestamp\030\013 \001(\003B\232\001\n,org.wso2.apk" + - ".enforcer.discovery.subscriptionB\027Subscr" + - "iptionPolicyProtoP\001ZOgithub.com/envoypro" + - "xy/go-control-plane/wso2/discovery/subsc" + - "ription;subscriptionb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_wso2_discovery_subscription_SubscriptionPolicy_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_wso2_discovery_subscription_SubscriptionPolicy_descriptor, - new java.lang.String[] { "Id", "TenantId", "Name", "QuotaType", "GraphQLMaxComplexity", "GraphQLMaxDepth", "RateLimitCount", "RateLimitTimeUnit", "StopOnQuotaReach", "TenantDomain", "Timestamp", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java index 030d301c2..ab472da4f 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/Application.java @@ -31,6 +31,34 @@ public class Application implements CacheableEntity { private String uuid; private String name = null; private String owner = null; + + public void setAttributes(Map attributes) { + + this.attributes = attributes; + } + + public String getOrganization() { + + return organization; + } + + public void setOrganization(String organization) { + + this.organization = organization; + } + + private String organization = null; + + public String getUuid() { + + return uuid; + } + + public void setUuid(String uuid) { + + this.uuid = uuid; + } + private Map attributes = new ConcurrentHashMap<>(); public String getUUID() { diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java index ba5282a7a..8a05a7d2e 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/models/SubscribedAPI.java @@ -29,6 +29,15 @@ public class SubscribedAPI { private String name = null; private String version = null; + public SubscribedAPI(org.wso2.apk.enforcer.discovery.subscription.SubscribedAPI subscribedApi) { + this.name = subscribedApi.getName(); + this.version = subscribedApi.getVersion(); + } + + public SubscribedAPI() { + + } + public String getName() { return name; } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java index b471cfeb6..cf5878f1f 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/security/jwt/validator/RevokedJWTDataHolder.java @@ -20,7 +20,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.wso2.apk.enforcer.discovery.RevokedTokenDiscoveryClient; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -35,8 +34,6 @@ public class RevokedJWTDataHolder { private static RevokedJWTDataHolder instance = new RevokedJWTDataHolder(); public void init() { - RevokedTokenDiscoveryClient revokedTokenDs = RevokedTokenDiscoveryClient.getInstance(); - revokedTokenDs.watchRevokedTokens(); } /** diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java new file mode 100644 index 000000000..0cded32cd --- /dev/null +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/EventingGrpcClient.java @@ -0,0 +1,172 @@ +package org.wso2.apk.enforcer.subscription; +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import io.grpc.ClientInterceptor; +import io.grpc.ConnectivityState; +import io.grpc.ManagedChannel; +import io.grpc.Metadata; +import io.grpc.stub.MetadataUtils; +import io.grpc.stub.StreamObserver; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.wso2.apk.enforcer.config.ConfigHolder; +import org.wso2.apk.enforcer.discovery.scheduler.XdsSchedulerManager; +import org.wso2.apk.enforcer.discovery.service.subscription.EventStreamServiceGrpc; +import org.wso2.apk.enforcer.discovery.service.subscription.Request; +import org.wso2.apk.enforcer.discovery.subscription.Application; +import org.wso2.apk.enforcer.discovery.subscription.Event; +import org.wso2.apk.enforcer.util.GRPCUtils; + +import java.util.UUID; +import java.util.concurrent.TimeUnit; + +/** + * Client to communicate with JWTIssuer discovery service at the adapter. + */ +public class EventingGrpcClient implements Runnable { + + private static final Logger logger = LogManager.getLogger(EventingGrpcClient.class); + private static EventingGrpcClient instance; + private ManagedChannel channel; + private EventStreamServiceGrpc.EventStreamServiceStub stub; + private final SubscriptionDataStoreImpl subscriptionDataStore; + private final String host; + private final String hostname; + private final int port; + + private EventingGrpcClient(String host, String hostname, int port) { + + this.host = host; + this.hostname = hostname; + this.port = port; + this.subscriptionDataStore = SubscriptionDataStoreImpl.getInstance(); + initConnection(); + } + + private void initConnection() { + + if (GRPCUtils.isReInitRequired(channel)) { + if (channel != null && !channel.isShutdown()) { + channel.shutdownNow(); + do { + try { + channel.awaitTermination(100, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + logger.error("JWTISsuer discovery channel shutdown wait was interrupted", e); + } + } while (!channel.isShutdown()); + } + Metadata metadata = new Metadata(); + String connectionId = UUID.randomUUID().toString(); + metadata.put(Metadata.Key.of("enforcer-uuid", Metadata.ASCII_STRING_MARSHALLER), + connectionId); + logger.info("Enforcer UUID: " + connectionId); + this.channel = GRPCUtils.createSecuredChannel(logger, host, port, hostname); + ClientInterceptor metadataInterceptor = MetadataUtils.newAttachHeadersInterceptor(metadata); + + this.stub = EventStreamServiceGrpc.newStub(channel).withInterceptors(metadataInterceptor); + } else if (channel.getState(true) == ConnectivityState.READY) { + XdsSchedulerManager.getInstance().stopEventStreamScheduling(); + } + } + + public static EventingGrpcClient getInstance() { + + if (instance == null) { + String sdsHost = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHost(); + String sdsHostname = ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerHostname(); + int sdsPort = Integer.parseInt(ConfigHolder.getInstance().getEnvVarConfig().getCommonControllerXdsPort()); + instance = new EventingGrpcClient(sdsHost, sdsHostname, sdsPort); + } + return instance; + } + + public void run() { + + initConnection(); + watchEvents(); + } + + public void watchEvents() { + + Request request = Request.newBuilder().setEvent("event").build(); + + stub.streamEvents(request, new StreamObserver() { + @Override + public void onNext(Event event) { + handleNotificationEvent(event); + XdsSchedulerManager.getInstance().stopEventStreamScheduling(); + } + + @Override + public void onError(Throwable t) { + + logger.error("Event error", t); + XdsSchedulerManager.getInstance().startEventScheduling(); + + } + + @Override + public void onCompleted() { + + logger.info("Completed===="); + } + }); + } + private void handleNotificationEvent(Event event) { + + switch (event.getType()) { + case "ALL_EVENTS": + subscriptionDataStore.loadStartupArtifacts(); + case "APPLICATION_CREATED": + Application application = event.getApplication(); + subscriptionDataStore.addApplication(application); + break; + case "SUBSCRIPTION_CREATED": + case "SUBSCRIPTION_UPDATED": + subscriptionDataStore.addSubscription(event.getSubscription()); + break; + case "APPLICATION_MAPPING_CREATED": + case "APPLICATION_MAPPING_UPDATED": + subscriptionDataStore.addApplicationMapping(event.getApplicationMapping()); + break; + case "APPLICATION_KEY_MAPPING_CREATED": + case "APPLICATION_KEY_MAPPING_UPDATED": + subscriptionDataStore.addApplicationKeyMapping(event.getApplicationKeyMapping()); + break; + case "APPLICATION_UPDATED": + subscriptionDataStore.addApplication(event.getApplication()); + break; + case "APPLICATION_MAPPING_DELETED": + subscriptionDataStore.removeApplicationMapping(event.getApplicationMapping()); + break; + case "APPLICATION_KEY_MAPPING_DELETED": + subscriptionDataStore.removeApplicationKeyMapping(event.getApplicationKeyMapping()); + break; + case "SUBSCRIPTION_DELETED": + subscriptionDataStore.removeSubscription(event.getSubscription()); + break; + case "APPLICATION_DELETED": + subscriptionDataStore.removeApplication(event.getApplication()); + break; + default: + logger.error("Unknown event type received from the server"); + } + } +} diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java index 18fe03df2..bee48039f 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStore.java @@ -90,7 +90,7 @@ void addApplicationKeyMappings( * @return ApplicationKeyMapping which match the given parameters */ ApplicationKeyMapping getMatchingApplicationKeyMapping(String applicationIdentifier, String keyType, - String securityScheme); + String securityScheme); /** * Filter the applications map based on the provided parameters. @@ -112,9 +112,28 @@ ApplicationKeyMapping getMatchingApplicationKeyMapping(String applicationIdentif /** * Returns the JWTValidator based on Issuer - * @param issuer issuer in JWT + * + * @param issuer issuer in JWT * @param environment environment of the Issuer * @return JWTValidator Implementation */ JWTValidator getJWTValidatorByIssuer(String issuer, String organization, String environment); + + void addApplication(org.wso2.apk.enforcer.discovery.subscription.Application application); + + void addSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription); + + void addApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping); + + void addApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping); + + void removeApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping); + + void removeApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping); + + void removeSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription); + + void removeApplication(org.wso2.apk.enforcer.discovery.subscription.Application application); + + void loadStartupArtifacts(); } diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java index 7b17e2b6e..edbd7d6b5 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/subscription/SubscriptionDataStoreImpl.java @@ -52,6 +52,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -127,15 +128,14 @@ public Subscription getSubscriptionById(String appId, String apiId) { } private void initializeLoadingTasks() { - loadSubscriptions(); - loadApplications(); - loadApplicationMappings(); - loadApplicationKeyMappings(); + ApiListDiscoveryClient.getInstance().watchApiList(); JWTIssuerDiscoveryClient.getInstance().watchJWTIssuers(); + EventingGrpcClient.getInstance().watchEvents(); } private void loadApplicationKeyMappings() { + new Thread(() -> { ApplicationKeyMappingDtoList applicationKeyMappings = subscriptionValidationDataRetrievalRestClient.getAllApplicationKeyMappings(); @@ -145,6 +145,7 @@ private void loadApplicationKeyMappings() { } private void loadApplicationMappings() { + new Thread(() -> { ApplicationMappingDtoList applicationMappings = subscriptionValidationDataRetrievalRestClient .getAllApplicationMappings(); @@ -153,12 +154,14 @@ private void loadApplicationMappings() { } - private void loadApplications(){ + private void loadApplications() { + new Thread(() -> { ApplicationListDto applications = subscriptionValidationDataRetrievalRestClient.getAllApplications(); addApplications(applications.getList()); }).start(); } + private void loadSubscriptions() { new Thread(() -> { @@ -194,7 +197,7 @@ public void addApplications(List applicationList) { Map newApplicationMap = new ConcurrentHashMap<>(); - for (ApplicationDto application: applicationList) { + for (ApplicationDto application : applicationList) { Application newApplication = new Application(); newApplication.setUUID(application.getUuid()); newApplication.setName(application.getName()); @@ -429,6 +432,129 @@ public JWTValidator getJWTValidatorByIssuer(String issuer, String organization, return null; } + @Override + public void addApplication(org.wso2.apk.enforcer.discovery.subscription.Application application) { + + Application resolvedApplication = new Application(); + resolvedApplication.setName(application.getName()); + resolvedApplication.setOwner(application.getOwner()); + resolvedApplication.setUUID(application.getUuid()); + resolvedApplication.setOrganization(application.getOrganization()); + resolvedApplication.setAttributes(application.getAttributesMap()); + if (applicationMap.containsKey(resolvedApplication.getUuid())) { + applicationMap.replace(resolvedApplication.getUuid(), resolvedApplication); + } else { + applicationMap.put(resolvedApplication.getUuid(), resolvedApplication); + } + } + + @Override + public void addSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription) { + + Subscription resolvedSubscription = new Subscription(); + resolvedSubscription.setSubscriptionId(subscription.getUuid()); + resolvedSubscription.setSubscriptionStatus(subscription.getSubStatus()); + resolvedSubscription.setOrganization(subscription.getOrganization()); + resolvedSubscription.setSubscribedApi(new SubscribedAPI(subscription.getSubscribedApi())); + if (subscriptionMap.containsKey(resolvedSubscription.getSubscriptionId())) { + subscriptionMap.replace(resolvedSubscription.getSubscriptionId(), resolvedSubscription); + } else { + subscriptionMap.put(resolvedSubscription.getSubscriptionId(), resolvedSubscription); + } + } + + @Override + public void addApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping) { + + ApplicationMapping resolvedApplicationMapping = new ApplicationMapping(); + resolvedApplicationMapping.setUuid(applicationMapping.getUuid()); + resolvedApplicationMapping.setApplicationRef(applicationMapping.getApplicationRef()); + resolvedApplicationMapping.setSubscriptionRef(applicationMapping.getSubscriptionRef()); + if (applicationMappingMap.containsKey(resolvedApplicationMapping.getUuid())) { + applicationMappingMap.replace(resolvedApplicationMapping.getUuid(), resolvedApplicationMapping); + } else { + applicationMappingMap.put(resolvedApplicationMapping.getUuid(), resolvedApplicationMapping); + } + } + + @Override + public void addApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping) { + + ApplicationKeyMapping resolvedApplicationKeyMapping = new ApplicationKeyMapping(); + resolvedApplicationKeyMapping.setApplicationUUID(applicationKeyMapping.getApplicationUUID()); + resolvedApplicationKeyMapping.setSecurityScheme(applicationKeyMapping.getSecurityScheme()); + resolvedApplicationKeyMapping.setApplicationIdentifier(applicationKeyMapping.getApplicationIdentifier()); + resolvedApplicationKeyMapping.setKeyType(applicationKeyMapping.getKeyType()); + resolvedApplicationKeyMapping.setEnvId(applicationKeyMapping.getEnvID()); + Iterator> iterator = applicationKeyMappingMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry cachedApplicationKeyMapping = iterator.next(); + ApplicationKeyMapping value = cachedApplicationKeyMapping.getValue(); + if (value.getApplicationIdentifier().equals(resolvedApplicationKeyMapping.getApplicationIdentifier()) && + value.getSecurityScheme().equals(resolvedApplicationKeyMapping.getSecurityScheme()) && + value.getKeyType().equals(resolvedApplicationKeyMapping.getKeyType()) && + value.getEnvId().equals(resolvedApplicationKeyMapping.getEnvId()) && + value.getApplicationUUID().equals(resolvedApplicationKeyMapping.getApplicationUUID())) { + iterator.remove(); + } + } + applicationKeyMappingMap.put(resolvedApplicationKeyMapping.getCacheKey(), resolvedApplicationKeyMapping); + } + + @Override + public void removeApplicationMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationMapping applicationMapping) { + + ApplicationMapping resolvedApplicationMapping = new ApplicationMapping(); + resolvedApplicationMapping.setUuid(applicationMapping.getUuid()); + resolvedApplicationMapping.setApplicationRef(applicationMapping.getApplicationRef()); + resolvedApplicationMapping.setSubscriptionRef(applicationMapping.getSubscriptionRef()); + applicationMappingMap.remove(resolvedApplicationMapping.getUuid()); + } + + @Override + public void removeApplicationKeyMapping(org.wso2.apk.enforcer.discovery.subscription.ApplicationKeyMapping applicationKeyMapping) { + + ApplicationKeyMapping resolvedApplicationKeyMapping = new ApplicationKeyMapping(); + resolvedApplicationKeyMapping.setApplicationUUID(applicationKeyMapping.getApplicationUUID()); + resolvedApplicationKeyMapping.setSecurityScheme(applicationKeyMapping.getSecurityScheme()); + resolvedApplicationKeyMapping.setApplicationIdentifier(applicationKeyMapping.getApplicationIdentifier()); + resolvedApplicationKeyMapping.setKeyType(applicationKeyMapping.getKeyType()); + resolvedApplicationKeyMapping.setEnvId(applicationKeyMapping.getEnvID()); + Iterator> iterator = applicationKeyMappingMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry cachedApplicationKeyMapping = iterator.next(); + ApplicationKeyMapping value = cachedApplicationKeyMapping.getValue(); + if (value.getApplicationIdentifier().equals(resolvedApplicationKeyMapping.getApplicationIdentifier()) && + value.getSecurityScheme().equals(resolvedApplicationKeyMapping.getSecurityScheme()) && + value.getKeyType().equals(resolvedApplicationKeyMapping.getKeyType()) && + value.getEnvId().equals(resolvedApplicationKeyMapping.getEnvId()) && + value.getApplicationUUID().equals(resolvedApplicationKeyMapping.getApplicationUUID())) { + iterator.remove(); + } + } + } + + @Override + public void removeSubscription(org.wso2.apk.enforcer.discovery.subscription.Subscription subscription) { + + subscriptionMap.remove(subscription.getUuid()); + } + + @Override + public void removeApplication(org.wso2.apk.enforcer.discovery.subscription.Application application) { + + applicationMap.remove(application.getUuid()); + } + + @Override + public void loadStartupArtifacts() { + + loadSubscriptions(); + loadApplications(); + loadApplicationMappings(); + loadApplicationKeyMappings(); + } + private List getEnvironments(JWTIssuer jwtIssuer) { List environmentsList = new ArrayList<>(); diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java index 373f3ed29..a7ec36f00 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/GRPCUtils.java @@ -19,7 +19,11 @@ package org.wso2.apk.enforcer.util; import io.grpc.ConnectivityState; +import io.grpc.Grpc; +import io.grpc.InsecureChannelCredentials; import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; @@ -37,6 +41,7 @@ public class GRPCUtils { public static ManagedChannel createSecuredChannel(Logger logger, String host, int port, String hostname) { + File certFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPublicKeyPath()).toFile(); File keyFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPrivateKeyPath()).toFile(); SslContext sslContext = null; @@ -57,6 +62,7 @@ public static ManagedChannel createSecuredChannel(Logger logger, String host, in } public static boolean isReInitRequired(ManagedChannel channel) { + if (channel != null && (channel.getState(true) == ConnectivityState.CONNECTING || channel.getState(true) == ConnectivityState.READY)) { return false; diff --git a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java index 4a98930c0..62ff2a676 100644 --- a/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java +++ b/gateway/enforcer/org.wso2.apk.enforcer/src/main/java/org/wso2/apk/enforcer/util/TLSUtils.java @@ -36,6 +36,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; @@ -51,6 +52,7 @@ * Utility Functions related to TLS Certificates. */ public class TLSUtils { + private static final Logger log = LogManager.getLogger(TLSUtils.class); private static final String X509 = "X.509"; private static final String crtExtension = ".crt"; @@ -65,6 +67,7 @@ public class TLSUtils { */ public static Certificate getCertificateFromFile(String filePath) throws CertificateException, IOException, EnforcerException { + return getCertsFromFile(filePath, true).get(0); } @@ -90,6 +93,7 @@ public static Certificate getCertificateFromString(String certificateContent) * @param trustStore Keystore with trusted certificates */ public static void addCertsToTruststore(KeyStore trustStore, String filePath) throws IOException { + if (!Files.exists(Paths.get(filePath))) { log.error("The provided certificates directory/file path does not exist. : " + filePath); return; @@ -110,6 +114,7 @@ public static void addCertsToTruststore(KeyStore trustStore, String filePath) th } public static void convertAndAddCertificatesToTrustStore(KeyStore trustStore, List certificates) { + for (Certificate certificate : certificates) { try { trustStore.setCertificateEntry(RandomStringUtils.random(10, true, false), @@ -122,6 +127,7 @@ public static void convertAndAddCertificatesToTrustStore(KeyStore trustStore, Li private static List getCertsFromFile(String filepath, boolean restrictToOne) throws CertificateException, IOException, EnforcerException { + String content = new String(Files.readAllBytes(Paths.get(filepath))); if (!content.contains(endCertificateDelimiter)) { @@ -154,6 +160,7 @@ private static List getCertsFromFile(String filepath, boolean restr } private static void updateTruststoreWithMultipleCertPem(KeyStore trustStore, String filePath) { + try { List certificateList = getCertsFromFile(filePath, false); certificateList.forEach(certificate -> { @@ -171,6 +178,7 @@ private static void updateTruststoreWithMultipleCertPem(KeyStore trustStore, Str } public static Certificate getCertificate(String filePath) throws CertificateException, IOException { + try (FileInputStream fileInputStream = new FileInputStream(filePath)) { String content = IOUtils.toString(fileInputStream); return getCertificateFromContent(content); @@ -178,6 +186,7 @@ public static Certificate getCertificate(String filePath) throws CertificateExce } public static Certificate getCertificateFromContent(String content) throws CertificateException, IOException { + CertificateFactory fact = CertificateFactory.getInstance(X509); try (InputStream is = new ByteArrayInputStream(content.getBytes())) { X509Certificate cert = (X509Certificate) fact.generateCertificate(is); @@ -192,6 +201,7 @@ public static Certificate getCertificateFromContent(String content) throws Certi * @throws SSLException */ public static SslContext buildGRPCServerSSLContext() throws SSLException { + File certFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPublicKeyPath()).toFile(); File keyFile = Paths.get(ConfigHolder.getInstance().getEnvVarConfig().getEnforcerPrivateKeyPath()).toFile(); @@ -202,6 +212,7 @@ public static SslContext buildGRPCServerSSLContext() throws SSLException { } public static KeyStore getDefaultCertTrustStore() throws EnforcerException { + try { KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); @@ -215,6 +226,7 @@ public static KeyStore getDefaultCertTrustStore() throws EnforcerException { public static void loadDefaultCertsToTrustStore(KeyStore trustStore) throws NoSuchAlgorithmException, KeyStoreException { + TrustManagerFactory tmf = TrustManagerFactory .getInstance(TrustManagerFactory.getDefaultAlgorithm()); // Using null here initialises the TMF with the default trust store. @@ -243,4 +255,20 @@ public static void loadDefaultCertsToTrustStore(KeyStore trustStore) throws }); } } + + public static KeyStore getKeyStore(String certPath, String keyPath) { + KeyStore keyStore = null; + try { + Certificate cert = + TLSUtils.getCertificateFromFile(certPath); + Key key = JWTUtils.getPrivateKey(keyPath); + keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, null); + keyStore.setKeyEntry("client-keys", key, null, new Certificate[]{cert}); + } catch (EnforcerException | CertificateException | IOException | KeyStoreException | + NoSuchAlgorithmException e) { + log.error("Error occurred while configuring KeyStore", e); + } + return keyStore; + } } diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml index 0426ebc38..7d1d0640f 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml @@ -109,7 +109,8 @@ spec: - name: enforcer_admin_pwd value: admin - name: JAVA_OPTS - value: -Dhttpclient.hostnameVerifier=AllowAll -Xms512m -Xmx512m -XX:MaxRAMFraction=2 + # value: -Dhttpclient.hostnameVerifier=AllowAll -Xms512m -Xmx512m -XX:MaxRAMFraction=2 + value: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5006 -Dhttpclient.hostnameVerifier=AllowAll -Xms512m -Xmx512m -XX:MaxRAMFraction=2 {{- if .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.redis }} - name: REDIS_USERNAME value: {{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.redis.username | default "default" }} diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 41fd0df10..9cb46b7b2 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -212,8 +212,8 @@ wso2: failureThreshold: 5 strategy: RollingUpdate replicas: 1 - imagePullPolicy: Always - image: wso2/apk-adapter:latest + imagePullPolicy: IfNotPresent + image: apk-adapter:1.0.0-SNAPSHOT security: sslHostname: "adapter" # logging: