├── components ├── distribution │ └── carbon-home │ │ ├── bin │ │ ├── version.txt │ │ ├── manager.sh │ │ ├── editor.sh │ │ └── worker.sh │ │ ├── deployment │ │ └── siddhi-files │ │ │ ├── empty.txt │ │ │ ├── MetricsTestApp.siddhi │ │ │ ├── TestInvalidSiddhiApp.siddhi │ │ │ └── store-api-test.siddhi │ │ ├── resources │ │ └── security │ │ │ ├── wso2carbon.jks │ │ │ └── client-truststore.jks │ │ └── conf │ │ └── osgi │ │ └── launch.properties ├── data-bridge │ ├── org.wso2.carbon.databridge.agent │ │ ├── src │ │ │ ├── test │ │ │ │ └── resources │ │ │ │ │ ├── wso2carbon.jks │ │ │ │ │ ├── client-truststore.jks │ │ │ │ │ ├── master-keys.yaml │ │ │ │ │ ├── secrets.properties │ │ │ │ │ ├── log4j.properties │ │ │ │ │ └── log4j2.properties │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── wso2 │ │ │ │ │ └── carbon │ │ │ │ │ └── databridge │ │ │ │ │ └── agent │ │ │ │ │ ├── internal │ │ │ │ │ └── DataAgentServiceValueHolder.java │ │ │ │ │ ├── exception │ │ │ │ │ ├── DataEndpointException.java │ │ │ │ │ ├── DataEndpointSecurityException.java │ │ │ │ │ ├── DataEndpointAuthenticationException.java │ │ │ │ │ ├── EventQueueFullException.java │ │ │ │ │ ├── DataEndpointConfigurationException.java │ │ │ │ │ └── DataEndpointAgentConfigurationException.java │ │ │ │ │ ├── endpoint │ │ │ │ │ ├── DataEndpointFailureCallback.java │ │ │ │ │ └── WrappedEventFactory.java │ │ │ │ │ ├── client │ │ │ │ │ └── AbstractSecureClientPoolFactory.java │ │ │ │ │ ├── conf │ │ │ │ │ ├── Agent.java │ │ │ │ │ └── DataAgentsConfiguration.java │ │ │ │ │ └── util │ │ │ │ │ └── DataEndpointConstants.java │ │ │ │ └── resources │ │ │ │ ├── log4j.properties │ │ │ │ └── log4j2.properties │ │ └── findbugs-exclude.xml │ ├── org.wso2.carbon.databridge.core │ │ └── src │ │ │ ├── test │ │ │ └── resources │ │ │ │ ├── wso2carbon.jks │ │ │ │ ├── master-keys.yaml │ │ │ │ ├── testng.xml │ │ │ │ ├── secrets.properties │ │ │ │ ├── log4j.properties │ │ │ │ └── log4j2.properties │ │ │ └── main │ │ │ ├── resources │ │ │ ├── stream-definitions.yaml │ │ │ ├── META-INF │ │ │ │ └── component.xml │ │ │ ├── log4j.properties │ │ │ ├── log4j2.properties │ │ │ └── databridge.config.yaml │ │ │ └── java │ │ │ └── org │ │ │ └── wso2 │ │ │ └── carbon │ │ │ └── databridge │ │ │ └── core │ │ │ ├── definitionstore │ │ │ ├── StreamAddRemoveListener.java │ │ │ └── StreamDefinitionStore.java │ │ │ ├── internal │ │ │ ├── authentication │ │ │ │ └── AuthenticationHandler.java │ │ │ └── utils │ │ │ │ └── DataBridgeConstants.java │ │ │ ├── EventConverter.java │ │ │ ├── exception │ │ │ ├── EventProcessingException.java │ │ │ ├── DataBridgeException.java │ │ │ ├── EventConversionException.java │ │ │ ├── StreamDefinitionNotFoundException.java │ │ │ ├── StreamDefinitionStoreException.java │ │ │ └── DataBridgeConfigurationException.java │ │ │ ├── conf │ │ │ ├── DataReceiver.java │ │ │ └── DataReceiverConfiguration.java │ │ │ ├── RawDataAgentCallback.java │ │ │ ├── DataBridgeSubscriberService.java │ │ │ ├── AgentCallback.java │ │ │ └── utils │ │ │ └── EventComposite.java │ ├── org.wso2.carbon.databridge.receiver.thrift │ │ └── src │ │ │ ├── test │ │ │ └── resources │ │ │ │ ├── wso2carbon.jks │ │ │ │ ├── master-keys.yaml │ │ │ │ ├── secrets.properties │ │ │ │ └── testng.xml │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── wso2 │ │ │ └── carbon │ │ │ └── databridge │ │ │ └── receiver │ │ │ └── thrift │ │ │ ├── internal │ │ │ ├── ThriftServerStartup.java │ │ │ └── ServiceHolder.java │ │ │ ├── service │ │ │ ├── ThriftEventTransmissionServlet.java │ │ │ └── ThriftSecureEventTransmissionServlet.java │ │ │ ├── converter │ │ │ └── IndexCounter.java │ │ │ └── ThriftDataReceiverFactory.java │ ├── org.wso2.carbon.databridge.commons │ │ ├── src │ │ │ ├── test │ │ │ │ └── resources │ │ │ │ │ ├── events.json │ │ │ │ │ ├── streamdefn1.json │ │ │ │ │ └── testng.xml │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── wso2 │ │ │ │ │ └── carbon │ │ │ │ │ └── databridge │ │ │ │ │ └── commons │ │ │ │ │ ├── AttributeType.java │ │ │ │ │ ├── ServerEventListener.java │ │ │ │ │ ├── exception │ │ │ │ │ ├── MalformedEventException.java │ │ │ │ │ ├── TransportException.java │ │ │ │ │ ├── AuthenticationException.java │ │ │ │ │ ├── SessionTimeoutException.java │ │ │ │ │ ├── UndefinedEventTypeException.java │ │ │ │ │ ├── StreamDefinitionException.java │ │ │ │ │ ├── NoStreamDefinitionExistException.java │ │ │ │ │ ├── MalformedStreamDefinitionException.java │ │ │ │ │ └── DifferentStreamDefinitionAlreadyDefinedException.java │ │ │ │ │ ├── EventBuilderCommonsConstants.java │ │ │ │ │ ├── utils │ │ │ │ │ └── DataBridgeThreadFactory.java │ │ │ │ │ └── Credentials.java │ │ │ │ └── resources │ │ │ │ ├── log4j.properties │ │ │ │ └── log4j2.properties │ │ └── findbugs-exclude.xml │ ├── org.wso2.carbon.databridge.commons.thrift │ │ └── src │ │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── Exception.thrift │ │ │ │ ├── Data.thrift │ │ │ │ ├── testng.xml │ │ │ │ ├── ThriftEventTransmissionService.thrift │ │ │ │ └── ThriftSecureEventTransmissionService.thrift │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── wso2 │ │ │ │ └── carbon │ │ │ │ └── databridge │ │ │ │ └── commons │ │ │ │ └── thrift │ │ │ │ ├── utils │ │ │ │ ├── CommonThriftConstants.java │ │ │ │ └── HostAddressFinder.java │ │ │ │ └── data │ │ │ │ └── ThriftAttributeType.java │ │ │ └── test │ │ │ └── resources │ │ │ └── testng.xml │ ├── org.wso2.carbon.databridge.commons.binary │ │ └── src │ │ │ ├── test │ │ │ └── resources │ │ │ │ ├── log4j.properties │ │ │ │ └── testng.xml │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── wso2 │ │ │ └── carbon │ │ │ └── databridge │ │ │ └── commons │ │ │ └── binary │ │ │ └── BinaryMessageConstants.java │ ├── org.wso2.carbon.databridge.receiver.binary │ │ └── src │ │ │ ├── test │ │ │ └── resources │ │ │ │ └── testng.xml │ │ │ └── main │ │ │ └── resources │ │ │ └── log4j.properties │ └── pom.xml ├── org.wso2.carbon.database.query.manager │ └── src │ │ ├── test │ │ └── resources │ │ │ └── testng.xml │ │ └── main │ │ └── java │ │ └── org │ │ └── wso2 │ │ └── carbon │ │ └── database │ │ └── query │ │ └── manager │ │ ├── exception │ │ └── QueryMappingNotAvailableException.java │ │ └── config │ │ └── Queries.java ├── permission-provider │ ├── org.wso2.carbon.analytics.permissions │ │ └── src │ │ │ ├── test │ │ │ └── resources │ │ │ │ └── testng.xml │ │ │ └── main │ │ │ └── java │ │ │ └── org │ │ │ └── wso2 │ │ │ └── carbon │ │ │ └── analytics │ │ │ └── permissions │ │ │ ├── PermissionManager.java │ │ │ ├── exceptions │ │ │ └── PermissionException.java │ │ │ ├── internal │ │ │ └── util │ │ │ │ └── PermissionUtil.java │ │ │ └── bean │ │ │ ├── PermissionString.java │ │ │ └── Role.java │ └── pom.xml ├── osgi-tests │ └── src │ │ └── test │ │ └── resources │ │ └── testng.xml └── authentication │ ├── org.wso2.carbon.analytics.idp.client │ └── src │ │ ├── test │ │ └── resources │ │ │ └── testng.xml │ │ └── main │ │ └── java │ │ └── org │ │ └── wso2 │ │ └── carbon │ │ └── analytics │ │ └── idp │ │ └── client │ │ ├── external │ │ ├── impl │ │ │ ├── DCRMServiceStub.java │ │ │ └── SCIM2ServiceStub.java │ │ ├── dto │ │ │ └── DCRError.java │ │ └── models │ │ │ └── ExternalSession.java │ │ ├── core │ │ ├── exception │ │ │ ├── IdPClientException.java │ │ │ └── AuthenticationException.java │ │ ├── utils │ │ │ └── config │ │ │ │ ├── RoleElement.java │ │ │ │ ├── UserElement.java │ │ │ │ ├── RoleChildElement.java │ │ │ │ ├── UserManagerElement.java │ │ │ │ ├── UserStoreElement.java │ │ │ │ ├── RESTAPIConfigurationElement.java │ │ │ │ ├── UserChildElement.java │ │ │ │ └── SSLConfiguration.java │ │ ├── spi │ │ │ └── IdPClientFactory.java │ │ └── models │ │ │ ├── Role.java │ │ │ └── User.java │ │ └── local │ │ ├── LocalIdPClientConstants.java │ │ └── models │ │ └── LocalUser.java │ └── pom.xml ├── features ├── permission-provider │ ├── org.wso2.carbon.analytics.permissions.feature │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ ├── database │ │ │ └── PERMISSION_DB.h2.db │ │ │ └── p2.inf │ └── pom.xml ├── authentication │ └── pom.xml └── data-bridge │ └── pom.xml ├── .gitignore ├── issue_template.md ├── README.md ├── deployment.yaml └── checkstyle-suppressions.xml /components/distribution/carbon-home/bin/version.txt: -------------------------------------------------------------------------------- 1 | WSO2 Stream Processor v${project.version} 2 | -------------------------------------------------------------------------------- /components/distribution/carbon-home/deployment/siddhi-files/empty.txt: -------------------------------------------------------------------------------- 1 | Empty file to make IDE happy -------------------------------------------------------------------------------- /components/distribution/carbon-home/resources/security/wso2carbon.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/carbon-analytics-common/HEAD/components/distribution/carbon-home/resources/security/wso2carbon.jks -------------------------------------------------------------------------------- /components/distribution/carbon-home/resources/security/client-truststore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/carbon-analytics-common/HEAD/components/distribution/carbon-home/resources/security/client-truststore.jks -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/test/resources/wso2carbon.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/carbon-analytics-common/HEAD/components/data-bridge/org.wso2.carbon.databridge.agent/src/test/resources/wso2carbon.jks -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/test/resources/wso2carbon.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/carbon-analytics-common/HEAD/components/data-bridge/org.wso2.carbon.databridge.core/src/test/resources/wso2carbon.jks -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/test/resources/client-truststore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/carbon-analytics-common/HEAD/components/data-bridge/org.wso2.carbon.databridge.agent/src/test/resources/client-truststore.jks -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/test/resources/wso2carbon.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/carbon-analytics-common/HEAD/components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/test/resources/wso2carbon.jks -------------------------------------------------------------------------------- /features/permission-provider/org.wso2.carbon.analytics.permissions.feature/src/main/resources/database/PERMISSION_DB.h2.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/carbon-analytics-common/HEAD/features/permission-provider/org.wso2.carbon.analytics.permissions.feature/src/main/resources/database/PERMISSION_DB.h2.db -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/test/resources/master-keys.yaml: -------------------------------------------------------------------------------- 1 | permanent: true 2 | # mastterKeys should be given in the base64 format and the data type of the 3 | # password should be explicitly specified as binary (type !!binary). 4 | masterKeys: 5 | keyStorePassword: !!binary d3NvMmNhcmJvbg== 6 | privateKeyPassword: !!binary d3NvMmNhcmJvbg== -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/test/resources/master-keys.yaml: -------------------------------------------------------------------------------- 1 | permanent: true 2 | # mastterKeys should be given in the base64 format and the data type of the 3 | # password should be explicitly specified as binary (type !!binary). 4 | masterKeys: 5 | keyStorePassword: !!binary d3NvMmNhcmJvbg== 6 | privateKeyPassword: !!binary d3NvMmNhcmJvbg== -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/test/resources/master-keys.yaml: -------------------------------------------------------------------------------- 1 | permanent: true 2 | # mastterKeys should be given in the base64 format and the data type of the 3 | # password should be explicitly specified as binary (type !!binary). 4 | masterKeys: 5 | keyStorePassword: !!binary d3NvMmNhcmJvbg== 6 | privateKeyPassword: !!binary d3NvMmNhcmJvbg== -------------------------------------------------------------------------------- /components/distribution/carbon-home/deployment/siddhi-files/MetricsTestApp.siddhi: -------------------------------------------------------------------------------- 1 | @App:name('MetricsTestApp') 2 | 3 | define stream FooStream (symbol string, price float, volume long); 4 | @source(type='inMemory', topic='symbol', @map(type='passThrough'))Define stream BarStream (symbol string, price float, volume long); 5 | 6 | from FooStream 7 | select symbol, price, volume 8 | insert into BarStream; 9 | -------------------------------------------------------------------------------- /components/distribution/carbon-home/deployment/siddhi-files/TestInvalidSiddhiApp.siddhi: -------------------------------------------------------------------------------- 1 | @App:name('TestInvalidSiddhiApp') 2 | define stream FooStream (symbol string, price float, volume long); 3 | 4 | @source(type='inMemory', topic='symbol', @map(type='passThrough'))Define stream BarStream (symbol string, price float, volume long); 5 | 6 | from FooStream 7 | select symbol, price, volume 8 | insert BarStream; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | target/ 3 | 4 | # Mobile Tools for Java (J2ME) 5 | .mtj.tmp/ 6 | 7 | # Package Files # 8 | *.jar 9 | *.war 10 | *.ear 11 | 12 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 13 | hs_err_pid* 14 | 15 | #idea files 16 | .idea/ 17 | *.iml 18 | 19 | #eclipse files 20 | .project 21 | .settings/ 22 | 23 | # Mac OS temp files 24 | .DS_Store 25 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/test/resources/events.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "payloadData":["IBM", 26.0, 848, 43.33, 2.3], 4 | "metaData":["123.233.0.1"], 5 | "timeStamp":1312345432 6 | } 7 | , 8 | { 9 | "streamId":"bar::2.1.0", 10 | "payloadData":["MSFT", 22.0, 233, 22.22, 4.3], 11 | "metaData":["5.211.1.1"] 12 | } 13 | ] -------------------------------------------------------------------------------- /features/permission-provider/org.wso2.carbon.analytics.permissions.feature/src/main/resources/p2.inf: -------------------------------------------------------------------------------- 1 | metaRequirements.0.namespace = org.eclipse.equinox.p2.iu 2 | metaRequirements.0.name = org.wso2.carbon.extensions.touchpoint 3 | metaRequirements.0.optional=true 4 | instructions.configure = \ 5 | org.wso2.carbon.extensions.touchpoint.copy(source:${installFolder}/../lib/features/org.wso2.carbon.analytics.permissions_${feature.version}/database/PERMISSION_DB.h2.db/,target:${installFolder}/../../wso2/{runtime}/database/PERMISSION_DB.h2.db,overwrite:true);\ 6 | -------------------------------------------------------------------------------- /components/distribution/carbon-home/deployment/siddhi-files/store-api-test.siddhi: -------------------------------------------------------------------------------- 1 | @App:name("store-api-test") 2 | 3 | @Source(type = 'tcp', context='SmartHomeData', 4 | @map(type='binary')) 5 | define stream SmartHomeData (id string, value float, property bool, plugId int, householdId int, houseId int, currentTime string); 6 | 7 | @PrimaryKey('recordId') 8 | define table SmartHomeTable (recordId string, value float, property bool, plugId int, householdId int, houseId int, currentTime string); 9 | 10 | from SmartHomeData 11 | select id as recordId, value, property, plugId, householdId, houseId, currentTime 12 | insert into SmartHomeTable; -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/resources/stream-definitions.yaml: -------------------------------------------------------------------------------- 1 | streamDefinitions: 2 | - "{'name':'org.wso2.esb.MediatorStatistics', 'version':'1.3.0', 'nickName':'Stock Quote Information', 'description':'Some Desc', 'metaData':[{'name':'ipAdd','type':'STRING'}], 'payloadData':[{'name':'symbol','type':'STRING'}, {'name':'price','type':'DOUBLE'}, {'name':'volume','type':'INT'}, {'name':'max','type':'DOUBLE'}, {'name':'min','type':'Double'}]}" 3 | - "{'name':'org.wso2.esb.MediatorStatistics', 'version':'1.3.4', 'nickName':'Stock Quote Information', 'description':'Some Other Desc', 'metaData':[{'name':'ipAdd','type':'STRING'}], 'payloadData':[{'name':'symbol','type':'STRING'}, {'name':'price','type':'DOUBLE'}, {'name':'volume','type':'INT'}]}" 4 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.thrift/src/main/resources/Exception.thrift: -------------------------------------------------------------------------------- 1 | namespace java org.wso2.carbon.databridge.commons.thrift.exception 2 | 3 | exception ThriftStreamDefinitionException { 4 | 1: required string message 5 | } 6 | 7 | exception ThriftNoStreamDefinitionExistException { 8 | 1: required string message 9 | } 10 | 11 | exception ThriftDifferentStreamDefinitionAlreadyDefinedException { 12 | 1: required string message 13 | } 14 | 15 | exception ThriftMalformedStreamDefinitionException { 16 | 1: required string message 17 | } 18 | 19 | exception ThriftUndefinedEventTypeException { 20 | 1: required string message 21 | } 22 | exception ThriftSessionExpiredException { 23 | 1: required string message 24 | } 25 | 26 | exception ThriftAuthenticationException { 27 | 1: required string message 28 | } 29 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.thrift/src/main/resources/Data.thrift: -------------------------------------------------------------------------------- 1 | namespace java org.wso2.carbon.databridge.commons.thrift.data 2 | 3 | enum ThriftAttributeType{ 4 | INT, 5 | LONG, 6 | FLOAT, 7 | DOUBLE, 8 | BOOL, 9 | STRING 10 | } 11 | 12 | struct ThriftAttribute{ 13 | 1: optional string name; 14 | 2: optional ThriftAttributeType attributeType; 15 | } 16 | 17 | struct ThriftEventBundle { 18 | 1: optional string sessionId; 19 | 2: optional i32 eventNum; 20 | 3: optional list intAttributeList; 21 | 4: optional list longAttributeList; 22 | 5: optional list doubleAttributeList; 23 | 6: optional list boolAttributeList; 24 | 7: optional list stringAttributeList; 25 | 8: optional map> arbitraryDataMapMap; 26 | } 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/findbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | **Description:** 2 | 3 | 4 | **Suggested Labels:** 5 | 6 | 7 | **Suggested Assignees:** 8 | 9 | 10 | **Affected Product Version:** 11 | 12 | **OS, DB, other environment details and versions:** 13 | 14 | **Steps to reproduce:** 15 | 16 | 17 | **Related Issues:** 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Carbon Analytics Common 2 | --- 3 | 4 | | Branch | Build Status | 5 | | :------------ |:------------- 6 | | master | [![Build Status](https://wso2.org/jenkins/job/platform-builds/job/carbon-analytics-common/badge/icon)](https://wso2.org/jenkins/job/platform-builds/job/carbon-analytics-common/) | 7 | 8 | --- 9 | 10 | This project contains compontents which implements common functionalities used in WSO2 analytics platform. 11 | 12 | #### Carbon Analytics Common repo contains following components: 13 | 14 | * data-bridge 15 | 16 | 17 | ## How to Contribute 18 | * Send your bug fixes pull requests to [master branch](https://github.com/wso2/carbon-analytics-common/tree/master) 19 | 20 | ## Contact us 21 | WSO2 Carbon developers can be contacted via the mailing lists: 22 | 23 | * Carbon Developers List : dev@wso2.org 24 | * Carbon Architecture List : architecture@wso2.org 25 | -------------------------------------------------------------------------------- /deployment.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the \"License\"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an \"AS IS\" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # MSF4J configuration 16 | wso2.msf4j.configuration: 17 | # No of worker pool threads to handle MSF4J requests 18 | threadCount: 100 19 | threadPoolName: msf4j.executor.workerpool 20 | 21 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/test/resources/streamdefn1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"org.wso2.esb.MediatorStatistics", 3 | "version":"1.0.2", 4 | "nickName":"Stock Quote Information", 5 | "description":"Some Desc", 6 | "tags":["foo", "bar"], 7 | "metaData":[ 8 | { 9 | "name":"ipAdd", 10 | "type":"STRING" 11 | } 12 | ], 13 | "payloadData":[ 14 | { 15 | "name":"symbol", 16 | "type":"string" 17 | }, 18 | { 19 | "name":"price", 20 | "type":"double" 21 | }, 22 | { 23 | "name":"volume", 24 | "type":"int" 25 | }, 26 | { 27 | "name":"max", 28 | "type":"double" 29 | }, 30 | { 31 | "name":"min", 32 | "type":"double" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /components/org.wso2.carbon.database.query.manager/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /components/permission-provider/org.wso2.carbon.analytics.permissions/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.thrift/src/main/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.binary/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 2 | # 3 | # WSO2 Inc. licenses this file to you under the Apache License, 4 | # Version 2.0 (the "License"); you may not use this file except 5 | # in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, 11 | # software distributed under the License is distributed on an 12 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 13 | # KIND, either express or implied. See the License for the 14 | # specific language governing permissions and limitations 15 | # under the License. 16 | 17 | log4j.rootLogger=info, console 18 | 19 | log4j.appender.console=org.apache.log4j.ConsoleAppender 20 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 21 | log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 22 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/AttributeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.wso2.carbon.databridge.commons; 18 | 19 | /** 20 | * Attribute Type of Event Stream Attributes. 21 | * 22 | * @since 5.0.0 23 | */ 24 | public enum AttributeType { 25 | INT, LONG, FLOAT, DOUBLE, STRING, BOOL 26 | } 27 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.binary/src/main/java/org/wso2/carbon/databridge/commons/binary/BinaryMessageConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.commons.binary; 19 | 20 | /** 21 | * Databridge Binary Message related constants. 22 | */ 23 | public class BinaryMessageConstants { 24 | public static final String DEFAULT_CHARSET = "UTF-8"; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /components/osgi-tests/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/definitionstore/StreamAddRemoveListener.java: -------------------------------------------------------------------------------- 1 | package org.wso2.carbon.databridge.core.definitionstore; 2 | 3 | /* 4 | * Copyright 2004,2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /** 20 | * Listener which notify when adding or removing stream. 21 | */ 22 | public interface StreamAddRemoveListener { 23 | 24 | public void streamAdded(String streamId); 25 | 26 | public void streamRemoved(String streamId); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.thrift/src/main/java/org/wso2/carbon/databridge/commons/thrift/utils/CommonThriftConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.commons.thrift.utils; 19 | 20 | /** 21 | * CommonThriftConstants class. 22 | */ 23 | public class CommonThriftConstants { 24 | 25 | public static final int SECURE_EVENT_RECEIVER_PORT_OFFSET = 100; 26 | public static final int DEFAULT_RECEIVER_PORT = 7611; 27 | } 28 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/ServerEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.commons; 20 | 21 | /** 22 | * Parent interface of handling servers. This extension point can be used to implement databridge server 23 | * handling 24 | */ 25 | public interface ServerEventListener { 26 | 27 | void start(); 28 | 29 | void stop(); 30 | 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /components/permission-provider/org.wso2.carbon.analytics.permissions/src/main/java/org/wso2/carbon/analytics/permissions/PermissionManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | */ 19 | 20 | package org.wso2.carbon.analytics.permissions; 21 | 22 | /** 23 | * Manages permission providers. 24 | */ 25 | public interface PermissionManager { 26 | /** 27 | * Get permission provider. 28 | * 29 | * @return 30 | */ 31 | PermissionProvider getProvider(); 32 | } 33 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.thrift/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.binary/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.thrift/src/main/resources/ThriftEventTransmissionService.thrift: -------------------------------------------------------------------------------- 1 | namespace java org.wso2.carbon.databridge.commons.thrift.service.general 2 | 3 | include "Data.thrift" 4 | include "Exception.thrift" 5 | 6 | service ThriftEventTransmissionService { 7 | string defineStream(1: string sessionId, 2: string streamDefinition) throws (1:Exception.ThriftDifferentStreamDefinitionAlreadyDefinedException ade, 2:Exception.ThriftMalformedStreamDefinitionException mtd, 3:Exception.ThriftStreamDefinitionException tde,4:Exception.ThriftSessionExpiredException se ), 8 | string findStreamId (1: string sessionId, 2: string streamName, 3: string streamVersion) throws (1:Exception.ThriftNoStreamDefinitionExistException tnde,2:Exception.ThriftSessionExpiredException se ), 9 | void publish(1:Data.ThriftEventBundle eventBundle) throws (1:Exception.ThriftUndefinedEventTypeException ue,2:Exception.ThriftSessionExpiredException se), 10 | bool deleteStreamById(1: string sessionId, 2: string streamId) throws (1:Exception.ThriftSessionExpiredException se ), 11 | bool deleteStreamByNameVersion(1: string sessionId, 2: string streamName, 3: string streamVersion) throws (1:Exception.ThriftSessionExpiredException se ) 12 | } -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/main/java/org/wso2/carbon/databridge/receiver/thrift/internal/ThriftServerStartup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.receiver.thrift.internal; 20 | 21 | /** 22 | * This interface contains methods for starting thrift server. 23 | */ 24 | 25 | //TODO replacement for ServerStartupObserver which used to be the interface for ThriftServerStartupImpl 26 | public interface ThriftServerStartup { 27 | 28 | void completingServerStartup(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.binary/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/external/impl/DCRMServiceStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.analytics.idp.client.external.impl; 20 | 21 | import feign.Headers; 22 | import feign.RequestLine; 23 | import feign.Response; 24 | 25 | /** 26 | * This is the stub class for DCR(M) services. 27 | */ 28 | public interface DCRMServiceStub { 29 | 30 | @Headers("Content-Type: application/json") 31 | @RequestLine("POST") 32 | Response registerApplication(String dcrClientInfo); 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/internal/authentication/AuthenticationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.core.internal.authentication; 19 | 20 | import org.wso2.carbon.databridge.core.utils.AgentSession; 21 | 22 | /** 23 | * The handler interface that's used to authenticate Agents. 24 | */ 25 | public interface AuthenticationHandler { 26 | 27 | boolean authenticate(String userName, String password); 28 | 29 | void initContext(AgentSession agentSession); 30 | 31 | void destroyContext(AgentSession agentSession); 32 | } 33 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/test/resources/secrets.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | #============================================================================== 17 | # secrets.properties 18 | # This file contains all the secrets(passwords) in the carbon server. 19 | # Usage: 20 | # alias=[plainText|cipherText] value 21 | # eg: 22 | # wso2.sample.password1=plainText ABC@123 23 | # wso2.sample.password2=cipherText SnBSWKjtZZOo0UsmOpPRhP6ZMNYTb80+BZHRDC/kxNT9ExcTswAbFjb/aip2KgQNaVuIT27UtrBaIv77Mb5sNPGiwyPrfajLNhSOlke2p8YmMkegx/mG2ytJhJa5j9iMGtCsbMt+SAf85v6kGIiH0gZA20qDZ9jnveT7/Ifz7v0\= 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/test/resources/secrets.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | #============================================================================== 17 | # secrets.properties 18 | # This file contains all the secrets(passwords) in the carbon server. 19 | # Usage: 20 | # alias=[plainText|cipherText] value 21 | # eg: 22 | # wso2.sample.password1=plainText ABC@123 23 | # wso2.sample.password2=cipherText SnBSWKjtZZOo0UsmOpPRhP6ZMNYTb80+BZHRDC/kxNT9ExcTswAbFjb/aip2KgQNaVuIT27UtrBaIv77Mb5sNPGiwyPrfajLNhSOlke2p8YmMkegx/mG2ytJhJa5j9iMGtCsbMt+SAf85v6kGIiH0gZA20qDZ9jnveT7/Ifz7v0\= 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/test/resources/secrets.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | #============================================================================== 17 | # secrets.properties 18 | # This file contains all the secrets(passwords) in the carbon server. 19 | # Usage: 20 | # alias=[plainText|cipherText] value 21 | # eg: 22 | # wso2.sample.password1=plainText ABC@123 23 | # wso2.sample.password2=cipherText SnBSWKjtZZOo0UsmOpPRhP6ZMNYTb80+BZHRDC/kxNT9ExcTswAbFjb/aip2KgQNaVuIT27UtrBaIv77Mb5sNPGiwyPrfajLNhSOlke2p8YmMkegx/mG2ytJhJa5j9iMGtCsbMt+SAf85v6kGIiH0gZA20qDZ9jnveT7/Ifz7v0\= 24 | #============================================================================== 25 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/resources/META-INF/component.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | Publish 22 | /permission/admin/publish 23 | 24 | 25 | WSO2 Event 26 | /permission/admin/publish/wso2event 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/exception/IdPClientException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.exception; 19 | 20 | /** 21 | * IdP Client Exception. 22 | */ 23 | public class IdPClientException extends Exception { 24 | public IdPClientException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public IdPClientException(Throwable cause) { 29 | super(cause); 30 | } 31 | 32 | public IdPClientException(String message) { 33 | super(message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/EventConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.core; 20 | 21 | 22 | import org.wso2.carbon.databridge.commons.Event; 23 | 24 | import java.util.List; 25 | 26 | 27 | /** 28 | * The util class that converts Events and its definitions in to various forms. 29 | */ 30 | public interface EventConverter { 31 | 32 | List toEventList(Object eventBundle, 33 | StreamTypeHolder streamTypeHolder); 34 | 35 | int getSize(Object eventBundle); 36 | 37 | int getNumberOfEvents(Object eventBundle); 38 | } 39 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/internal/DataAgentServiceValueHolder.java: -------------------------------------------------------------------------------- 1 | package org.wso2.carbon.databridge.agent.internal; 2 | 3 | /* 4 | * Copyright 2004,2005 The Apache Software Foundation. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 20 | import org.wso2.carbon.config.provider.ConfigProvider; 21 | 22 | /** 23 | * Data Agent Service value holder. 24 | */ 25 | public class DataAgentServiceValueHolder { 26 | 27 | private static ConfigProvider configProvider; 28 | 29 | public static ConfigProvider getConfigProvider() { 30 | return configProvider; 31 | } 32 | 33 | public static void setConfigProvider(ConfigProvider configProvider) { 34 | DataAgentServiceValueHolder.configProvider = configProvider; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/exception/AuthenticationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.exception; 19 | 20 | /** 21 | * Authentication Exception. 22 | */ 23 | public class AuthenticationException extends Exception { 24 | public AuthenticationException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | 28 | public AuthenticationException(Throwable cause) { 29 | super(cause); 30 | } 31 | 32 | public AuthenticationException(String message) { 33 | super(message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/utils/config/RoleElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.utils.config; 19 | 20 | import org.wso2.carbon.config.annotation.Configuration; 21 | import org.wso2.carbon.config.annotation.Element; 22 | 23 | /** 24 | * Role Element. 25 | */ 26 | @Configuration(description = "Role Element") 27 | public class RoleElement { 28 | 29 | @Element(description = "Role Child Element", required = true) 30 | private RoleChildElement role = new RoleChildElement(); 31 | 32 | public RoleChildElement getRole() { 33 | return role; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/utils/config/UserElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.utils.config; 19 | 20 | import org.wso2.carbon.config.annotation.Configuration; 21 | import org.wso2.carbon.config.annotation.Element; 22 | 23 | /** 24 | * User Element. 25 | */ 26 | @Configuration(description = "User Element") 27 | public class UserElement { 28 | 29 | @Element(description = "User Child Element", required = true) 30 | private UserChildElement user = new UserChildElement(); 31 | 32 | public UserChildElement getUser() { 33 | return user; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/external/dto/DCRError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.analytics.idp.client.external.dto; 20 | 21 | import com.google.gson.annotations.SerializedName; 22 | 23 | /** 24 | * Model of DCR(M) Error. 25 | */ 26 | public class DCRError { 27 | 28 | @SerializedName("error") 29 | private String error; 30 | @SerializedName("error_description") 31 | private String errorDescription; 32 | 33 | public String getError() { 34 | return error; 35 | } 36 | 37 | public String getErrorDescription() { 38 | return errorDescription; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/spi/IdPClientFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.spi; 19 | 20 | import org.wso2.carbon.analytics.idp.client.core.api.IdPClient; 21 | import org.wso2.carbon.analytics.idp.client.core.exception.IdPClientException; 22 | import org.wso2.carbon.analytics.idp.client.core.utils.config.IdPClientConfiguration; 23 | 24 | 25 | /** 26 | * IdP Client Factory interface. 27 | */ 28 | public interface IdPClientFactory { 29 | 30 | String getType(); 31 | 32 | IdPClient getIdPClient(IdPClientConfiguration idPClientConfiguration) 33 | throws IdPClientException; 34 | } 35 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/findbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.thrift/src/main/resources/ThriftSecureEventTransmissionService.thrift: -------------------------------------------------------------------------------- 1 | namespace java org.wso2.carbon.databridge.commons.thrift.service.secure 2 | 3 | include "Data.thrift" 4 | include "Exception.thrift" 5 | 6 | service ThriftSecureEventTransmissionService { 7 | string connect(1:string userName, 2:string password) throws 8 | (1:Exception.ThriftAuthenticationException ae), 9 | void disconnect(1:string sessionId), 10 | 11 | string defineStream(1: string sessionId, 2: string streamDefinition) throws (1:Exception.ThriftDifferentStreamDefinitionAlreadyDefinedException ade, 2:Exception.ThriftMalformedStreamDefinitionException mtd, 3:Exception.ThriftStreamDefinitionException tde,4:Exception.ThriftSessionExpiredException se ), 12 | string findStreamId (1: string sessionId, 2: string streamName, 3: string streamVersion) throws (1:Exception.ThriftNoStreamDefinitionExistException tnde,2:Exception.ThriftSessionExpiredException se ), 13 | void publish(1:Data.ThriftEventBundle eventBundle) throws (1:Exception.ThriftUndefinedEventTypeException ue,2:Exception.ThriftSessionExpiredException se), 14 | bool deleteStreamById(1: string sessionId, 2: string streamId) throws (1:Exception.ThriftSessionExpiredException se ), 15 | bool deleteStreamByNameVersion(1: string sessionId, 2: string streamName, 3: string streamVersion) throws (1:Exception.ThriftSessionExpiredException se ) 16 | 17 | } -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/main/java/org/wso2/carbon/databridge/receiver/thrift/service/ThriftEventTransmissionServlet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.wso2.carbon.databridge.receiver.thrift.service; 17 | 18 | import org.apache.thrift.TProcessor; 19 | import org.apache.thrift.protocol.TProtocolFactory; 20 | import org.apache.thrift.server.TServlet; 21 | 22 | /** 23 | * Thrift Event Transmission Servlet. 24 | */ 25 | public class ThriftEventTransmissionServlet extends TServlet { 26 | 27 | public ThriftEventTransmissionServlet(TProcessor processor, TProtocolFactory inProtocolFactory, 28 | TProtocolFactory outProtocolFactory) { 29 | super(processor, inProtocolFactory, outProtocolFactory); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/external/models/ExternalSession.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.external.models; 19 | 20 | /** 21 | * Session object maintained by the external idp client. 22 | */ 23 | public class ExternalSession { 24 | private String userName; 25 | private String accessToken; 26 | 27 | public ExternalSession(String userName, String accessToken) { 28 | this.userName = userName; 29 | this.accessToken = accessToken; 30 | } 31 | 32 | public String getUserName() { 33 | return userName; 34 | } 35 | 36 | public String getAccessToken() { 37 | return accessToken; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /components/org.wso2.carbon.database.query.manager/src/main/java/org/wso2/carbon/database/query/manager/exception/QueryMappingNotAvailableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.database.query.manager.exception; 20 | 21 | /** 22 | * This exception will be thrown in case a where it cannot mapping the queries. 23 | */ 24 | public class QueryMappingNotAvailableException extends Exception { 25 | public QueryMappingNotAvailableException(String message) { 26 | super(message); 27 | } 28 | 29 | public QueryMappingNotAvailableException(String message, Throwable cause) { 30 | super(message, cause); 31 | } 32 | 33 | public QueryMappingNotAvailableException(Throwable cause) { 34 | super(cause); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/exception/EventProcessingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed to the Apache Software Foundation (ASF) under one or more 6 | * contributor license agreements. See the NOTICE file distributed with 7 | * this work for additional information regarding copyright ownership. 8 | * The ASF licenses this file to You under the Apache License, Version 2.0 9 | * (the "License"); you may not use this file except in compliance with 10 | * the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.wso2.carbon.databridge.core.exception; 22 | 23 | /** 24 | * WSo2Event processing exception. 25 | */ 26 | public class EventProcessingException extends Exception { 27 | public EventProcessingException(String s) { 28 | super(s); 29 | } 30 | 31 | public EventProcessingException(String s, Throwable throwable) { 32 | super(s, throwable); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/local/LocalIdPClientConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.local; 19 | 20 | /** 21 | * Local IdP Client Constants. 22 | */ 23 | public class LocalIdPClientConstants { 24 | 25 | public static final String LOCAL_IDP_CLIENT_TYPE = "local"; 26 | 27 | public static final String SESSION_TIME_OUT = "sessionTimeout"; 28 | public static final String DEFAULT_SESSION_TIMEOUT = "3600"; 29 | 30 | public static final String REFRESH_SESSION_TIME_OUT = "refreshSessionTimeout"; 31 | public static final String DEFAULT_REFRESH_SESSION_TIMEOUT = "86400"; 32 | 33 | private LocalIdPClientConstants() { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/exception/MalformedEventException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.wso2.carbon.databridge.commons.exception; 18 | 19 | /** 20 | * Malformed Event Exception. 21 | */ 22 | public class MalformedEventException extends RuntimeException { 23 | private String errorMessage; 24 | 25 | public MalformedEventException() { 26 | } 27 | 28 | public MalformedEventException(String s) { 29 | super(s); 30 | errorMessage = s; 31 | } 32 | 33 | public MalformedEventException(String s, Throwable throwable) { 34 | super(s, throwable); 35 | errorMessage = s; 36 | } 37 | 38 | public String getErrorMessage() { 39 | return errorMessage; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /components/distribution/carbon-home/conf/osgi/launch.properties: -------------------------------------------------------------------------------- 1 | # Uncomment the following line to enable OSGi console. Specify a port as value of the following property to allow 2 | # telnet access to OSGi console 3 | osgi.console= 4 | 5 | org.osgi.framework.bundle.parent=framework 6 | 7 | 8 | # When osgi.clean is set to "true", any cached data used by the OSGi framework 9 | # will be wiped clean. This will clean the caches used to store bundle 10 | # dependency resolution and eclipse extension registry data. Using this 11 | # option will force OSGi framework to reinitialize these caches. 12 | # The following setting is put in place to get rid of the problems 13 | # faced when re-starting the system. Please note that, when this setting is 14 | # true, if you manually start a bundle, it would not be available when 15 | # you re-start the system. To avid this, copy the bundle jar to the plugins 16 | # folder, before you re-start the system. 17 | osgi.clean=true 18 | 19 | # Uncomment the following line to turn on Eclipse Equinox debugging. 20 | # You may also edit the osgi-debug.options file and fine tune the debugging 21 | # options to suite your needs. 22 | #osgi.debug=./conf/osgi/osgi-debug.options 23 | 24 | carbon.server.listeners=org.wso2.carbon.launcher.extensions.OSGiLibBundleDeployer 25 | osgi.compatibility.bootdelegation=true 26 | org.osgi.framework.system.packages.extra=sun.misc 27 | org.osgi.framework.bootdelegation=sun.misc,sun.security.provider,sun.reflect.generics.reflectiveObjects,sun.security.util -------------------------------------------------------------------------------- /checkstyle-suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.thrift/src/main/java/org/wso2/carbon/databridge/commons/thrift/data/ThriftAttributeType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Autogenerated by Thrift Compiler (0.16.0) 3 | * 4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 5 | * @generated 6 | */ 7 | package org.wso2.carbon.databridge.commons.thrift.data; 8 | 9 | 10 | @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2022-04-22") 11 | public enum ThriftAttributeType implements org.apache.thrift.TEnum { 12 | INT(0), 13 | LONG(1), 14 | FLOAT(2), 15 | DOUBLE(3), 16 | BOOL(4), 17 | STRING(5); 18 | 19 | private final int value; 20 | 21 | private ThriftAttributeType(int value) { 22 | this.value = value; 23 | } 24 | 25 | /** 26 | * Get the integer value of this enum value, as defined in the Thrift IDL. 27 | */ 28 | public int getValue() { 29 | return value; 30 | } 31 | 32 | /** 33 | * Find a the enum type by its integer value, as defined in the Thrift IDL. 34 | * @return null if the value is not found. 35 | */ 36 | @org.apache.thrift.annotation.Nullable 37 | public static ThriftAttributeType findByValue(int value) { 38 | switch (value) { 39 | case 0: 40 | return INT; 41 | case 1: 42 | return LONG; 43 | case 2: 44 | return FLOAT; 45 | case 3: 46 | return DOUBLE; 47 | case 4: 48 | return BOOL; 49 | case 5: 50 | return STRING; 51 | default: 52 | return null; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /components/permission-provider/org.wso2.carbon.analytics.permissions/src/main/java/org/wso2/carbon/analytics/permissions/exceptions/PermissionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | */ 19 | 20 | package org.wso2.carbon.analytics.permissions.exceptions; 21 | 22 | /** 23 | * General permission exception class. 24 | */ 25 | public class PermissionException extends RuntimeException { 26 | 27 | /** 28 | * Constructor with message. 29 | * 30 | * @param message 31 | */ 32 | public PermissionException(String message) { 33 | super(message); 34 | } 35 | 36 | /** 37 | * Constructor with message and the exception. 38 | * 39 | * @param message 40 | * @param e 41 | */ 42 | public PermissionException(String message, Throwable e) { 43 | super(message, e); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/models/Role.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.models; 19 | 20 | /** 21 | * Group class. 22 | */ 23 | public class Role { 24 | private String id; 25 | private String displayName; 26 | 27 | public Role(String id, String displayName) { 28 | this.id = id; 29 | this.displayName = displayName; 30 | } 31 | 32 | public String getId() { 33 | return id; 34 | } 35 | 36 | public void setId(String id) { 37 | this.id = id; 38 | } 39 | 40 | public String getDisplayName() { 41 | return displayName; 42 | } 43 | 44 | public void setDisplayName(String displayName) { 45 | this.displayName = displayName; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /components/permission-provider/org.wso2.carbon.analytics.permissions/src/main/java/org/wso2/carbon/analytics/permissions/internal/util/PermissionUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | */ 19 | package org.wso2.carbon.analytics.permissions.internal.util; 20 | 21 | import org.wso2.carbon.analytics.permissions.bean.Permission; 22 | 23 | import java.nio.charset.Charset; 24 | import java.util.UUID; 25 | 26 | /** 27 | * Permission Util Class. 28 | */ 29 | public class PermissionUtil { 30 | private static final Charset charset = Charset.forName("UTF-8"); 31 | 32 | /** 33 | * @param permission 34 | * @return 35 | */ 36 | public static String createPermissionID(Permission permission) { 37 | String uuid = UUID.nameUUIDFromBytes(permission.toString().getBytes(charset)).toString(); 38 | return uuid; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/exception/TransportException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | package org.wso2.carbon.databridge.commons.exception; 19 | 20 | 21 | /** 22 | * TransportException. 23 | */ 24 | public class TransportException extends Exception { 25 | 26 | private String errorMessage; 27 | 28 | public TransportException() { 29 | } 30 | 31 | public TransportException(String message) { 32 | super(message); 33 | errorMessage = message; 34 | } 35 | 36 | public TransportException(String message, Throwable cause) { 37 | super(message, cause); 38 | errorMessage = message; 39 | } 40 | 41 | public TransportException(Throwable cause) { 42 | super(cause); 43 | } 44 | 45 | public String getErrorMessage() { 46 | return errorMessage; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/exception/DataEndpointException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.agent.exception; 19 | 20 | /** 21 | * Exception to be thrown when communicating with DataEndpoint. 22 | */ 23 | 24 | public class DataEndpointException extends Exception { 25 | private String errorMessage; 26 | 27 | public DataEndpointException(String message) { 28 | super(message); 29 | errorMessage = message; 30 | } 31 | 32 | public DataEndpointException(String message, Throwable cause) { 33 | super(message, cause); 34 | errorMessage = message; 35 | } 36 | 37 | public DataEndpointException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | public String getErrorMessage() { 42 | return errorMessage; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/endpoint/DataEndpointFailureCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.agent.endpoint; 19 | 20 | import org.wso2.carbon.databridge.commons.Event; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * This interface is used to implement a call back for get the notifications upon the unsuccessful event publishing. 26 | */ 27 | public interface DataEndpointFailureCallback { 28 | 29 | /** 30 | * Notifies the The failed events, and should try to send the events again successfully. 31 | * In case if this couldn't send the events, then the unsuccessful events list needs to be returned back. 32 | * 33 | * @param events List failed events 34 | * 35 | */ 36 | public void tryResendEvents(List events, DataEndpoint failedEP); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/utils/config/RoleChildElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.utils.config; 19 | 20 | import org.wso2.carbon.config.annotation.Configuration; 21 | import org.wso2.carbon.config.annotation.Element; 22 | 23 | /** 24 | * Role Child Element. 25 | */ 26 | @Configuration(description = "Role Child Element configuration") 27 | public class RoleChildElement { 28 | 29 | @Element(description = "Role Id", required = true) 30 | private String id = "1"; 31 | 32 | @Element(description = "Role Display Name", required = true) 33 | private String displayName = "admin"; 34 | 35 | public String getId() { 36 | return id; 37 | } 38 | 39 | public String getDisplayName() { 40 | return displayName; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/client/AbstractSecureClientPoolFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.agent.client; 19 | 20 | /** 21 | * This abstract class needs to be implemented to handling secure communication with the endpoint. 22 | */ 23 | public abstract class AbstractSecureClientPoolFactory extends AbstractClientPoolFactory { 24 | 25 | private String trustStorePassword; 26 | 27 | private String trustStore; 28 | 29 | public AbstractSecureClientPoolFactory(String trustStore, String trustStorePassword) { 30 | this.trustStore = trustStore; 31 | this.trustStorePassword = trustStorePassword; 32 | } 33 | 34 | public String getTrustStorePassword() { 35 | return trustStorePassword; 36 | } 37 | 38 | public String getTrustStore() { 39 | return trustStore; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/exception/AuthenticationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | package org.wso2.carbon.databridge.commons.exception; 19 | 20 | /** 21 | * Data Bridge Authentication Exception. 22 | */ 23 | public class AuthenticationException extends Exception { 24 | private String errorMessage; 25 | 26 | public AuthenticationException() { 27 | } 28 | 29 | public AuthenticationException(String message) { 30 | super(message); 31 | errorMessage = message; 32 | } 33 | 34 | public AuthenticationException(String message, Throwable cause) { 35 | super(message, cause); 36 | errorMessage = message; 37 | } 38 | 39 | public AuthenticationException(Throwable cause) { 40 | super(cause); 41 | } 42 | 43 | public String getErrorMessage() { 44 | return errorMessage; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/exception/SessionTimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | package org.wso2.carbon.databridge.commons.exception; 19 | 20 | /** 21 | * Data Bridge Session Timeout Exception. 22 | */ 23 | public class SessionTimeoutException extends Exception { 24 | private String errorMessage; 25 | 26 | public SessionTimeoutException() { 27 | } 28 | 29 | public SessionTimeoutException(String message) { 30 | super(message); 31 | errorMessage = message; 32 | } 33 | 34 | public SessionTimeoutException(String message, Throwable cause) { 35 | super(message, cause); 36 | errorMessage = message; 37 | } 38 | 39 | public SessionTimeoutException(Throwable cause) { 40 | super(cause); 41 | } 42 | 43 | public String getErrorMessage() { 44 | return errorMessage; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/exception/UndefinedEventTypeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.wso2.carbon.databridge.commons.exception; 18 | 19 | /** 20 | * UndefinedEventTypeException. 21 | */ 22 | public class UndefinedEventTypeException extends Exception { 23 | private String errorMessage; 24 | 25 | public UndefinedEventTypeException() { 26 | } 27 | 28 | public UndefinedEventTypeException(String message) { 29 | super(message); 30 | errorMessage = message; 31 | } 32 | 33 | public UndefinedEventTypeException(String message, Throwable cause) { 34 | super(message, cause); 35 | errorMessage = message; 36 | } 37 | 38 | public UndefinedEventTypeException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | public String getErrorMessage() { 43 | return errorMessage; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/exception/DataEndpointSecurityException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.agent.exception; 19 | 20 | /** 21 | * Security Exception thrown when communicating with Data Endpoint. 22 | */ 23 | 24 | public class DataEndpointSecurityException extends Exception { 25 | private String errorMessage; 26 | 27 | public DataEndpointSecurityException(String message) { 28 | super(message); 29 | errorMessage = message; 30 | } 31 | 32 | public DataEndpointSecurityException(String message, Throwable cause) { 33 | super(message, cause); 34 | errorMessage = message; 35 | } 36 | 37 | public DataEndpointSecurityException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | public String getErrorMessage() { 42 | return errorMessage; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/exception/StreamDefinitionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | package org.wso2.carbon.databridge.commons.exception; 19 | 20 | /** 21 | * Generic Data Bridge Stream Definition Exception. 22 | */ 23 | public class StreamDefinitionException extends Exception { 24 | private String errorMessage; 25 | 26 | public StreamDefinitionException() { 27 | } 28 | 29 | public StreamDefinitionException(String message) { 30 | super(message); 31 | errorMessage = message; 32 | } 33 | 34 | public StreamDefinitionException(String message, Throwable cause) { 35 | super(message, cause); 36 | errorMessage = message; 37 | } 38 | 39 | public StreamDefinitionException(Throwable cause) { 40 | super(cause); 41 | } 42 | 43 | public String getErrorMessage() { 44 | return errorMessage; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/exception/DataEndpointAuthenticationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.agent.exception; 19 | 20 | /** 21 | * Exception to be thrown when connecting the Data Endpoint. 22 | */ 23 | 24 | public class DataEndpointAuthenticationException extends Exception { 25 | private String errorMessage; 26 | 27 | public DataEndpointAuthenticationException(String message) { 28 | super(message); 29 | errorMessage = message; 30 | } 31 | 32 | public DataEndpointAuthenticationException(String message, Throwable cause) { 33 | super(message, cause); 34 | errorMessage = message; 35 | } 36 | 37 | public DataEndpointAuthenticationException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | public String getErrorMessage() { 42 | return errorMessage; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/conf/DataReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.core.conf; 20 | 21 | import org.wso2.carbon.config.annotation.Configuration; 22 | import org.wso2.carbon.config.annotation.Element; 23 | 24 | import java.util.LinkedHashMap; 25 | 26 | /** 27 | * Class which wrap data receiver constructs. 28 | */ 29 | @Configuration(description = "Data Receiver configuration") 30 | public class DataReceiver { 31 | 32 | @Element(description = "Data receiver configuration") 33 | private DataReceiverConfiguration dataReceiver; 34 | 35 | public DataReceiverConfiguration getDataReceiver() { 36 | return dataReceiver; 37 | } 38 | 39 | public DataReceiver(String type, LinkedHashMap propertiesMap) { 40 | dataReceiver = new DataReceiverConfiguration(type, propertiesMap); 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # WSO2 Inc. licenses this file to you under the Apache License, 5 | # Version 2.0 (the "License"); you may not use this file except 6 | # in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | 19 | 20 | # For the general syntax of property based configuration files see the 21 | # documenation of org.apache.log4j.PropertyConfigurator. 22 | 23 | # The root category uses the appender called A1. Since no priority is 24 | # specified, the root category assumes the default priority for root 25 | # which is DEBUG in log4j. The root category is the only category that 26 | # has a default priority. All other categories need not be assigned a 27 | # priority in which case they inherit their priority from the 28 | # hierarchy. 29 | 30 | #log4j.rootLogger=DEBUG, stdout 31 | log4j.rootLogger=INFO, stdout 32 | 33 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 34 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 35 | log4j.appender.stdout.layout.ConversionPattern=%m%n 36 | #log4j.appender.stdout.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 37 | -------------------------------------------------------------------------------- /components/authentication/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | org.wso2.carbon.analytics-common 23 | org.wso2.carbon.analytics-common.parent 24 | 6.1.70-SNAPSHOT 25 | ../../pom.xml 26 | 27 | 28 | 4.0.0 29 | authentication 30 | pom 31 | WSO2 Carbon - Authenticator Aggregator Module 32 | http://wso2.org 33 | 34 | 35 | org.wso2.carbon.analytics.idp.client 36 | 37 | 38 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/exception/EventQueueFullException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.agent.exception; 19 | 20 | /** 21 | * Exception to be thrown when the event is tried to insert into the queue 22 | * which doesn't have adequate capacity to hold. 23 | */ 24 | 25 | public class EventQueueFullException extends Exception { 26 | private String errorMessage; 27 | 28 | public EventQueueFullException(String message) { 29 | super(message); 30 | errorMessage = message; 31 | } 32 | 33 | public EventQueueFullException(String message, Throwable cause) { 34 | super(message, cause); 35 | errorMessage = message; 36 | } 37 | 38 | public EventQueueFullException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | public String getErrorMessage() { 43 | return errorMessage; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/conf/Agent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.agent.conf; 20 | 21 | import org.wso2.carbon.config.annotation.Configuration; 22 | import org.wso2.carbon.config.annotation.Element; 23 | 24 | 25 | /** 26 | * Class which wrap data receiver constructs. 27 | */ 28 | @Configuration(description = "Agent configuration") 29 | public class Agent { 30 | 31 | @Element(description = "Agent configuration") 32 | private AgentConfiguration agentConfiguration; 33 | 34 | public AgentConfiguration getAgentConfiguration() { 35 | return agentConfiguration; 36 | } 37 | 38 | public Agent(String name, String dataEndpointClass) { 39 | agentConfiguration = new AgentConfiguration(name, dataEndpointClass); 40 | } 41 | 42 | public Agent() { 43 | agentConfiguration = new AgentConfiguration(); 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/exception/NoStreamDefinitionExistException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | package org.wso2.carbon.databridge.commons.exception; 19 | 20 | /** 21 | * No Stream Definition Exist Exception. 22 | */ 23 | public class NoStreamDefinitionExistException extends Exception { 24 | private String errorMessage; 25 | 26 | public NoStreamDefinitionExistException() { 27 | } 28 | 29 | public NoStreamDefinitionExistException(String message) { 30 | super(message); 31 | errorMessage = message; 32 | } 33 | 34 | public NoStreamDefinitionExistException(String message, Throwable cause) { 35 | super(message, cause); 36 | errorMessage = message; 37 | } 38 | 39 | public NoStreamDefinitionExistException(Throwable cause) { 40 | super(cause); 41 | } 42 | 43 | public String getErrorMessage() { 44 | return errorMessage; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/external/impl/SCIM2ServiceStub.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.external.impl; 19 | 20 | import feign.Param; 21 | import feign.RequestLine; 22 | import feign.Response; 23 | 24 | /** 25 | * This is the stub class for SCIM2 services. 26 | */ 27 | public interface SCIM2ServiceStub { 28 | 29 | @RequestLine("GET /Users?filter={query}") 30 | Response searchUser(@Param("query") String query); 31 | 32 | @RequestLine("GET /Groups") 33 | Response getAllGroups(); 34 | 35 | @RequestLine("GET /Groups?domain={query}") 36 | Response getAllDomainGroups(@Param("query") String query); 37 | 38 | @RequestLine("GET /Groups?filter={query}") 39 | Response getFilteredGroups(@Param("query") String query); 40 | 41 | @RequestLine("GET /Users/{id}") 42 | Response getUserByID(@Param("id") String id); 43 | } 44 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/utils/config/UserManagerElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.utils.config; 19 | 20 | import org.wso2.carbon.config.annotation.Configuration; 21 | import org.wso2.carbon.config.annotation.Element; 22 | 23 | /** 24 | * User manager Element. 25 | */ 26 | @Configuration(description = "User Manager Element") 27 | public class UserManagerElement { 28 | 29 | @Element(description = "Admin Role - Display name of the role defined in the user store", required = true) 30 | private String adminRole = "admin"; 31 | 32 | @Element(description = "User Store") 33 | private UserStoreElement userStore = new UserStoreElement(); 34 | 35 | public String getAdminRole() { 36 | return adminRole; 37 | } 38 | 39 | public UserStoreElement getUserStore() { 40 | return userStore; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # WSO2 Inc. licenses this file to you under the Apache License, 5 | # Version 2.0 (the "License"); you may not use this file except 6 | # in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | 19 | 20 | # For the general syntax of property based configuration files see the 21 | # documenation of org.apache.log4j.PropertyConfigurator. 22 | 23 | # The root category uses the appender called A1. Since no priority is 24 | # specified, the root category assumes the default priority for root 25 | # which is DEBUG in log4j. The root category is the only category that 26 | # has a default priority. All other categories need not be assigned a 27 | # priority in which case they inherit their priority from the 28 | # hierarchy. 29 | 30 | #log4j.rootLogger=debug, console 31 | log4j.rootLogger=info, console 32 | 33 | log4j.appender.console=org.apache.log4j.ConsoleAppender 34 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 35 | #log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 36 | log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 37 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # WSO2 Inc. licenses this file to you under the Apache License, 5 | # Version 2.0 (the "License"); you may not use this file except 6 | # in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | 19 | 20 | # For the general syntax of property based configuration files see the 21 | # documenation of org.apache.log4j.PropertyConfigurator. 22 | 23 | # The root category uses the appender called A1. Since no priority is 24 | # specified, the root category assumes the default priority for root 25 | # which is DEBUG in log4j. The root category is the only category that 26 | # has a default priority. All other categories need not be assigned a 27 | # priority in which case they inherit their priority from the 28 | # hierarchy. 29 | 30 | #log4j.rootLogger=debug, console 31 | log4j.rootLogger=info, console 32 | 33 | log4j.appender.console=org.apache.log4j.ConsoleAppender 34 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 35 | #log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 36 | log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 37 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # WSO2 Inc. licenses this file to you under the Apache License, 5 | # Version 2.0 (the "License"); you may not use this file except 6 | # in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | 19 | 20 | # For the general syntax of property based configuration files see the 21 | # documenation of org.apache.log4j.PropertyConfigurator. 22 | 23 | # The root category uses the appender called A1. Since no priority is 24 | # specified, the root category assumes the default priority for root 25 | # which is DEBUG in log4j. The root category is the only category that 26 | # has a default priority. All other categories need not be assigned a 27 | # priority in which case they inherit their priority from the 28 | # hierarchy. 29 | 30 | #log4j.rootLogger=debug, console 31 | log4j.rootLogger=info, console 32 | 33 | log4j.appender.console=org.apache.log4j.ConsoleAppender 34 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 35 | #log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 36 | log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 37 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # WSO2 Inc. licenses this file to you under the Apache License, 5 | # Version 2.0 (the "License"); you may not use this file except 6 | # in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | 19 | 20 | # For the general syntax of property based configuration files see the 21 | # documenation of org.apache.log4j.PropertyConfigurator. 22 | 23 | # The root category uses the appender called A1. Since no priority is 24 | # specified, the root category assumes the default priority for root 25 | # which is DEBUG in log4j. The root category is the only category that 26 | # has a default priority. All other categories need not be assigned a 27 | # priority in which case they inherit their priority from the 28 | # hierarchy. 29 | 30 | #log4j.rootLogger=debug, console 31 | log4j.rootLogger=info, console 32 | 33 | log4j.appender.console=org.apache.log4j.ConsoleAppender 34 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 35 | #log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 36 | log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 37 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/exception/MalformedStreamDefinitionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | package org.wso2.carbon.databridge.commons.exception; 19 | 20 | /** 21 | * Malformed Stream Definition Exception. 22 | */ 23 | public class MalformedStreamDefinitionException extends Exception { 24 | private String errorMessage; 25 | 26 | public MalformedStreamDefinitionException() { 27 | } 28 | 29 | public MalformedStreamDefinitionException(String message) { 30 | super(message); 31 | errorMessage = message; 32 | } 33 | 34 | public MalformedStreamDefinitionException(String message, Throwable cause) { 35 | super(message, cause); 36 | errorMessage = message; 37 | } 38 | 39 | public MalformedStreamDefinitionException(Throwable cause) { 40 | super(cause); 41 | } 42 | 43 | public String getErrorMessage() { 44 | return errorMessage; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/exception/DataEndpointConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.agent.exception; 19 | 20 | /** 21 | * Exception to be thrown When parsing the Data Endpoint configurations when initializing data publisher. 22 | */ 23 | 24 | public class DataEndpointConfigurationException extends Exception { 25 | private String errorMessage; 26 | 27 | public DataEndpointConfigurationException(String message) { 28 | super(message); 29 | errorMessage = message; 30 | } 31 | 32 | public DataEndpointConfigurationException(String message, Throwable cause) { 33 | super(message, cause); 34 | errorMessage = message; 35 | } 36 | 37 | public DataEndpointConfigurationException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | public String getErrorMessage() { 42 | return errorMessage; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.binary/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # WSO2 Inc. licenses this file to you under the Apache License, 5 | # Version 2.0 (the "License"); you may not use this file except 6 | # in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | 19 | 20 | # For the general syntax of property based configuration files see the 21 | # documenation of org.apache.log4j.PropertyConfigurator. 22 | 23 | # The root category uses the appender called A1. Since no priority is 24 | # specified, the root category assumes the default priority for root 25 | # which is DEBUG in log4j. The root category is the only category that 26 | # has a default priority. All other categories need not be assigned a 27 | # priority in which case they inherit their priority from the 28 | # hierarchy. 29 | 30 | #log4j.rootLogger=debug, console 31 | log4j.rootLogger=info, console 32 | 33 | log4j.appender.console=org.apache.log4j.ConsoleAppender 34 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 35 | #log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 36 | log4j.appender.console.layout.ConversionPattern=[%t] %-5p %c %x - %m%n 37 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/RawDataAgentCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.core; 20 | 21 | import org.wso2.carbon.databridge.commons.StreamDefinition; 22 | 23 | /** 24 | * RawData Agent Callback. 25 | */ 26 | public interface RawDataAgentCallback { 27 | 28 | /** 29 | * will get called when types are defined. 30 | * 31 | * @param streamDefinition TypeDefinition of event streams 32 | */ 33 | void definedStream(StreamDefinition streamDefinition); 34 | 35 | /** 36 | * will get called when types are removed. 37 | * 38 | * @param streamDefinition TypeDefinition of event streams 39 | */ 40 | void removeStream(StreamDefinition streamDefinition); 41 | 42 | /** 43 | * will get called when Events arrive. 44 | * 45 | * @param eventComposite Event Composite 46 | */ 47 | void receive(Object eventComposite); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /features/authentication/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | org.wso2.carbon.analytics-common 23 | org.wso2.carbon.analytics-common.parent 24 | 6.1.70-SNAPSHOT 25 | ../../pom.xml 26 | 27 | 28 | 4.0.0 29 | authentication-feature 30 | pom 31 | WSO2 Carbon - Authentication - Feature Aggregator Module 32 | http://wso2.org 33 | 34 | 35 | org.wso2.carbon.analytics.idp.client.feature 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /features/permission-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | org.wso2.carbon.analytics-common 24 | org.wso2.carbon.analytics-common.parent 25 | 6.1.70-SNAPSHOT 26 | ../../pom.xml 27 | 28 | 29 | 4.0.0 30 | permission-provider-feature 31 | pom 32 | WSO2 Carbon - Permission Provider - Feature Aggregator Module 33 | http://wso2.org 34 | 35 | 36 | org.wso2.carbon.analytics.permissions.feature 37 | 38 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/exception/DataEndpointAgentConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.agent.exception; 19 | 20 | /** 21 | * Exception to be thrown for DataEndpointAgentConfiguration which was specified in the data.agent.config.yaml. 22 | */ 23 | 24 | public class DataEndpointAgentConfigurationException extends Exception { 25 | private String errorMessage; 26 | 27 | public DataEndpointAgentConfigurationException(String message) { 28 | super(message); 29 | errorMessage = message; 30 | } 31 | 32 | public DataEndpointAgentConfigurationException(String message, Throwable cause) { 33 | super(message, cause); 34 | errorMessage = message; 35 | } 36 | 37 | public DataEndpointAgentConfigurationException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | public String getErrorMessage() { 42 | return errorMessage; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/DataBridgeSubscriberService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.core; 19 | 20 | import org.wso2.carbon.databridge.core.definitionstore.StreamDefinitionStore; 21 | 22 | import java.util.List; 23 | 24 | /** 25 | * Databridge subscriber service. 26 | */ 27 | public interface DataBridgeSubscriberService extends StreamDefinitionStore { 28 | 29 | 30 | /** 31 | * CEP/BAM can subscribe for Event Streams. 32 | * 33 | * @param agentCallback callbacks of the subscribers 34 | */ 35 | public void subscribe(AgentCallback agentCallback); 36 | 37 | /** 38 | * CEP/BAM can subscribe for Raw Event Streams. 39 | * 40 | * @param agentCallback callbacks of the subscribers 41 | */ 42 | public void subscribe(RawDataAgentCallback agentCallback); 43 | 44 | public List getSubscribers(); 45 | 46 | public List getRawDataSubscribers(); 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/utils/config/UserStoreElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.utils.config; 19 | 20 | import org.wso2.carbon.config.annotation.Configuration; 21 | import org.wso2.carbon.config.annotation.Element; 22 | 23 | import java.util.Collections; 24 | import java.util.List; 25 | 26 | /** 27 | * User store Element. 28 | */ 29 | @Configuration(description = "User Store Element") 30 | public class UserStoreElement { 31 | 32 | @Element(description = "Groups", required = true) 33 | private List roles = Collections.singletonList(new RoleElement()); 34 | 35 | @Element(description = "Users", required = true) 36 | private List users = Collections.singletonList(new UserElement()); 37 | 38 | public List getUsers() { 39 | return users; 40 | } 41 | 42 | public List getRoles() { 43 | return roles; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | # 2 | # /* 3 | # * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | # * 5 | # * WSO2 Inc. licenses this file to you under the Apache License, 6 | # * Version 2.0 (the "License"); you may not use this file except 7 | # * in compliance with the License. 8 | # * You may obtain a copy of the License at 9 | # * 10 | # * http://www.apache.org/licenses/LICENSE-2.0 11 | # * 12 | # * Unless required by applicable law or agreed to in writing, 13 | # * software distributed under the License is distributed on an 14 | # * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # * KIND, either express or implied. See the License for the 16 | # * specific language governing permissions and limitations 17 | # * under the License. 18 | # */ 19 | # 20 | 21 | 22 | # For the general syntax of property based configuration files see the 23 | # documenation of org.apache.log4j.PropertyConfigurator. 24 | 25 | # The root category uses the appender called A1. Since no priority is 26 | # specified, the root category assumes the default priority for root 27 | # which is DEBUG in log4j. The root category is the only category that 28 | # has a default priority. All other categories need not be assigned a 29 | # priority in which case they inherit their priority from the 30 | # hierarchy. 31 | 32 | # Console appender configuration 33 | appender.console.type = Console 34 | appender.console.name = consoleLogger 35 | appender.console.layout.type = PatternLayout 36 | appender.console.layout.pattern = [%t] %-5p %c %x - %m%n 37 | 38 | # Root logger referring to console appender 39 | rootLogger.level = info 40 | rootLogger.appenderRef.stdout.ref = consoleLogger 41 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/test/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | # 2 | # /* 3 | # * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | # * 5 | # * WSO2 Inc. licenses this file to you under the Apache License, 6 | # * Version 2.0 (the "License"); you may not use this file except 7 | # * in compliance with the License. 8 | # * You may obtain a copy of the License at 9 | # * 10 | # * http://www.apache.org/licenses/LICENSE-2.0 11 | # * 12 | # * Unless required by applicable law or agreed to in writing, 13 | # * software distributed under the License is distributed on an 14 | # * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # * KIND, either express or implied. See the License for the 16 | # * specific language governing permissions and limitations 17 | # * under the License. 18 | # */ 19 | # 20 | 21 | 22 | # For the general syntax of property based configuration files see the 23 | # documenation of org.apache.log4j.PropertyConfigurator. 24 | 25 | # The root category uses the appender called A1. Since no priority is 26 | # specified, the root category assumes the default priority for root 27 | # which is DEBUG in log4j. The root category is the only category that 28 | # has a default priority. All other categories need not be assigned a 29 | # priority in which case they inherit their priority from the 30 | # hierarchy. 31 | 32 | # Console appender configuration 33 | appender.console.type = Console 34 | appender.console.name = consoleLogger 35 | appender.console.layout.type = PatternLayout 36 | appender.console.layout.pattern = [%t] %-5p %c %x - %m%n 37 | 38 | # Root logger referring to console appender 39 | rootLogger.level = info 40 | rootLogger.appenderRef.stdout.ref = consoleLogger 41 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | # 2 | # /* 3 | # * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | # * 5 | # * WSO2 Inc. licenses this file to you under the Apache License, 6 | # * Version 2.0 (the "License"); you may not use this file except 7 | # * in compliance with the License. 8 | # * You may obtain a copy of the License at 9 | # * 10 | # * http://www.apache.org/licenses/LICENSE-2.0 11 | # * 12 | # * Unless required by applicable law or agreed to in writing, 13 | # * software distributed under the License is distributed on an 14 | # * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # * KIND, either express or implied. See the License for the 16 | # * specific language governing permissions and limitations 17 | # * under the License. 18 | # */ 19 | # 20 | 21 | 22 | # For the general syntax of property based configuration files see the 23 | # documenation of org.apache.log4j.PropertyConfigurator. 24 | 25 | # The root category uses the appender called A1. Since no priority is 26 | # specified, the root category assumes the default priority for root 27 | # which is DEBUG in log4j. The root category is the only category that 28 | # has a default priority. All other categories need not be assigned a 29 | # priority in which case they inherit their priority from the 30 | # hierarchy. 31 | 32 | # Console appender configuration 33 | appender.console.type = Console 34 | appender.console.name = consoleLogger 35 | appender.console.layout.type = PatternLayout 36 | appender.console.layout.pattern = [%t] %-5p %c %x - %m%n 37 | 38 | # Root logger referring to console appender 39 | rootLogger.level = info 40 | rootLogger.appenderRef.stdout.ref = consoleLogger 41 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | # 2 | # /* 3 | # * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | # * 5 | # * WSO2 Inc. licenses this file to you under the Apache License, 6 | # * Version 2.0 (the "License"); you may not use this file except 7 | # * in compliance with the License. 8 | # * You may obtain a copy of the License at 9 | # * 10 | # * http://www.apache.org/licenses/LICENSE-2.0 11 | # * 12 | # * Unless required by applicable law or agreed to in writing, 13 | # * software distributed under the License is distributed on an 14 | # * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # * KIND, either express or implied. See the License for the 16 | # * specific language governing permissions and limitations 17 | # * under the License. 18 | # */ 19 | # 20 | 21 | 22 | # For the general syntax of property based configuration files see the 23 | # documenation of org.apache.log4j.PropertyConfigurator. 24 | 25 | # The root category uses the appender called A1. Since no priority is 26 | # specified, the root category assumes the default priority for root 27 | # which is DEBUG in log4j. The root category is the only category that 28 | # has a default priority. All other categories need not be assigned a 29 | # priority in which case they inherit their priority from the 30 | # hierarchy. 31 | 32 | # Console appender configuration 33 | appender.console.type = Console 34 | appender.console.name = consoleLogger 35 | appender.console.layout.type = PatternLayout 36 | appender.console.layout.pattern = [%t] %-5p %c %x - %m%n 37 | 38 | # Root logger referring to console appender 39 | rootLogger.level = info 40 | rootLogger.appenderRef.stdout.ref = consoleLogger 41 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/test/resources/log4j2.properties: -------------------------------------------------------------------------------- 1 | # 2 | # /* 3 | # * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | # * 5 | # * WSO2 Inc. licenses this file to you under the Apache License, 6 | # * Version 2.0 (the "License"); you may not use this file except 7 | # * in compliance with the License. 8 | # * You may obtain a copy of the License at 9 | # * 10 | # * http://www.apache.org/licenses/LICENSE-2.0 11 | # * 12 | # * Unless required by applicable law or agreed to in writing, 13 | # * software distributed under the License is distributed on an 14 | # * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # * KIND, either express or implied. See the License for the 16 | # * specific language governing permissions and limitations 17 | # * under the License. 18 | # */ 19 | # 20 | 21 | 22 | # For the general syntax of property based configuration files see the 23 | # documenation of org.apache.log4j.PropertyConfigurator. 24 | 25 | # The root category uses the appender called A1. Since no priority is 26 | # specified, the root category assumes the default priority for root 27 | # which is DEBUG in log4j. The root category is the only category that 28 | # has a default priority. All other categories need not be assigned a 29 | # priority in which case they inherit their priority from the 30 | # hierarchy. 31 | 32 | # Console appender configuration 33 | appender.console.type = Console 34 | appender.console.name = consoleLogger 35 | appender.console.layout.type = PatternLayout 36 | appender.console.layout.pattern = [%t] %-5p %c %x - %m%n 37 | 38 | # Root logger referring to console appender 39 | rootLogger.level = info 40 | rootLogger.appenderRef.stdout.ref = consoleLogger 41 | -------------------------------------------------------------------------------- /components/permission-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | org.wso2.carbon.analytics-common 24 | org.wso2.carbon.analytics-common.parent 25 | 6.1.70-SNAPSHOT 26 | ../../pom.xml 27 | 28 | 29 | 4.0.0 30 | permission-provider 31 | pom 32 | WSO2 Carbon - Common Permission Provider Module 33 | Common permission provider module to use across analytics apps. 34 | http://wso2.org 35 | 36 | 37 | org.wso2.carbon.analytics.permissions 38 | 39 | 40 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/EventBuilderCommonsConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.wso2.carbon.databridge.commons; 18 | 19 | /** 20 | * Common constants related to event builder. 21 | */ 22 | public class EventBuilderCommonsConstants { 23 | public static final String STREAM_ID = "streamId"; 24 | public static final String NAME = "name"; 25 | public static final String VERSION = "version"; 26 | public static final String NICK_NAME = "nickName"; 27 | public static final String DESCRIPTION = "description"; 28 | public static final String TAGS = "tags"; 29 | public static final String META_DATA = "metaData"; 30 | public static final String META = "meta"; 31 | public static final String CORRELATION_DATA = "correlationData"; 32 | public static final String CORRELATION = "correlation"; 33 | public static final String ARBITRARY_DATA_MAP = "arbitraryDataMap"; 34 | public static final String PAYLOAD_DATA = "payloadData"; 35 | public static final String TIME_STAMP = "timeStamp"; 36 | } 37 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/utils/config/RESTAPIConfigurationElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.utils.config; 19 | 20 | import org.wso2.carbon.config.annotation.Configuration; 21 | import org.wso2.carbon.config.annotation.Element; 22 | 23 | import java.util.ArrayList; 24 | import java.util.List; 25 | 26 | /** 27 | * REST API Authentication config Element. 28 | */ 29 | @Configuration(description = "REST API Auth configurations") 30 | public class RESTAPIConfigurationElement { 31 | 32 | @Element(description = "Enable authentication for REST API", required = true) 33 | private String authEnable = "true"; 34 | 35 | @Element(description = "APIs to be excluded when auth is enabled", required = true) 36 | private List exclude = new ArrayList<>(); 37 | 38 | public String getAuthEnable() { 39 | return authEnable; 40 | } 41 | 42 | public List getExclude() { 43 | return exclude; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/internal/utils/DataBridgeConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.core.internal.utils; 20 | 21 | 22 | /** 23 | * Agent Server Constants. 24 | */ 25 | public final class DataBridgeConstants { 26 | 27 | public static final String DATA_BRIDGE_DIR = "data-bridge"; 28 | 29 | private DataBridgeConstants() { 30 | } 31 | 32 | public static final int NO_OF_WORKER_THREADS = 10; 33 | public static final int EVENT_BUFFER_CAPACITY = 10000; 34 | public static final int CLIENT_TIMEOUT_MS = 30000; 35 | 36 | public static final String STREAM_DEFINITIONS_ELEMENT = "streamDefinitions"; 37 | 38 | public static final String DATABRIDGE_CONFIG_NAMESPACE = "databridge.config"; 39 | public static final String TRANSPORTS_NAMESPACE = "transports"; 40 | public static final String STREAMLINED_DATABRIDGE_CONFIG_NAMESPACE = "databridge"; 41 | public static final String DATABRIDGE_LISTENER_CONFIG_NAMESPACE = "listenerConfigurations"; 42 | } 43 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/exception/DifferentStreamDefinitionAlreadyDefinedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | package org.wso2.carbon.databridge.commons.exception; 19 | 20 | 21 | /** 22 | * Data Bridge Different Stream Definition Already Defined Exception. 23 | */ 24 | public class DifferentStreamDefinitionAlreadyDefinedException extends Exception { 25 | private String errorMessage; 26 | 27 | public DifferentStreamDefinitionAlreadyDefinedException() { 28 | } 29 | 30 | public DifferentStreamDefinitionAlreadyDefinedException(String message) { 31 | super(message); 32 | errorMessage = message; 33 | } 34 | 35 | public DifferentStreamDefinitionAlreadyDefinedException(String message, Throwable cause) { 36 | super(message, cause); 37 | errorMessage = message; 38 | } 39 | 40 | public DifferentStreamDefinitionAlreadyDefinedException(Throwable cause) { 41 | super(cause); 42 | } 43 | 44 | public String getErrorMessage() { 45 | return errorMessage; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/endpoint/WrappedEventFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.agent.endpoint; 20 | 21 | import com.lmax.disruptor.EventFactory; 22 | import org.wso2.carbon.databridge.commons.Event; 23 | 24 | /** 25 | * Wrapper Event Factory. 26 | */ 27 | public class WrappedEventFactory implements EventFactory { 28 | 29 | public WrappedEvent newInstance() { 30 | return new WrappedEvent(); 31 | } 32 | 33 | /** 34 | * Wrapped Event. 35 | */ 36 | public static class WrappedEvent { 37 | 38 | private Event event; 39 | 40 | public Event getEvent() { 41 | return event; 42 | } 43 | 44 | public void setEvent(Event event) { 45 | this.event = event; 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return "WrappedEvent{" + 51 | "event=" + event + 52 | "}"; 53 | } 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/exception/DataBridgeException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed to the Apache Software Foundation (ASF) under one or more 6 | * contributor license agreements. See the NOTICE file distributed with 7 | * this work for additional information regarding copyright ownership. 8 | * The ASF licenses this file to You under the Apache License, Version 2.0 9 | * (the "License"); you may not use this file except in compliance with 10 | * the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.wso2.carbon.databridge.core.exception; 21 | 22 | /** 23 | * Databridge exception. 24 | */ 25 | public class DataBridgeException extends Exception { 26 | private String errorMessage; 27 | 28 | public DataBridgeException() { 29 | } 30 | 31 | public DataBridgeException(String message) { 32 | super(message); 33 | errorMessage = message; 34 | } 35 | 36 | public DataBridgeException(String message, Throwable cause) { 37 | super(message, cause); 38 | errorMessage = message; 39 | } 40 | 41 | public DataBridgeException(Throwable cause) { 42 | super(cause); 43 | } 44 | 45 | public String getErrorMessage() { 46 | return errorMessage; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/exception/EventConversionException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed to the Apache Software Foundation (ASF) under one or more 6 | * contributor license agreements. See the NOTICE file distributed with 7 | * this work for additional information regarding copyright ownership. 8 | * The ASF licenses this file to You under the Apache License, Version 2.0 9 | * (the "License"); you may not use this file except in compliance with 10 | * the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.wso2.carbon.databridge.core.exception; 21 | 22 | /** 23 | * WSO2Event conversion exception. 24 | */ 25 | public class EventConversionException extends RuntimeException { 26 | private String errorMessage; 27 | 28 | public EventConversionException() { 29 | } 30 | 31 | public EventConversionException(String message) { 32 | super(message); 33 | errorMessage = message; 34 | } 35 | 36 | public EventConversionException(String message, Throwable cause) { 37 | super(message, cause); 38 | errorMessage = message; 39 | } 40 | 41 | public EventConversionException(Throwable cause) { 42 | super(cause); 43 | } 44 | 45 | public String getErrorMessage() { 46 | return errorMessage; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/exception/StreamDefinitionNotFoundException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed to the Apache Software Foundation (ASF) under one or more 6 | * contributor license agreements. See the NOTICE file distributed with 7 | * this work for additional information regarding copyright ownership. 8 | * The ASF licenses this file to You under the Apache License, Version 2.0 9 | * (the "License"); you may not use this file except in compliance with 10 | * the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.wso2.carbon.databridge.core.exception; 21 | 22 | /** 23 | * Stream not found exception. 24 | */ 25 | public class StreamDefinitionNotFoundException extends Exception { 26 | private String errorMessage; 27 | 28 | public StreamDefinitionNotFoundException() { 29 | } 30 | 31 | public StreamDefinitionNotFoundException(String message) { 32 | super(message); 33 | errorMessage = message; 34 | } 35 | 36 | public StreamDefinitionNotFoundException(String message, Throwable cause) { 37 | super(message, cause); 38 | errorMessage = message; 39 | } 40 | 41 | public StreamDefinitionNotFoundException(Throwable cause) { 42 | super(cause); 43 | } 44 | 45 | public String getErrorMessage() { 46 | return errorMessage; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/exception/StreamDefinitionStoreException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed to the Apache Software Foundation (ASF) under one or more 6 | * contributor license agreements. See the NOTICE file distributed with 7 | * this work for additional information regarding copyright ownership. 8 | * The ASF licenses this file to You under the Apache License, Version 2.0 9 | * (the "License"); you may not use this file except in compliance with 10 | * the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | package org.wso2.carbon.databridge.core.exception; 23 | 24 | /** 25 | * Stream definition store exception. 26 | */ 27 | public class StreamDefinitionStoreException extends Exception { 28 | private String errorMessage; 29 | 30 | public StreamDefinitionStoreException() { 31 | } 32 | 33 | public StreamDefinitionStoreException(String message) { 34 | super(message); 35 | errorMessage = message; 36 | } 37 | 38 | public StreamDefinitionStoreException(String message, Throwable cause) { 39 | super(message, cause); 40 | errorMessage = message; 41 | } 42 | 43 | public StreamDefinitionStoreException(Throwable cause) { 44 | super(cause); 45 | } 46 | 47 | public String getErrorMessage() { 48 | return errorMessage; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/exception/DataBridgeConfigurationException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed to the Apache Software Foundation (ASF) under one or more 6 | * contributor license agreements. See the NOTICE file distributed with 7 | * this work for additional information regarding copyright ownership. 8 | * The ASF licenses this file to You under the Apache License, Version 2.0 9 | * (the "License"); you may not use this file except in compliance with 10 | * the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.wso2.carbon.databridge.core.exception; 21 | 22 | /** 23 | * Databridge configuration exception. 24 | */ 25 | public class DataBridgeConfigurationException extends Exception { 26 | private String errorMessage; 27 | 28 | public DataBridgeConfigurationException() { 29 | } 30 | 31 | public DataBridgeConfigurationException(String message) { 32 | super(message); 33 | errorMessage = message; 34 | } 35 | 36 | public DataBridgeConfigurationException(String message, Throwable cause) { 37 | super(message, cause); 38 | errorMessage = message; 39 | } 40 | 41 | public DataBridgeConfigurationException(Throwable cause) { 42 | super(cause); 43 | } 44 | 45 | public String getErrorMessage() { 46 | return errorMessage; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/models/User.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.wso2.carbon.analytics.idp.client.core.models; 17 | 18 | import java.util.List; 19 | import java.util.Map; 20 | 21 | /** 22 | * Users mapper class. 23 | */ 24 | public class User { 25 | 26 | private String username; 27 | private Map properties; 28 | private List roles; 29 | 30 | public User(String username, Map properties, List roles) { 31 | this.username = username; 32 | this.properties = properties; 33 | this.roles = roles; 34 | } 35 | 36 | public String getUsername() { 37 | return username; 38 | } 39 | 40 | public void setUsername(String username) { 41 | this.username = username; 42 | } 43 | 44 | public Map getProperties() { 45 | return properties; 46 | } 47 | 48 | public void setProperties(Map properties) { 49 | this.properties = properties; 50 | } 51 | 52 | public List getRoles() { 53 | return roles; 54 | } 55 | 56 | public void setRoles(List roles) { 57 | this.roles = roles; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/local/models/LocalUser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.local.models; 19 | 20 | import org.wso2.carbon.analytics.idp.client.core.models.Role; 21 | 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | /** 26 | * Local user class to hold the user values from user store in configs. 27 | */ 28 | public class LocalUser { 29 | private final char[] password; 30 | private String username; 31 | private Map properties; 32 | private List roles; 33 | 34 | public LocalUser(String username, char[] password, Map properties, List roles) { 35 | this.username = username; 36 | this.password = password.clone(); 37 | this.properties = properties; 38 | this.roles = roles; 39 | } 40 | 41 | public String getUsername() { 42 | return username; 43 | } 44 | 45 | public char[] getPassword() { 46 | return password.clone(); 47 | } 48 | 49 | public Map getProperties() { 50 | return properties; 51 | } 52 | 53 | public List getRoles() { 54 | return roles; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /components/permission-provider/org.wso2.carbon.analytics.permissions/src/main/java/org/wso2/carbon/analytics/permissions/bean/PermissionString.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | */ 19 | package org.wso2.carbon.analytics.permissions.bean; 20 | 21 | /** 22 | * Bean class for PermissionString. 23 | */ 24 | public class PermissionString { 25 | 26 | private String permissionID; 27 | private String permissionString; 28 | 29 | public PermissionString(String permissionID, String permissionString) { 30 | this.permissionID = permissionID; 31 | this.permissionString = permissionString; 32 | } 33 | 34 | public String getPermissionID() { 35 | return permissionID; 36 | } 37 | 38 | public void setPermissionID(String permissionID) { 39 | this.permissionID = permissionID; 40 | } 41 | 42 | public String getPermissionString() { 43 | return permissionString; 44 | } 45 | 46 | public void setPermissionString(String permissionString) { 47 | this.permissionString = permissionString; 48 | } 49 | 50 | /** 51 | * Overrides to strings. 52 | * 53 | * @return 54 | */ 55 | @Override 56 | public String toString() { 57 | return "Permission[permissionID=" + permissionID + ", permissionString=" + permissionString + "]"; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/utils/DataBridgeThreadFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.wso2.carbon.databridge.commons.utils; 17 | 18 | import java.util.concurrent.ThreadFactory; 19 | import java.util.concurrent.atomic.AtomicInteger; 20 | 21 | /** 22 | * DataBridgeThreadFactory. 23 | */ 24 | public class DataBridgeThreadFactory implements ThreadFactory { 25 | private static final AtomicInteger poolNumber = new AtomicInteger(1); 26 | final ThreadGroup group; 27 | final AtomicInteger threadNumber = new AtomicInteger(1); 28 | final String namePrefix; 29 | 30 | public DataBridgeThreadFactory(String threadPoolExecutorName) { 31 | SecurityManager s = System.getSecurityManager(); 32 | group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); 33 | namePrefix = "DataBridge-" + threadPoolExecutorName + "-pool-" + poolNumber.getAndIncrement() + "-thread-"; 34 | } 35 | 36 | public Thread newThread(Runnable r) { 37 | Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0); 38 | if (t.isDaemon()) { 39 | t.setDaemon(false); 40 | } 41 | if (t.getPriority() != Thread.NORM_PRIORITY) { 42 | t.setPriority(Thread.NORM_PRIORITY); 43 | } 44 | return t; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/conf/DataReceiverConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) $today.year, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.core.conf; 19 | 20 | 21 | 22 | import org.wso2.carbon.config.annotation.Configuration; 23 | import org.wso2.carbon.config.annotation.Element; 24 | 25 | import java.util.LinkedHashMap; 26 | import java.util.Map; 27 | 28 | /** 29 | * Data receiver configuration properties. 30 | */ 31 | @Configuration(description = "Data receiver configuration") 32 | public class DataReceiverConfiguration { 33 | 34 | @Element(description = "Data receiver type", required = true) 35 | private String type = ""; 36 | 37 | @Element(description = "Data receiver properties") 38 | private LinkedHashMap properties = new LinkedHashMap<>(); 39 | 40 | public String getType() { 41 | return type; 42 | } 43 | 44 | public Map getProperties() { 45 | return properties; 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return ", type : " + type + "properties : " + properties.toString(); 51 | } 52 | 53 | 54 | public DataReceiverConfiguration(String type, LinkedHashMap propertiesMap) { 55 | this.type = type; 56 | this.properties = propertiesMap; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/main/java/org/wso2/carbon/databridge/receiver/thrift/converter/IndexCounter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.receiver.thrift.converter; 20 | 21 | /** 22 | * Counter used to dematerialise event bundle. 23 | */ 24 | public class IndexCounter { 25 | 26 | private int intCount = 0; 27 | private int longCount = 0; 28 | private int boolCount = 0; 29 | private int stringCount = 0; 30 | private int doubleCount = 0; 31 | 32 | public int getIntCount() { 33 | return intCount; 34 | } 35 | 36 | public int getLongCount() { 37 | return longCount; 38 | } 39 | 40 | public int getBoolCount() { 41 | return boolCount; 42 | } 43 | 44 | public int getStringCount() { 45 | return stringCount; 46 | } 47 | 48 | public int getDoubleCount() { 49 | return doubleCount; 50 | } 51 | 52 | 53 | public void incrementIntCount() { 54 | intCount++; 55 | } 56 | 57 | public void incrementLongCount() { 58 | longCount++; 59 | } 60 | 61 | public void incrementBoolCount() { 62 | boolCount++; 63 | } 64 | 65 | public void incrementStringCount() { 66 | stringCount++; 67 | } 68 | 69 | public void incrementDoubleCount() { 70 | doubleCount++; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons/src/main/java/org/wso2/carbon/databridge/commons/Credentials.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.wso2.carbon.databridge.commons; 18 | 19 | /** 20 | * Credentials using for login. 21 | */ 22 | 23 | public class Credentials { 24 | private final String username; 25 | private final String password; 26 | 27 | public Credentials(String username, String password/*, String domainName*/) { 28 | this.username = username; 29 | this.password = password; 30 | } 31 | 32 | public String getUsername() { 33 | return username; 34 | } 35 | 36 | public String getPassword() { 37 | return password; 38 | } 39 | 40 | @Override 41 | public boolean equals(Object o) { 42 | if (this == o) { 43 | return true; 44 | } 45 | if (!(o instanceof Credentials)) { 46 | return false; 47 | } 48 | 49 | Credentials that = (Credentials) o; 50 | 51 | if (!password.equals(that.password)) { 52 | return false; 53 | } 54 | if (!username.equals(that.username)) { 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | 61 | @Override 62 | public int hashCode() { 63 | int result = username.hashCode(); 64 | result = 31 * result + password.hashCode(); 65 | return result; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/AgentCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Copyright (c) WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed to the Apache Software Foundation (ASF) under one or more 6 | * contributor license agreements. See the NOTICE file distributed with 7 | * this work for additional information regarding copyright ownership. 8 | * The ASF licenses this file to You under the Apache License, Version 2.0 9 | * (the "License"); you may not use this file except in compliance with 10 | * the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.wso2.carbon.databridge.core; 21 | 22 | import org.wso2.carbon.databridge.commons.Credentials; 23 | import org.wso2.carbon.databridge.commons.Event; 24 | import org.wso2.carbon.databridge.commons.StreamDefinition; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * The call back that notifies Event arrivals and StreamDefinition declarations. 30 | */ 31 | public interface AgentCallback { 32 | 33 | /** 34 | * will get called when types are defined. 35 | * 36 | * @param streamDefinition TypeDefinition of event streams 37 | */ 38 | void definedStream(StreamDefinition streamDefinition); 39 | 40 | 41 | /** 42 | * will get called when types are removed. 43 | * 44 | * @param streamDefinition TypeDefinition of event streams 45 | */ 46 | void removeStream(StreamDefinition streamDefinition); 47 | 48 | /** 49 | * will get called when Events arrive. 50 | * 51 | * @param eventList Arrived event list 52 | */ 53 | void receive(List eventList, Credentials credentials); 54 | } 55 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/utils/config/UserChildElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.analytics.idp.client.core.utils.config; 19 | 20 | import org.wso2.carbon.config.annotation.Configuration; 21 | import org.wso2.carbon.config.annotation.Element; 22 | 23 | import java.util.HashMap; 24 | import java.util.Map; 25 | 26 | /** 27 | * User Details Child Element. 28 | */ 29 | @Configuration(description = "User Child Element configuration") 30 | public class UserChildElement { 31 | 32 | @Element(description = "Username", required = true) 33 | private String username = "admin"; 34 | 35 | @Element(description = "Encrypted Password", required = true) 36 | private String password = "YWRtaW4="; 37 | 38 | @Element(description = "Properties associated with the user") 39 | private Map properties = new HashMap<>(); 40 | 41 | @Element(description = "List of comma separated role ids", required = true) 42 | private String roles = "1"; 43 | 44 | public String getUsername() { 45 | return username; 46 | } 47 | 48 | public String getPassword() { 49 | return password; 50 | } 51 | 52 | public Map getProperties() { 53 | return properties; 54 | } 55 | 56 | public String getRoles() { 57 | return roles; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /components/authentication/org.wso2.carbon.analytics.idp.client/src/main/java/org/wso2/carbon/analytics/idp/client/core/utils/config/SSLConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.analytics.idp.client.core.utils.config; 20 | 21 | import org.wso2.carbon.config.annotation.Configuration; 22 | import org.wso2.carbon.config.annotation.Element; 23 | 24 | /** 25 | * SSL configurations. 26 | */ 27 | @Configuration(namespace = "ssl.configs", description = "SSL Configuration Parameters") 28 | public class SSLConfiguration { 29 | 30 | @Element(description = "Keystore Password", required = true) 31 | private String keyStorePassword = null; 32 | 33 | @Element(description = "Keystore Location", required = true) 34 | private String keyStoreLocation = null; 35 | 36 | @Element(description = "Truststore Password") 37 | private String trustStorePassword = null; 38 | 39 | @Element(description = "Truststore Location") 40 | private String trustStoreLocation = null; 41 | 42 | public String getKeyStorePassword() { 43 | 44 | return keyStorePassword; 45 | } 46 | 47 | public String getTrustStorePassword() { 48 | 49 | return trustStorePassword; 50 | } 51 | 52 | public String getTrustStoreLocation() { 53 | 54 | return trustStoreLocation; 55 | } 56 | 57 | public String getKeyStoreLocation() { 58 | 59 | return keyStoreLocation; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/conf/DataAgentsConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.wso2.carbon.databridge.agent.conf; 17 | 18 | 19 | import org.wso2.carbon.config.annotation.Configuration; 20 | import org.wso2.carbon.config.annotation.Element; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | /** 26 | * Configuration class for data-bridge-config.yaml file. 27 | */ 28 | @Configuration(namespace = "data.agent.config", description = "Configuration of the Data Agents - to " + 29 | "publish events through databridge") 30 | public class DataAgentsConfiguration { 31 | 32 | 33 | @Element(description = "Data agent configurations", required = true) 34 | public List agents = new ArrayList<>(); 35 | 36 | public DataAgentsConfiguration() { 37 | agents.add(new Agent("Thrift", 38 | "org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftDataEndpoint")); 39 | agents.add(new Agent("Binary", 40 | "org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint")); 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return "Data Agents - " + agents.toString(); 46 | } 47 | 48 | public List getAgents() { 49 | return agents; 50 | } 51 | 52 | public void setAgents(List agents) { 53 | this.agents = agents; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/main/java/org/wso2/carbon/databridge/receiver/thrift/ThriftDataReceiverFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.receiver.thrift; 19 | 20 | import org.wso2.carbon.databridge.core.DataBridgeReceiverService; 21 | import org.wso2.carbon.databridge.receiver.thrift.conf.ThriftDataReceiverConfiguration; 22 | 23 | /** 24 | * The falconry method that is used to create Agent server. 25 | */ 26 | public class ThriftDataReceiverFactory { 27 | public ThriftDataReceiver createAgentServer( 28 | ThriftDataReceiverConfiguration thriftDataReceiverConfiguration, 29 | DataBridgeReceiverService dataBridgeReceiverService) { 30 | return new ThriftDataReceiver(thriftDataReceiverConfiguration, dataBridgeReceiverService); 31 | } 32 | 33 | public ThriftDataReceiver createAgentServer(int secureReceiverPort, int receiverPort, 34 | DataBridgeReceiverService dataBridgeReceiverService) { 35 | return new ThriftDataReceiver(secureReceiverPort, receiverPort, dataBridgeReceiverService); 36 | } 37 | 38 | 39 | public ThriftDataReceiver createAgentServer(int receiverPort, 40 | DataBridgeReceiverService dataBridgeReceiverService) { 41 | return new ThriftDataReceiver(receiverPort, dataBridgeReceiverService); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /components/data-bridge/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | org.wso2.carbon.analytics-common 23 | org.wso2.carbon.analytics-common.parent 24 | 6.1.70-SNAPSHOT 25 | ../../pom.xml 26 | 27 | 28 | 4.0.0 29 | data-bridge 30 | pom 31 | WSO2 Carbon - Data Bridge Aggregator Module 32 | Use a common event format and send events backend servers 33 | http://wso2.org 34 | 35 | 36 | org.wso2.carbon.databridge.commons 37 | org.wso2.carbon.databridge.commons.thrift 38 | org.wso2.carbon.databridge.commons.binary 39 | org.wso2.carbon.databridge.core 40 | org.wso2.carbon.databridge.receiver.thrift 41 | org.wso2.carbon.databridge.receiver.binary 42 | org.wso2.carbon.databridge.agent 43 | 44 | 45 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.commons.thrift/src/main/java/org/wso2/carbon/databridge/commons/thrift/utils/HostAddressFinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2012, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.commons.thrift.utils; 19 | 20 | import java.net.Inet4Address; 21 | import java.net.InetAddress; 22 | import java.net.NetworkInterface; 23 | import java.net.SocketException; 24 | import java.util.Enumeration; 25 | 26 | /** 27 | * Host address finder. 28 | */ 29 | public class HostAddressFinder { 30 | public static String findAddress(String hostname) throws SocketException { 31 | if (hostname.trim().equals("localhost") || hostname.trim().equals("127.0.0.1") 32 | || hostname.trim().equals("::1")) { 33 | Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); 34 | while (ifaces.hasMoreElements()) { 35 | NetworkInterface iface = ifaces.nextElement(); 36 | Enumeration addresses = iface.getInetAddresses(); 37 | 38 | while (addresses.hasMoreElements()) { 39 | InetAddress addr = addresses.nextElement(); 40 | if (addr instanceof Inet4Address && !addr.isLoopbackAddress()) { 41 | return addr.getHostAddress(); 42 | } 43 | } 44 | } 45 | return "127.0.0.1"; 46 | } else { 47 | return hostname; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/main/java/org/wso2/carbon/databridge/receiver/thrift/service/ThriftSecureEventTransmissionServlet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.wso2.carbon.databridge.receiver.thrift.service; 18 | 19 | import org.apache.thrift.TProcessor; 20 | import org.apache.thrift.protocol.TProtocolFactory; 21 | import org.apache.thrift.server.TServlet; 22 | 23 | import java.io.IOException; 24 | import javax.servlet.ServletException; 25 | import javax.servlet.http.HttpServletRequest; 26 | import javax.servlet.http.HttpServletResponse; 27 | 28 | /** 29 | * Thrift Secure Event Transmission Servlet. 30 | */ 31 | public class ThriftSecureEventTransmissionServlet extends TServlet { 32 | 33 | 34 | public ThriftSecureEventTransmissionServlet(TProcessor processor, 35 | TProtocolFactory inProtocolFactory, 36 | TProtocolFactory outProtocolFactory) { 37 | super(processor, inProtocolFactory, outProtocolFactory); 38 | } 39 | 40 | protected void doGet(HttpServletRequest request, HttpServletResponse response) 41 | throws IOException, ServletException { 42 | doPost(request, response); 43 | } 44 | 45 | protected void doPost(HttpServletRequest request, HttpServletResponse response) 46 | throws ServletException, IOException { 47 | if (request.isSecure()) { 48 | super.doPost(request, response); 49 | } 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /features/data-bridge/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | org.wso2.carbon.analytics-common 23 | org.wso2.carbon.analytics-common.parent 24 | 6.1.70-SNAPSHOT 25 | ../../pom.xml 26 | 27 | 28 | 4.0.0 29 | data-bridge-feature 30 | pom 31 | WSO2 Carbon - Data Bridge - Feature Aggregator Module 32 | http://wso2.org 33 | 34 | 35 | org.wso2.carbon.databridge.feature 36 | org.wso2.carbon.databridge.commons.binary.feature 37 | org.wso2.carbon.databridge.commons.thrift.feature 38 | org.wso2.carbon.databridge.core.feature 39 | org.wso2.carbon.databridge.receiver.binary.feature 40 | org.wso2.carbon.databridge.receiver.thrift.feature 41 | org.wso2.carbon.databridge.commons.feature 42 | org.wso2.carbon.databridge.agent.feature 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.receiver.thrift/src/main/java/org/wso2/carbon/databridge/receiver/thrift/internal/ServiceHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.receiver.thrift.internal; 19 | 20 | import org.wso2.carbon.databridge.core.DataBridgeReceiverService; 21 | import org.wso2.carbon.databridge.receiver.thrift.ThriftDataReceiver; 22 | import org.wso2.carbon.kernel.CarbonRuntime; 23 | 24 | /** 25 | * Service holder class. 26 | */ 27 | public class ServiceHolder { 28 | private static DataBridgeReceiverService dataBridgeReceiverService; 29 | private static ThriftDataReceiver dataReceiver; 30 | private static CarbonRuntime carbonRuntime; 31 | 32 | public static DataBridgeReceiverService getDataBridgeReceiverService() { 33 | return dataBridgeReceiverService; 34 | } 35 | 36 | public static void setDataBridgeReceiverService(DataBridgeReceiverService dataBridgeReceiverService) { 37 | ServiceHolder.dataBridgeReceiverService = dataBridgeReceiverService; 38 | } 39 | 40 | public static CarbonRuntime getCarbonRuntime() { 41 | return carbonRuntime; 42 | } 43 | 44 | public static void setCarbonRuntime(CarbonRuntime carbonRuntime) { 45 | ServiceHolder.carbonRuntime = carbonRuntime; 46 | } 47 | 48 | public static ThriftDataReceiver getDataReceiver() { 49 | return dataReceiver; 50 | } 51 | 52 | public static void setDataReceiver(ThriftDataReceiver dataReceiver) { 53 | ServiceHolder.dataReceiver = dataReceiver; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /components/distribution/carbon-home/bin/manager.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # --------------------------------------------------------------------------- 3 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | cygwin=false; 18 | darwin=false; 19 | os400=false; 20 | mingw=false; 21 | case "`uname`" in 22 | CYGWIN*) cygwin=true;; 23 | MINGW*) mingw=true;; 24 | OS400*) os400=true;; 25 | Darwin*) darwin=true 26 | if [ -z "$JAVA_VERSION" ] ; then 27 | JAVA_VERSION="CurrentJDK" 28 | else 29 | echo "Using Java version: $JAVA_VERSION" 30 | fi 31 | if [ -z "$JAVA_HOME" ] ; then 32 | JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home 33 | fi 34 | ;; 35 | esac 36 | 37 | # resolve links - $0 may be a softlink 38 | PRG="$0" 39 | 40 | while [ -h "$PRG" ]; do 41 | ls=`ls -ld "$PRG"` 42 | link=`expr "$ls" : '.*-> \(.*\)$'` 43 | if expr "$link" : '.*/.*' > /dev/null; then 44 | PRG="$link" 45 | else 46 | PRG=`dirname "$PRG"`/"$link" 47 | fi 48 | done 49 | 50 | # Get standard environment variables 51 | PRGDIR=`dirname "$PRG"` 52 | 53 | # Only set CARBON_HOME if not already set 54 | [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd` 55 | 56 | ########################################################################### 57 | NAME=start-worker 58 | # Daemon name, where is the actual executable 59 | 60 | WORKER_INIT_SCRIPT="$CARBON_HOME/wso2/manager/bin/carbon.sh" 61 | 62 | # If the daemon is not there, then exit. 63 | 64 | sh $WORKER_INIT_SCRIPT $* & 65 | 66 | trap "sh $WORKER_INIT_SCRIPT stop; exit;" INT TERM 67 | while : 68 | do 69 | sleep 60 70 | done -------------------------------------------------------------------------------- /components/permission-provider/org.wso2.carbon.analytics.permissions/src/main/java/org/wso2/carbon/analytics/permissions/bean/Role.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | */ 19 | 20 | package org.wso2.carbon.analytics.permissions.bean; 21 | 22 | /** 23 | * Role bean class. 24 | */ 25 | public class Role { 26 | private String id; 27 | private String name; 28 | 29 | /** 30 | * Default constructor. 31 | */ 32 | public Role() { 33 | } 34 | 35 | /** 36 | * Constructor with role Id, name parameters. 37 | * 38 | * @param id 39 | * @param name 40 | */ 41 | public Role(String id, String name) { 42 | this.id = id; 43 | this.name = name; 44 | } 45 | 46 | /** 47 | * Get role Id. 48 | * 49 | * @return 50 | */ 51 | public String getId() { 52 | return id; 53 | } 54 | 55 | /** 56 | * Set role Id. 57 | * 58 | * @param id 59 | */ 60 | public void setId(String id) { 61 | this.id = id; 62 | } 63 | 64 | /** 65 | * Get role name. 66 | * 67 | * @return 68 | */ 69 | public String getName() { 70 | return name; 71 | } 72 | 73 | /** 74 | * Set role name. 75 | * 76 | * @param name 77 | */ 78 | public void setName(String name) { 79 | this.name = name; 80 | } 81 | 82 | /** 83 | * Overrides to string. 84 | * 85 | * @return 86 | */ 87 | @Override 88 | public String toString() { 89 | return "Role[id=" + id + ", name=" + name + "]"; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/resources/databridge.config.yaml: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the \"License\"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an \"AS IS\" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | ################################################################################ 16 | 17 | # Configuration used for the databridge communication 18 | databridge.config: 19 | # No of worker threads to consume events 20 | # THIS IS A MANDATORY FIELD 21 | workerThreads: 10 22 | # Maximum amount of messages that can be queued internally in MB 23 | # THIS IS A MANDATORY FIELD 24 | maxEventBufferCapacity: 10000000 25 | # Queue size; the maximum number of events that can be stored in the queue 26 | # THIS IS A MANDATORY FIELD 27 | eventBufferSize: 2000 28 | # Session Timeout value in mins 29 | # THIS IS A MANDATORY FIELD 30 | clientTimeoutMin: 30 31 | # Data receiver configurations 32 | # THIS IS A MANDATORY FIELD 33 | dataReceivers: 34 | - 35 | # Data receiver configuration 36 | dataReceiver: 37 | # Data receiver type 38 | # THIS IS A MANDATORY FIELD 39 | type: Thrift 40 | # Data receiver properties 41 | properties: 42 | tcpPort: '7611' 43 | sslPort: '7711' 44 | 45 | - 46 | # Data receiver configuration 47 | dataReceiver: 48 | # Data receiver type 49 | # THIS IS A MANDATORY FIELD 50 | type: Binary 51 | # Data receiver properties 52 | properties: 53 | tcpPort: '9611' 54 | sslPort: '9711' 55 | tcpReceiverThreadPoolSize: '100' 56 | sslReceiverThreadPoolSize: '100' 57 | hostName: 0.0.0.0 -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/utils/EventComposite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.core.utils; 20 | 21 | import org.wso2.carbon.databridge.core.EventConverter; 22 | import org.wso2.carbon.databridge.core.StreamTypeHolder; 23 | 24 | /** 25 | * Event composite that's passed to the Queue Worker. 26 | */ 27 | public class EventComposite { 28 | private StreamTypeHolder streamTypeHolder; 29 | private Object eventBundle; 30 | private AgentSession agentSession; 31 | private EventConverter eventConverter; 32 | private int size; 33 | 34 | public EventComposite(Object eventBundle, 35 | StreamTypeHolder streamTypeHolder, AgentSession agentSession, 36 | EventConverter eventConverter) { 37 | this.streamTypeHolder = streamTypeHolder; 38 | this.eventBundle = eventBundle; 39 | this.agentSession = agentSession; 40 | this.eventConverter = eventConverter; 41 | } 42 | 43 | public StreamTypeHolder getStreamTypeHolder() { 44 | return streamTypeHolder; 45 | } 46 | 47 | public Object getEventBundle() { 48 | return eventBundle; 49 | } 50 | 51 | public AgentSession getAgentSession() { 52 | return agentSession; 53 | } 54 | 55 | public EventConverter getEventConverter() { 56 | return eventConverter; 57 | } 58 | 59 | public int getSize() { 60 | return size; 61 | } 62 | 63 | public void setSize(int size) { 64 | this.size = size; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/util/DataEndpointConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.carbon.databridge.agent.util; 19 | 20 | import java.io.File; 21 | 22 | /** 23 | * Class to define the constants that are used. 24 | */ 25 | public class DataEndpointConstants { 26 | 27 | private DataEndpointConstants() { 28 | } 29 | 30 | public static final String DATA_AGENT_CONF_FILE_NAME = "data.agent.config.yaml"; 31 | public static final String DATA_AGENT_CONF_FILE_PATH = File.separator 32 | + "data-bridge" + File.separator + DATA_AGENT_CONF_FILE_NAME; 33 | public static final int DEFAULT_DATA_AGENT_BATCH_SIZE = 100; 34 | public static final String LB_URL_GROUP_SEPARATOR = ","; 35 | public static final String FAILOVER_URL_GROUP_SEPARATOR = "|"; 36 | public static final String FAILOVER_URL_GROUP_SEPARATOR_REGEX = "\\|"; 37 | public static final int DEFAULT_AUTH_PORT_OFFSET = 100; 38 | public static final String SEPARATOR = "##"; 39 | 40 | public static final String THRIFT_DATA_AGENT_TYPE = "THRIFT"; 41 | public static final String BINARY_DATA_AGENT_TYPE = "BINARY"; 42 | 43 | public static final String SYNC_STRATEGY = "sync"; 44 | public static final String ASYNC_STRATEGY = "async"; 45 | 46 | public static final String DATA_AGENT_CONFIG_NAMESPACE = "data.agent.config"; 47 | public static final String TRANSPORTS_NAMESPACE = "transports"; 48 | public static final String DATABRIDGE_CONFIG_NAMESPACE = "databridge"; 49 | public static final String DATABRIDGE_SENDER_CONFIG_NAMESPACE = "senderConfigurations"; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /components/data-bridge/org.wso2.carbon.databridge.core/src/main/java/org/wso2/carbon/databridge/core/definitionstore/StreamDefinitionStore.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.databridge.core.definitionstore; 20 | 21 | import org.wso2.carbon.databridge.commons.StreamDefinition; 22 | import org.wso2.carbon.databridge.commons.exception.DifferentStreamDefinitionAlreadyDefinedException; 23 | import org.wso2.carbon.databridge.core.exception.StreamDefinitionNotFoundException; 24 | import org.wso2.carbon.databridge.core.exception.StreamDefinitionStoreException; 25 | 26 | import java.util.Collection; 27 | 28 | /** 29 | * Stream definition store. 30 | */ 31 | public interface StreamDefinitionStore { 32 | 33 | public StreamDefinition getStreamDefinition(String streamName, 34 | String streamVersion) 35 | throws StreamDefinitionNotFoundException, StreamDefinitionStoreException; 36 | 37 | public StreamDefinition getStreamDefinition(String streamId) 38 | throws StreamDefinitionNotFoundException, StreamDefinitionStoreException; 39 | 40 | 41 | public Collection getAllStreamDefinitions(); 42 | 43 | public void saveStreamDefinition(StreamDefinition streamDefinition) 44 | throws DifferentStreamDefinitionAlreadyDefinedException, StreamDefinitionStoreException; 45 | 46 | public boolean deleteStreamDefinition(String streamName, String streamVersion); 47 | 48 | public void subscribe(StreamAddRemoveListener streamAddRemoveListener); 49 | 50 | public void unsubscribe(StreamAddRemoveListener streamAddRemoveListener); 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /components/org.wso2.carbon.database.query.manager/src/main/java/org/wso2/carbon/database/query/manager/config/Queries.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.carbon.database.query.manager.config; 20 | 21 | import org.wso2.carbon.config.annotation.Configuration; 22 | import org.wso2.carbon.config.annotation.Element; 23 | 24 | import java.io.Serializable; 25 | import java.util.Map; 26 | 27 | /** 28 | * Bean class for query configuration. 29 | */ 30 | @Configuration( 31 | description = "Queries configuration parent." 32 | ) 33 | public class Queries implements Serializable { 34 | @Element( 35 | description = "Queries type", 36 | required = true 37 | ) 38 | private String type = ""; 39 | @Element( 40 | description = "Queries version", 41 | required = true 42 | ) 43 | private String version = ""; 44 | @Element( 45 | description = "Queries mappings", 46 | required = true 47 | ) 48 | private Map mappings; 49 | 50 | public Queries() { 51 | } 52 | 53 | public String getType() { 54 | return this.type; 55 | } 56 | 57 | public String getVersion() { 58 | return this.version; 59 | } 60 | 61 | public Map getMappings() { 62 | return this.mappings; 63 | } 64 | 65 | public void setType(String type) { 66 | this.type = type; 67 | } 68 | 69 | public void setVersion(String version) { 70 | this.version = version; 71 | } 72 | 73 | public void setMappings(Map mappings) { 74 | this.mappings = mappings; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /components/distribution/carbon-home/bin/editor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # --------------------------------------------------------------------------- 3 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | cygwin=false; 18 | darwin=false; 19 | os400=false; 20 | mingw=false; 21 | case "`uname`" in 22 | CYGWIN*) cygwin=true;; 23 | MINGW*) mingw=true;; 24 | OS400*) os400=true;; 25 | Darwin*) darwin=true 26 | if [ -z "$JAVA_VERSION" ] ; then 27 | JAVA_VERSION="CurrentJDK" 28 | else 29 | echo "Using Java version: $JAVA_VERSION" 30 | fi 31 | if [ -z "$JAVA_HOME" ] ; then 32 | JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home 33 | fi 34 | ;; 35 | esac 36 | 37 | # resolve links - $0 may be a softlink 38 | PRG="$0" 39 | 40 | while [ -h "$PRG" ]; do 41 | ls=`ls -ld "$PRG"` 42 | link=`expr "$ls" : '.*-> \(.*\)$'` 43 | if expr "$link" : '.*/.*' > /dev/null; then 44 | PRG="$link" 45 | else 46 | PRG=`dirname "$PRG"`/"$link" 47 | fi 48 | done 49 | 50 | # Get standard environment variables 51 | PRGDIR=`dirname "$PRG"` 52 | 53 | # Only set CARBON_HOME if not already set 54 | [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd` 55 | 56 | ########################################################################### 57 | NAME=start-editor 58 | # Daemon name, where is the actual executable 59 | EDITOR_INIT_SCRIPT="$CARBON_HOME/wso2/editor/bin/carbon.sh" 60 | 61 | # If the daemon is not there, then exit. 62 | 63 | sh ${EDITOR_INIT_SCRIPT} -Deditor.port=9091 \ 64 | -DenableCloud=false \ 65 | -Dworkspace.port=8289 \ 66 | $* & 67 | 68 | trap "sh ${EDITOR_INIT_SCRIPT} stop; exit;" INT TERM 69 | while : 70 | do 71 | sleep 60 72 | done -------------------------------------------------------------------------------- /components/distribution/carbon-home/bin/worker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # --------------------------------------------------------------------------- 3 | # Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | cygwin=false; 18 | darwin=false; 19 | os400=false; 20 | mingw=false; 21 | case "`uname`" in 22 | CYGWIN*) cygwin=true;; 23 | MINGW*) mingw=true;; 24 | OS400*) os400=true;; 25 | Darwin*) darwin=true 26 | if [ -z "$JAVA_VERSION" ] ; then 27 | JAVA_VERSION="CurrentJDK" 28 | else 29 | echo "Using Java version: $JAVA_VERSION" 30 | fi 31 | if [ -z "$JAVA_HOME" ] ; then 32 | JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home 33 | fi 34 | ;; 35 | esac 36 | 37 | # resolve links - $0 may be a softlink 38 | PRG="$0" 39 | 40 | while [ -h "$PRG" ]; do 41 | ls=`ls -ld "$PRG"` 42 | link=`expr "$ls" : '.*-> \(.*\)$'` 43 | if expr "$link" : '.*/.*' > /dev/null; then 44 | PRG="$link" 45 | else 46 | PRG=`dirname "$PRG"`/"$link" 47 | fi 48 | done 49 | 50 | # Get standard environment variables 51 | PRGDIR=`dirname "$PRG"` 52 | 53 | # Only set CARBON_HOME if not already set 54 | [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd` 55 | 56 | ########################################################################### 57 | NAME=start-worker 58 | # Daemon name, where is the actual executable 59 | 60 | # Using "default" as the runtime name instead of "worker", 61 | # until https://github.com/wso2/carbon-kernel/issues/1525 is fixed 62 | WORKER_INIT_SCRIPT="$CARBON_HOME/wso2/default/bin/carbon.sh" 63 | 64 | # If the daemon is not there, then exit. 65 | 66 | sh $WORKER_INIT_SCRIPT $* & 67 | 68 | trap "sh $WORKER_INIT_SCRIPT stop; exit;" INT TERM 69 | while : 70 | do 71 | sleep 60 72 | done --------------------------------------------------------------------------------