├── components
└── tenant-mgt
│ ├── org.wso2.carbon.tenant.mgt.ui
│ └── src
│ │ └── main
│ │ └── resources
│ │ ├── web
│ │ └── tenant-mgt
│ │ │ ├── js
│ │ │ └── theme_resource_util.js
│ │ │ ├── images
│ │ │ ├── services.gif
│ │ │ ├── services1.gif
│ │ │ └── multi_tenancy.png
│ │ │ ├── docs
│ │ │ ├── images
│ │ │ │ ├── add-org.png
│ │ │ │ ├── add-tenant.png
│ │ │ │ └── view-tenants.png
│ │ │ └── userguide.html
│ │ │ ├── check_domain_availability_ajaxprocessor.jsp
│ │ │ ├── css
│ │ │ └── tenant.css
│ │ │ └── get_package_info_ajaxprocessor.jsp
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── tenant
│ │ └── mgt
│ │ └── ui
│ │ └── i18n
│ │ ├── JSResources.properties
│ │ └── Resources.properties
│ ├── org.wso2.carbon.tenant.theme.mgt.ui
│ └── src
│ │ └── main
│ │ └── resources
│ │ ├── web
│ │ └── tenant-theme
│ │ │ ├── images
│ │ │ ├── forum.gif
│ │ │ ├── help.gif
│ │ │ ├── logo.jpg
│ │ │ ├── footer.jpg
│ │ │ ├── header.jpg
│ │ │ ├── images.gif
│ │ │ ├── logomgt.gif
│ │ │ ├── people.gif
│ │ │ ├── sel-02.jpg
│ │ │ ├── services.gif
│ │ │ ├── thememgt.gif
│ │ │ ├── page-back.jpg
│ │ │ ├── user-guide.gif
│ │ │ ├── ajax-loader.gif
│ │ │ ├── button-back.gif
│ │ │ ├── content-back.jpg
│ │ │ ├── issue-tracker.gif
│ │ │ ├── mailing-list.gif
│ │ │ ├── content-back-left.jpg
│ │ │ └── create-org-button.gif
│ │ │ ├── docs
│ │ │ └── images
│ │ │ │ ├── edit-theme.png
│ │ │ │ ├── change-logo.png
│ │ │ │ └── select-theme.png
│ │ │ ├── js
│ │ │ └── editarea
│ │ │ │ ├── edit_area
│ │ │ │ ├── autocompletion.js
│ │ │ │ ├── images
│ │ │ │ │ ├── close.gif
│ │ │ │ │ ├── help.gif
│ │ │ │ │ ├── load.gif
│ │ │ │ │ ├── move.gif
│ │ │ │ │ ├── redo.gif
│ │ │ │ │ ├── save.gif
│ │ │ │ │ ├── search.gif
│ │ │ │ │ ├── spacer.gif
│ │ │ │ │ ├── undo.gif
│ │ │ │ │ ├── opacity.png
│ │ │ │ │ ├── fullscreen.gif
│ │ │ │ │ ├── go_to_line.gif
│ │ │ │ │ ├── highlight.gif
│ │ │ │ │ ├── newdocument.gif
│ │ │ │ │ ├── processing.gif
│ │ │ │ │ ├── word_wrap.gif
│ │ │ │ │ ├── autocompletion.gif
│ │ │ │ │ ├── reset_highlight.gif
│ │ │ │ │ ├── smooth_selection.gif
│ │ │ │ │ └── statusbar_resize.gif
│ │ │ │ ├── license_apache.txt
│ │ │ │ ├── reg_syntax
│ │ │ │ │ ├── robotstxt.js
│ │ │ │ │ ├── brainfuck.js
│ │ │ │ │ ├── html.js
│ │ │ │ │ ├── xml.js
│ │ │ │ │ ├── java.js
│ │ │ │ │ ├── c.js
│ │ │ │ │ ├── ruby.js
│ │ │ │ │ ├── cpp.js
│ │ │ │ │ └── vb.js
│ │ │ │ ├── license_bsd.txt
│ │ │ │ └── langs
│ │ │ │ │ └── en.js
│ │ │ │ ├── license_apache.txt
│ │ │ │ └── license_bsd.txt
│ │ │ ├── css
│ │ │ ├── theme-mgt.css
│ │ │ ├── tenent-theme.css
│ │ │ └── tenant.css
│ │ │ ├── rename_resource_ajaxprocessor.jsp
│ │ │ ├── delete_ajaxprocessor.jsp
│ │ │ ├── display_text_content_ajaxprocessor.jsp
│ │ │ ├── css-editor.jsp
│ │ │ ├── add_collection_ajaxprocessor.jsp
│ │ │ ├── update_text_content.jsp
│ │ │ ├── add_text_resource_ajaxprocessor.jsp
│ │ │ └── theme_mgt_ajaxprocessor.jsp
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── theme
│ │ └── mgt
│ │ └── ui
│ │ └── i18n
│ │ ├── JSResources.properties
│ │ └── Resources.properties
│ ├── org.wso2.carbon.tenant.sso.redirector.ui
│ └── src
│ │ └── main
│ │ ├── resources
│ │ ├── web
│ │ │ └── stratos-auth
│ │ │ │ ├── images
│ │ │ │ ├── sso.gif
│ │ │ │ ├── logo.gif
│ │ │ │ ├── delete.gif
│ │ │ │ ├── import.gif
│ │ │ │ ├── loading.gif
│ │ │ │ ├── policy.gif
│ │ │ │ ├── powered.gif
│ │ │ │ ├── register.gif
│ │ │ │ ├── cloud-sso-config.png
│ │ │ │ ├── st-login-body-bg.gif
│ │ │ │ ├── st-login-footer-bg.gif
│ │ │ │ ├── st-login-header-bg.gif
│ │ │ │ ├── st-login-content-bg.gif
│ │ │ │ ├── cloud-identity-sso-config.png
│ │ │ │ └── cloud-identity-sso-config-ok.png
│ │ │ │ └── css
│ │ │ │ └── stratos-loginpage.css
│ │ ├── META-INF
│ │ │ └── component.xml
│ │ └── org
│ │ │ └── wso2
│ │ │ └── stratos
│ │ │ └── sso
│ │ │ └── redirector
│ │ │ └── ui
│ │ │ └── i18n
│ │ │ └── Resources.properties
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── sso
│ │ └── redirector
│ │ └── ui
│ │ └── internal
│ │ └── RedirectorJSPFilter.java
│ ├── org.wso2.carbon.tenant.common
│ └── src
│ │ ├── main
│ │ ├── java
│ │ │ └── org
│ │ │ │ └── wso2
│ │ │ │ └── carbon
│ │ │ │ └── stratos
│ │ │ │ └── common
│ │ │ │ ├── services
│ │ │ │ └── PackageInfoService.java
│ │ │ │ ├── TenantBillingService.java
│ │ │ │ ├── exception
│ │ │ │ └── StratosException.java
│ │ │ │ ├── statistics
│ │ │ │ └── publisher
│ │ │ │ │ └── StatisticsPublisher.java
│ │ │ │ ├── util
│ │ │ │ ├── MeteringAccessValidationUtils.java
│ │ │ │ └── CommandUtils.java
│ │ │ │ ├── config
│ │ │ │ ├── CloudServiceConfigParser.java
│ │ │ │ ├── PermissionConfig.java
│ │ │ │ └── CloudServicesDescConfig.java
│ │ │ │ ├── listeners
│ │ │ │ └── TenantMgtListener.java
│ │ │ │ └── packages
│ │ │ │ └── PackageInfo.java
│ │ └── resources
│ │ │ └── META-INF
│ │ │ └── services.xml
│ │ └── test
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── common
│ │ └── test
│ │ └── CommonTest.java
│ ├── org.wso2.carbon.tenant.usage.agent
│ └── src
│ │ └── main
│ │ ├── resources
│ │ └── META-INF
│ │ │ ├── usage-throttling-agent-config.xml
│ │ │ ├── services.xml
│ │ │ ├── component.xml
│ │ │ └── module.xml
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── usage
│ │ └── agent
│ │ ├── exception
│ │ └── UsageException.java
│ │ ├── listeners
│ │ ├── UsageStatsAxis2ConfigurationContextObserver.java
│ │ ├── axis2
│ │ │ └── RequestMeteringModule.java
│ │ └── StatisticsInHandler.java
│ │ ├── util
│ │ ├── MonitoredReader.java
│ │ ├── MonitoredWriter.java
│ │ └── UsageAgentConstants.java
│ │ ├── beans
│ │ └── BandwidthUsage.java
│ │ └── persist
│ │ └── BandwidthPersistor.java
│ ├── org.wso2.carbon.tenant.throttling.agent
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── org
│ │ │ └── wso2
│ │ │ └── carbon
│ │ │ └── throttling
│ │ │ └── agent
│ │ │ ├── client
│ │ │ └── ThrottlingRuleInvoker.java
│ │ │ ├── validation
│ │ │ ├── ValidationException.java
│ │ │ └── ValidationInfo.java
│ │ │ ├── cache
│ │ │ ├── ThrottlingActionInfo.java
│ │ │ ├── Axis2ConfigurationContextObserverImpl.java
│ │ │ └── TenantThrottlingInfo.java
│ │ │ └── listeners
│ │ │ └── ThrottlingModule.java
│ │ └── resources
│ │ └── META-INF
│ │ └── module.xml
│ ├── org.wso2.carbon.tenant.mgt
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── org
│ │ │ └── wso2
│ │ │ └── carbon
│ │ │ └── tenant
│ │ │ └── mgt
│ │ │ ├── exception
│ │ │ └── TenantManagementException.java
│ │ │ ├── beans
│ │ │ └── PaginatedTenantInfoBean.java
│ │ │ ├── internal
│ │ │ └── TenantMgtImplServiceComponent.java
│ │ │ └── util
│ │ │ └── TenantDataDeletionUtil.java
│ │ └── resources
│ │ └── META-INF
│ │ └── component.xml
│ ├── org.wso2.carbon.tenant.redirector.servlet
│ └── src
│ │ └── main
│ │ ├── resources
│ │ └── META-INF
│ │ │ └── services.xml
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── redirector
│ │ └── servlet
│ │ ├── services
│ │ └── RedirectorServletService.java
│ │ └── internal
│ │ └── RedirectorServletActivationServiceComponent.java
│ ├── org.wso2.carbon.tenant.activation
│ └── src
│ │ └── main
│ │ ├── resources
│ │ └── META-INF
│ │ │ ├── services.xml
│ │ │ └── module.xml
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── activation
│ │ └── module
│ │ └── ActivationModule.java
│ ├── org.wso2.carbon.tenant.keystore.mgt
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── keystore
│ │ └── mgt
│ │ ├── util
│ │ ├── RealmServiceHolder.java
│ │ └── RegistryServiceHolder.java
│ │ └── KeyStoreMgtException.java
│ ├── org.wso2.carbon.tenant.theme.mgt
│ └── src
│ │ └── main
│ │ └── resources
│ │ └── META-INF
│ │ └── component.xml
│ ├── org.wso2.carbon.tenant.deployment
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── stratos
│ │ └── deployment
│ │ ├── SuperTenantRolePlayer.java
│ │ └── internal
│ │ └── DataHolder.java
│ ├── org.wso2.carbon.client.configcontext.provider
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── client
│ │ └── configcontext
│ │ └── provider
│ │ ├── Axis2ClientConfigContextProvider.java
│ │ ├── store
│ │ └── Axis2ClientConfigurationContextStore.java
│ │ └── listener
│ │ ├── Axis2ConfigurationContextObserverImpl.java
│ │ └── Axis2ConfigurationContextActivator.java
│ ├── org.wso2.carbon.tenant.redirector.servlet.ui
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── redirector
│ │ └── servlet
│ │ └── ui
│ │ └── internal
│ │ └── RedirectorServletUIComponent.java
│ └── pom.xml
├── .gitignore
├── features
└── tenant-mgt
│ ├── org.wso2.carbon.tenant.common.server.feature
│ └── src
│ │ └── main
│ │ └── resources
│ │ ├── conf
│ │ ├── cloud-services-desc.xml
│ │ ├── tenant-mgt.xml
│ │ └── usage-throttling-agent-config.xml
│ │ ├── conf_templates
│ │ └── templates
│ │ │ └── repository
│ │ │ └── conf
│ │ │ ├── multitenancy
│ │ │ ├── cloud-services-desc.xml.j2
│ │ │ └── multitenancy-packages.xml.j2
│ │ │ └── tenant-mgt.xml.j2
│ │ └── p2.inf
│ └── pom.xml
├── issue_template.md
├── .github
└── workflows
│ ├── pr-builder.yml
│ └── coverage.yml
├── README.md
└── pull_request_template.md
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/js/theme_resource_util.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore everything in this directory
2 | target
3 | .classpath
4 | .settings
5 | .project
6 | *.iml
7 | *.iws
8 | *.ipr
9 | .idea
10 | .DS_Store
11 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services1.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-org.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-org.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/multi_tenancy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/multi_tenancy.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/forum.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/forum.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/help.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/help.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logo.jpg
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-tenant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-tenant.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/sso.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/sso.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/JSResources.properties:
--------------------------------------------------------------------------------
1 | password.mismatched=Passwords do not match.
2 | current.password.should.provided=You should provide the current password inorder to change the password.
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/footer.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/footer.jpg
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/header.jpg
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/images.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/images.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logomgt.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/logomgt.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/people.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/people.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/sel-02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/sel-02.jpg
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/services.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/services.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/thememgt.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/thememgt.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/view-tenants.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/view-tenants.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/logo.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/page-back.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/page-back.jpg
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/user-guide.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/user-guide.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/delete.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/delete.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/import.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/import.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/loading.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/policy.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/policy.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/powered.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/powered.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/register.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/register.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/ajax-loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/ajax-loader.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/button-back.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/button-back.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back.jpg
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/issue-tracker.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/issue-tracker.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/mailing-list.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/mailing-list.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/edit-theme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/edit-theme.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/change-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/change-logo.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/select-theme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/docs/images/select-theme.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back-left.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/content-back-left.jpg
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/create-org-button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/images/create-org-button.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-sso-config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-sso-config.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-body-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-body-bg.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-footer-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-footer-bg.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-header-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-header-bg.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-content-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/st-login-content-bg.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/autocompletion.js
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/close.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/help.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/load.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/move.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/redo.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/save.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/search.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/spacer.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/undo.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/opacity.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config-ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/images/cloud-identity-sso-config-ok.png
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/fullscreen.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/go_to_line.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/highlight.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/newdocument.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/processing.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/word_wrap.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/autocompletion.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/reset_highlight.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/smooth_selection.gif
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wso2/carbon-multitenancy/master/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/images/statusbar_resize.gif
--------------------------------------------------------------------------------
/features/tenant-mgt/org.wso2.carbon.tenant.common.server.feature/src/main/resources/conf/cloud-services-desc.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/css/theme-mgt.css:
--------------------------------------------------------------------------------
1 | .subcontent {
2 | padding:5px 0px 5px; 0px
3 | }
4 |
5 | .subtopic {
6 | padding:10px 0px 5px; 0px;
7 | border-bottom:1px solid #000000;
8 | font-size:140%;
9 | font-weight:normal;
10 | margin-bottom:10px;
11 | margin-top:5px;
12 | }
13 |
14 | .green-note {
15 | color: #058000;
16 | }
17 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/org/wso2/carbon/tenant/mgt/ui/i18n/JSResources.properties:
--------------------------------------------------------------------------------
1 | password.mismatched=Passwords do not match.
2 | email.mismatched=The emails are mismatching.
3 | current.password.should.provided=You should provide the current password in order to change the password.
4 | password.length=Your password must be at least 6 characters long. Try again.
5 | password.regex.violation=Password policy violation. Please enter your password to follow the regex.
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_apache.txt:
--------------------------------------------------------------------------------
1 | Copyright 2008 Christophe Dolivet
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
4 |
5 | http://www.apache.org/licenses/LICENSE-2.0
6 |
7 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_apache.txt:
--------------------------------------------------------------------------------
1 | Copyright 2008 Christophe Dolivet
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
4 |
5 | http://www.apache.org/licenses/LICENSE-2.0
6 |
7 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/services/PackageInfoService.java:
--------------------------------------------------------------------------------
1 | package org.wso2.carbon.stratos.common.services;
2 |
3 | import java.util.List;
4 |
5 | import org.wso2.carbon.stratos.common.internal.CloudCommonServiceComponent;
6 | import org.wso2.carbon.stratos.common.packages.PackageInfo;
7 |
8 | public class PackageInfoService {
9 |
10 | public PackageInfo[] getPackageInfos() throws Exception {
11 | List list = CloudCommonServiceComponent.getPackageInfos().
12 | getMultitenancyPackages();
13 | PackageInfo[] packageInfos = list.toArray(new PackageInfo[list.size()]);
14 | return packageInfos;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/check_domain_availability_ajaxprocessor.jsp:
--------------------------------------------------------------------------------
1 | <%@ page import="org.apache.axis2.AxisFault" %>
2 | <%@ page import="org.wso2.carbon.stratos.common.util.CommonUtil" %>
3 | <%@ page import="org.json.JSONException" %>
4 | <%@ page import="org.json.JSONObject" %>
5 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
6 | <%
7 | String tenantDomain = request.getParameter("domain");
8 | boolean isDomainAvailable = CommonUtil.isDomainNameAvailable(tenantDomain);
9 | JSONObject jsonObject = new JSONObject();
10 |
11 | if (isDomainAvailable) {
12 | jsonObject.put("available", "true");
13 |
14 | } else {
15 | jsonObject.put("available", "false");
16 | }
17 | out.println(jsonObject);
18 |
19 | %>
20 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenent-theme.css:
--------------------------------------------------------------------------------
1 | .sel-box{
2 | background-image:url(../images/sel-02.jpg);
3 | background-repeat:repeat-x;
4 | background-position:0 0;
5 | background-color:#f2f2f2;
6 | border: inset 2px #48657a;
7 | padding:3px;
8 | float:left;
9 | margin-right:20px;
10 | margin-bottom:20px;
11 | }
12 | .sel-box span{
13 | color:#1c475f;
14 | font-weight:bold;
15 | text-align:center;
16 | font-size:14px;
17 | line-height:30px;
18 | }
19 | .nor-box{
20 | background-color:#ffffff;
21 | border: solid 1px #7699b3;
22 | padding:3px;
23 | float:left;
24 | margin-right:20px;
25 | margin-bottom:20px;
26 | }
27 | .nor-box span{
28 | color:#1c475f;
29 | font-weight:bold;
30 | text-align:center;
31 | line-height:30px;
32 | }
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/robotstxt.js:
--------------------------------------------------------------------------------
1 | editAreaLoader.load_syntax["robotstxt"] = {
2 | 'COMMENT_SINGLE' : {1 : '#'},
3 | 'COMMENT_MULTI' : {},
4 | 'QUOTEMARKS' : [],
5 | 'KEYWORD_CASE_SENSITIVE' : false,
6 | 'KEYWORDS' : {
7 | 'attributes' : ['User-agent', 'Disallow', 'Allow', 'Crawl-delay'],
8 | 'values' : ['*'],
9 | 'specials' : ['*']
10 | },
11 | 'OPERATORS' :[':'],
12 | 'DELIMITERS' :[],
13 | 'STYLES' : {
14 | 'COMMENTS': 'color: #AAAAAA;',
15 | 'QUOTESMARKS': 'color: #6381F8;',
16 | 'KEYWORDS' : {
17 | 'attributes' : 'color: #48BDDF;',
18 | 'values' : 'color: #2B60FF;',
19 | 'specials' : 'color: #FF0000;'
20 | },
21 | 'OPERATORS' : 'color: #FF00FF;',
22 | 'DELIMITERS' : 'color: #60CA00;'
23 | }
24 | };
25 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/resources/META-INF/usage-throttling-agent-config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 60000
5 | 100
6 | 100
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.throttling.agent/src/main/java/org/wso2/carbon/throttling/agent/client/ThrottlingRuleInvoker.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.throttling.agent.client;
17 |
18 | public interface ThrottlingRuleInvoker {
19 | public void executeThrottlingRules(int tenantId) throws Exception;
20 | }
21 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/TenantBillingService.java:
--------------------------------------------------------------------------------
1 | package org.wso2.carbon.stratos.common;
2 |
3 | import org.wso2.carbon.stratos.common.exception.StratosException;
4 | import org.wso2.carbon.user.api.Tenant;
5 |
6 | /**
7 | * The OSGI service interface that enables tenant related billing actions.
8 | */
9 | public interface TenantBillingService {
10 |
11 | public void addUsagePlan(Tenant tenant, String usagePlan) throws StratosException;
12 |
13 | public String getActiveUsagePlan(String tenantDomain) throws StratosException;
14 |
15 | public void updateUsagePlan(String tenantDomain, String usagePlan) throws StratosException;
16 |
17 | public void activateUsagePlan(String tenantDomain) throws StratosException;
18 |
19 | public void deactivateActiveUsagePlan(String tenantDomain) throws StratosException;
20 |
21 | public void deleteBillingData(int tenantId) throws StratosException;
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.throttling.agent/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.throttling.agent.validation;
17 |
18 | public class ValidationException extends Exception {
19 | public ValidationException(String msg, Exception e) {
20 | super(msg, e);
21 | }
22 | public ValidationException(String msg) {
23 | super(msg);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/META-INF/component.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 | ../stratos-auth/redirect_ajaxprocessor.jsp
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/.github/workflows/pr-builder.yml:
--------------------------------------------------------------------------------
1 | # This workflow will build the project on pull requests with tests
2 | # Uses:
3 | # OS: ubuntu-latest
4 | # JDK: Adopt JDK 11
5 |
6 | name: PR Builder
7 |
8 | on:
9 | pull_request:
10 | branches: [main, master]
11 | workflow_dispatch:
12 |
13 | env:
14 | MAVEN_OPTS: -Xmx4g -Xms1g
15 |
16 | jobs:
17 | build:
18 | runs-on: ubuntu-latest
19 |
20 | steps:
21 | - uses: actions/checkout@v2
22 | - name: Set up Adopt JDK 11
23 | uses: actions/setup-java@v2
24 | with:
25 | java-version: "11"
26 | distribution: "adopt"
27 | - name: Cache local Maven repository
28 | id: cache-maven-m2
29 | uses: actions/cache@v3
30 | env:
31 | cache-name: cache-m2
32 | with:
33 | path: ~/.m2/repository
34 | key: ${{ runner.os }}-maven-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
35 | restore-keys: |
36 | ${{ runner.os }}-maven-${{ env.cache-name }}-
37 | ${{ runner.os }}-maven-
38 | ${{ runner.os }}-
39 | - name: Build with Maven
40 | run: mvn clean install -U -B
41 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/java/org/wso2/carbon/usage/agent/exception/UsageException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.usage.agent.exception;
17 |
18 | /**
19 | * UsageException class to handle usage exception
20 | */
21 | public class UsageException extends Exception {
22 | public UsageException(String msg, Exception e) {
23 | super(msg, e);
24 | }
25 | public UsageException(String msg) {
26 | super(msg);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/brainfuck.js:
--------------------------------------------------------------------------------
1 | editAreaLoader.load_syntax["brainfuck"] = {
2 | 'COMMENT_SINGLE' : {}
3 | ,'COMMENT_MULTI' : {}
4 | ,'QUOTEMARKS' : {}
5 | ,'KEYWORD_CASE_SENSITIVE' : true
6 | ,'OPERATORS' :[
7 | '+', '-'
8 | ]
9 | ,'DELIMITERS' :[
10 | '[', ']'
11 | ]
12 | ,'REGEXPS' : {
13 | 'bfispis' : {
14 | 'search' : '()(\\.)()'
15 | ,'class' : 'bfispis'
16 | ,'modifiers' : 'g'
17 | ,'execute' : 'before'
18 | }
19 | ,'bfupis' : {
20 | 'search' : '()(\\,)()'
21 | ,'class' : 'bfupis'
22 | ,'modifiers' : 'g'
23 | ,'execute' : 'before'
24 | }
25 | ,'bfmemory' : {
26 | 'search' : '()([<>])()'
27 | ,'class' : 'bfmemory'
28 | ,'modifiers' : 'g'
29 | ,'execute' : 'before'
30 | }
31 | }
32 | ,'STYLES' : {
33 | 'COMMENTS': 'color: #AAAAAA;'
34 | ,'QUOTESMARKS': 'color: #6381F8;'
35 | ,'OPERATORS' : 'color: #88AA00;'
36 | ,'DELIMITERS' : 'color: #00C138;'
37 | ,'REGEXPS' : {
38 | 'bfispis' : 'color: #EE0000;'
39 | ,'bfupis' : 'color: #4455ee;'
40 | ,'bfmemory' : 'color: #DD00DD;'
41 | }
42 | }
43 | };
44 |
45 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt/src/main/java/org/wso2/carbon/tenant/mgt/exception/TenantManagementException.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.tenant.mgt.exception;
20 |
21 | /**
22 | * Tenant Management Specific Exception.
23 | */
24 | public class TenantManagementException extends Exception {
25 |
26 | public TenantManagementException(String msg, Exception e) {
27 | super(msg, e);
28 | }
29 |
30 | public TenantManagementException(String msg) {
31 | super(msg);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.redirector.servlet/src/main/resources/META-INF/services.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | https
22 |
23 |
24 | org.wso2.carbon.redirector.servlet.services.RedirectorServletService
25 |
26 |
27 | true
28 |
29 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.activation/src/main/resources/META-INF/services.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
23 | https
24 |
25 |
26 | org.wso2.carbon.activation.service.ActivationService
27 |
28 |
29 | true
30 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.keystore.mgt/src/main/java/org/wso2/carbon/keystore/mgt/util/RealmServiceHolder.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.keystore.mgt.util;
19 |
20 | import org.wso2.carbon.user.core.service.RealmService;
21 |
22 | public class RealmServiceHolder {
23 |
24 | private static RealmService realmServiceService;
25 |
26 | public static RealmService getRealmService() {
27 | return realmServiceService;
28 | }
29 |
30 | public static void setRealmService(RealmService realmService) {
31 | RealmServiceHolder.realmServiceService = realmService;
32 | }
33 | }
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/resources/META-INF/services.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 | https
23 |
24 |
25 | org.wso2.carbon.usage.agent.services.CustomMeteringService
26 |
27 |
28 | true
29 | true
30 |
31 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.throttling.agent/src/main/java/org/wso2/carbon/throttling/agent/cache/ThrottlingActionInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, 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.throttling.agent.cache;
18 |
19 | public class ThrottlingActionInfo {
20 | private boolean blocked = false;
21 |
22 | private String message = "";
23 |
24 | public ThrottlingActionInfo(boolean blocked, String message) {
25 | this.blocked = blocked;
26 | this.message = message;
27 | }
28 |
29 | public boolean isBlocked() {
30 | return blocked;
31 | }
32 |
33 | public String getMessage() {
34 | return message;
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.keystore.mgt/src/main/java/org/wso2/carbon/keystore/mgt/util/RegistryServiceHolder.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.keystore.mgt.util;
19 |
20 | import org.wso2.carbon.registry.core.service.RegistryService;
21 |
22 | public class RegistryServiceHolder {
23 |
24 | private static RegistryService registryService;
25 |
26 | public static RegistryService getRegistryService() {
27 | return registryService;
28 | }
29 |
30 | public static void setRegistryService(RegistryService registryService) {
31 | RegistryServiceHolder.registryService = registryService;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/.github/workflows/coverage.yml:
--------------------------------------------------------------------------------
1 | name: Code coverage upload workflow (codecov)
2 |
3 | on:
4 | schedule:
5 | - cron: '0 20 * * *'
6 | workflow_dispatch:
7 |
8 | permissions:
9 | contents: read # to fetch code (actions/checkout)
10 |
11 | jobs:
12 | build-and-upload-coverage:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Run hostname
16 | run: hostname
17 | - name: Fix host entry
18 | run: sudo echo "127.0.0.1 $(hostname)" | sudo tee -a /etc/hosts
19 | - name: Show hosts
20 | run: cat /etc/hosts
21 | - name: Checkout master
22 | uses: actions/checkout@v3
23 | with:
24 | fetch-depth: '10'
25 | - name: Set up JDK 8
26 | uses: actions/setup-java@v2
27 | with:
28 | java-version: 8
29 | distribution: 'adopt'
30 | - name: Cache Maven packages
31 | uses: actions/cache@v3
32 | with:
33 | path: ~/.m2
34 | key: ${{ runner.os }}-m2
35 | restore-keys: ${{ runner.os }}-m2
36 | - name: Build with tests
37 | run: mvn clean install --file pom.xml
38 | - name: Upload test coverage to Codecov
39 | uses: codecov/codecov-action@v4.0.1
40 | with:
41 | flags: unit_tests
42 | token: ${{ secrets.CODECOV_TOKEN }}
43 | slug: wso2/carbon-multitenancy
44 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt/src/main/resources/META-INF/component.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | Configure
22 | /permission/admin/configure
23 |
24 |
25 | Theme
26 | /permission/admin/configure/theme
27 |
28 |
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # carbon-multitenancy
2 |
3 | ---
4 |
5 | | Branch | Build Status |
6 | | :------------ |:-------------
7 | | master | [](https://wso2.org/jenkins/job/carbon-multitenancy) |
8 |
9 |
10 | ---
11 |
12 | Latest Released Version v4.5.0, v4.4.4.
13 |
14 | #### carbon-multitenancy repo contains the the following component.
15 |
16 | * tenant-mgt
17 |
18 | The goal of multitenancy is to maximize resource sharing by allowing multiple users (tenants) to log in and use a single sever/cluster at the same time, in a tenant-isolated manner. That is, each user is given the experience of using his/her own server, rather than a shared environment. Multitenancy ensures optimal performance of the system's resources such as memory and hardware and also secures each tenant's personal data.
19 |
20 | This repository contains the features required for multitenancy functionality.
21 |
22 | ## How to Contribute
23 | * Please report issues at [Carbon JIRA] (https://wso2.org/jira/browse/CARBON).
24 | * Send your bug fixes pull requests to [master branch] (https://github.com/wso2/carbon-multitenancy/tree/master)
25 |
26 | ## Contact us
27 | WSO2 Carbon developers can be contacted via the mailing lists:
28 |
29 | * Carbon Developers List : dev@wso2.org
30 | * Carbon Architecture List : architecture@wso2.org
31 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/java/org/wso2/carbon/usage/agent/listeners/UsageStatsAxis2ConfigurationContextObserver.java:
--------------------------------------------------------------------------------
1 | package org.wso2.carbon.usage.agent.listeners;
2 |
3 | import org.apache.axis2.AxisFault;
4 | import org.apache.axis2.context.ConfigurationContext;
5 | import org.apache.axis2.description.AxisModule;
6 | import org.apache.axis2.engine.AxisConfiguration;
7 | import org.apache.commons.logging.Log;
8 | import org.apache.commons.logging.LogFactory;
9 | import org.wso2.carbon.context.PrivilegedCarbonContext;
10 | import org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver;
11 |
12 |
13 | public class UsageStatsAxis2ConfigurationContextObserver extends AbstractAxis2ConfigurationContextObserver {
14 |
15 | private static final Log log = LogFactory.getLog(UsageStatsAxis2ConfigurationContextObserver.class);
16 |
17 | @Override
18 | public void createdConfigurationContext(ConfigurationContext configContext) {
19 |
20 | AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
21 | int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(false);
22 | try {
23 | axisConfiguration.engageModule("metering");
24 | } catch (AxisFault axisFault) {
25 | log.error("Could not engage metering module for tenant: " + tenantId, axisFault);
26 | }
27 |
28 |
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.keystore.mgt/src/main/java/org/wso2/carbon/keystore/mgt/KeyStoreMgtException.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.keystore.mgt;
19 |
20 | /**
21 | * This class is used to wrap the exceptions thrown from stratos keystore mgt component.
22 | */
23 | public class KeyStoreMgtException extends Exception {
24 | public KeyStoreMgtException() {
25 | }
26 |
27 | public KeyStoreMgtException(String message) {
28 | super(message);
29 | }
30 |
31 | public KeyStoreMgtException(String message, Throwable cause) {
32 | super(message, cause);
33 | }
34 |
35 | public KeyStoreMgtException(Throwable cause) {
36 | super(cause);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.throttling.agent/src/main/java/org/wso2/carbon/throttling/agent/validation/ValidationInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.throttling.agent.validation;
17 |
18 | public class ValidationInfo {
19 | boolean isActionBlocked;
20 | String blockedActionMsg;
21 |
22 | public ValidationInfo(){
23 | isActionBlocked = false;
24 | }
25 |
26 | public boolean isActionBlocked() {
27 | return isActionBlocked;
28 | }
29 | public void setActionBlocked(boolean isBlocked) {
30 | this.isActionBlocked = isBlocked;
31 | }
32 | public String getBlockedActionMsg() {
33 | return blockedActionMsg;
34 | }
35 | public void setBlockedActionMsg(String blockedMsg) {
36 | this.blockedActionMsg = blockedMsg;
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/html.js:
--------------------------------------------------------------------------------
1 | /*
2 | * last update: 2006-08-24
3 | */
4 |
5 | editAreaLoader.load_syntax["html"] = {
6 | 'COMMENT_SINGLE' : {}
7 | ,'COMMENT_MULTI' : {''}
8 | ,'QUOTEMARKS' : {1: "'", 2: '"'}
9 | ,'KEYWORD_CASE_SENSITIVE' : false
10 | ,'KEYWORDS' : {
11 | }
12 | ,'OPERATORS' :[
13 | ]
14 | ,'DELIMITERS' :[
15 | ]
16 | ,'REGEXPS' : {
17 | 'doctype' : {
18 | 'search' : '()(]*>)()'
19 | ,'class' : 'doctype'
20 | ,'modifiers' : ''
21 | ,'execute' : 'before' // before or after
22 | }
23 | ,'tags' : {
24 | 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
25 | ,'class' : 'tags'
26 | ,'modifiers' : 'gi'
27 | ,'execute' : 'before' // before or after
28 | }
29 | ,'attributes' : {
30 | 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
31 | ,'class' : 'attributes'
32 | ,'modifiers' : 'g'
33 | ,'execute' : 'before' // before or after
34 | }
35 | }
36 | ,'STYLES' : {
37 | 'COMMENTS': 'color: #AAAAAA;'
38 | ,'QUOTESMARKS': 'color: #6381F8;'
39 | ,'KEYWORDS' : {
40 | }
41 | ,'OPERATORS' : 'color: #E775F0;'
42 | ,'DELIMITERS' : ''
43 | ,'REGEXPS' : {
44 | 'attributes': 'color: #B1AC41;'
45 | ,'tags': 'color: #E62253;'
46 | ,'doctype': 'color: #8DCFB5;'
47 | ,'test': 'color: #00FF00;'
48 | }
49 | }
50 | };
51 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/exception/StratosException.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.stratos.common.exception;
20 |
21 | /**
22 | * This class is defined as the general Exception implementation for Stratos. This can be used
23 | * within Stratos components when handling exceptions.
24 | */
25 | public class StratosException extends Exception{
26 |
27 | public StratosException() {
28 | }
29 |
30 | public StratosException(String message) {
31 | super(message);
32 | }
33 |
34 | public StratosException(String message, Throwable cause) {
35 | super(message, cause);
36 | }
37 |
38 | public StratosException(Throwable cause) {
39 | super(cause);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.activation/src/main/resources/META-INF/module.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
30 |
31 |
32 | true
33 |
34 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/resources/META-INF/services.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 | https
23 |
24 |
25 | org.wso2.carbon.stratos.common.services.PackageInfoService
26 |
27 | false
28 |
29 | /permission/admin/manage
30 |
31 |
32 |
33 |
34 | true
35 |
36 |
37 |
--------------------------------------------------------------------------------
/features/tenant-mgt/org.wso2.carbon.tenant.common.server.feature/src/main/resources/conf_templates/templates/repository/conf/multitenancy/cloud-services-desc.xml.j2:
--------------------------------------------------------------------------------
1 |
18 |
19 |
24 |
25 | {% for service in multi_tenancy.cloud_services %}
26 |
27 | {{service.key}}
28 |
29 | {{service.link}}
30 | {{service.description}}
31 |
32 | {% endfor %}
33 |
34 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.throttling.agent/src/main/resources/META-INF/module.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
30 |
31 |
32 | true
33 |
34 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.deployment/src/main/java/org/wso2/carbon/stratos/deployment/SuperTenantRolePlayer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2004,2005 The Apache Software Foundation.
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.stratos.deployment;
18 |
19 | import org.apache.axiom.soap.RolePlayer;
20 | import org.wso2.carbon.base.MultitenantConstants;
21 | import org.wso2.carbon.context.CarbonContext;
22 |
23 | import java.util.List;
24 | import java.util.ArrayList;
25 |
26 | public class SuperTenantRolePlayer implements RolePlayer{
27 |
28 | private List roles;
29 |
30 | public SuperTenantRolePlayer() {
31 | this.roles = new ArrayList();
32 | this.roles.add("supertenant");
33 | }
34 |
35 | public List getRoles() {
36 | return this.roles;
37 | }
38 |
39 | public boolean isUltimateDestination() {
40 | return (MultitenantConstants.SUPER_TENANT_ID == CarbonContext.getThreadLocalCarbonContext().getTenantId());
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/license_bsd.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008, Christophe Dolivet
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 |
6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8 | * Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9 |
10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/resources/META-INF/component.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | Monitor
22 | /permission/admin/monitor
23 |
24 |
25 | Tenant-Usage
26 | /permission/admin/monitor/tenantUsage
27 |
28 |
29 | Tenant-Usage
30 | /permission/admin/monitor/tenantUsage/customUsage
31 |
32 |
33 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/java/org/wso2/carbon/usage/agent/util/MonitoredReader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.usage.agent.util;
17 |
18 | import java.io.IOException;
19 | import java.io.Reader;
20 |
21 |
22 | /**
23 | * this class is used to wrap the Reader object
24 | */
25 | public class MonitoredReader extends Reader {
26 | Reader reader;
27 | long totalRead;
28 |
29 | public MonitoredReader(Reader reader) {
30 | this.reader = reader;
31 | totalRead = 0;
32 | }
33 |
34 | public int read(char cbuf[], int off, int len) throws IOException {
35 | int read = reader.read(cbuf, off, len);
36 | totalRead += read;
37 | return read;
38 | }
39 |
40 | public void close() throws IOException {
41 | reader.close();
42 | }
43 |
44 | public long getTotalRead() {
45 | return totalRead;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/license_bsd.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2008, Christophe Dolivet
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 |
6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8 | * Neither the name of EditArea nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9 |
10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/css/tenant.css:
--------------------------------------------------------------------------------
1 | /*css editor styles */
2 | .csseditor-top-line{
3 | background-color:black;
4 | height:5px;
5 | }
6 | .csseditor-leftbox{
7 | background-color:#9a9a9a;
8 | padding-left:5px;
9 | padding-right:5px;
10 | padding-bottom:5px;
11 | padding-top:15px;
12 | height:380px;
13 | }
14 | .csseditor-leftbox-top{
15 | color:#ffffff;
16 | font-size:18px;
17 | height:30px;
18 | }
19 | .csseditor-textbox{
20 | background-color:#dfe7ed;
21 | border:solid 1px #ffffff;
22 | width:100%;
23 | }
24 | .csseditor-rightbox{
25 | background-color:#c9c9c9;
26 | border:solid 1px #ffffff;
27 | height:400px;
28 | }
29 | .csseditor-rightbox-title{
30 | background-color:#9a9a9a;
31 | height:25px;
32 | color:#ffffff;
33 | padding-left:10px;
34 | padding-top:5px;
35 | }
36 | .csseditor-searchbox{
37 | padding-left:10px;
38 | padding-top:10px;
39 | }
40 | #flickr_results{
41 | height:300px;
42 | overflow-y:auto;
43 | overflow-x:hidden;
44 | margin-left:5px;
45 | margin-right:5px;
46 | border:solid 1px #ffffff;
47 | }
48 | .imageList{
49 | }
50 | .imageList li {
51 | padding-top: 3px !important;
52 | padding-left: 5px !important;
53 | background-color: #e1e9ec;
54 | border: solid 1px #b5bdc1;
55 | }
56 |
57 | .imageList li a {
58 | background-image: url(../images/images.gif);
59 | background-repeat: no-repeat;
60 | padding-left: 20px;
61 | text-indent: 50px;
62 | }
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/xml.js:
--------------------------------------------------------------------------------
1 | /*
2 | * last update: 2006-08-24
3 | */
4 |
5 | editAreaLoader.load_syntax["xml"] = {
6 | 'COMMENT_SINGLE' : {}
7 | ,'COMMENT_MULTI' : {''}
8 | ,'QUOTEMARKS' : {1: "'", 2: '"'}
9 | ,'KEYWORD_CASE_SENSITIVE' : false
10 | ,'KEYWORDS' : {
11 | }
12 | ,'OPERATORS' :[
13 | ]
14 | ,'DELIMITERS' :[
15 | ]
16 | ,'REGEXPS' : {
17 | 'xml' : {
18 | 'search' : '()(<\\?[^>]*?\\?>)()'
19 | ,'class' : 'xml'
20 | ,'modifiers' : 'g'
21 | ,'execute' : 'before' // before or after
22 | }
23 | ,'cdatas' : {
24 | 'search' : '()()()'
25 | ,'class' : 'cdata'
26 | ,'modifiers' : 'g'
27 | ,'execute' : 'before' // before or after
28 | }
29 | ,'tags' : {
30 | 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)'
31 | ,'class' : 'tags'
32 | ,'modifiers' : 'gi'
33 | ,'execute' : 'before' // before or after
34 | }
35 | ,'attributes' : {
36 | 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)'
37 | ,'class' : 'attributes'
38 | ,'modifiers' : 'g'
39 | ,'execute' : 'before' // before or after
40 | }
41 | }
42 | ,'STYLES' : {
43 | 'COMMENTS': 'color: #AAAAAA;'
44 | ,'QUOTESMARKS': 'color: #6381F8;'
45 | ,'KEYWORDS' : {
46 | }
47 | ,'OPERATORS' : 'color: #E775F0;'
48 | ,'DELIMITERS' : ''
49 | ,'REGEXPS' : {
50 | 'attributes': 'color: #B1AC41;'
51 | ,'tags': 'color: #E62253;'
52 | ,'xml': 'color: #8DCFB5;'
53 | ,'cdata': 'color: #50B020;'
54 | }
55 | }
56 | };
57 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/statistics/publisher/StatisticsPublisher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. 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 | package org.wso2.carbon.stratos.common.statistics.publisher;
21 |
22 | /**
23 | * Statistics publisher interface.
24 | */
25 | public interface StatisticsPublisher {
26 |
27 | /**
28 | * Set statistics publisher enabled or disabled.
29 | *
30 | * @param enabled
31 | */
32 | void setEnabled(boolean enabled);
33 |
34 | /**
35 | * Return enabled state of the statistics publisher.
36 | */
37 | boolean isEnabled();
38 |
39 | /**
40 | * Payload to be published.
41 | *
42 | * @param payload An array of parameter values.
43 | */
44 | void publish(Object[] payload);
45 | }
46 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.client.configcontext.provider/src/main/java/org/wso2/carbon/client/configcontext/provider/Axis2ClientConfigContextProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005-2014, 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.client.configcontext.provider;
21 |
22 | import java.rmi.RemoteException;
23 |
24 | import org.apache.axis2.context.ConfigurationContext;
25 |
26 | public interface Axis2ClientConfigContextProvider {
27 |
28 | String AXIS2_CLIENT_CONTEXT_PROVIDER_KEY = "axis2_client_context_provider.key";
29 |
30 | /**
31 | * Returns the Configuration Context for the specified tenant ID,
32 | * Create a Configuration Context if not already created, and return it.
33 | * If the client Configuration Context for that tenant is available, it will return it.
34 | *
35 | * @param tenantID
36 | * @return
37 | * @throws RemoteException
38 | */
39 | ConfigurationContext getConfigurationContext()
40 | throws RemoteException;
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/java/org/wso2/carbon/usage/agent/util/MonitoredWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.usage.agent.util;
17 |
18 | import java.io.IOException;
19 | import java.io.Writer;
20 |
21 |
22 | /**
23 | * this class is used to wrap Writer object
24 | */
25 | public class MonitoredWriter extends Writer {
26 | Writer writer;
27 | long totalWritten;
28 |
29 | public MonitoredWriter(Writer writer) {
30 | this.writer = writer;
31 | totalWritten = 0;
32 | }
33 |
34 | public void write(char cbuf[], int off, int len) throws IOException {
35 | totalWritten += (len - off);
36 | writer.write(cbuf, off, len);
37 | }
38 |
39 | public void flush() throws IOException {
40 | writer.flush();
41 | }
42 |
43 | public void close() throws IOException {
44 | writer.close();
45 | }
46 |
47 | public long getTotalWritten() {
48 | return totalWritten;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.redirector.servlet/src/main/java/org/wso2/carbon/redirector/servlet/services/RedirectorServletService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005-2008, 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.redirector.servlet.services;
20 |
21 | import org.wso2.carbon.user.core.tenant.TenantManager;
22 | import org.wso2.carbon.stratos.common.constants.StratosConstants;
23 | import org.wso2.carbon.redirector.servlet.util.Util;
24 |
25 | public class RedirectorServletService {
26 | public String validateTenant(String tenantDomain) throws Exception {
27 | TenantManager tenantManager = Util.getTenantManager();
28 | int tenantId = tenantManager.getTenantId(tenantDomain);
29 | if (tenantId <= 0) {
30 | return StratosConstants.INVALID_TENANT;
31 | } else if (Util.getActivationService() != null &&
32 | !Util.getActivationService().isActive(tenantId)) {
33 | return StratosConstants.INACTIVE_TENANT;
34 | }
35 | return StratosConstants.ACTIVE_TENANT;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/features/tenant-mgt/org.wso2.carbon.tenant.common.server.feature/src/main/resources/p2.inf:
--------------------------------------------------------------------------------
1 | instructions.configure = \
2 | org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.tenant.common.server_${feature.version}/conf/cloud-services-desc.xml,target:${installFolder}/../../conf/multitenancy/cloud-services-desc.xml,overwrite:true);\
3 | org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.tenant.common.server_${feature.version}/conf/stratos.xml,target:${installFolder}/../../conf/multitenancy/stratos.xml,overwrite:true);\
4 | org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.tenant.common.server_${feature.version}/conf/tenant-mgt.xml,target:${installFolder}/../../conf/multitenancy/tenant-mgt.xml,overwrite:true);\
5 | org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.tenant.common.server_${feature.version}/conf/multitenancy-packages.xml,target:${installFolder}/../../conf/multitenancy/multitenancy-packages.xml,overwrite:true);\
6 | org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.tenant.common.server_${feature.version}/conf/usage-throttling-agent-config.xml,target:${installFolder}/../../conf/multitenancy/usage-throttling-agent-config.xml,overwrite:true);\
7 | org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.tenant.common.server_${feature.version}/conf/eula.xml,target:${installFolder}/../../conf/multitenancy/eula.xml,overwrite:true);\
8 | org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.tenant.common.server_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\
9 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.throttling.agent/src/main/java/org/wso2/carbon/throttling/agent/listeners/ThrottlingModule.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.throttling.agent.listeners;
19 |
20 | import org.apache.axis2.AxisFault;
21 | import org.apache.axis2.context.ConfigurationContext;
22 | import org.apache.axis2.description.AxisDescription;
23 | import org.apache.axis2.description.AxisModule;
24 | import org.apache.axis2.modules.Module;
25 | import org.apache.neethi.Assertion;
26 | import org.apache.neethi.Policy;
27 |
28 | /**
29 | *
30 | */
31 | public class ThrottlingModule implements Module {
32 |
33 | public void applyPolicy(Policy arg0, AxisDescription arg1) throws AxisFault {
34 | }
35 |
36 | public boolean canSupportAssertion(Assertion arg0) {
37 | return true;
38 | }
39 |
40 | public void engageNotify(AxisDescription arg0) throws AxisFault {
41 | }
42 |
43 | public void init(ConfigurationContext arg0, AxisModule arg1) throws AxisFault {
44 | }
45 |
46 | public void shutdown(ConfigurationContext arg0) throws AxisFault {
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/java/org/wso2/carbon/usage/agent/beans/BandwidthUsage.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 |
20 | package org.wso2.carbon.usage.agent.beans;
21 |
22 | /**
23 | * the bean class for BandwidthUsage with attributes
24 | * int tenant id,
25 | * String measurement
26 | * long value *
27 | */
28 |
29 | public class BandwidthUsage {
30 | private int tenantId;
31 | private String measurement;
32 | private long value;
33 |
34 |
35 | public String getMeasurement() {
36 | return measurement;
37 | }
38 |
39 | public BandwidthUsage(int tenantId, String measurement, long value) {
40 | this.tenantId = tenantId;
41 | this.measurement = measurement;
42 | this.value = value;
43 | }
44 |
45 | public long getValue() {
46 | return value;
47 | }
48 |
49 | public void setValue(long value) {
50 | this.value = value;
51 | }
52 |
53 | public void setTenantId(int tenantId) {
54 | this.tenantId = tenantId;
55 | }
56 |
57 | public int getTenantId() {
58 | return tenantId;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/java/org/wso2/carbon/usage/agent/listeners/axis2/RequestMeteringModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.usage.agent.listeners.axis2;
17 |
18 | import org.apache.axis2.AxisFault;
19 | import org.apache.axis2.context.ConfigurationContext;
20 | import org.apache.axis2.description.AxisDescription;
21 | import org.apache.axis2.description.AxisModule;
22 | import org.apache.axis2.modules.Module;
23 | import org.apache.neethi.Assertion;
24 | import org.apache.neethi.Policy;
25 |
26 | public class RequestMeteringModule implements Module {
27 |
28 | public void init(ConfigurationContext configurationContext, AxisModule axisModule)
29 | throws AxisFault {
30 | }
31 |
32 | public void engageNotify(AxisDescription axisDescription) throws AxisFault {
33 | }
34 |
35 | public boolean canSupportAssertion(Assertion assertion) {
36 | return true;
37 | }
38 |
39 | public void applyPolicy(Policy policy, AxisDescription axisDescription) throws AxisFault {
40 | }
41 |
42 | public void shutdown(ConfigurationContext configurationContext) throws AxisFault {
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/rename_resource_ajaxprocessor.jsp:
--------------------------------------------------------------------------------
1 |
18 | <%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
19 | <%@ page import="org.wso2.carbon.utils.ServerConstants" %>
20 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
21 | <%
22 | String parentPath = request.getParameter("parentPath");
23 | String oldResourcePath = request.getParameter("oldResourcePath");
24 | String newName = request.getParameter("newName");
25 |
26 | String cookie = (String) request.
27 | getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
28 |
29 | try {
30 | ThemeMgtServiceClient client =
31 | new ThemeMgtServiceClient(cookie, config, request.getSession());
32 | client.renameResource(parentPath, oldResourcePath, newName);
33 |
34 |
35 | } catch (Exception e) {
36 | String type = "resource";
37 | response.setStatus(500);
38 | out.write("Failed to rename " + type + " " + oldResourcePath + " To " + newName);
39 | return;
40 | }
41 | %>
42 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/test/java/org/wso2/carbon/common/test/CommonTest.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.stratos.common.test;
19 |
20 | import junit.framework.TestCase;
21 | import org.wso2.carbon.stratos.common.util.CommonUtil;
22 |
23 | public class CommonTest extends TestCase {
24 | public void testEmailValidation() throws Exception {
25 | try {
26 | CommonUtil.validateEmail("damn@right.com");
27 | assertTrue(true);
28 | } catch (Exception e) {
29 | assertTrue(false);
30 | }
31 |
32 | try {
33 | CommonUtil.validateEmail("damn@right].com");
34 | assertTrue(false);
35 | } catch (Exception e) {
36 | assertTrue(true);
37 | assertEquals("Wrong characters in the email.", e.getMessage());
38 | }
39 |
40 | try {
41 | CommonUtil.validateEmail("damn@right@wrong.com");
42 | assertTrue(false);
43 | } catch (Exception e) {
44 | assertTrue(true);
45 | assertEquals("Invalid email address is provided.", e.getMessage());
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt/src/main/java/org/wso2/carbon/tenant/mgt/beans/PaginatedTenantInfoBean.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.tenant.mgt.beans;
20 |
21 | import org.wso2.carbon.stratos.common.beans.TenantInfoBean;
22 | import org.wso2.carbon.utils.Pageable;
23 |
24 | import java.util.List;
25 |
26 | /**
27 | * Bean for paginated tenant information
28 | */
29 | public class PaginatedTenantInfoBean implements Pageable {
30 | private TenantInfoBean[] tenantInfoBeans;
31 | private int numberOfPages;
32 |
33 | public TenantInfoBean[] getTenantInfoBeans() {
34 | return tenantInfoBeans;
35 | }
36 |
37 | public void setTenantInfoBeans(TenantInfoBean[] tenantInfoBeans) {
38 | this.tenantInfoBeans = tenantInfoBeans;
39 | }
40 |
41 | public int getNumberOfPages() {
42 | return numberOfPages;
43 | }
44 |
45 | public void setNumberOfPages(int numberOfPages) {
46 | this.numberOfPages = numberOfPages;
47 | }
48 |
49 | public void set(List items) {
50 | this.tenantInfoBeans = items.toArray(new TenantInfoBean[items.size()]);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/css/tenant.css:
--------------------------------------------------------------------------------
1 | /*css editor styles */
2 | .csseditor-top-line{
3 | background-color:black;
4 | height:5px;
5 | }
6 | .csseditor-leftbox{
7 | background-color:#e6e6e6;
8 | padding-left:5px;
9 | padding-right:5px;
10 | padding-bottom:5px;
11 | padding-top:15px;
12 | height:380px;
13 | }
14 | .csseditor-leftbox-top{
15 | color:#000000;
16 | font-size:18px;
17 | height:30px;
18 | }
19 | .csseditor-textbox{
20 | background-color:#dfe7ed;
21 | border:solid 1px #ffffff;
22 | width:100%;
23 | }
24 | .csseditor-rightbox{
25 | background-color:#f3f3f3;
26 | border:solid 1px #ffffff;
27 | height:400px;
28 | }
29 | .csseditor-rightbox-title{
30 | background-color:#9a9a9a;
31 | height:25px;
32 | color:#ffffff;
33 | padding-left:10px;
34 | padding-top:5px;
35 | }
36 | .csseditor-searchbox{
37 | padding-left:10px;
38 | padding-top:10px;
39 | }
40 | .csseditor-right{
41 | width:320px;
42 | }
43 | #flickr_results{
44 | height:210px;
45 | overflow-y:auto;
46 | overflow-x:hidden;
47 | margin-left:5px;
48 | margin-right:5px;
49 | border:solid 1px #ffffff;
50 | }
51 | .flicker_selected{
52 | height:20px;
53 | border:solid 1px #cccccc;
54 | background-color:#ffffff;
55 | color:#333333;
56 | padding:5px;
57 | margin-top:5px;
58 | margin-bottom:5px;
59 | }
60 | .imageList{
61 | }
62 | .imageList li {
63 | padding-top: 3px !important;
64 | padding-left: 5px !important;
65 | background-color: #e1e9ec;
66 | border: solid 1px #b5bdc1;
67 | }
68 |
69 | .imageList li a {
70 | background-image: url(../images/images.gif);
71 | background-repeat: no-repeat;
72 | padding-left: 20px;
73 | text-indent: 50px;
74 | }
--------------------------------------------------------------------------------
/features/tenant-mgt/org.wso2.carbon.tenant.common.server.feature/src/main/resources/conf/tenant-mgt.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 | org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder
21 |
22 |
23 |
24 |
25 | org.wso2.carbon.user.core.config.multitenancy.CommonLDAPRealmConfigBuilder
26 | dc=wso2,dc=org
27 | organizationalUnit
28 | ou
29 | organizationalUnit
30 | ou
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/userguide.html:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 | Multitenancy Registry Tenant Configuration - User Guide
22 |
23 |
24 |
25 |
26 |
27 |
28 | Multitenancy Add new Tenants and View Tenants
29 |
30 |
31 | Add New Tenants
32 |
33 |
34 | Following form can be used to add new tenants.You are required to fill all the requested details.
35 |
36 |
Figure1: Add New Tenants Form
37 |
38 |
39 |
40 |
41 |
42 | Multitenancy View Tenants
43 |
44 |
45 |
46 |
47 | You can view a list of available tenants from this page.
48 |
49 |
50 |
Figure2: View tenants Form
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.throttling.agent/src/main/java/org/wso2/carbon/throttling/agent/cache/Axis2ConfigurationContextObserverImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, 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.throttling.agent.cache;
18 |
19 | import org.apache.axis2.context.ConfigurationContext;
20 | import org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver;
21 | import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
22 |
23 | /**
24 | * Axis configuration context observer which add and remove lazy loaded/unloaded tenants to throttling information
25 | * cache.
26 | */
27 | public class Axis2ConfigurationContextObserverImpl extends AbstractAxis2ConfigurationContextObserver{
28 |
29 | private ThrottlingInfoCache throttlingInfoCache;
30 |
31 | public Axis2ConfigurationContextObserverImpl(ThrottlingInfoCache throttlingInfoCache){
32 | this.throttlingInfoCache = throttlingInfoCache;
33 | }
34 |
35 | public void createdConfigurationContext(ConfigurationContext configContext) {
36 | throttlingInfoCache.addTenant(MultitenantUtils.getTenantId(configContext));
37 | }
38 |
39 | public void terminatedConfigurationContext(ConfigurationContext configCtx) {
40 | throttlingInfoCache.deleteTenant(MultitenantUtils.getTenantId(configCtx));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/org/wso2/stratos/sso/redirector/ui/i18n/Resources.properties:
--------------------------------------------------------------------------------
1 | saml.sso.menu=SAML SSO
2 | saml.sso=SAML 2.0 based Single Sign-On
3 | enter.password.to.signin=Please enter your credentials to sign in to WSO2 Identity Server SAML SSO
4 | username=Username
5 | password=Password
6 | login=Sign In
7 | sso.configuration=SAML SSO Configuration
8 | sp.issuer=Issuer
9 | sp.assertionConsumerURL=Assertion Consumer URL
10 | sp.certAlias=Certificate Alias
11 | saml.sso.service.providers.not.found=No SAML SSO Service Providers are found.
12 | saml.sso.add.service.provider=Add new Service Provider
13 | saml.sso.add=Add
14 | sp.enter.valid.endpoint.address=Please enter a valid URL for AssertionConsumerURL
15 | sp.enter.valid.issuer=Please enter a valid issuer
16 | sp.enter.valid.claimID=ClaimID field cannot be left empty
17 | sp.added.successfully=Service Provider Added Successfully
18 | error.adding.sp=Could not add Service Provider. You might be entering a duplicate Service Provider
19 | remove.message1=You are about to remove the trusted service provider
20 | remove.message2=. Do you want to proceed?
21 | error.removing.sp=Problem in removing the service provider
22 | select.subject.type=Select the value to be appeared as the subject
23 | select.subject.type.username=Use current username as the subject
24 | select.subject.type.claimid=Use a custom claim as the subject
25 | subject.type.claimid=Claim ID
26 | subject.type.namidformat=NameID Format
27 | logout.url=Custom Logout URL
28 | validate.signature=Enable Signature Validation in Authentication Requests and Logout Requests
29 | saml.sso.generated.key=Generated Key for Signing SAML2 based single sign-on
30 | saml.sso.download.pub.key=Download the public key of the generated key pair
31 | saml.sso.add.sp.to.genkey=Add atleast one service provider to generate a key pair
32 | login.fail.message=Login failed! Please recheck the username and password and try again.
33 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/java.js:
--------------------------------------------------------------------------------
1 | editAreaLoader.load_syntax["java"] = {
2 | 'COMMENT_SINGLE': { 1: '//', 2: '@' }
3 | , 'COMMENT_MULTI': { '/*': '*/' }
4 | , 'QUOTEMARKS': { 1: "'", 2: '"' }
5 | , 'KEYWORD_CASE_SENSITIVE': true
6 | , 'KEYWORDS': {
7 | 'constants': [
8 | 'null', 'false', 'true'
9 | ]
10 | , 'types': [
11 | 'String', 'int', 'short', 'long', 'char', 'double', 'byte',
12 | 'float', 'static', 'void', 'private', 'boolean', 'protected',
13 | 'public', 'const', 'class', 'final', 'abstract', 'volatile',
14 | 'enum', 'transient', 'interface'
15 | ]
16 | , 'statements': [
17 | 'this', 'extends', 'if', 'do', 'while', 'try', 'catch', 'finally',
18 | 'throw', 'throws', 'else', 'for', 'switch', 'continue', 'implements',
19 | 'break', 'case', 'default', 'goto'
20 | ]
21 | , 'keywords': [
22 | 'new', 'return', 'import', 'native', 'super', 'package', 'assert', 'synchronized',
23 | 'instanceof', 'strictfp'
24 | ]
25 | }
26 | , 'OPERATORS': [
27 | '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
28 | ]
29 | , 'DELIMITERS': [
30 | '(', ')', '[', ']', '{', '}'
31 | ]
32 | , 'REGEXPS': {
33 | 'precompiler': {
34 | 'search': '()(#[^\r\n]*)()'
35 | , 'class': 'precompiler'
36 | , 'modifiers': 'g'
37 | , 'execute': 'before'
38 | }
39 | }
40 | , 'STYLES': {
41 | 'COMMENTS': 'color: #AAAAAA;'
42 | , 'QUOTESMARKS': 'color: #6381F8;'
43 | , 'KEYWORDS': {
44 | 'constants': 'color: #EE0000;'
45 | , 'types': 'color: #0000EE;'
46 | , 'statements': 'color: #60CA00;'
47 | , 'keywords': 'color: #48BDDF;'
48 | }
49 | , 'OPERATORS': 'color: #FF00FF;'
50 | , 'DELIMITERS': 'color: #0038E1;'
51 | , 'REGEXPS': {
52 | 'precompiler': 'color: #009900;'
53 | , 'precompilerstring': 'color: #994400;'
54 | }
55 | }
56 | };
57 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/c.js:
--------------------------------------------------------------------------------
1 | editAreaLoader.load_syntax["c"] = {
2 | 'COMMENT_SINGLE' : {1 : '//'}
3 | ,'COMMENT_MULTI' : {'/*' : '*/'}
4 | ,'QUOTEMARKS' : {1: "'", 2: '"'}
5 | ,'KEYWORD_CASE_SENSITIVE' : true
6 | ,'KEYWORDS' : {
7 | 'constants' : [
8 | 'NULL', 'false', 'stdin', 'stdout', 'stderr', 'true'
9 | ]
10 | ,'types' : [
11 | 'FILE', 'auto', 'char', 'const', 'double',
12 | 'extern', 'float', 'inline', 'int', 'long', 'register',
13 | 'short', 'signed', 'size_t', 'static', 'struct',
14 | 'time_t', 'typedef', 'union', 'unsigned', 'void',
15 | 'volatile'
16 | ]
17 | ,'statements' : [
18 | 'do', 'else', 'enum', 'for', 'goto', 'if', 'sizeof',
19 | 'switch', 'while'
20 | ]
21 | ,'keywords' : [
22 | 'break', 'case', 'continue', 'default', 'delete',
23 | 'return'
24 | ]
25 | }
26 | ,'OPERATORS' :[
27 | '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
28 | ]
29 | ,'DELIMITERS' :[
30 | '(', ')', '[', ']', '{', '}'
31 | ]
32 | ,'REGEXPS' : {
33 | 'precompiler' : {
34 | 'search' : '()(#[^\r\n]*)()'
35 | ,'class' : 'precompiler'
36 | ,'modifiers' : 'g'
37 | ,'execute' : 'before'
38 | }
39 | /* ,'precompilerstring' : {
40 | 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
41 | ,'class' : 'precompilerstring'
42 | ,'modifiers' : 'g'
43 | ,'execute' : 'before'
44 | }*/
45 | }
46 | ,'STYLES' : {
47 | 'COMMENTS': 'color: #AAAAAA;'
48 | ,'QUOTESMARKS': 'color: #6381F8;'
49 | ,'KEYWORDS' : {
50 | 'constants' : 'color: #EE0000;'
51 | ,'types' : 'color: #0000EE;'
52 | ,'statements' : 'color: #60CA00;'
53 | ,'keywords' : 'color: #48BDDF;'
54 | }
55 | ,'OPERATORS' : 'color: #FF00FF;'
56 | ,'DELIMITERS' : 'color: #0038E1;'
57 | ,'REGEXPS' : {
58 | 'precompiler' : 'color: #009900;'
59 | ,'precompilerstring' : 'color: #994400;'
60 | }
61 | }
62 | };
63 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/delete_ajaxprocessor.jsp:
--------------------------------------------------------------------------------
1 |
18 | <%@ page import="org.wso2.carbon.registry.resource.ui.processors.DeleteProcessor" %>
19 | <%@ page import="org.wso2.carbon.utils.ServerConstants" %>
20 | <%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
21 | <%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
22 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
23 | <%
24 | String errorMessage = null;
25 | String pathToDelete = request.getParameter("pathToDelete");
26 |
27 | String cookie = (String) request.
28 | getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
29 |
30 | try {
31 | ThemeMgtServiceClient client =
32 | new ThemeMgtServiceClient(cookie, config, request.getSession());
33 | client.delete(pathToDelete);
34 | } catch (Exception e) {
35 | String msg = "Failed to delete " + pathToDelete + ". " + e.getMessage();
36 | errorMessage = new Exception(msg, e).getMessage();
37 | }
38 |
39 | %>
40 |
41 | <% if (errorMessage != null) { %>
42 |
43 |
46 |
47 | <% } %>
48 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/resources/META-INF/module.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
33 |
34 |
35 |
36 |
38 |
39 |
40 |
41 |
42 |
43 |
45 |
46 |
47 |
48 |
49 | true
50 |
51 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/display_text_content_ajaxprocessor.jsp:
--------------------------------------------------------------------------------
1 |
18 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
19 |
20 | <%@ page import="org.wso2.carbon.utils.ServerConstants" %>
21 | <%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
22 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
23 |
24 |
25 | <%
26 | String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
27 |
28 | String textContent;
29 | try {
30 | ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, config, session);
31 | textContent = client.getTextContent(request);
32 | } catch (Exception e) {
33 | response.setStatus(500);
34 | %><%=e.getMessage()%><%
35 | return;
36 | }
37 | %>
38 |
39 |
40 |
41 |
42 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.deployment/src/main/java/org/wso2/carbon/stratos/deployment/internal/DataHolder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2004,2005 The Apache Software Foundation.
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.stratos.deployment.internal;
17 |
18 | import org.apache.axis2.context.ConfigurationContext;
19 |
20 | /**
21 | * DataHolder for Service deployment component
22 | */
23 | public class DataHolder {
24 | private static DataHolder instance = new DataHolder();
25 |
26 | private ConfigurationContext serverConfigContext;
27 |
28 | public static DataHolder getInstance() {
29 | return instance;
30 | }
31 |
32 | private DataHolder() {
33 | }
34 |
35 | public ConfigurationContext getServerConfigContext() {
36 | return serverConfigContext;
37 | }
38 |
39 | public void setServerConfigContext(ConfigurationContext serverConfigContext) {
40 | this.serverConfigContext = serverConfigContext;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/features/tenant-mgt/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | org.wso2.carbon.multitenancy
22 | carbon-multitenancy
23 | 4.11.46-SNAPSHOT
24 | ../../pom.xml
25 |
26 |
27 | 4.0.0
28 | tenant-mgt-feature
29 | pom
30 | WSO2 Tenant Management Aggregator Module
31 | http://wso2.org
32 |
33 |
34 | org.wso2.carbon.tenant.mgt.server.feature
35 | org.wso2.carbon.tenant.mgt.core.feature
36 | org.wso2.carbon.tenant.throttling.agent.feature
37 | org.wso2.carbon.tenant.usage.agent.feature
38 | org.wso2.carbon.tenant.deployment
39 | org.wso2.carbon.tenant.common.server.feature
40 | org.wso2.carbon.tenant.common.ui.feature
41 | org.wso2.carbon.tenant.common.feature
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt/src/main/java/org/wso2/carbon/tenant/mgt/internal/TenantMgtImplServiceComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020, 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.tenant.mgt.internal;
17 |
18 | import org.apache.commons.logging.Log;
19 | import org.apache.commons.logging.LogFactory;
20 | import org.osgi.service.component.ComponentContext;
21 | import org.osgi.service.component.annotations.Activate;
22 | import org.osgi.service.component.annotations.Component;
23 | import org.wso2.carbon.tenant.mgt.services.TenantMgtImpl;
24 | import org.wso2.carbon.tenant.mgt.services.TenantMgtService;
25 |
26 | @Component(
27 | name = "org.wso2.carbon.tenant.mgt.impl",
28 | immediate = true)
29 | public class TenantMgtImplServiceComponent {
30 |
31 | private static Log log = LogFactory.getLog(TenantMgtImplServiceComponent.class);
32 |
33 | private static TenantMgtService tenantMgtService;
34 |
35 | @Activate
36 | protected void activate(ComponentContext context) {
37 |
38 | TenantMgtService tenantMgt = new TenantMgtImpl();
39 | context.getBundleContext().registerService(TenantMgtService.class.getName(), tenantMgt, null);
40 | if (log.isDebugEnabled()) {
41 | log.debug("Tenant management component is activated.");
42 | }
43 | }
44 |
45 | public static TenantMgtService getTenantMgtService() {
46 |
47 | return tenantMgtService;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/util/MeteringAccessValidationUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.stratos.common.util;
17 |
18 | import java.util.HashSet;
19 | import java.util.Properties;
20 | import java.util.Set;
21 |
22 | public class MeteringAccessValidationUtils {
23 |
24 | public static final String ERROR_MSG_PROPERTY_KEY_POST_FIX = "error_msg";
25 | public static final String IS_BLOCKED_PROPERTY_KEY_POST_FIX = "is_blocked";
26 |
27 | public static String generateIsBlockedPropertyKey(String action) {
28 | return action + "_" + IS_BLOCKED_PROPERTY_KEY_POST_FIX;
29 | }
30 |
31 | public static String generateErrorMsgPropertyKey(String action) {
32 | return action + "_" + ERROR_MSG_PROPERTY_KEY_POST_FIX;
33 | }
34 |
35 | public static Set getAvailableActions(Properties properties) {
36 | Set propertyKeys = properties.keySet();
37 | Set actions = new HashSet();
38 | for (Object propertyKeyObj : propertyKeys) {
39 | String propertyKey = (String) propertyKeyObj;
40 | if (propertyKey.endsWith(IS_BLOCKED_PROPERTY_KEY_POST_FIX)) {
41 | // -1 for the length of the '_'
42 | String action =
43 | propertyKey.substring(0, propertyKey.length() -
44 | IS_BLOCKED_PROPERTY_KEY_POST_FIX.length() - 1);
45 | actions.add(action);
46 | }
47 | }
48 | return actions;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/config/CloudServiceConfigParser.java:
--------------------------------------------------------------------------------
1 | package org.wso2.carbon.stratos.common.config;
2 |
3 | import org.apache.axiom.om.OMElement;
4 | import org.apache.commons.logging.Log;
5 | import org.apache.commons.logging.LogFactory;
6 | import org.wso2.carbon.stratos.common.constants.StratosConstants;
7 | import org.wso2.carbon.stratos.common.util.CommonUtil;
8 | import org.wso2.carbon.utils.CarbonUtils;
9 |
10 | import java.io.File;
11 | import java.io.FileInputStream;
12 |
13 | public class CloudServiceConfigParser {
14 |
15 | private static Log log = LogFactory.getLog(CloudServiceConfigParser.class);
16 |
17 | private static class SynchronizingClass {
18 | }
19 |
20 | private static final SynchronizingClass loadlock = new SynchronizingClass();
21 |
22 | private static CloudServicesDescConfig cloudServicesDescConfig = null;
23 |
24 | private static final String CONFIG_FILENAME = "cloud-services-desc.xml";
25 |
26 | public static CloudServicesDescConfig loadCloudServicesConfiguration() throws Exception {
27 | if (cloudServicesDescConfig != null) {
28 | return cloudServicesDescConfig;
29 | }
30 |
31 | synchronized (loadlock) {
32 | if (cloudServicesDescConfig == null) {
33 | try {
34 | String configFileName = CarbonUtils.getCarbonConfigDirPath() + File.separator +
35 | StratosConstants.MULTITENANCY_CONFIG_FOLDER + File.separator + CONFIG_FILENAME;
36 | OMElement configElement = CommonUtil.buildOMElement(new FileInputStream(configFileName));
37 | cloudServicesDescConfig = new CloudServicesDescConfig(configElement);
38 | } catch (Exception e) {
39 | String msg = "Error in building the cloud service configuration.";
40 | log.error(msg, e);
41 | throw new Exception(msg, e);
42 | }
43 | }
44 | }
45 | return cloudServicesDescConfig;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/features/tenant-mgt/org.wso2.carbon.tenant.common.server.feature/src/main/resources/conf_templates/templates/repository/conf/tenant-mgt.xml.j2:
--------------------------------------------------------------------------------
1 |
18 |
19 | {% if tenant_manager.jdbc.enabled %}
20 |
21 | {% for property_name,property_value in tenant_manager.jdbc.properties.items() %}
22 | {{property_value}}
23 | {% endfor %}
24 |
25 | {% endif %}
26 |
27 |
28 | {% if tenant_manager.ldap.enabled %}
29 |
30 | {% for property_name,property_value in tenant_manager.ldap.properties.items() %}
31 | {{property_value}}
32 | {% endfor %}
33 |
34 | {% endif %}
35 |
36 | {% for tenant_manager in tenant_manager.custom %}
37 |
38 | {% for property_name,property_value in tenant_manager.properties.items() %}
39 | {{property_value}}
40 | {% endfor %}
41 |
42 | {% endfor %}
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/ruby.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Ruby syntax v 1.0
3 | *
4 | * v1.0 by Patrice De Saint Steban (2007/01/03)
5 | *
6 | **/
7 | editAreaLoader.load_syntax["ruby"] = {
8 | 'COMMENT_SINGLE' : {1 : '#'}
9 | ,'COMMENT_MULTI' : {}
10 | ,'QUOTEMARKS' : {1: "'", 2: '"'}
11 | ,'KEYWORD_CASE_SENSITIVE' : true
12 | ,'KEYWORDS' : {
13 | 'reserved' : [
14 | 'alias', 'and', 'BEGIN', 'begin', 'break', 'case', 'class', 'def', 'defined', 'do', 'else',
15 | 'elsif', 'END', 'end', 'ensure', 'false', 'for', 'if',
16 | 'in', 'module', 'next', 'not', 'or', 'redo', 'rescue', 'retry',
17 | 'return', 'self', 'super', 'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'
18 | ]
19 | }
20 | ,'OPERATORS' :[
21 | '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','
22 | ]
23 | ,'DELIMITERS' :[
24 | '(', ')', '[', ']', '{', '}'
25 | ]
26 | ,'REGEXPS' : {
27 | 'constants' : {
28 | 'search' : '()([A-Z]\\w*)()'
29 | ,'class' : 'constants'
30 | ,'modifiers' : 'g'
31 | ,'execute' : 'before'
32 | }
33 | ,'variables' : {
34 | 'search' : '()([\$\@\%]+\\w+)()'
35 | ,'class' : 'variables'
36 | ,'modifiers' : 'g'
37 | ,'execute' : 'before'
38 | }
39 | ,'numbers' : {
40 | 'search' : '()(-?[0-9]+)()'
41 | ,'class' : 'numbers'
42 | ,'modifiers' : 'g'
43 | ,'execute' : 'before'
44 | }
45 | ,'symbols' : {
46 | 'search' : '()(:\\w+)()'
47 | ,'class' : 'symbols'
48 | ,'modifiers' : 'g'
49 | ,'execute' : 'before'
50 | }
51 | }
52 | ,'STYLES' : {
53 | 'COMMENTS': 'color: #AAAAAA;'
54 | ,'QUOTESMARKS': 'color: #660066;'
55 | ,'KEYWORDS' : {
56 | 'reserved' : 'font-weight: bold; color: #0000FF;'
57 | }
58 | ,'OPERATORS' : 'color: #993300;'
59 | ,'DELIMITERS' : 'color: #993300;'
60 | ,'REGEXPS' : {
61 | 'variables' : 'color: #E0BD54;'
62 | ,'numbers' : 'color: green;'
63 | ,'constants' : 'color: #00AA00;'
64 | ,'symbols' : 'color: #879EFA;'
65 | }
66 | }
67 | };
68 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/web/tenant-mgt/get_package_info_ajaxprocessor.jsp:
--------------------------------------------------------------------------------
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 | <%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
19 | <%@ page import="org.json.JSONArray" %>
20 | <%@ page import="org.wso2.carbon.tenant.mgt.ui.clients.PackageInfoServiceClient" %>
21 | <%@ page import="org.wso2.carbon.utils.ServerConstants" %>
22 | <%@ page import="org.apache.axis2.context.ConfigurationContext" %>
23 | <%@ page import="org.wso2.carbon.CarbonConstants" %>
24 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
25 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
26 | <%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
27 |
28 | <%
29 | try{
30 | String backendServerUrl = CarbonUIUtil.getServerURL(config.getServletContext(), session);
31 | String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
32 | ConfigurationContext configContext =
33 | (ConfigurationContext)config.getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
34 |
35 | PackageInfoServiceClient client = new PackageInfoServiceClient(cookie, backendServerUrl,configContext);
36 | JSONArray packageInfoArray = client.getBillingPackagesJsonArray();
37 |
38 | out.write(packageInfoArray.toString());
39 | } catch (Exception e){
40 | e.getStackTrace();
41 | }
42 | %>
43 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/resources/web/stratos-auth/css/stratos-loginpage.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-image:url(../images/st-login-body-bg.gif);
3 | background-position:left top;
4 | background-repeat:repeat-x;
5 | font-family:"Calibri",Arial,Helvetica,san-serif;
6 | font-size:0.8em;
7 | margin:0;
8 | padding:0;
9 | }
10 | p {
11 | }
12 | td {
13 | }
14 | a:link {
15 | text-decoration:none;
16 | }
17 | a:visited {
18 | }
19 | a:hover {
20 | }
21 | a:active {
22 | }
23 | a img {
24 | border:0 none;
25 | }
26 | div#middle {
27 | background-color:#FFFFFF;
28 | margin:auto;
29 | width:961px;
30 | }
31 | div#header {
32 | background-image:url(../images/st-login-header-bg.gif);
33 | background-position:left top;
34 | background-repeat:no-repeat;
35 | height:87px;
36 | padding-top:94px;
37 | text-align:center;
38 | }
39 | div#content {
40 | background-image:url(../images/st-login-content-bg.gif);
41 | background-position:left top;
42 | background-repeat:no-repeat;
43 | padding-left:60px;
44 | padding-right:60px;
45 | padding-top:20px;
46 | }
47 | div#intro {
48 | padding-bottom:10px;
49 | text-align:center;
50 | }
51 | div#register {
52 | float:left;
53 | padding-top:85px;
54 | text-align:center;
55 | width:420px;
56 | }
57 | div#sign-in {
58 | border-left:1px solid #0499CC;
59 | float:left;
60 | padding:20px 30px 30px 50px;
61 | text-align:left;
62 | width:340px;
63 | }
64 | div#sign-in h2 {
65 | border-bottom:1px solid #78BDE8;
66 | font-size:130%;
67 | margin-bottom:10px;
68 | margin-top:0;
69 | padding-bottom:10px;
70 | padding-top:0;
71 | }
72 | div#sign-in table tr td {
73 | padding-bottom:5px;
74 | padding-right:7px;
75 | }
76 | div#sign-in table {
77 | border-bottom:1px solid #78BDE8;
78 | margin-bottom:7px;
79 | }
80 | div#footer {
81 | background-image:url(../images/st-login-footer-bg.gif);
82 | background-position:left top;
83 | background-repeat:no-repeat;
84 | margin-top:5px;
85 | padding-bottom:7px;
86 | padding-top:25px;
87 | text-align:center;
88 | }
89 | div.clear {
90 | clear:both;
91 | }
92 | #loginForm td label{
93 | font-size:11px;
94 | }
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/listeners/TenantMgtListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.stratos.common.listeners;
17 |
18 | import org.wso2.carbon.stratos.common.beans.TenantInfoBean;
19 | import org.wso2.carbon.stratos.common.exception.StratosException;
20 |
21 | public interface TenantMgtListener {
22 | public void onTenantCreate(TenantInfoBean tenantInfo) throws StratosException;
23 |
24 | public void onTenantUpdate(TenantInfoBean tenantInfo) throws StratosException;
25 |
26 | public void onTenantDelete(int tenantId);
27 |
28 | public void onTenantRename(int tenantId, String oldDomainName,
29 | String newDomainName)throws StratosException;
30 |
31 | public void onTenantInitialActivation(int tenantId) throws StratosException;
32 |
33 | public void onTenantActivation(int tenantId) throws StratosException;
34 |
35 | public void onTenantDeactivation(int tenantId) throws StratosException;
36 |
37 | public void onSubscriptionPlanChange(int tenentId, String oldPlan,
38 | String newPlan) throws StratosException;
39 |
40 | public int getListenerOrder();
41 |
42 | /**
43 | * On Pre delete method will delete product specific data
44 | *
45 | * @param tenantId - Tenant Id
46 | * @throws StratosException
47 | */
48 | public void onPreDelete(int tenantId) throws StratosException;
49 | }
50 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt/src/main/resources/META-INF/component.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | Manage
22 | /permission/protected/manage
23 |
24 |
25 | Monitor
26 | /permission/protected/manage/monitor
27 |
28 |
29 | Tenants
30 | /permission/protected/manage/monitor/tenants
31 |
32 |
33 | Modify
34 | /permission/protected/manage/modify
35 |
36 |
37 | Tenants
38 | /permission/protected/manage/modify/tenants
39 |
40 |
41 | List
42 | /permission/protected/manage/monitor/tenants/list
43 |
44 |
45 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.redirector.servlet/src/main/java/org/wso2/carbon/redirector/servlet/internal/RedirectorServletActivationServiceComponent.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.redirector.servlet.internal;
19 |
20 | import org.apache.commons.logging.Log;
21 | import org.apache.commons.logging.LogFactory;
22 | import org.osgi.service.component.ComponentContext;
23 | import org.osgi.service.component.annotations.Activate;
24 | import org.osgi.service.component.annotations.Component;
25 | import org.osgi.service.component.annotations.Deactivate;
26 |
27 | @Component(
28 | name = "org.wso2.carbon.redirector.servlet.activation",
29 | immediate = true)
30 | public class RedirectorServletActivationServiceComponent {
31 |
32 | private static Log log = LogFactory.getLog(RedirectorServletActivationServiceComponent.class);
33 |
34 | @Activate
35 | protected void activate(ComponentContext context) {
36 |
37 | try {
38 | log.debug("******* Multitenancy Redirector Servlet admin service bundle is activated ******* ");
39 | } catch (Exception e) {
40 | log.error("******* Multitenancy Redirector Servlet admin service bundle failed activating ****", e);
41 | }
42 | }
43 |
44 | @Deactivate
45 | protected void deactivate(ComponentContext context) {
46 |
47 | log.debug("******* Multitenancy Redirector Servlet admin service bundle is deactivated ******* ");
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.activation/src/main/java/org/wso2/carbon/activation/module/ActivationModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005-2009, 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.activation.module;
20 |
21 | import org.apache.axis2.AxisFault;
22 | import org.apache.axis2.context.ConfigurationContext;
23 | import org.apache.axis2.description.AxisDescription;
24 | import org.apache.axis2.description.AxisModule;
25 | import org.apache.axis2.modules.Module;
26 | import org.apache.neethi.Assertion;
27 | import org.apache.neethi.Policy;
28 |
29 | /**
30 | * Module used to engage the activation handler.
31 | */
32 | public class ActivationModule implements Module {
33 |
34 | /**
35 | * {@inheritDoc}
36 | */
37 | public void init(ConfigurationContext configurationContext, AxisModule axisModule)
38 | throws AxisFault {
39 | }
40 |
41 | /**
42 | * {@inheritDoc}
43 | */
44 | public void engageNotify(AxisDescription axisDescription) throws AxisFault {
45 | }
46 |
47 | /**
48 | * {@inheritDoc}
49 | */
50 | public boolean canSupportAssertion(Assertion assertion) {
51 | return true;
52 | }
53 |
54 | /**
55 | * {@inheritDoc}
56 | */
57 | public void applyPolicy(Policy policy, AxisDescription axisDescription) throws AxisFault {
58 | }
59 |
60 | /**
61 | * {@inheritDoc}
62 | */
63 | public void shutdown(ConfigurationContext configurationContext) throws AxisFault {
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/css-editor.jsp:
--------------------------------------------------------------------------------
1 |
18 | <%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
19 | <%@ page import="org.wso2.carbon.utils.ServerConstants" %>
20 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
21 | <%
22 | java.lang.String[] imagePaths = {"test1", "test2"};
23 |
24 | String cookie = (String) request.
25 | getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
26 |
27 | try {
28 | ThemeMgtServiceClient client =
29 | new ThemeMgtServiceClient(cookie, config, request.getSession());
30 | imagePaths = client.getAllPaths();
31 |
32 |
33 | } catch (Exception e) {
34 | String type = "resource";
35 | response.setStatus(500);
36 | out.write("Fail to get image paths");
37 | return;
38 | }
39 | %>
40 |
49 |
50 |
51 |
52 |
59 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/org/wso2/carbon/theme/mgt/ui/i18n/Resources.properties:
--------------------------------------------------------------------------------
1 | submit.tenant=Submit Tenant
2 | domain=Domain
3 | domain.information=Domain Information
4 | contact.details=Contact Details
5 | admin.username=Admin Username
6 | current.admin.password=Current Admin Password
7 | new.admin.password=New Admin Password
8 | new.admin.password.repeat=New Admin Password (Repeat)
9 | admin.password=Admin Password
10 | admin.password.repeat=Admin Password (Repeat)
11 | govern.add_tenants.menu=Add New Tenant
12 | govern.view_tenants.menu=View Tenants
13 | overview=Overview
14 | tenants.list=Tenants List
15 | company.organization=Company/Organization
16 | admin.contact=Admin Contact
17 | edit=Edit
18 | multitenancy=Multitenancy
19 | added.successfully=You have successfully added a new tenant with domain:
20 | updated.successfully=You have successfully updated the tenant with domain:
21 | update.added.tenant=Update the just added/updated tenant
22 | update.tenant=Update Tenant
23 | add.new.tenant=Add a new tenant
24 | register.new.organization=Register A New Organization
25 | view.all.tenants=View all tenants
26 | tenant.admin=Tenant Admin
27 | tenant.description=Tenant Description
28 | admin.fullname=Full Name
29 | admin.address=Address
30 | admin.email=Email
31 | admin.telephone=Telephone
32 | admin.im=IM
33 | admin.url=URL
34 | self.registration=Registry Tenant
35 | gaas=GaaS
36 | gaas.register.a.new.tenant=Register A New Tenant
37 | active=Active
38 | theme.management=Theme
39 | word.verification=Word Verification
40 | captcha.message=Type the characters you see in the picture below.
41 | add.image=Add an Image
42 | image.path.help.text=Give the path of a file to fetch a image (bmp,gif,jpg,png)
43 | image.url.help.text=Give the full url of the resource to fetch a image from URL (bmp,gif,jpg,png)
44 | upload.image.from.file=Upload an image from a file
45 | import.image.from.url=Import an image from a URL
46 | update.logo.image.from.file=Update the logo image from a file
47 | update.logo.image.from.url=Update the logo image from a URL
48 | method=Method
49 | logo.management=Logo Management
50 | change.the.logo=Change the Logo
51 | wait.message=Process may take some time. Please wait..
52 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/cpp.js:
--------------------------------------------------------------------------------
1 | editAreaLoader.load_syntax["cpp"] = {
2 | 'COMMENT_SINGLE' : {1 : '//'}
3 | ,'COMMENT_MULTI' : {'/*' : '*/'}
4 | ,'QUOTEMARKS' : {1: "'", 2: '"'}
5 | ,'KEYWORD_CASE_SENSITIVE' : true
6 | ,'KEYWORDS' : {
7 | 'constants' : [
8 | 'NULL', 'false', 'std', 'stdin', 'stdout', 'stderr',
9 | 'true'
10 | ]
11 | ,'types' : [
12 | 'FILE', 'auto', 'char', 'class', 'const', 'double',
13 | 'extern', 'float', 'friend', 'inline', 'int',
14 | 'iterator', 'long', 'map', 'operator', 'queue',
15 | 'register', 'short', 'signed', 'size_t', 'stack',
16 | 'static', 'string', 'struct', 'time_t', 'typedef',
17 | 'union', 'unsigned', 'vector', 'void', 'volatile'
18 | ]
19 | ,'statements' : [
20 | 'catch', 'do', 'else', 'enum', 'for', 'goto', 'if',
21 | 'sizeof', 'switch', 'this', 'throw', 'try', 'while'
22 | ]
23 | ,'keywords' : [
24 | 'break', 'case', 'continue', 'default', 'delete',
25 | 'namespace', 'new', 'private', 'protected', 'public',
26 | 'return', 'using'
27 | ]
28 | }
29 | ,'OPERATORS' :[
30 | '+', '-', '/', '*', '=', '<', '>', '%', '!', '?', ':', '&'
31 | ]
32 | ,'DELIMITERS' :[
33 | '(', ')', '[', ']', '{', '}'
34 | ]
35 | ,'REGEXPS' : {
36 | 'precompiler' : {
37 | 'search' : '()(#[^\r\n]*)()'
38 | ,'class' : 'precompiler'
39 | ,'modifiers' : 'g'
40 | ,'execute' : 'before'
41 | }
42 | /* ,'precompilerstring' : {
43 | 'search' : '(#[\t ]*include[\t ]*)([^\r\n]*)([^\r\n]*[\r\n])'
44 | ,'class' : 'precompilerstring'
45 | ,'modifiers' : 'g'
46 | ,'execute' : 'before'
47 | }*/
48 | }
49 | ,'STYLES' : {
50 | 'COMMENTS': 'color: #AAAAAA;'
51 | ,'QUOTESMARKS': 'color: #6381F8;'
52 | ,'KEYWORDS' : {
53 | 'constants' : 'color: #EE0000;'
54 | ,'types' : 'color: #0000EE;'
55 | ,'statements' : 'color: #60CA00;'
56 | ,'keywords' : 'color: #48BDDF;'
57 | }
58 | ,'OPERATORS' : 'color: #FF00FF;'
59 | ,'DELIMITERS' : 'color: #0038E1;'
60 | ,'REGEXPS' : {
61 | 'precompiler' : 'color: #009900;'
62 | ,'precompilerstring' : 'color: #994400;'
63 | }
64 | }
65 | };
66 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.client.configcontext.provider/src/main/java/org/wso2/carbon/client/configcontext/provider/store/Axis2ClientConfigurationContextStore.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005-2014, 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.client.configcontext.provider.store;
21 |
22 | import java.util.concurrent.ConcurrentHashMap;
23 |
24 | import org.apache.axis2.context.ConfigurationContext;
25 |
26 | public final class Axis2ClientConfigurationContextStore {
27 |
28 | private static volatile Axis2ClientConfigurationContextStore tenantConfigContextStore;
29 | private ConcurrentHashMap tenantConfigurationContextMap = new ConcurrentHashMap();
30 |
31 | private Axis2ClientConfigurationContextStore() {
32 | }
33 |
34 | public static Axis2ClientConfigurationContextStore getInstance() {
35 | if (tenantConfigContextStore == null) {
36 | synchronized (Axis2ClientConfigurationContextStore.class) {
37 | if (tenantConfigContextStore == null) {
38 | tenantConfigContextStore = new Axis2ClientConfigurationContextStore();
39 | }
40 | }
41 | }
42 |
43 | return tenantConfigContextStore;
44 | }
45 |
46 | public ConcurrentHashMap getTenantConfigurationContextMap() {
47 | return tenantConfigurationContextMap;
48 | }
49 |
50 | public void setTenantConfigurationContextMap(
51 | ConcurrentHashMap tenantConfigurationContextMap) {
52 | this.tenantConfigurationContextMap = tenantConfigurationContextMap;
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/add_collection_ajaxprocessor.jsp:
--------------------------------------------------------------------------------
1 |
18 | <%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
19 | <%@ page import="org.wso2.carbon.utils.ServerConstants" %>
20 | <%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
21 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
22 | <%
23 | String errorMessage = null;
24 | try {
25 |
26 | String parentPath = request.getParameter("parentPath");
27 | String collectionName = request.getParameter("collectionName");
28 | String mediaType = request.getParameter("mediaType");
29 | String description = request.getParameter("description");
30 |
31 | String cookie = (String) request.
32 | getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
33 |
34 | try {
35 | ThemeMgtServiceClient client = new ThemeMgtServiceClient(cookie, config, session);
36 | client.addCollection(parentPath, collectionName, mediaType, description);
37 | } catch (Exception e) {
38 | String msg = "Failed to add new collection " + collectionName +
39 | " to the parent collection " + parentPath + ". " + e.getMessage();
40 | throw new UIException(msg, e);
41 | }
42 |
43 | } catch (Exception e) {
44 | errorMessage = e.getMessage();
45 | response.setStatus(500);
46 | out.write(errorMessage);
47 | return;
48 | }
49 | %>
50 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.throttling.agent/src/main/java/org/wso2/carbon/throttling/agent/cache/TenantThrottlingInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, 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.throttling.agent.cache;
18 |
19 | import org.wso2.carbon.stratos.common.constants.StratosConstants;
20 |
21 | import java.util.HashMap;
22 | import java.util.Map;
23 |
24 | public class TenantThrottlingInfo {
25 | private Map throttlingActionInfoMap = new HashMap();
26 |
27 | public ThrottlingActionInfo getThrottlingActionInfo(String action) {
28 | if(throttlingActionInfoMap.get(action) != null){
29 | return throttlingActionInfoMap.get(action);
30 | }
31 | return new ThrottlingActionInfo(false, "");
32 | }
33 |
34 | public ThrottlingActionInfo getThrottlingActionInfo(String[] actions) {
35 | ThrottlingActionInfo actionInfo = throttlingActionInfoMap.get(StratosConstants.THROTTLING_ALL_ACTION);
36 | if (actionInfo != null && actionInfo.isBlocked()) {
37 | return actionInfo;
38 | }
39 |
40 | for (String action : actions) {
41 | actionInfo = throttlingActionInfoMap.get(action);
42 | if (actionInfo != null && actionInfo.isBlocked()) {
43 | return actionInfo;
44 | }
45 | }
46 |
47 | return new ThrottlingActionInfo(false, "");
48 | }
49 |
50 | public void updateThrottlingActionInfo(String action, ThrottlingActionInfo throttlingActionInfo) {
51 | throttlingActionInfoMap.put(action, throttlingActionInfo);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.client.configcontext.provider/src/main/java/org/wso2/carbon/client/configcontext/provider/listener/Axis2ConfigurationContextObserverImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005-2014, 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.client.configcontext.provider.listener;
21 |
22 | import org.apache.axis2.context.ConfigurationContext;
23 | import org.apache.commons.logging.Log;
24 | import org.apache.commons.logging.LogFactory;
25 | import org.wso2.carbon.client.configcontext.provider.store.Axis2ClientConfigurationContextStore;
26 | import org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver;
27 | import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
28 |
29 | public class Axis2ConfigurationContextObserverImpl extends
30 | AbstractAxis2ConfigurationContextObserver {
31 |
32 | private static Log log = LogFactory
33 | .getLog(Axis2ConfigurationContextObserverImpl.class);
34 |
35 | @Override
36 | public void terminatingConfigurationContext(ConfigurationContext configCtx) {
37 | // Remove the configuration context for the map when tenant unload.
38 | int tenantID = MultitenantUtils.getTenantId(configCtx);
39 | ConfigurationContext clientContext = Axis2ClientConfigurationContextStore
40 | .getInstance().getTenantConfigurationContextMap().get(tenantID);
41 |
42 | // cleanup contexts
43 | if(clientContext != null){
44 | clientContext.cleanupContexts();
45 | Axis2ClientConfigurationContextStore.getInstance()
46 | .getTenantConfigurationContextMap().remove(tenantID);
47 | log.info("Configuration Context for Tenant ID: " + tenantID
48 | + " is removed");
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/java/org/wso2/carbon/usage/agent/persist/BandwidthPersistor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.usage.agent.persist;
17 |
18 | import org.wso2.carbon.stratos.common.constants.UsageConstants;
19 | import org.wso2.carbon.usage.agent.beans.BandwidthUsage;
20 | import org.wso2.carbon.usage.agent.util.Util;
21 | import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
22 |
23 | /**
24 | * this class is used to store incoming and outgoing bandwidth
25 | */
26 |
27 | public class BandwidthPersistor {
28 |
29 | /**
30 | * method to store incoming bandwidth
31 | * @param tenantId tenant id
32 | * @param size value of the incoming bandwidth
33 | */
34 |
35 | public static void storeIncomingBandwidth(int tenantId, long size) {
36 | if ((MultitenantConstants.SUPER_TENANT_ID!=tenantId) && (size > 0)) {
37 | BandwidthUsage usage = new BandwidthUsage(
38 | tenantId, UsageConstants.REGISTRY_INCOMING_BW, size);
39 | Util.addToPersistingControllerQueue(usage);
40 | }
41 | }
42 |
43 | /**
44 | * method to store outgoingBandwidth
45 | * @param tenantId tenant id
46 | * @param size value of the outgoing bandwidth
47 | */
48 | public static void storeOutgoingBandwidth(int tenantId, long size) {
49 | if ((MultitenantConstants.SUPER_TENANT_ID!=tenantId) && (size > 0)) {
50 | BandwidthUsage usage = new BandwidthUsage(
51 | tenantId, UsageConstants.REGISTRY_OUTGOING_BW, size);
52 | Util.addToPersistingControllerQueue(usage);
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/langs/en.js:
--------------------------------------------------------------------------------
1 | editAreaLoader.lang["en"]={
2 | new_document: "new empty document",
3 | search_button: "search and replace",
4 | search_command: "search next / open search area",
5 | search: "search",
6 | replace: "replace",
7 | replace_command: "replace / open search area",
8 | find_next: "find next",
9 | replace_all: "replace all",
10 | reg_exp: "regular expressions",
11 | match_case: "match case",
12 | not_found: "not found.",
13 | occurrence_replaced: "occurences replaced.",
14 | search_field_empty: "Search field empty",
15 | restart_search_at_begin: "End of area reached. Restart at begin.",
16 | move_popup: "move search popup",
17 | font_size: "--Font size--",
18 | go_to_line: "go to line",
19 | go_to_line_prompt: "go to line number:",
20 | undo: "undo",
21 | redo: "redo",
22 | change_smooth_selection: "enable/disable some display features (smarter display but more CPU charge)",
23 | highlight: "toggle syntax highlight on/off",
24 | reset_highlight: "reset highlight (if desyncronized from text)",
25 | word_wrap: "toggle word wrapping mode",
26 | help: "about",
27 | save: "save",
28 | load: "load",
29 | line_abbr: "Ln",
30 | char_abbr: "Ch",
31 | position: "Position",
32 | total: "Total",
33 | close_popup: "close popup",
34 | shortcuts: "Shortcuts",
35 | add_tab: "add tabulation to text",
36 | remove_tab: "remove tabulation to text",
37 | about_notice: "Notice: syntax highlight function is only for small text",
38 | toggle: "Toggle editor",
39 | accesskey: "Accesskey",
40 | tab: "Tab",
41 | shift: "Shift",
42 | ctrl: "Ctrl",
43 | esc: "Esc",
44 | processing: "Processing...",
45 | fullscreen: "fullscreen",
46 | syntax_selection: "--Syntax--",
47 | syntax_css: "CSS",
48 | syntax_html: "HTML",
49 | syntax_js: "Javascript",
50 | syntax_php: "Php",
51 | syntax_python: "Python",
52 | syntax_vb: "Visual Basic",
53 | syntax_xml: "Xml",
54 | syntax_c: "C",
55 | syntax_cpp: "CPP",
56 | syntax_basic: "Basic",
57 | syntax_pas: "Pascal",
58 | syntax_brainfuck: "Brainfuck",
59 | syntax_sql: "SQL",
60 | syntax_ruby: "Ruby",
61 | syntax_robotstxt: "Robots txt",
62 | syntax_tsql: "T-SQL",
63 | syntax_perl: "Perl",
64 | syntax_coldfusion: "Coldfusion",
65 | syntax_java: "Java",
66 | close_tab: "Close file"
67 | };
68 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/update_text_content.jsp:
--------------------------------------------------------------------------------
1 |
18 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
19 |
20 | <%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
21 | <%@ page import="org.wso2.carbon.utils.ServerConstants" %>
22 | <%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
23 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
24 |
25 |
26 | <%
27 | try {
28 | String resourcePath = request.getParameter("resourcePath");
29 | String contentText = request.getParameter("contentText");
30 |
31 | String cookie = (String) request.
32 | getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
33 |
34 | try {
35 | ThemeMgtServiceClient client =
36 | new ThemeMgtServiceClient(cookie, config, request.getSession());
37 | client.updateTextContent(resourcePath, contentText);
38 |
39 | } catch (Exception e) {
40 | String msg = "Failed to update text content of the resource " +
41 | resourcePath + ". " + e.getMessage();
42 | throw new UIException(msg, e);
43 | }
44 | } catch (UIException e) {
45 | response.setStatus(500);
46 | %>.
<%=e.getMessage()%><%
47 | return;
48 | }
49 | %>
50 |
51 |
52 |
--------------------------------------------------------------------------------
/features/tenant-mgt/org.wso2.carbon.tenant.common.server.feature/src/main/resources/conf/usage-throttling-agent-config.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 | 60000
22 | 100
23 | -1
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | 10
37 | 60
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/features/tenant-mgt/org.wso2.carbon.tenant.common.server.feature/src/main/resources/conf_templates/templates/repository/conf/multitenancy/multitenancy-packages.xml.j2:
--------------------------------------------------------------------------------
1 |
18 |
19 |
22 |
23 |
24 | {% set packages = [] %}
25 | {% if multi_tenancy.billing.package.demo is defined %}
26 | {% do packages.append(multi_tenancy.billing.package.demo) %}
27 | {% endif %}
28 | {% if multi_tenancy.billing.package.smb is defined %}
29 | {% do packages.append(multi_tenancy.billing.package.smb) %}
30 | {% endif %}
31 | {% for package in packages + multi_tenancy.billing.package.custom %}
32 |
33 | {{package.subscription_charge}}
34 |
35 |
36 | {{package.users.limit}}
37 | {{package.users.charge}}
38 |
39 |
40 |
41 | {{package.resource_volume.limit}}
42 |
43 | {{package.resource_volume.overuse_charge}}
44 |
45 |
46 | {{package.bandwidth.limit}}
47 |
48 | {{package.bandwidth.overuse_charge}}
49 |
50 |
51 |
52 | {% endfor %}
53 |
54 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.redirector.servlet.ui/src/main/java/org/wso2/carbon/redirector/servlet/ui/internal/RedirectorServletUIComponent.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.redirector.servlet.ui.internal;
19 |
20 | import org.apache.commons.logging.Log;
21 | import org.apache.commons.logging.LogFactory;
22 | import org.osgi.service.component.ComponentContext;
23 | import org.wso2.carbon.redirector.servlet.ui.util.Util;
24 | import org.osgi.service.component.annotations.Activate;
25 | import org.osgi.service.component.annotations.Component;
26 | import org.osgi.service.component.annotations.Deactivate;
27 | import org.osgi.service.component.annotations.Reference;
28 | import org.osgi.service.component.annotations.ReferenceCardinality;
29 | import org.osgi.service.component.annotations.ReferencePolicy;
30 |
31 | @Component(
32 | name = "org.wso2.carbon.redirector.servlet.ui",
33 | immediate = true)
34 | public class RedirectorServletUIComponent {
35 |
36 | private static Log log = LogFactory.getLog(RedirectorServletUIComponent.class);
37 |
38 | @Activate
39 | protected void activate(ComponentContext context) {
40 |
41 | try {
42 | Util.domainRegisterServlet(context.getBundleContext());
43 | log.debug("******* Multitenancy Redirector Servlet UI bundle is activated ******* ");
44 | } catch (Exception e) {
45 | log.error("******* Multitenancy Redirector Servlet UI bundle failed activating ****", e);
46 | }
47 | }
48 |
49 | @Deactivate
50 | protected void deactivate(ComponentContext context) {
51 |
52 | log.debug("******* Multitenancy Redirector Servlet UI bundle is deactivated ******* ");
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.client.configcontext.provider/src/main/java/org/wso2/carbon/client/configcontext/provider/listener/Axis2ConfigurationContextActivator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005-2014, 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.client.configcontext.provider.listener;
21 |
22 | import org.apache.commons.logging.Log;
23 | import org.apache.commons.logging.LogFactory;
24 | import org.osgi.framework.BundleActivator;
25 | import org.osgi.framework.BundleContext;
26 | import org.wso2.carbon.client.configcontext.provider.Axis2ClientConfigContextProvider;
27 | import org.wso2.carbon.client.configcontext.provider.Axis2ClientConfigContextProviderImpl;
28 | import org.wso2.carbon.utils.Axis2ConfigurationContextObserver;
29 |
30 | public class Axis2ConfigurationContextActivator implements BundleActivator {
31 |
32 | private Axis2ConfigurationContextObserverImpl axis2ConfigurationContextObserverImpl = new Axis2ConfigurationContextObserverImpl();
33 | private Axis2ClientConfigContextProvider contextProvider = new Axis2ClientConfigContextProviderImpl();
34 | private static Log log = LogFactory
35 | .getLog(Axis2ConfigurationContextActivator.class);
36 |
37 | public void start(BundleContext context) {
38 | try {
39 | context.registerService(
40 | Axis2ConfigurationContextObserver.class.getName(),
41 | axis2ConfigurationContextObserverImpl, null);
42 | context.registerService(
43 | Axis2ClientConfigContextProvider.class.getName(),
44 | contextProvider, null);
45 | log.debug("tenant configuration context bundle is activated");
46 | } catch (Throwable e) {
47 | log.error("Failed to activate tenant configuration context bundle ",e);
48 | }
49 | }
50 |
51 | public void stop(BundleContext context) {
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt/src/main/java/org/wso2/carbon/tenant/mgt/util/TenantDataDeletionUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright (c) 2015, 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 | package org.wso2.carbon.tenant.mgt.util;
22 |
23 | import org.apache.commons.logging.Log;
24 | import org.apache.commons.logging.LogFactory;
25 |
26 | import java.sql.Connection;
27 | import java.sql.PreparedStatement;
28 | import java.sql.SQLException;
29 |
30 | /**
31 | * This class is responsible for deleting product specific tenant data
32 | */
33 | public class TenantDataDeletionUtil {
34 |
35 | public static final Log log = LogFactory.getLog(TenantDataDeletionUtil.class);
36 |
37 | public static void deleteProductSpecificTenantData(Connection conn, String tableName, int tenantId) {
38 | try {
39 | conn.setAutoCommit(false);
40 | String deleteUserPermissionSql = "DELETE FROM " + tableName + " WHERE TENANT_ID = ?";
41 | executeDeleteQuery(conn, deleteUserPermissionSql, tenantId);
42 | } catch (Exception e) {
43 | e.printStackTrace();
44 | }
45 | }
46 |
47 | private static void executeDeleteQuery(Connection conn, String query, int tenantId)
48 | throws Exception {
49 | PreparedStatement ps = null;
50 | try {
51 | ps = conn.prepareStatement(query);
52 | ps.setInt(1, tenantId);
53 | ps.executeUpdate();
54 | } catch (SQLException e) {
55 | String errMsg = "Error executing query " + query + " for tenant: " + tenantId;
56 | log.error(errMsg, e);
57 | throw new Exception(errMsg, e);
58 | } finally {
59 | if (ps != null) {
60 | ps.close();
61 | }
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/config/PermissionConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.stratos.common.config;
17 |
18 | import org.apache.axiom.om.OMElement;
19 |
20 | import javax.xml.namespace.QName;
21 | import java.util.Iterator;
22 |
23 | public class PermissionConfig {
24 | private static final String CONFIG_NS = "http://wso2.com/carbon/cloud/mgt/services";
25 | private static final String PATH = "path";
26 | private static final String NAME = "name";
27 | String name;
28 | String path;
29 |
30 | public PermissionConfig(OMElement configEle) {
31 | serialize(configEle);
32 | }
33 |
34 | public void serialize(OMElement configEle) {
35 |
36 | Iterator configChildIt = configEle.getChildElements();
37 | while (configChildIt.hasNext()) {
38 | Object configChildObj = configChildIt.next();
39 | if (!( configChildObj instanceof OMElement)) {
40 | continue;
41 | }
42 | OMElement configChildEle = (OMElement)configChildObj;
43 | if (new QName(CONFIG_NS, NAME, "").
44 | equals(configChildEle.getQName())) {
45 | name = configChildEle.getText();
46 | } else if (new QName(CONFIG_NS, PATH, "").
47 | equals(configChildEle.getQName())) {
48 | path = configChildEle.getText();
49 | }
50 | }
51 | }
52 |
53 | public String getName() {
54 | return name;
55 | }
56 |
57 | public void setName(String name) {
58 | this.name = name;
59 | }
60 |
61 | public String getPath() {
62 | return path;
63 | }
64 |
65 | public void setPath(String path) {
66 | this.path = path;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/js/editarea/edit_area/reg_syntax/vb.js:
--------------------------------------------------------------------------------
1 | editAreaLoader.load_syntax["vb"] = {
2 | 'COMMENT_SINGLE' : {1 : "'"}
3 | ,'COMMENT_MULTI' : { }
4 | ,'QUOTEMARKS' : {1: '"'}
5 | ,'KEYWORD_CASE_SENSITIVE' : false
6 | ,'KEYWORDS' : {
7 | 'statements' : [
8 | 'if','then','for','each','while','do','loop',
9 | 'else','elseif','select','case','end select',
10 | 'until','next','step','to','in','end if'
11 | ]
12 | ,'keywords' : [
13 | 'empty','isempty','nothing','null','isnull','true','false',
14 | 'set','call',
15 | 'sub','end sub','function','end function','exit','exit function',
16 | 'dim','Mod','In','private','public','shared','const'
17 | ]
18 |
19 | ,'functions' : [
20 | 'CDate','Date','DateAdd','DateDiff','DatePart','DateSerial','DateValue','Day','FormatDateTime',
21 | 'Hour','IsDate','Minute','Month',
22 | 'MonthName','Now','Second','Time','Timer','TimeSerial','TimeValue','Weekday','WeekdayName ','Year',
23 | 'Asc','CBool','CByte','CCur','CDate','CDbl','Chr','CInt','CLng','CSng','CStr','Hex','Oct','FormatCurrency',
24 | 'FormatDateTime','FormatNumber','FormatPercent','Abs','Atn','Cos','Exp','Hex','Int','Fix','Log','Oct',
25 | 'Rnd','Sgn','Sin','Sqr','Tan',
26 | 'Array','Filter','IsArray','Join','LBound','Split','UBound',
27 | 'InStr','InStrRev','LCase','Left','Len','LTrim','RTrim','Trim','Mid','Replace','Right','Space','StrComp',
28 | 'String','StrReverse','UCase',
29 | 'CreateObject','Eval','GetLocale','GetObject','GetRef','InputBox','IsEmpty','IsNull','IsNumeric',
30 | 'IsObject','LoadPicture','MsgBox','RGB','Round','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion',
31 | 'ScriptEngineMinorVersion','SetLocale','TypeName','VarType'
32 | ]
33 | }
34 | ,'OPERATORS' :[
35 | '+', '-', '/', '*', '=', '<', '>', '!', '&'
36 | ]
37 | ,'DELIMITERS' :[
38 | '(', ')', '[', ']', '{', '}'
39 | ]
40 | ,'STYLES' : {
41 | 'COMMENTS': 'color: #99CC00;'
42 | ,'QUOTESMARKS': 'color: #333399;'
43 | ,'KEYWORDS' : {
44 | 'keywords' : 'color: #3366FF;'
45 | ,'functions' : 'color: #0000FF;'
46 | ,'statements' : 'color: #3366FF;'
47 | }
48 | ,'OPERATORS' : 'color: #FF0000;'
49 | ,'DELIMITERS' : 'color: #0000FF;'
50 |
51 | }
52 | };
53 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.sso.redirector.ui/src/main/java/org/wso2/carbon/sso/redirector/ui/internal/RedirectorJSPFilter.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.sso.redirector.ui.internal;
20 |
21 | import javax.servlet.Filter;
22 | import javax.servlet.FilterChain;
23 | import javax.servlet.FilterConfig;
24 | import javax.servlet.RequestDispatcher;
25 | import javax.servlet.ServletException;
26 | import javax.servlet.ServletRequest;
27 | import javax.servlet.ServletResponse;
28 | import javax.servlet.http.HttpServletRequest;
29 | import java.io.IOException;
30 |
31 | /**
32 | * This class acts as a servlet filter which forwads the requests coming for sso-acs/redirect_ajaxprocessor.jsp
33 | * to stratos-auth/redirect_ajaxprocessor.jsp
34 | */
35 | public class RedirectorJSPFilter implements Filter {
36 |
37 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
38 | FilterChain filterChain) throws IOException, ServletException {
39 | if (!(servletRequest instanceof HttpServletRequest)) {
40 | return;
41 | }
42 | String url = ((HttpServletRequest) servletRequest).getServletPath();
43 | if(url.contains("//")){
44 | url = url.replace("//", "/");
45 | }
46 | url = url.replace("sso-acs/redirect_ajaxprocessor.jsp", "stratos-auth/redirect_ajaxprocessor.jsp");
47 | RequestDispatcher requestDispatcher =
48 | servletRequest.getRequestDispatcher(url);
49 | requestDispatcher.forward(servletRequest, servletResponse);
50 | }
51 |
52 | public void init(FilterConfig filterConfig) throws ServletException {
53 | // not required to implement
54 | }
55 |
56 | public void destroy() {
57 | // not required to implement
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/add_text_resource_ajaxprocessor.jsp:
--------------------------------------------------------------------------------
1 |
18 | <%@ page import="org.wso2.carbon.utils.ServerConstants" %>
19 | <%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
20 | <%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
21 | <%@ page import="org.wso2.carbon.registry.resource.ui.processors.AddTextResourceProcessor" %>
22 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
23 | <%
24 | String errorMessage = null;
25 | try {
26 |
27 | String parentPath = request.getParameter("parentPath");
28 | String fileName = request.getParameter("fileName");
29 | String mediaType = request.getParameter("mediaType");
30 | String description = request.getParameter("description");
31 | String content = request.getParameter("content");
32 |
33 | String cookie = (String) request.
34 | getSession().getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
35 |
36 | try {
37 | ThemeMgtServiceClient client =
38 | new ThemeMgtServiceClient(cookie, config, request.getSession());
39 | client.addTextResource(parentPath, fileName, mediaType, description, content);
40 | } catch (Exception e) {
41 | String msg = "Failed to add new text resource " + fileName +
42 | " to the parent collection " + parentPath + ". " + e.getMessage();
43 | throw new UIException(msg, e);
44 | }
45 |
46 | } catch (Exception e) {
47 | errorMessage = e.getMessage();
48 | }
49 | %>
50 |
51 | <% if (errorMessage != null) { %>
52 |
53 |
56 |
57 | <% } %>
58 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/java/org/wso2/carbon/usage/agent/listeners/StatisticsInHandler.java:
--------------------------------------------------------------------------------
1 | package org.wso2.carbon.usage.agent.listeners;
2 |
3 |
4 | import org.apache.axis2.AxisFault;
5 | import org.apache.axis2.context.MessageContext;
6 | import org.apache.axis2.description.AxisService;
7 | import org.apache.axis2.engine.Handler;
8 | import org.apache.axis2.handlers.AbstractHandler;
9 | import org.apache.commons.logging.Log;
10 | import org.apache.commons.logging.LogFactory;
11 | import org.wso2.carbon.base.ServerConfiguration;
12 | import org.wso2.carbon.context.CarbonContext;
13 | import org.wso2.carbon.core.util.SystemFilter;
14 | import org.wso2.carbon.statistics.services.util.SystemStatistics;
15 | import org.wso2.carbon.usage.agent.util.PublisherUtils;
16 | import org.wso2.carbon.usage.agent.util.Util;
17 | import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
18 |
19 | public class StatisticsInHandler extends AbstractHandler{
20 | private static Log log = LogFactory.getLog(StatisticsOutHandler.class);
21 |
22 | public InvocationResponse invoke(MessageContext messageContext) throws AxisFault {
23 | AxisService axisService = messageContext.getAxisService();
24 | if(axisService== null || SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup()) ||
25 | axisService.isClientSide()){
26 | return InvocationResponse.CONTINUE;
27 | }
28 |
29 | if(Util.getSystemStatisticsUtil()==null){
30 | return InvocationResponse.CONTINUE;
31 | }
32 |
33 | SystemStatistics systemStatistics = Util.getSystemStatisticsUtil().getSystemStatistics(messageContext);
34 |
35 | int tenantId = MultitenantConstants.INVALID_TENANT_ID;
36 | tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
37 |
38 | if(tenantId == MultitenantConstants.INVALID_TENANT_ID ||
39 | tenantId == MultitenantConstants.SUPER_TENANT_ID) {
40 | return Handler.InvocationResponse.CONTINUE;
41 | }
42 |
43 | try {
44 | PublisherUtils.publish(systemStatistics, tenantId);
45 | } catch (Exception e) {
46 | //Logging the complete stacktrace in debug mode
47 | if(log.isDebugEnabled()){
48 | log.debug(e);
49 | }
50 |
51 | log.error("Error occurred while publishing request statistics. Full stacktrace available in debug logs. " + e.getMessage());
52 | }
53 |
54 | return InvocationResponse.CONTINUE;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.usage.agent/src/main/java/org/wso2/carbon/usage/agent/util/UsageAgentConstants.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010, 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.usage.agent.util;
17 |
18 | /**
19 | * this class define constants for UsageAgent component
20 | */
21 | public class UsageAgentConstants {
22 | public static final String ELEMENT_NAME_DATA = "Data";
23 | public static final String ELEMENT_NAME_KEY = "Key";
24 | public static final String ELEMENT_NAME_VALUE = "Value";
25 |
26 | public static final String STATISTICS_DATA_NS_URI = "http://wso2.org/ns/2009/09/bam/server/user-defined/data";
27 | public static final String STATISTICS_DATA_NS_PREFIX = "svrusrdata";
28 |
29 | // OM element names
30 | public static final String STATISTICS_DATA_ELEMENT_NAME_EVENT = "Event";
31 | public static final String STATISTICS_DATA_ELEMENT_NAME_SERVICE_STATISTICS_DATA = "ServerUserDefinedData";
32 | public static final String STATISTICS_DATA_ELEMENT_NAME_TENANT_ID = "TenantID";
33 | public static final String STATISTICS_DATA_ELEMENT_NAME_SERVER_NAME = "ServerName";
34 |
35 | public static final String BAM_SERVER_URL = "BamServerURL";
36 | public static final String BAM_SERVER_STAT_SERVICE = "BAMServerUserDefinedDataSubscriberService";
37 | public static final String BAM_SERVER_STAT_FILTER = "carbon/bam/data/publishers/bandwidth-stat";
38 |
39 | public static final String TOPIC_SEPARATOR = "/";
40 | public static final String EVENT_NAME = "UsageMeteringEvent";
41 |
42 | public static final String BANDWIDTH_USAGE_TOPIC = BAM_SERVER_STAT_FILTER;
43 | // public static final String BANDWIDTH_USAGE_TOPIC = BAM_SERVER_STAT_FILTER + TOPIC_SEPARATOR + EVENT_NAME;
44 |
45 |
46 | public static final String BANDWIDTH_USAGE_SERVICES_CONTEXT = "services";
47 | public static final String BANDWIDTH_USAGE_WEBAPPS_CONTEXT = "webapps";
48 | public static final String BANDWIDTH_CARBON = "carbon";
49 | }
50 |
--------------------------------------------------------------------------------
/components/tenant-mgt/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | org.wso2.carbon.multitenancy
22 | carbon-multitenancy
23 | 4.11.46-SNAPSHOT
24 | ../../pom.xml
25 |
26 |
27 | 4.0.0
28 | tenant-mgt-parent
29 | pom
30 | WSO2 Tenant Management Parent Module
31 | WSO2 Tenant Management Parent Module
32 | http://wso2.org
33 |
34 |
35 |
36 | org.wso2.carbon.tenant.keystore.mgt
37 | org.wso2.carbon.tenant.deployment
38 | org.wso2.carbon.tenant.dispatcher
39 | org.wso2.carbon.tenant.mgt.core
40 | org.wso2.carbon.tenant.activation
41 | org.wso2.carbon.tenant.redirector.servlet
42 | org.wso2.carbon.tenant.redirector.servlet.ui
43 | org.wso2.carbon.tenant.throttling.agent
44 | org.wso2.carbon.tenant.usage.agent
45 | org.wso2.carbon.tenant.theme.mgt
46 | org.wso2.carbon.tenant.theme.mgt.ui
47 | org.wso2.carbon.tenant.sso.redirector.ui
48 | org.wso2.carbon.tenant.mgt
49 | org.wso2.carbon.tenant.mgt.ui
50 | org.wso2.carbon.client.configcontext.provider
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/packages/PackageInfo.java:
--------------------------------------------------------------------------------
1 | package org.wso2.carbon.stratos.common.packages;
2 |
3 | /*
4 | * Deserialize following XML
5 |
6 |
7 |
8 |
9 | 5
10 | 0
11 |
12 |
13 | 10
14 |
15 |
16 | 1000
17 | 0
18 |
19 |
20 |
21 | ...
22 |
23 |
24 | */
25 | public class PackageInfo {
26 |
27 | private String name;
28 | private int usersLimit;
29 | private int subscriptionCharge;
30 | private int chargePerUser;
31 | private int resourceVolumeLimit;
32 | private int bandwidthLimit;
33 | private int bandwidthOveruseCharge;
34 |
35 |
36 | public String getName() {
37 | return name;
38 | }
39 |
40 | public void setName(String name) {
41 | this.name = name;
42 | }
43 |
44 | public int getUsersLimit() {
45 | return usersLimit;
46 | }
47 |
48 | public void setUsersLimit(int usersLimit) {
49 | this.usersLimit = usersLimit;
50 | }
51 |
52 | public int getSubscriptionCharge() {
53 | return subscriptionCharge;
54 | }
55 |
56 | public void setSubscriptionCharge(int subscriptionCharge) {
57 | this.subscriptionCharge = subscriptionCharge;
58 | }
59 |
60 | public int getChargePerUser() {
61 | return chargePerUser;
62 | }
63 |
64 | public void setChargePerUser(int chargePerUser) {
65 | this.chargePerUser = chargePerUser;
66 | }
67 |
68 | public int getResourceVolumeLimit() {
69 | return resourceVolumeLimit;
70 | }
71 |
72 | public void setResourceVolumeLimit(int resourceVolumeLimit) {
73 | this.resourceVolumeLimit = resourceVolumeLimit;
74 | }
75 |
76 | public int getBandwidthLimit() {
77 | return bandwidthLimit;
78 | }
79 |
80 | public void setBandwidthLimit(int bandwidthLimit) {
81 | this.bandwidthLimit = bandwidthLimit;
82 | }
83 |
84 | public int getBandwidthOveruseCharge() {
85 | return bandwidthOveruseCharge;
86 | }
87 |
88 | public void setBandwidthOveruseCharge(int bandwidthOveruseCharge) {
89 | this.bandwidthOveruseCharge = bandwidthOveruseCharge;
90 | }
91 |
92 |
93 | }
94 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.mgt.ui/src/main/resources/org/wso2/carbon/tenant/mgt/ui/i18n/Resources.properties:
--------------------------------------------------------------------------------
1 | submit.tenant=Submit Tenant
2 | domain=Domain
3 | tenant.id=Tenant ID
4 | activate.deactivate=Activation Status
5 | deactivate.account.msg=This tenant is active. You can deactivate this tenant from here.
6 | activate.account.msg=This tenant is inactive. You can activate this tenant from here.
7 | deactivate.account.btn=Deactivate
8 | activate.account.btn=Activate
9 | error.deactivating.activating.tenant=Error occurred in changing the activation status of the tenant.
10 | domain.information=Domain Information
11 | contact.details=Contact Details
12 | admin.username=Admin Username
13 | current.admin.password=Current Admin Password
14 | new.admin.password=New Admin Password
15 | new.admin.password.repeat=New Admin Password (Repeat)
16 | admin.password=Admin Password
17 | admin.password.repeat=Admin Password (Repeat)
18 | govern.add_tenants.menu=Add New Tenant
19 | govern.view_tenants.menu=View Tenants
20 | overview=Overview
21 | tenants.list=Tenants List
22 | company.organization=Company/Organization
23 | admin.contact=Admin Contact
24 | edit=Edit
25 | multitenancy=Multitenancy
26 | added.successfully=You have successfully added a new tenant with domain:
27 | updated.successfully=You have successfully updated the tenant with domain:
28 | update.added.tenant=Update the just added/updated tenant
29 | update.tenant=Update Tenant
30 | add.new.tenant=Add a new tenant
31 | register.new.organization=Register A New Organization
32 | view.all.tenants=View all tenants
33 | tenant.admin=Tenant Admin
34 | tenant.description=Tenant Description
35 | admin.fullname=Full Name
36 | admin.firstname=First Name
37 | admin.lastname=Last Name
38 | admin.address=Address
39 | admin.email=Email
40 | admin.telephone=Telephone
41 | admin.im=IM
42 | admin.url=URL
43 | self.registration=Registry Tenant
44 | gaas=GaaS
45 | gaas.register.a.new.tenant=Register A New Tenant
46 | active=Active
47 | actions=Actions
48 | theme.management=Theme Management
49 | word.verification=Word Verification
50 | captcha.message=Type the characters you see in the picture below.
51 | created.date=Created Date
52 | enter.tenant.domain=Enter the Tenant Domain
53 | accept.eula=I have read and accepted the terms in the license agreement above.
54 | usage.plan.information= Usage Plan Information
55 | select.usage.plan.for.tenant=Select Usage Plan For Tenant
56 | select.package.message=According to the selected plan, resources will be allocated to you.\n You can update or downgrade your plan later \n according to your requirements.
57 | no.tenants.available=There are no tenants available
58 | number.of.tenants=Number of tenants
59 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.theme.mgt.ui/src/main/resources/web/tenant-theme/theme_mgt_ajaxprocessor.jsp:
--------------------------------------------------------------------------------
1 |
18 | <%@ page import="org.wso2.carbon.CarbonConstants" %>
19 | <%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
20 | <%@ page import="org.wso2.carbon.theme.mgt.ui.clients.ThemeMgtServiceClient" %>
21 | <%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
22 | <%@ page import="java.util.UUID" %>
23 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
24 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
25 | <%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %>
26 |
29 | <%
30 |
31 | String redirectWithStr = request.getParameter("redirectWith");
32 | if (redirectWithStr == null) {
33 | redirectWithStr = "";
34 | }
35 | try {
36 | ThemeMgtServiceClient client = new ThemeMgtServiceClient(config, session);
37 | String themeName = request.getParameter("theme");
38 | request.getSession().setAttribute(
39 | CarbonConstants.THEME_URL_RANDOM_SUFFIX_SESSION_KEY, UUID.randomUUID().toString());
40 | client.applyTheme(themeName, redirectWithStr);
41 | if (redirectWithStr.equals("")) {
42 | response.sendRedirect(CarbonUIUtil.resolveAdminConsoleBaseURL("",
43 | "../tenant-theme/theme_mgt.jsp?updateTheme=Success&redirectWith=" + redirectWithStr, request));
44 | } else {
45 | response.sendRedirect(CarbonUIUtil.resolveAdminConsoleBaseURL("", "../admin/login.jsp", request));
46 | }
47 | } catch (UIException e) {
48 | response.sendRedirect(CarbonUIUtil.resolveAdminConsoleBaseURL("",
49 | "../tenant-theme/theme_mgt.jsp?updateTheme=Failed&redirectWith=" + redirectWithStr, request));
50 | }
51 | %>
52 |
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/config/CloudServicesDescConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2008, 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.stratos.common.config;
17 |
18 | import org.apache.axiom.om.OMElement;
19 | import org.apache.commons.logging.Log;
20 | import org.apache.commons.logging.LogFactory;
21 |
22 | import javax.xml.namespace.QName;
23 | import java.util.*;
24 |
25 | public class CloudServicesDescConfig {
26 | private static final Log log = LogFactory.getLog(CloudServicesDescConfig.class);
27 | private static final String CONFIG_NS = "http://wso2.com/carbon/cloud/mgt/services";
28 | private static final String CLOUD_SERVICE_ELEMENT_NAME = "cloudService";
29 |
30 | Map cloudServiceConfigs;
31 |
32 | public CloudServicesDescConfig(OMElement configEle) {
33 | // as the cloud service configs are kept in an order, we use an ordered map.
34 | cloudServiceConfigs = new LinkedHashMap();
35 | serialize(configEle);
36 | }
37 |
38 | public void serialize(OMElement configEle) {
39 | Iterator configChildIt = configEle.getChildElements();
40 | while (configChildIt.hasNext()) {
41 | Object configChildObj = configChildIt.next();
42 | if (!( configChildObj instanceof OMElement)) {
43 | continue;
44 | }
45 | OMElement configChildEle = (OMElement)configChildObj;
46 | if (new QName(CONFIG_NS, CLOUD_SERVICE_ELEMENT_NAME, "").
47 | equals(configChildEle.getQName())) {
48 | CloudServiceConfig cloudServiceConfig = new CloudServiceConfig(configChildEle);
49 | String name = cloudServiceConfig.getName();
50 | cloudServiceConfigs.put(name, cloudServiceConfig);
51 | }
52 | }
53 | }
54 |
55 | public Map getCloudServiceConfigs() {
56 | return cloudServiceConfigs;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Purpose
2 | > Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.
3 |
4 | ## Goals
5 | > Describe the solutions that this feature/fix will introduce to resolve the problems described above
6 |
7 | ## Approach
8 | > Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.
9 |
10 | ## User stories
11 | > Summary of user stories addressed by this change>
12 |
13 | ## Release note
14 | > Brief description of the new feature or bug fix as it will appear in the release notes
15 |
16 | ## Documentation
17 | > Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact
18 |
19 | ## Training
20 | > Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable
21 |
22 | ## Certification
23 | > Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.
24 |
25 | ## Marketing
26 | > Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable
27 |
28 | ## Automation tests
29 | - Unit tests
30 | > Code coverage information
31 | - Integration tests
32 | > Details about the test cases and coverage
33 |
34 | ## Security checks
35 | - Followed secure coding standards in http://wso2.com/technical-reports/wso2-secure-engineering-guidelines? yes/no
36 | - Ran FindSecurityBugs plugin and verified report? yes/no
37 | - Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets? yes/no
38 |
39 | ## Samples
40 | > Provide high-level details about the samples related to this feature
41 |
42 | ## Related PRs
43 | > List any other related PRs
44 |
45 | ## Migrations (if applicable)
46 | > Describe migration steps and platforms on which migration has been tested
47 |
48 | ## Test environment
49 | > List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested
50 |
51 | ## Learning
52 | > Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.
--------------------------------------------------------------------------------
/components/tenant-mgt/org.wso2.carbon.tenant.common/src/main/java/org/wso2/carbon/stratos/common/util/CommandUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. 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 | package org.apache.stratos.common.util;
21 |
22 | import org.apache.commons.logging.Log;
23 | import org.apache.commons.logging.LogFactory;
24 |
25 | import java.io.BufferedReader;
26 | import java.io.IOException;
27 | import java.io.InputStreamReader;
28 |
29 | /**
30 | * A utility class for executing shell commands.
31 | */
32 | public class CommandUtils {
33 | private static final Log log = LogFactory.getLog(CommandUtils.class);
34 | private static final String NEW_LINE = System.getProperty("line.separator");
35 |
36 | public static String executeCommand(String command) throws IOException {
37 | String line;
38 | Runtime r = Runtime.getRuntime();
39 | if (log.isDebugEnabled()) {
40 | log.debug("command = " + command);
41 | }
42 | Process p = r.exec(command);
43 |
44 | StringBuilder output = new StringBuilder();
45 | BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
46 | while ((line = in.readLine()) != null) {
47 | if (log.isDebugEnabled()) {
48 | log.debug("output = " + line);
49 | }
50 | output.append(line).append(NEW_LINE);
51 | }
52 | StringBuilder errors = new StringBuilder();
53 | BufferedReader error = new BufferedReader(new InputStreamReader(p.getErrorStream()));
54 | while ((line = error.readLine()) != null) {
55 | if (log.isDebugEnabled()) {
56 | log.debug("error = " + line);
57 | }
58 | errors.append(line).append(NEW_LINE);
59 | }
60 | if (errors.length() > 0) {
61 | throw new RuntimeException("Command execution failed: " + NEW_LINE + errors.toString());
62 | }
63 |
64 | return output.toString();
65 | }
66 | }
67 |
--------------------------------------------------------------------------------