├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── Jenkinsfile ├── LICENSE.md ├── README.Jenkinsfile.md ├── README.md ├── Vagrant ├── Vagrantfile ├── bootstrap.sh └── playbook.yml ├── Vagrantfile ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── jaspersoft │ │ └── jasperserver │ │ └── jaxrs │ │ └── client │ │ ├── apiadapters │ │ ├── AbstractAdapter.java │ │ ├── adhoc │ │ │ └── queryexecution │ │ │ │ ├── QueryExecutionAdapter.java │ │ │ │ ├── QueryExecutionHelper.java │ │ │ │ ├── QueryExecutionService.java │ │ │ │ └── QueryResultDataHelper.java │ │ ├── alerting │ │ │ ├── AlertValidationErrorHandler.java │ │ │ ├── AlertsParameter.java │ │ │ ├── AlertsService.java │ │ │ ├── BatchAlertsOperationsAdapter.java │ │ │ ├── SingleAlertOperationsAdapter.java │ │ │ └── calendar │ │ │ │ ├── CalendarParameter.java │ │ │ │ ├── CalendarType.java │ │ │ │ └── SingleCalendarOperationsAdapter.java │ │ ├── attributes │ │ │ ├── AttributesGroupParameter.java │ │ │ ├── AttributesSearchParameter.java │ │ │ ├── AttributesService.java │ │ │ ├── BatchAttributeAdapter.java │ │ │ └── SingleAttributeAdapter.java │ │ ├── authority │ │ │ ├── organizations │ │ │ │ ├── BatchOrganizationsAdapter.java │ │ │ │ ├── OrganizationParameter.java │ │ │ │ ├── OrganizationsService.java │ │ │ │ └── SingleOrganizationAdapter.java │ │ │ ├── roles │ │ │ │ ├── BatchRolesRequestAdapter.java │ │ │ │ ├── RolesParameter.java │ │ │ │ ├── RolesService.java │ │ │ │ └── SingleRoleRequestAdapter.java │ │ │ └── users │ │ │ │ ├── BatchUsersRequestAdapter.java │ │ │ │ ├── SingleUserRequestAdapter.java │ │ │ │ ├── UsersAttributesParameter.java │ │ │ │ ├── UsersParameter.java │ │ │ │ └── UsersService.java │ │ ├── bundles │ │ │ └── BundlesService.java │ │ ├── connections │ │ │ └── query │ │ │ │ └── SingleQueryAdapter.java │ │ ├── context │ │ │ ├── ContextService.java │ │ │ ├── SingleContextAdapter.java │ │ │ └── domain │ │ │ │ ├── DomainContextOperationResult.java │ │ │ │ ├── DomainContextService.java │ │ │ │ └── SingleDomainContextAdapter.java │ │ ├── dashboard │ │ │ ├── DashboardExecutionsAdapter.java │ │ │ ├── DashboardOutputResourceAdapter.java │ │ │ ├── DashboardsAdapter.java │ │ │ ├── DashboardsService.java │ │ │ └── RunDashboardsAdapter.java │ │ ├── datadiscovery │ │ │ ├── DataDiscoveryService.java │ │ │ ├── DerivedTableContextManager.java │ │ │ ├── DomElContextManager.java │ │ │ ├── DomainContextManager.java │ │ │ └── TopicContextManager.java │ │ ├── diagnostic │ │ │ ├── BatchDiagnosticCollectorsAdapter.java │ │ │ ├── DiagnosticService.java │ │ │ └── SingleDiagnosticCollectorAdapter.java │ │ ├── domain │ │ │ ├── DomainService.java │ │ │ ├── metadata │ │ │ │ └── DomainMetadataAdapter.java │ │ │ ├── newDomain │ │ │ │ └── DomainAdapter.java │ │ │ └── schema │ │ │ │ └── DomainSchemaAdapter.java │ │ ├── favorites │ │ │ └── FavoritesService.java │ │ ├── importexport │ │ │ ├── exportservice │ │ │ │ ├── ExportParameter.java │ │ │ │ ├── ExportRequestAdapter.java │ │ │ │ └── ExportService.java │ │ │ └── importservice │ │ │ │ ├── BrokenDependenciesParameter.java │ │ │ │ ├── ImportParameter.java │ │ │ │ ├── ImportRequestAdapter.java │ │ │ │ └── ImportService.java │ │ ├── inputControls │ │ │ ├── InputControlsAdapter.java │ │ │ ├── InputControlsPaginationValuesAdapter.java │ │ │ ├── InputControlsSelectedValuesAdapter.java │ │ │ ├── InputControlsService.java │ │ │ └── InputControlsValuesAdapter.java │ │ ├── jobs │ │ │ ├── BatchJobsOperationsAdapter.java │ │ │ ├── JobValidationErrorHandler.java │ │ │ ├── JobsParameter.java │ │ │ ├── JobsService.java │ │ │ ├── SingleJobOperationsAdapter.java │ │ │ └── calendar │ │ │ │ ├── CalendarParameter.java │ │ │ │ ├── CalendarType.java │ │ │ │ └── SingleCalendarOperationsAdapter.java │ │ ├── permissions │ │ │ ├── BatchPermissionsAdapter.java │ │ │ ├── PermissionMask.java │ │ │ ├── PermissionRecipient.java │ │ │ ├── PermissionResourceParameter.java │ │ │ ├── PermissionsService.java │ │ │ └── SinglePermissionsAdapter.java │ │ ├── query │ │ │ ├── QueryExecutorAdapter.java │ │ │ └── QueryExecutorService.java │ │ ├── reporting │ │ │ ├── ReportingService.java │ │ │ ├── ReportsAdapter.java │ │ │ ├── RunReportAdapter.java │ │ │ ├── reportexecution │ │ │ │ ├── ReportExecutionAdapter.java │ │ │ │ └── ReportExecutionExportAdapter.java │ │ │ ├── reportoptions │ │ │ │ ├── ReportOptionsAdapter.java │ │ │ │ └── ReportOptionsUtil.java │ │ │ └── util │ │ │ │ ├── PageRange.java │ │ │ │ ├── ReportOutputFormat.java │ │ │ │ ├── ReportSearchParameter.java │ │ │ │ └── RunReportErrorHandler.java │ │ ├── resources │ │ │ ├── BatchResourcesAdapter.java │ │ │ ├── ResourcesService.java │ │ │ ├── SingleFileResourceUploadAdapter.java │ │ │ ├── SingleResourceAdapter.java │ │ │ ├── compexResourcesSupport │ │ │ │ ├── ResourceBuilderFactory.java │ │ │ │ ├── WrongResourceFormatException.java │ │ │ │ ├── builder │ │ │ │ │ ├── DomainResourceBuilder.java │ │ │ │ │ ├── DomainTopicResourceBuilder.java │ │ │ │ │ ├── MondrianConnectionResourceBuilder.java │ │ │ │ │ ├── ReportUnitResourceBuilder.java │ │ │ │ │ ├── SecureMondrianConnectionResourceBuilder.java │ │ │ │ │ └── SemanticLayerResourceBuilder.java │ │ │ │ ├── decorator │ │ │ │ │ ├── DomainOperationProcessorDecorator.java │ │ │ │ │ ├── DomainTopicOperationProcessorDecorator.java │ │ │ │ │ ├── MondrianConnectionResourceOperationProcessorDecorator.java │ │ │ │ │ ├── ReportUnitResourceOperationProcessorDecorator.java │ │ │ │ │ ├── SecureMondrianConnectionResourceOperationProcessorDecorator.java │ │ │ │ │ └── SemanticLayerResourceOperationProcessorDecorator.java │ │ │ │ └── processor │ │ │ │ │ ├── CommonOperationProcessor.java │ │ │ │ │ └── CommonOperationProcessorImpl.java │ │ │ ├── uploadFileResourceAdapters │ │ │ │ ├── SingleResourceUploadBase64Adapter.java │ │ │ │ ├── SingleResourceUploadMultipartAdapter.java │ │ │ │ └── SingleResourceUploadStreamAdapter.java │ │ │ └── util │ │ │ │ ├── MediaTypeUtil.java │ │ │ │ ├── ResourceFilesMimeType.java │ │ │ │ ├── ResourceSearchParameter.java │ │ │ │ ├── ResourceServiceParameter.java │ │ │ │ ├── ResourceUtil.java │ │ │ │ ├── ResourceValidationErrorHandler.java │ │ │ │ └── ResourcesTypeResolverUtil.java │ │ ├── serverInfo │ │ │ └── ServerInfoService.java │ │ ├── settings │ │ │ ├── SettingsService.java │ │ │ └── SingleSettingsAdapter.java │ │ └── thumbnails │ │ │ ├── BatchThumbnailAdapter.java │ │ │ ├── SingleThumbnailAdapter.java │ │ │ └── ThumbnailsService.java │ │ ├── core │ │ ├── AnonymousSession.java │ │ ├── AuthenticationCredentials.java │ │ ├── Callback.java │ │ ├── JasperserverRestClient.java │ │ ├── JerseyRequest.java │ │ ├── MimeTypeUtil.java │ │ ├── RequestBuilder.java │ │ ├── RequestExecution.java │ │ ├── RestClientConfiguration.java │ │ ├── Session.java │ │ ├── SessionStorage.java │ │ ├── ThreadPoolUtil.java │ │ ├── UrlUtils.java │ │ ├── enums │ │ │ ├── AuthenticationType.java │ │ │ ├── ContextMediaTypes.java │ │ │ ├── JRSVersion.java │ │ │ ├── MimeType.java │ │ │ └── RequestMethod.java │ │ ├── exceptions │ │ │ ├── AccessDeniedException.java │ │ │ ├── AuthenticationFailedException.java │ │ │ ├── BadRequestException.java │ │ │ ├── ConflictException.java │ │ │ ├── ExportFailedException.java │ │ │ ├── FolderAlreadyExistsException.java │ │ │ ├── FolderNotFoundException.java │ │ │ ├── HttpMethodNotAllowedException.java │ │ │ ├── IllegalParameterValueException.java │ │ │ ├── InternalServerErrorException.java │ │ │ ├── JSClientException.java │ │ │ ├── JSClientWebException.java │ │ │ ├── MandatoryParameterNotFoundException.java │ │ │ ├── ModificationNotAllowedException.java │ │ │ ├── NoResultException.java │ │ │ ├── NoSuchImportTaskException.java │ │ │ ├── NoSuchTaskException.java │ │ │ ├── NotAFileException.java │ │ │ ├── NotReadyResultException.java │ │ │ ├── ParamException.java │ │ │ ├── PatchException.java │ │ │ ├── ReportExportException.java │ │ │ ├── ReportInvalidPageRangeException.java │ │ │ ├── ReportStartPageGreaterThenEndPageException.java │ │ │ ├── RepresentationalTypeNotSupportedForResourceException.java │ │ │ ├── RequestedRepresentationNotAvailableForResourceException.java │ │ │ ├── ResourceAlreadyExistsException.java │ │ │ ├── ResourceInUseException.java │ │ │ ├── ResourceNotFoundException.java │ │ │ ├── UnexpectedErrorException.java │ │ │ ├── ValidationException.java │ │ │ ├── VersionNotMatchException.java │ │ │ ├── WeakPasswordException.java │ │ │ └── handling │ │ │ │ ├── DefaultErrorHandler.java │ │ │ │ ├── ErrorHandler.java │ │ │ │ └── JRSExceptionsMapping.java │ │ └── operationresult │ │ │ ├── NullEntityOperationResult.java │ │ │ ├── OperationResult.java │ │ │ ├── OperationResultFactory.java │ │ │ ├── OperationResultFactoryImpl.java │ │ │ └── WithEntityOperationResult.java │ │ ├── dto │ │ ├── alerting │ │ │ └── calender │ │ │ │ ├── AnnualCalendar.java │ │ │ │ ├── BaseCalendar.java │ │ │ │ ├── Calendar.java │ │ │ │ ├── CronCalendar.java │ │ │ │ ├── DailyCalendar.java │ │ │ │ ├── HolidayCalendar.java │ │ │ │ ├── MonthlyCalendar.java │ │ │ │ └── WeeklyCalendar.java │ │ ├── common │ │ │ ├── ValidationError.java │ │ │ └── ValidationErrorsListWrapper.java │ │ ├── dataDiscovery │ │ │ └── TestJdbcConnectionResult.java │ │ ├── jobs │ │ │ └── calendar │ │ │ │ ├── AnnualCalendar.java │ │ │ │ ├── BaseCalendar.java │ │ │ │ ├── Calendar.java │ │ │ │ ├── CronCalendar.java │ │ │ │ ├── DailyCalendar.java │ │ │ │ ├── HolidayCalendar.java │ │ │ │ ├── MonthlyCalendar.java │ │ │ │ └── WeeklyCalendar.java │ │ ├── query │ │ │ ├── Query.java │ │ │ └── QueryField.java │ │ ├── reports │ │ │ ├── ExportExecution.java │ │ │ ├── ExportExecutionOptions.java │ │ │ ├── ExportsContainer.java │ │ │ ├── OutputResourceDescriptor.java │ │ │ ├── ReportExecution.java │ │ │ ├── ReportExecutionOptions.java │ │ │ ├── ReportExecutionRequest.java │ │ │ ├── ReportExecutionStatus.java │ │ │ ├── ReportExecutionStatusEntity.java │ │ │ ├── ReportExecutionStatusObject.java │ │ │ ├── ReportExecutionsSetWrapper.java │ │ │ ├── inputcontrols │ │ │ │ └── InputControlStateListWrapper.java │ │ │ └── reportinfo │ │ │ │ ├── Bookmark.java │ │ │ │ ├── BookmarksInfo.java │ │ │ │ ├── Part.java │ │ │ │ ├── PartsInfo.java │ │ │ │ └── ReportInfo.java │ │ └── settings │ │ │ ├── AwsSettings.java │ │ │ ├── DashboardSettings.java │ │ │ ├── DataSourcePatternsSettings.java │ │ │ ├── DataSourceType.java │ │ │ ├── DateTimeSettings.java │ │ │ ├── Datepicker.java │ │ │ ├── DecimalFormatSymbolsSettings.java │ │ │ ├── GlobalConfigurationSettings.java │ │ │ ├── InputControlsSettings.java │ │ │ ├── ItemRegistry.java │ │ │ ├── RequestSettings.java │ │ │ ├── Timepicker.java │ │ │ └── UserTimeZone.java │ │ ├── filters │ │ ├── BasicAuthenticationFilter.java │ │ └── SessionOutputFilter.java │ │ └── providers │ │ └── CustomRepresentationTypeProvider.java └── resources │ ├── config.properties │ └── org │ └── powermock │ └── extensions │ └── configuration.properties └── test ├── java └── com │ └── jaspersoft │ └── jasperserver │ └── jaxrs │ └── client │ ├── apiadapters │ ├── adhoc │ │ └── queryexecution │ │ │ ├── QueryExecutionAdapterTest.java │ │ │ └── QueryExecutionServiceTest.java │ ├── alerting │ │ └── calendar │ │ │ └── SingleCalendarOperationsAdapterTestNew.java │ ├── alertingNew │ │ ├── AlertsServiceTest.java │ │ ├── BatchAlertsOperationsAdapterTest.java │ │ ├── SingleAlertOperationsAdapterTest.java │ │ └── trigger │ │ │ ├── CalendarTriggerTest.java │ │ │ └── SimpleTriggerTest.java │ ├── attributes │ │ ├── AttributesServiceTest.java │ │ ├── BatchAttributeAdapterTest.java │ │ └── SingleAttributeAdapterTest.java │ ├── authority │ │ ├── organizations │ │ │ ├── BatchOrganizationsAdapterTest.java │ │ │ ├── OrganizationsServiceTest.java │ │ │ └── SingleOrganizationAdapterTest.java │ │ ├── roles │ │ │ ├── BatchRolesRequestAdapterTest.java │ │ │ ├── RolesServiceTest.java │ │ │ └── SingleRoleRequestAdapterTest.java │ │ └── users │ │ │ ├── BatchUsersRequestAdapterTest.java │ │ │ ├── SingleUserRequestAdapterTest.java │ │ │ └── UsersServiceTest.java │ ├── bundles │ │ └── BundlesServiceTest.java │ ├── connections │ │ └── ContextMediaTypesTest.java │ ├── context │ │ ├── ContextServiceTest.java │ │ ├── SingleContextAdapterTest.java │ │ └── domain │ │ │ ├── DomainContextOperationResultTest.java │ │ │ ├── DomainContextServiceTest.java │ │ │ └── SingleDomainContextAdapterTest.java │ ├── datadiscovery │ │ ├── DataDiscoveryServiceTest.java │ │ ├── DerivedTableContextManagerTest.java │ │ ├── DomElContextManagerTest.java │ │ ├── DomainContextManagerTest.java │ │ └── TopicContextManagerTest.java │ ├── diagnostic │ │ ├── BatchDiagnosticCollectorsAdapterTest.java │ │ ├── DiagnosticServiceTest.java │ │ └── SingleDiagnosticCollectorAdapterTest.java │ ├── domain │ │ ├── DomainServiceTest.java │ │ ├── metadata │ │ │ └── DomainMetadataAdapterTest.java │ │ ├── newDomain │ │ │ └── DomainAdapterTest.java │ │ └── schema │ │ │ └── DomainSchemaAdapterTest.java │ ├── importexport │ │ ├── exportservice │ │ │ ├── ExportRequestAdapterTest.java │ │ │ └── ExportServiceTest.java │ │ └── importservice │ │ │ ├── ImportRequestAdapterTest.java │ │ │ └── ImportServiceTest.java │ ├── inputControls │ │ ├── InputControlsAdapterTest.java │ │ ├── InputControlsServiceTest.java │ │ └── InputControlsValuesAdapterTest.java │ ├── jobs │ │ └── calendar │ │ │ └── SingleCalendarOperationsAdapterTestNew.java │ ├── jobsNew │ │ ├── BatchJobsOperationsAdapterTest.java │ │ ├── JobsServiceTest.java │ │ ├── SingleJobOperationsAdapterTest.java │ │ └── trigger │ │ │ ├── CalendarTriggerTest.java │ │ │ └── SimpleTriggerTest.java │ ├── permissions │ │ └── PermissionMaskTest.java │ ├── query │ │ └── QueryExecutorAdapterTest.java │ ├── reporting │ │ ├── ReportingServiceTest.java │ │ ├── ReportsAdapterTest.java │ │ ├── RunReportAdapterTest.java │ │ └── reportoptions │ │ │ └── ReportOptionsAdapterTest.java │ ├── resources │ │ ├── BatchResourcesAdapterTest.java │ │ ├── ResourceFilesMimeTypeTest.java │ │ ├── ResourcesServiceTest.java │ │ ├── ResourcesTypeResolverUtilTest.java │ │ ├── SingleResourceAdapterTest.java │ │ └── support │ │ │ ├── ResourceBuilderFactoryTest.java │ │ │ └── builder │ │ │ └── SecureMondrianConnectionResourceBuilderTest.java │ ├── serverInfo │ │ └── ServerInfoServiceTest.java │ ├── settings │ │ ├── SettingsServiceTest.java │ │ └── SingleSettingsAdapterTest.java │ └── thumbnails │ │ ├── BatchThumbnailAdapterTest.java │ │ ├── SingleThumbnailAdapterTest.java │ │ └── ThumbnailsServiceTest.java │ ├── core │ ├── AnonymousSessionTest.java │ ├── AuthenticationCredentialsTest.java │ ├── JasperserverRestClientTest.java │ ├── JerseyRequestTest.java │ ├── MimeTypeUtilTest.java │ ├── RequestExecutionTest.java │ ├── RestClientConfigurationTest.java │ ├── SessionStorageTest.java │ ├── SessionTest.java │ ├── ThreadPoolUtilTest.java │ ├── exceptions │ │ └── handling │ │ │ └── JRSExceptionsMappingTest.java │ └── operationresult │ │ ├── NullEntityOperationResultTest.java │ │ ├── OperationResultFactoryImplTest.java │ │ ├── OperationResultTest.java │ │ └── WithEntityOperationResultTest.java │ └── providers │ └── CustomRepresentationTypeProviderTest.java └── resources └── url.properties /.gitignore: -------------------------------------------------------------------------------- 1 | # hidden folders 2 | .idea 3 | .svn 4 | 5 | 6 | # projects files 7 | *.iml 8 | 9 | 10 | # output directories 11 | target/ 12 | libs/ 13 | javax/ 14 | out/ 15 | build/ 16 | 17 | 18 | # OS generated files 19 | .DS_Store* 20 | ehthumbs.db 21 | Icon? 22 | Thumbs.db 23 | logs -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: 4 | - oraclejdk7 5 | 6 | notifications: 7 | email: 8 | - o.krasnianskyi@globallogic.com 9 | - igor.nesterenko@globallogic.com 10 | 11 | branches: 12 | only: 13 | - develop 14 | - master 15 | 16 | env: 17 | global: 18 | - secure: "Dwb41Mdes13RFaB9Pf4fViLVt9U0NK8EvbzrD/GcWfHjKi1GpAgQ0WyUdQSKrxLViH2OL4BqQIQmOtugkW1rNQn/Gnnb4Hu4/rZ06+tLStcvmrm9+Pph++niqzCxZe206/VwDV393UVPWtVpFtbhDTaiJOf0dP+3BX7NAzqW+JU=" 19 | 20 | after_success: 21 | - mvn clean cobertura:cobertura coveralls:cobertura 22 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 5.5.0.2-ALPHA-SNAPSHOT 2 | ---------------------- 3 | ###Features 4 | * Automatical password encryption (if encryption is on) 5 | * Added ability to get report in HTML format with all its attachments in one call. 6 | * Added builder for `ReportExecutionRequest`. 7 | * Added utils to work with input controls. 8 | 9 | ###Bug fixes 10 | * Java 6 compatibility 11 | 12 | ###Breaking changes 13 | * You shouldn't specify an encrypted password now, password is being encrypted on client side automatically 14 | 15 | 5.5.0.1-ALPHA 16 | ---------------------- 17 | 18 | ###Features 19 | * Customizable exception handling system 20 | * Ability to get an `ErrorDescriptor` from exception instance 21 | * Multitenancy support 22 | * Ability to configure to work over HTTPS 23 | * Ability to switch between JSON and XML 24 | * Asynchronous API 25 | * Logout functionality 26 | 27 | ###Bug fixes 28 | * Input controls values are not applied while scheduling the report 29 | * Job validation exception's stack trace is unclear 30 | 31 | ###Breaking changes 32 | * Removed `JobExtension` class, now you should use only `Job` for scheduling 33 | * Calendar service doesn't return `ReportJobCalendar` instance anymore, now it returns one of the implementations of `com.jaspersoft.jasperserver.jaxrs.client.dto.jobs.calendars.Calendar` 34 | -------------------------------------------------------------------------------- /README.Jenkinsfile.md: -------------------------------------------------------------------------------- 1 | # JRS java REST client build setup via pipeline 2 | 3 | ## Builds 4 | Every branch with exisiting `Jenkisfile` will be picked up by CI and built 5 | Exceptions: 6 | * branches containing `dev-` in names are built on development CI 7 | * branches containing `dev-` in names are **not** built on production CI 8 | 9 | ## Pipeline 10 | `Jenkinsfile` uses [Declarative Pipeline]( 11 | https://jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline) 12 | syntax. 13 | `rtMavenResolver`, `rtMavenDeployer`, `rtBuildInfo`, `rtMavenRun`, `rtPublishBuildInfo` and 14 | `rtAddInteractivePromotion` are declarative steps for [Jenkins Artifactory Plugin]( 15 | https://github.com/JFrog/jenkins-artifactory-plugin) and are documented in 16 | [Working With Pipeline Jobs in Jenkins](https://www.jfrog.com/confluence/display/RTF/Working+With+Pipeline+Jobs+in+Jenkins) 17 | 18 | ## Flowchart 19 | ```mermaid 20 | graph TB 21 | subgraph agent 'qaa' 22 | subgraph pipeline options, environment and tools 23 | A1[Setup pipeline] 24 | end 25 | subgraph stages 26 | subgraph stage Configure 27 | A1 --> B1["Configure (artifactory pipeline plugin)"] 28 | end 29 | subgraph stage Build 30 | B1 --> B2["Build (run Maven via artifactory pipeline plugin)"] 31 | end 32 | end 33 | subgraph Post-build 34 | subgraph success 35 | B2 --> C2[archive artifacts] 36 | C2 --> C3[publish test results] 37 | C3 --> C4[Set buildInfo and interactive promotion artifactory plugin] 38 | end 39 | A1 --> |Timeout or Error | E2 40 | subgraph always 41 | E2[Remove workspace] 42 | end 43 | C4 --> E2 44 | end 45 | end 46 | ``` 47 | -------------------------------------------------------------------------------- /Vagrant/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure(2) do |config| 2 | 3 | config.vm.box = "ubuntu/trusty64" 4 | config.vm.box_check_update = false 5 | 6 | config.vm.network "forwarded_port", guest: 8080, host: 8090 7 | config.vm.network "forwarded_port", guest: 5432, host: 5430 8 | 9 | config.vm.provider "virtualbox" do |vb| 10 | vb.gui = true 11 | vb.memory = "2048" 12 | end 13 | 14 | config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" 15 | 16 | config.vm.provision :shell do |sh| 17 | sh.path = "bootstrap.sh" 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /Vagrant/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo apt-get update 4 | 5 | sudo apt-get install python-software-properties 6 | sudo add-apt-repository ppa:webupd8team/java 7 | sudo apt-get update 8 | 9 | sudo echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | \ 10 | sudo /usr/bin/debconf-set-selections 11 | sudo apt-get install oracle-java7-installer -y 12 | sudo apt-get install oracle-java7-set-default 13 | 14 | yes | sudo apt-get install python-pip python-dev build-essential python-setuptools 15 | sudo pip install --upgrade pip 16 | sudo pip install --upgrade virtualenv 17 | sudo pip install paramiko PyYAML Jinja2 httplib2 six 18 | 19 | if [ $(dpkg-query -W -f='${Status}' ansible 2>/dev/null | grep -c "ok installed") -eq 0 ]; 20 | then 21 | echo "Add APT repositories" 22 | export DEBIAN_FRONTEND=noninteractive 23 | apt-get install -qq software-properties-common &> /dev/null || exit 1 24 | apt-add-repository ppa:ansible/ansible &> /dev/null || exit 1 25 | 26 | apt-get update -qq 27 | 28 | echo "Installing Ansible" 29 | apt-get install -qq ansible &> /dev/null || exit 1 30 | echo "Ansible installed" 31 | fi 32 | 33 | sudo apt-get install unzip 34 | 35 | echo "Running Ansible" 36 | bash -c "ansible-playbook /vagrant/playbook.yml --connection=local" 37 | -------------------------------------------------------------------------------- /Vagrant/playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | remote_user: vagrant 4 | tasks: 5 | - name: download Jasper Server 6 | get_url: 7 | url=http://sourceforge.net/projects/jasperserver/files/JasperServer/JasperReports%20Server%20Community%20Edition%206.1.0/jasperreports-server-cp-6.1.0-linux-x64-installer.run 8 | dest=/home/vagrant/jasperreports-server-cp-6.1.0-linux-x64-installer.run 9 | mode=755 10 | - name: setup Jasper Server 11 | shell: printf '\n\n\n\ny\n\n/home/vagrant/jrs/\n\nn\nn\n' | ./jasperreports-server-cp-6.1.0-linux-x64-installer.run 12 | args: 13 | chdir: /home/vagrant/ 14 | creates: /home/vagrant/jrs/ 15 | - name: run Jasper Server 16 | command: sh /home/vagrant/jrs/ctlscript.sh start 17 | sudo: yes 18 | - name: download jrsh 19 | get_url: 20 | url=http://github.com/Jaspersoft/jrsh/archive/master.zip 21 | dest=/home/vagrant/master.zip 22 | mode=755 23 | - name: setup jrsh 24 | unarchive: 25 | src=/home/vagrant/master.zip 26 | dest=/home/vagrant/ 27 | copy=no -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | # http://www.jaspersoft.com. 4 | # 5 | # Unless you have purchased a commercial license agreement from Jaspersoft, 6 | # the following license terms apply: 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU Affero General Public License as 10 | # published by the Free Software Foundation, either version 3 of the 11 | # License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU Affero General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU Affero General Public License 19 | # along with this program.  If not, see . 20 | # 21 | 22 | Vagrant.configure(2) do |config| 23 | 24 | config.vm.box = "JasperSoft/JasperServer6.1.0" 25 | config.vm.box_check_update = true 26 | config.ssh.pty = true 27 | 28 | config.vm.network "forwarded_port", guest: 8080, host: 8090 29 | config.vm.network "forwarded_port", guest: 5432, host: 5430 30 | 31 | config.vm.provision "shell", inline: "/bin/sh /home/vagrant/jrs/ctlscript.sh start" 32 | 33 | end 34 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/AbstractAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters; 22 | 23 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 24 | 25 | public abstract class AbstractAdapter { 26 | protected final SessionStorage sessionStorage; 27 | 28 | public AbstractAdapter(SessionStorage sessionStorage) { 29 | if (sessionStorage == null ) { 30 | throw new IllegalArgumentException("SessionStorage is null, adapter can not be initialized."); 31 | } 32 | this.sessionStorage = sessionStorage; 33 | } 34 | 35 | /** 36 | * This getter is used for testing needs only 37 | */ 38 | public SessionStorage getSessionStorage() { 39 | return sessionStorage; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/adhoc/queryexecution/QueryExecutionHelper.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.adhoc.queryexecution; 2 | 3 | import com.jaspersoft.jasperserver.dto.executions.AbstractClientExecution; 4 | import com.jaspersoft.jasperserver.dto.executions.ClientMultiAxisQueryExecution; 5 | import com.jaspersoft.jasperserver.dto.executions.ClientMultiLevelQueryExecution; 6 | import com.jaspersoft.jasperserver.dto.executions.ClientProvidedQueryExecution; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | import static com.jaspersoft.jasperserver.dto.executions.QueryExecutionsMediaType.EXECUTION_MULTI_LEVEL_QUERY_JSON; 12 | import static com.jaspersoft.jasperserver.dto.executions.QueryExecutionsMediaType.EXECUTION_MULTI_AXIS_QUERY_JSON; 13 | import static com.jaspersoft.jasperserver.dto.executions.QueryExecutionsMediaType.EXECUTION_PROVIDED_QUERY_JSON; 14 | 15 | public class QueryExecutionHelper { 16 | 17 | private static Map> mediaTypeWithExecutionClassInfo = 18 | new HashMap>(){{ 19 | put(EXECUTION_MULTI_LEVEL_QUERY_JSON, ClientMultiLevelQueryExecution.class); 20 | put(EXECUTION_MULTI_AXIS_QUERY_JSON, ClientMultiAxisQueryExecution.class); 21 | put(EXECUTION_PROVIDED_QUERY_JSON, ClientProvidedQueryExecution.class); 22 | }}; 23 | 24 | public static Class getClassForMime(String mime) { 25 | for (Map.Entry> entry : 26 | mediaTypeWithExecutionClassInfo.entrySet()) { 27 | if (entry.getKey().equalsIgnoreCase(mime)) { 28 | return entry.getValue(); 29 | } 30 | } 31 | return null; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/adhoc/queryexecution/QueryResultDataHelper.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.adhoc.queryexecution; 2 | 3 | import com.jaspersoft.jasperserver.dto.executions.ClientFlatQueryResultData; 4 | import com.jaspersoft.jasperserver.dto.executions.ClientMultiAxisQueryResultData; 5 | import com.jaspersoft.jasperserver.dto.executions.ClientMultiLevelQueryResultData; 6 | import com.jaspersoft.jasperserver.dto.executions.ClientQueryResultData; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | import static com.jaspersoft.jasperserver.dto.executions.QueryResultDataMediaType.FLAT_DATA_JSON; 12 | import static com.jaspersoft.jasperserver.dto.executions.QueryResultDataMediaType.MULTI_AXIS_DATA_JSON; 13 | import static com.jaspersoft.jasperserver.dto.executions.QueryResultDataMediaType.MULTI_LEVEL_DATA_JSON; 14 | 15 | public class QueryResultDataHelper { 16 | 17 | private static Map> mediaTypeWithResultDataClassInfo = 18 | new HashMap>(){{ 19 | put(FLAT_DATA_JSON, ClientFlatQueryResultData.class); 20 | put(MULTI_LEVEL_DATA_JSON, ClientMultiLevelQueryResultData.class); 21 | put(MULTI_AXIS_DATA_JSON, ClientMultiAxisQueryResultData.class); 22 | }}; 23 | 24 | public static Class getResultDataType(String access) { 25 | for (Map.Entry> entry : 26 | mediaTypeWithResultDataClassInfo.entrySet()) { 27 | if (entry.getKey().equalsIgnoreCase(access)) { 28 | return entry.getValue(); 29 | } 30 | } 31 | return null; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/alerting/calendar/CalendarParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.alerting.calendar; 23 | 24 | public enum CalendarParameter { 25 | 26 | /** 27 | * If true, any calendar existing in the JobStore with the same name should be 28 | * over-written. 29 | */ 30 | REPLACE("replace"), 31 | 32 | /** 33 | * whether or not inFolder update existing triggers that referenced the already 34 | * existing calendar so that they are 'correct' based on the new trigger. 35 | */ 36 | UPDATE_TRIGGERS("updateTriggers"); 37 | 38 | private String name; 39 | 40 | private CalendarParameter(String name){ 41 | this.name = name; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/alerting/calendar/CalendarType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.alerting.calendar; 23 | 24 | public enum CalendarType { 25 | 26 | annual, 27 | base, 28 | cron, 29 | daily, 30 | holiday, 31 | monthly, 32 | weekly 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/attributes/AttributesGroupParameter.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.attributes; 2 | 3 | /** 4 | *

5 | *

6 | * 7 | * @author tetiana.iefimenko 8 | * @version $Id$ 9 | * @see 10 | */ 11 | public enum AttributesGroupParameter { 12 | 13 | /** 14 | * Custom attributes(doesn't affect on server). 15 | */ 16 | CUSTOM("custom"), 17 | 18 | /** 19 | * Logger specific attributes. 20 | */ 21 | LOG4J("log4j"), 22 | 23 | /** 24 | * Server attributes that make affect on Mondrian engine. 25 | * 26 | */ 27 | MONDRIAN("mondrian"), 28 | 29 | /** 30 | * AWS specific server attributes. 31 | */ 32 | AWS("aws"), 33 | 34 | /** 35 | * JDBC drivers specific attributes. 36 | */ 37 | JDBC("jdbc"), 38 | 39 | /** 40 | * AdHoc specific attributes. 41 | */ 42 | ADHOC("adhoc"), 43 | 44 | /** 45 | * Profiling attributes. 46 | */ 47 | JI("ji"), 48 | 49 | /** 50 | * Updated server settings(changed log4j, mondrian, aws, jdbc, adhoc, ji server setting). 51 | */ 52 | CUSTOM_SERVER_SETTINGS("customServerSettings"); 53 | 54 | private String name; 55 | 56 | AttributesGroupParameter(String name) { 57 | this.name = name; 58 | } 59 | 60 | public String getName() { 61 | return name; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/attributes/AttributesSearchParameter.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.attributes; 2 | 3 | /** 4 | *

5 | *

6 | * 7 | * @author tetiana.iefimenko 8 | * @version $Id$ 9 | * @see 10 | */ 11 | public enum AttributesSearchParameter { 12 | /** 13 | * Represent the target holder, attributes should be fetched from. 14 | */ 15 | HOLDER("holder"), 16 | 17 | /** 18 | * name of the attribute 19 | */ 20 | NAME("name"), 21 | 22 | /** 23 | * Attribute group: 24 | * 25 | * custom - custom attributes(doesn't affect on server) 26 | * log4j - logger specific attributes 27 | * mondrian - server attributes that make affect on Mondrian engine 28 | * aws - aws specific server attributes 29 | * jdbc - jdbc drivers specific attributes 30 | * adhoc - adhoc specific attributes 31 | * ji - profiling attributes 32 | * customServerSettings - updated server settings(changed log4j, mondrian, aws, jdbc, adhoc, ji server setting) 33 | 34 | * default value is null 35 | */ 36 | GROUP("group"), 37 | 38 | /** 39 | * Flag indicates if attributes will be fetched also from lower level. 40 | * 41 | * Default value is true 42 | */ 43 | RECURSIVE("recursive"), 44 | 45 | /** 46 | * Flag indicates if search should include also higher level attributes, relatively to target holder. 47 | */ 48 | INCLUDE_INHERITED("includeInherited"), 49 | 50 | /** 51 | * Pagination. Start index for requested pate. 52 | */ 53 | OFFSET("offset"), 54 | 55 | /** 56 | * Pagination. Resources count per page 57 | */ 58 | LIMIT("limit");// @QueryParam("_embedded") String embedded, 59 | 60 | private String name; 61 | 62 | AttributesSearchParameter(String name) { 63 | this.name = name; 64 | } 65 | 66 | public String getName() { 67 | return name; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/authority/organizations/OrganizationsService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.authority.organizations; 22 | 23 | import com.jaspersoft.jasperserver.dto.authority.ClientTenant; 24 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 25 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 26 | 27 | public class OrganizationsService extends AbstractAdapter { 28 | 29 | public OrganizationsService(SessionStorage sessionStorage) { 30 | super(sessionStorage); 31 | } 32 | 33 | public SingleOrganizationAdapter organization(ClientTenant organization) { 34 | if (organization != null && ((organization.getAlias() != null && !organization.getAlias().isEmpty()) 35 | || (organization.getId() != null && !organization.getId().isEmpty()))) { 36 | return new SingleOrganizationAdapter(sessionStorage, organization); 37 | } 38 | throw new IllegalArgumentException("Organization is not valid."); 39 | } 40 | 41 | public SingleOrganizationAdapter organization(String organizationId) { 42 | return this.organization(new ClientTenant().setId(organizationId)); 43 | } 44 | 45 | public BatchOrganizationsAdapter allOrganizations() { 46 | return new BatchOrganizationsAdapter(sessionStorage); 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/authority/roles/RolesParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.authority.roles; 23 | 24 | public enum RolesParameter { 25 | 26 | /** 27 | * If false, returns all roles of users, set by "user" param, 28 | * otherwise returns only roles, which owned by all set users. 29 | * 30 | * By default it's false. 31 | */ 32 | HAS_ALL_USERS("hasAllUsers"), 33 | 34 | /** 35 | * Describes, will service retrieve roles of sub organizations. 36 | * If false, roles of exactly set organization will be retrieved. 37 | * Is true by default. 38 | */ 39 | INCLUDE_SUB_ORGS("includeSubOrgs"), 40 | 41 | /** 42 | * Returns roles of user, can be set multiple times. 43 | */ 44 | USER("user"), 45 | 46 | OFFSET("offset"), 47 | 48 | LIMIT("limit"), 49 | 50 | Q("q") 51 | ; 52 | 53 | private String paramName; 54 | 55 | private RolesParameter(String paramName){ 56 | this.paramName = paramName; 57 | } 58 | 59 | public String getParamName() { 60 | return paramName; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/authority/roles/RolesService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.authority.roles; 23 | 24 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 25 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 26 | 27 | public class RolesService extends AbstractAdapter { 28 | 29 | private String organizationId; 30 | 31 | public RolesService(SessionStorage sessionStorage) { 32 | super(sessionStorage); 33 | } 34 | 35 | public SingleRoleRequestAdapter roleName(String rolename) { 36 | if ("".equals(rolename) || "/".equals(rolename)) { 37 | throw new IllegalArgumentException("'roleName' mustn't be an empty string"); 38 | } 39 | return new SingleRoleRequestAdapter(sessionStorage, organizationId, rolename); 40 | } 41 | 42 | public BatchRolesRequestAdapter allRoles() { 43 | return new BatchRolesRequestAdapter(sessionStorage, organizationId); 44 | } 45 | 46 | public RolesService organization(String organizationId) { 47 | if ("".equals(organizationId) || "/".equals(organizationId)) { 48 | throw new IllegalArgumentException("'organizationId' mustn't be an empty string"); 49 | } 50 | this.organizationId = organizationId; 51 | return this; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/authority/users/UsersAttributesParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.authority.users; 22 | 23 | public enum UsersAttributesParameter { 24 | 25 | NAME("name"); 26 | 27 | private String paramName; 28 | 29 | private UsersAttributesParameter(String paramName){ 30 | this.paramName = paramName; 31 | } 32 | 33 | public String getParamName() { 34 | return paramName; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/context/ContextService.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.context; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 4 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 5 | 6 | /** 7 | *

8 | *

9 | * 10 | * @author tetiana.iefimenko 11 | * @version $Id$ 12 | * @see 13 | */ 14 | public class ContextService extends AbstractAdapter { 15 | 16 | public ContextService(SessionStorage sessionStorage) { 17 | super(sessionStorage); 18 | } 19 | public SingleContextAdapter context(Class contextClass, String contextMimeType) { 20 | return new SingleContextAdapter(sessionStorage, contextClass, contextMimeType); 21 | } 22 | 23 | public SingleContextAdapter context(Class contextClass, String contextMimeType, String uuId) { 24 | return new SingleContextAdapter(sessionStorage, contextClass, contextMimeType, uuId); 25 | } 26 | 27 | public SingleContextAdapter context(String uuId, Class metadataClass, String metadataMimeType) { 28 | return new SingleContextAdapter(sessionStorage, uuId, metadataClass, metadataMimeType); 29 | } 30 | 31 | public SingleContextAdapter context(Class context, String contextMimeType, 32 | Class metadataClass, 33 | String metadataMimeType) { 34 | return new SingleContextAdapter(sessionStorage, context, contextMimeType, metadataClass, metadataMimeType); 35 | } 36 | 37 | public SingleContextAdapter context(String uuId) { 38 | return new SingleContextAdapter(sessionStorage, uuId); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/context/domain/DomainContextService.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.context.domain; 2 | 3 | import com.jaspersoft.jasperserver.dto.resources.ClientResourceLookup; 4 | import com.jaspersoft.jasperserver.dto.resources.ClientSemanticLayerDataSource; 5 | import com.jaspersoft.jasperserver.dto.resources.domain.ClientDomain; 6 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 7 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 8 | import com.jaspersoft.jasperserver.jaxrs.client.core.enums.ContextMediaTypes; 9 | 10 | /** 11 | *

12 | *

13 | * 14 | * @author tetiana.iefimenko 15 | * @version $Id$ 16 | * @see 17 | */ 18 | public class DomainContextService extends AbstractAdapter { 19 | 20 | public DomainContextService(SessionStorage sessionStorage) { 21 | super(sessionStorage); 22 | } 23 | 24 | public SingleDomainContextAdapter context(String contextUri) { 25 | return new SingleDomainContextAdapter<>(sessionStorage, 26 | new ClientResourceLookup().setUri(contextUri), 27 | ClientResourceLookup.class, 28 | ContextMediaTypes.RESOURCE_LOOKUP_JSON); 29 | } 30 | 31 | public SingleDomainContextAdapter context(ClientDomain context) { 32 | return new SingleDomainContextAdapter<>(sessionStorage, 33 | context, 34 | ClientDomain.class, 35 | ContextMediaTypes.DOMAIN_JSON); 36 | } 37 | 38 | public SingleDomainContextAdapter context(ClientSemanticLayerDataSource context) { 39 | return new SingleDomainContextAdapter(sessionStorage, 40 | context, 41 | ClientSemanticLayerDataSource.class, 42 | ContextMediaTypes.DOMAIN_DATA_SOURCE_JSON); 43 | } 44 | 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/dashboard/DashboardsAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.dashboard; 23 | 24 | import com.jaspersoft.jasperserver.dto.dashboard.DashboardExportExecution; 25 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 26 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 27 | 28 | public class DashboardsAdapter extends AbstractAdapter { 29 | 30 | private final String dashboardUri; 31 | 32 | public DashboardsAdapter(SessionStorage sessionStorage, String dashboardUri) { 33 | super(sessionStorage); 34 | this.dashboardUri = dashboardUri; 35 | } 36 | 37 | public RunDashboardsAdapter prepareForRun(DashboardExportExecution.ExportFormat format) { 38 | return new RunDashboardsAdapter(sessionStorage, dashboardUri, format.toString()); 39 | } 40 | 41 | public RunDashboardsAdapter prepareForRun(String format) { 42 | return new RunDashboardsAdapter(sessionStorage, dashboardUri, format); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/datadiscovery/DataDiscoveryService.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.datadiscovery; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 4 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 5 | 6 | /** 7 | *

8 | *

9 | * 10 | * @author tetiana.iefimenko 11 | * @version $Id$ 12 | * @see 13 | */ 14 | public class DataDiscoveryService extends AbstractAdapter { 15 | 16 | public DataDiscoveryService(SessionStorage sessionStorage) { 17 | super(sessionStorage); 18 | } 19 | 20 | public DomainContextManager domainContext() { 21 | return new DomainContextManager(sessionStorage); 22 | } 23 | 24 | public TopicContextManager topicContext() { 25 | return new TopicContextManager(sessionStorage); 26 | } 27 | 28 | public DomElContextManager domElContext() { 29 | return new DomElContextManager(sessionStorage); 30 | } 31 | 32 | public DerivedTableContextManager derivedTableContext() { 33 | return new DerivedTableContextManager(sessionStorage); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/datadiscovery/DerivedTableContextManager.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.datadiscovery; 2 | 3 | import com.jaspersoft.jasperserver.dto.resources.SqlExecutionRequest; 4 | import com.jaspersoft.jasperserver.dto.resources.domain.PresentationGroupElement; 5 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 6 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.context.ContextService; 7 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 8 | import com.jaspersoft.jasperserver.jaxrs.client.core.enums.ContextMediaTypes; 9 | import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult; 10 | 11 | /** 12 | *

13 | *

14 | * 15 | * @author tetiana.iefimenko 16 | * @version $Id$ 17 | * @see 18 | */ 19 | public class DerivedTableContextManager extends AbstractAdapter { 20 | 21 | public DerivedTableContextManager(SessionStorage sessionStorage) { 22 | super(sessionStorage); 23 | } 24 | 25 | public OperationResult execute(SqlExecutionRequest sqlExecutionRequest) { 26 | return new ContextService(sessionStorage). 27 | context(SqlExecutionRequest.class, 28 | ContextMediaTypes.SQL_EXECUTION_JSON, 29 | PresentationGroupElement.class, 30 | ContextMediaTypes.DATASET_METADATA_JSON). 31 | createAndGetMetadata(sqlExecutionRequest); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/datadiscovery/DomElContextManager.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.datadiscovery; 2 | 3 | import com.jaspersoft.jasperserver.dto.domain.DomElExpressionCollectionContext; 4 | import com.jaspersoft.jasperserver.dto.domain.DomElExpressionContext; 5 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 6 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.context.ContextService; 7 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 8 | import com.jaspersoft.jasperserver.jaxrs.client.core.enums.ContextMediaTypes; 9 | import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult; 10 | 11 | /** 12 | *

13 | *

14 | * 15 | * @author tetiana.iefimenko 16 | * @version $Id$ 17 | * @see 18 | */ 19 | public class DomElContextManager extends AbstractAdapter { 20 | 21 | public DomElContextManager(SessionStorage sessionStorage) { 22 | super(sessionStorage); 23 | } 24 | 25 | public OperationResult create(DomElExpressionContext expressionContext) { 26 | return new ContextService(sessionStorage). 27 | context(DomElExpressionContext.class, ContextMediaTypes.DOM_EL_CONTEXT_JSON). 28 | create(expressionContext); 29 | } 30 | 31 | public OperationResult create(DomElExpressionCollectionContext expressionCollectionContext) { 32 | return new ContextService(sessionStorage). 33 | context(DomElExpressionCollectionContext.class, 34 | ContextMediaTypes.DOM_EL_COLLECTION_CONTEXT_JSON). 35 | create(expressionCollectionContext); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/datadiscovery/DomainContextManager.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.datadiscovery; 2 | 3 | import com.jaspersoft.jasperserver.dto.resources.domain.ClientDomain; 4 | import com.jaspersoft.jasperserver.dto.resources.domain.PresentationGroupElement; 5 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.context.ContextService; 6 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 7 | import com.jaspersoft.jasperserver.jaxrs.client.core.enums.ContextMediaTypes; 8 | import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult; 9 | 10 | /** 11 | *

12 | *

13 | * 14 | * @author tetiana.iefimenko 15 | * @version $Id$ 16 | * @see 17 | */ 18 | public class DomainContextManager { 19 | private SessionStorage sessionStorage; 20 | public DomainContextManager(SessionStorage sessionStorage) { 21 | this.sessionStorage = sessionStorage; 22 | } 23 | 24 | public OperationResult create(ClientDomain domain) { 25 | return new ContextService(sessionStorage). 26 | context(ClientDomain.class, ContextMediaTypes.DOMAIN_JSON). 27 | create(domain); 28 | } 29 | 30 | public OperationResult fetchMetadataById(String id) { 31 | return new ContextService(sessionStorage).context(id, 32 | PresentationGroupElement.class, 33 | ContextMediaTypes.DOMAIN_METADATA_JSON). 34 | metadata(); 35 | } 36 | 37 | public OperationResult fetchMetadataByContext(ClientDomain domain) { 38 | return new ContextService(sessionStorage). 39 | context(ClientDomain.class, 40 | ContextMediaTypes.DOMAIN_JSON, 41 | PresentationGroupElement.class, 42 | ContextMediaTypes.DOMAIN_METADATA_JSON). 43 | createAndGetMetadata(domain); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/datadiscovery/TopicContextManager.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.datadiscovery; 2 | 3 | import com.jaspersoft.jasperserver.dto.resources.ClientReportUnit; 4 | import com.jaspersoft.jasperserver.dto.resources.domain.ResourceGroupElement; 5 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.context.ContextService; 6 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 7 | import com.jaspersoft.jasperserver.jaxrs.client.core.enums.ContextMediaTypes; 8 | import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult; 9 | 10 | /** 11 | *

12 | *

13 | * 14 | * @author tetiana.iefimenko 15 | * @version $Id$ 16 | * @see 17 | */ 18 | public class TopicContextManager { 19 | private SessionStorage sessionStorage; 20 | public TopicContextManager(SessionStorage sessionStorage) { 21 | this.sessionStorage = sessionStorage; 22 | } 23 | 24 | public OperationResult create(ClientReportUnit reportUnit) { 25 | return new ContextService(sessionStorage). 26 | context(ClientReportUnit.class, 27 | ContextMediaTypes.REPORT_UNIT_JSON). 28 | create(reportUnit); 29 | } 30 | 31 | public OperationResult fetchMetadataById(String id) { 32 | return new ContextService(sessionStorage). 33 | context(id, 34 | ResourceGroupElement.class, 35 | ContextMediaTypes.REPORT_UNIT_METADATA_JSON). 36 | metadata(); 37 | } 38 | 39 | public OperationResult fetchMetadataByContext(ClientReportUnit reportUnit) { 40 | return new ContextService(sessionStorage). 41 | context(ClientReportUnit.class, 42 | ContextMediaTypes.REPORT_UNIT_JSON, 43 | ResourceGroupElement.class, 44 | ContextMediaTypes.REPORT_UNIT_METADATA_JSON). 45 | createAndGetMetadata(reportUnit); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/diagnostic/BatchDiagnosticCollectorsAdapter.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.diagnostic; 2 | 3 | import com.jaspersoft.jasperserver.dto.common.PatchDescriptor; 4 | import com.jaspersoft.jasperserver.dto.logcapture.CollectorSettingsList; 5 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 6 | import com.jaspersoft.jasperserver.jaxrs.client.core.JerseyRequest; 7 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 8 | import com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.handling.DefaultErrorHandler; 9 | import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult; 10 | import java.io.InputStream; 11 | 12 | /** 13 | *

14 | *

15 | * 16 | * @author tetiana.iefimenko 17 | * @version $Id$ 18 | * @see 19 | */ 20 | public class BatchDiagnosticCollectorsAdapter extends AbstractAdapter { 21 | public BatchDiagnosticCollectorsAdapter(SessionStorage sessionStorage) { 22 | super(sessionStorage); 23 | } 24 | 25 | public OperationResult collectorsSettings() { 26 | return buildRequest().get(); 27 | } 28 | 29 | 30 | public OperationResult collectorsContent() { 31 | JerseyRequest request = JerseyRequest.buildRequest(sessionStorage, 32 | InputStream.class, 33 | new String[]{"diagnostic", "collectors", "content"}, 34 | new DefaultErrorHandler()); 35 | request.setAccept("application/zip"); 36 | return request.get(); 37 | } 38 | 39 | public OperationResult delete() { 40 | 41 | return buildRequest().delete(); 42 | } 43 | 44 | public OperationResult updateCollectorsSettings(PatchDescriptor newData) { 45 | return buildRequest() 46 | .addHeader("X-HTTP-Method-Override", "PATCH") 47 | .post(newData); 48 | } 49 | 50 | 51 | protected JerseyRequest buildRequest() { 52 | return JerseyRequest.buildRequest(sessionStorage, 53 | CollectorSettingsList.class, 54 | new String[]{"diagnostic", "collectors"}, 55 | new DefaultErrorHandler()); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/diagnostic/DiagnosticService.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.diagnostic; 2 | 3 | import com.jaspersoft.jasperserver.dto.logcapture.CollectorSettings; 4 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 5 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 6 | import com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.MandatoryParameterNotFoundException; 7 | 8 | /** 9 | *

10 | *

11 | * 12 | * @author tetiana.iefimenko 13 | * @version $Id$ 14 | * @see 15 | */ 16 | public class DiagnosticService extends AbstractAdapter { 17 | 18 | public DiagnosticService(SessionStorage sessionStorage) { 19 | super(sessionStorage); 20 | } 21 | 22 | public SingleDiagnosticCollectorAdapter forCollector(CollectorSettings collector) { 23 | if (collector == null) { 24 | throw new MandatoryParameterNotFoundException("Collector must not be null"); 25 | } 26 | return new SingleDiagnosticCollectorAdapter(sessionStorage, collector); 27 | } 28 | 29 | public SingleDiagnosticCollectorAdapter forCollector(String collectorId) { 30 | if (collectorId == null || "".equals(collectorId)) { 31 | throw new MandatoryParameterNotFoundException("Collector's ID is not valid"); 32 | } 33 | CollectorSettings collectorSettings = new CollectorSettings(); 34 | collectorSettings.setId(collectorId); 35 | return this.forCollector(collectorSettings); 36 | } 37 | 38 | 39 | public BatchDiagnosticCollectorsAdapter allCollectors() { 40 | return new BatchDiagnosticCollectorsAdapter(sessionStorage); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/domain/DomainService.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.domain; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 4 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.domain.metadata.DomainMetadataAdapter; 5 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.domain.newDomain.DomainAdapter; 6 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.domain.schema.DomainSchemaAdapter; 7 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 8 | import com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.MandatoryParameterNotFoundException; 9 | 10 | /** 11 | *

12 | *

13 | * 14 | * @author tetiana.iefimenko 15 | * @version $Id$ 16 | * @see 17 | */ 18 | public class DomainService extends AbstractAdapter { 19 | private String uri; 20 | 21 | public DomainService(SessionStorage sessionStorage) { 22 | super(sessionStorage); 23 | } 24 | 25 | public DomainService forDomain(String uri) { 26 | if (uri == null) { 27 | throw new MandatoryParameterNotFoundException("URI must be specified"); 28 | } 29 | this.uri = uri; 30 | return this; 31 | } 32 | 33 | public DomainAdapter domain(String uri) { 34 | if (uri == null) { 35 | throw new MandatoryParameterNotFoundException("URI must be specified"); 36 | } 37 | return new DomainAdapter(sessionStorage, uri); 38 | } 39 | 40 | public DomainMetadataAdapter metadata() { 41 | return new DomainMetadataAdapter(sessionStorage, uri); 42 | } 43 | 44 | public DomainSchemaAdapter schema() { 45 | return new DomainSchemaAdapter(sessionStorage, uri); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/importexport/exportservice/ExportService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.importexport.exportservice; 22 | 23 | import com.jaspersoft.jasperserver.dto.importexport.ExportTask; 24 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 25 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 26 | 27 | public class ExportService extends AbstractAdapter { 28 | 29 | public ExportService(SessionStorage sessionStorage) { 30 | super(sessionStorage); 31 | } 32 | 33 | public ExportRequestAdapter newTask(ExportTask exportTask) { 34 | return new ExportRequestAdapter(sessionStorage, exportTask); 35 | } 36 | 37 | public ExportRequestAdapter task(String taskId) { 38 | if ("".equals(taskId) || "/".equals(taskId)) { 39 | throw new IllegalArgumentException("'taskId' mustn't be an empty string"); 40 | } 41 | return new ExportRequestAdapter(sessionStorage, taskId); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/importexport/importservice/BrokenDependenciesParameter.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.importexport.importservice; 2 | 3 | /** 4 | * @author Tetiana Iefimenko 5 | * @version 6 | * @see 7 | */ 8 | public enum BrokenDependenciesParameter { 9 | 10 | /** 11 | * Server will give an error (errorCode=import.broken.dependencies) if import archive contain broken dependent resources. 12 | */ 13 | FAIL("fail"), 14 | 15 | /** 16 | * Import will skip from import broken resources. 17 | */ 18 | SKIP("skip"), 19 | 20 | /** 21 | * Import will proceed with broken dependencies. 22 | */ 23 | INCLUDE("include"); 24 | 25 | private String valueName; 26 | 27 | private BrokenDependenciesParameter(String valueName){ 28 | this.valueName = valueName; 29 | } 30 | 31 | public String getValueName() { 32 | return valueName; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/importexport/importservice/ImportService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.importexport.importservice; 22 | 23 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 24 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 25 | 26 | import java.io.File; 27 | 28 | public class ImportService extends AbstractAdapter { 29 | 30 | public ImportService(SessionStorage sessionStorage) { 31 | super(sessionStorage); 32 | } 33 | 34 | public ImportRequestAdapter newImport(File file) { 35 | return new ImportRequestAdapter(sessionStorage, file, false); 36 | } 37 | 38 | public ImportRequestAdapter newImport(String pathToFile) { 39 | return new ImportRequestAdapter(sessionStorage, new File(pathToFile), false); 40 | } 41 | 42 | public ImportRequestAdapter newMultiPartImport(File file) { 43 | return new ImportRequestAdapter(sessionStorage, file, true); 44 | } 45 | 46 | public ImportRequestAdapter task(String taskId) { 47 | if ("".equals(taskId) || "/".equals(taskId)) { 48 | throw new IllegalArgumentException("'taskId' mustn't be an empty string"); 49 | } 50 | return new ImportRequestAdapter(sessionStorage, taskId); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/inputControls/InputControlsService.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.inputControls; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 4 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 5 | 6 | /** 7 | * @author Tetiana Iefimenko 8 | */ 9 | public class InputControlsService extends AbstractAdapter { 10 | 11 | public InputControlsService(SessionStorage sessionStorage) { 12 | super(sessionStorage); 13 | } 14 | 15 | public InputControlsAdapter inputControls() { 16 | return new InputControlsAdapter (sessionStorage); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/jobs/calendar/CalendarParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.jobs.calendar; 23 | 24 | public enum CalendarParameter { 25 | 26 | /** 27 | * If true, any calendar existing in the JobStore with the same name should be 28 | * over-written. 29 | */ 30 | REPLACE("replace"), 31 | 32 | /** 33 | * whether or not inFolder update existing triggers that referenced the already 34 | * existing calendar so that they are 'correct' based on the new trigger. 35 | */ 36 | UPDATE_TRIGGERS("updateTriggers"); 37 | 38 | private String name; 39 | 40 | private CalendarParameter(String name){ 41 | this.name = name; 42 | } 43 | 44 | public String getName() { 45 | return name; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/jobs/calendar/CalendarType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.jobs.calendar; 23 | 24 | public enum CalendarType { 25 | 26 | annual, 27 | base, 28 | cron, 29 | daily, 30 | holiday, 31 | monthly, 32 | weekly 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/permissions/PermissionMask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.permissions; 22 | 23 | public final class PermissionMask { 24 | public static final int NO_ACCESS = 0; 25 | public static final int ADMINISTER = 1; 26 | public static final int READ_ONLY = 2; 27 | public static final int READ_WRITE = 6; 28 | public static final int READ_DELETE = 18; 29 | public static final int READ_WRITE_DELETE = 30; 30 | public static final int EXECUTE = 32; 31 | 32 | private PermissionMask(){ 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/permissions/PermissionRecipient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.permissions; 22 | 23 | public enum PermissionRecipient { 24 | 25 | USER("user"), 26 | ROLE("role"); 27 | 28 | private String protocol; 29 | 30 | private PermissionRecipient(String protocol){ 31 | this.protocol = protocol; 32 | } 33 | 34 | public String getProtocol() { 35 | return protocol; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/query/QueryExecutorService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.query; 22 | 23 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 24 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 25 | import com.jaspersoft.jasperserver.jaxrs.client.dto.query.Query; 26 | 27 | /** 28 | * @deprecated proposal. Replaced by {@link com.jaspersoft.jasperserver.jaxrs.client.apiadapters.adhoc.queryexecution.QueryExecutionService} 29 | */ 30 | public class QueryExecutorService extends AbstractAdapter { 31 | 32 | public QueryExecutorService(SessionStorage sessionStorage) { 33 | super(sessionStorage); 34 | } 35 | 36 | public QueryExecutorAdapter query(Query query, String resourceURI) { 37 | return new QueryExecutorAdapter(sessionStorage, query, resourceURI); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/reporting/ReportingService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting; 23 | 24 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 25 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting.reportexecution.ReportExecutionAdapter; 26 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 27 | import com.jaspersoft.jasperserver.jaxrs.client.dto.reports.ReportExecutionRequest; 28 | 29 | public class ReportingService extends AbstractAdapter { 30 | 31 | public ReportingService(SessionStorage sessionStorage) { 32 | super(sessionStorage); 33 | } 34 | 35 | public ReportsAdapter report(String reportUnitUri) { 36 | return new ReportsAdapter(sessionStorage, reportUnitUri); 37 | } 38 | 39 | public ReportExecutionAdapter reportExecutions() { 40 | return new ReportExecutionAdapter(sessionStorage); 41 | } 42 | 43 | public ReportExecutionAdapter reportExecution(ReportExecutionRequest reportExecution) { 44 | return new ReportExecutionAdapter(sessionStorage, reportExecution); 45 | } 46 | 47 | public ReportExecutionAdapter reportExecution(String executionId) { 48 | return new ReportExecutionAdapter(sessionStorage, executionId); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/reporting/reportoptions/ReportOptionsUtil.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting.reportoptions; 2 | 3 | import com.jaspersoft.jasperserver.dto.reports.ReportParameter; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import javax.ws.rs.core.MultivaluedHashMap; 7 | import javax.ws.rs.core.MultivaluedMap; 8 | 9 | /** 10 | *

11 | *

12 | * 13 | * @author tetiana.iefimenko 14 | * @version $Id$ 15 | * @see 16 | */ 17 | public class ReportOptionsUtil { 18 | 19 | public static MultivaluedHashMap toMap(List reportParameters) { 20 | 21 | final MultivaluedHashMap reportOptions = new MultivaluedHashMap<>(); 22 | 23 | for (ReportParameter reportParameter : reportParameters) { 24 | reportOptions.addAll(reportParameter.getName(), reportParameter.getValues()); 25 | } 26 | return reportOptions; 27 | } 28 | 29 | public static List toReportParameters(MultivaluedMap params){ 30 | 31 | List parameters = new ArrayList(); 32 | 33 | for (MultivaluedMap.Entry> entry : params.entrySet()){ 34 | ReportParameter parameter = new ReportParameter(); 35 | parameter.setName(entry.getKey()); 36 | parameter.setValues(entry.getValue()); 37 | parameters.add(parameter); 38 | } 39 | return parameters; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/reporting/util/PageRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting.util; 23 | 24 | public class PageRange { 25 | 26 | private final long startIndex; 27 | private final long endIndex; 28 | 29 | public PageRange(long startIndex, long endIndex){ 30 | this.startIndex = startIndex; 31 | this.endIndex = endIndex; 32 | } 33 | 34 | public String getRange(){ 35 | if (startIndex == endIndex) 36 | return String.valueOf(startIndex); 37 | return startIndex + "-" + endIndex; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/reporting/util/ReportOutputFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting.util; 23 | 24 | public enum ReportOutputFormat { 25 | 26 | PDF, HTML, XLS, XLSX, RTF, CSV, XML, DOCX, ODT, PPTX, 27 | ODS, JRPRINT 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/reporting/util/RunReportErrorHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting.util; 23 | 24 | import com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.handling.DefaultErrorHandler; 25 | import javax.ws.rs.core.Response; 26 | 27 | public class RunReportErrorHandler extends DefaultErrorHandler { 28 | 29 | @Override 30 | protected void handleBodyError(Response response) { 31 | String jasperServerError = response.getHeaderString("JasperServerError"); 32 | if (jasperServerError != null && jasperServerError.equals("true")){ 33 | String errorMessage = readBody(response, String.class); 34 | handleStatusCodeError(response, errorMessage); 35 | } 36 | 37 | super.handleBodyError(response); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/resources/compexResourcesSupport/WrongResourceFormatException.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.compexResourcesSupport; 2 | 3 | /** 4 | * @author Alexander Krasnyanskiy 5 | */ 6 | public class WrongResourceFormatException extends RuntimeException { 7 | public WrongResourceFormatException(String msg) { 8 | super(msg); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/resources/compexResourcesSupport/processor/CommonOperationProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.compexResourcesSupport.processor; 22 | 23 | import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult; 24 | import org.glassfish.jersey.media.multipart.FormDataMultiPart; 25 | 26 | import javax.ws.rs.core.MediaType; 27 | import javax.ws.rs.core.MultivaluedMap; 28 | 29 | /** 30 | * @author Alexander Krasnyanskiy 31 | */ 32 | public interface CommonOperationProcessor { 33 | OperationResult create(FormDataMultiPart multipart, MediaType mediaType, String path, MultivaluedMap params); 34 | OperationResult createOrUpdate(FormDataMultiPart multipart, MediaType mediaType, String path, MultivaluedMap params); 35 | OperationResult get(String uri); 36 | } -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/resources/util/MediaTypeUtil.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.util; 2 | 3 | import javax.ws.rs.core.MediaType; 4 | 5 | /** 6 | *

7 | *

8 | * 9 | * @author tetiana.iefimenko 10 | * @version $Id$ 11 | * @see 12 | */ 13 | public class MediaTypeUtil { 14 | public static MediaType stringToMediaType(String mediatype) { 15 | String primaryType= mediatype.substring(0, mediatype.indexOf("/")); 16 | String subType= mediatype.substring(mediatype.indexOf("/")+1); 17 | return new MediaType(primaryType, subType); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/resources/util/ResourceFilesMimeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.util; 23 | 24 | public enum ResourceFilesMimeType { 25 | 26 | PDF("application/pdf"), 27 | HTML("text/html"), 28 | XLS("application/xls"), 29 | RTF("application/rtf"), 30 | CSV("text/csv"), 31 | ODS("application/vnd.oasis.opendocument.spreadsheet"), 32 | ODT("application/vnd.oasis.opendocument.text"), 33 | TXT("text/plain"), 34 | DOCX("application/vnd.openxmlformatsofficedocument.wordprocessingml.document"), 35 | XLSX("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"), 36 | FONT("font/*"), 37 | IMG("image/*"), 38 | JRXML("application/jrxml"), 39 | JAR("application/zip"), 40 | PROP("application/properties"), 41 | JRTX("application/jrtx"), 42 | XML("application/xml"), 43 | CSS("text/css"), 44 | ACCES_GRANT_SCHEMA("application/accessGrantSchema"), 45 | OLAP_MONDRIAN_SCHEMA("application/olapMondrianSchema"); 46 | 47 | private String type; 48 | 49 | private ResourceFilesMimeType(String type){ 50 | this.type = type; 51 | } 52 | 53 | public String getType() { 54 | return type; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/resources/util/ResourceUtil.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.util; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import java.io.InputStreamReader; 7 | import java.io.UnsupportedEncodingException; 8 | import javax.xml.bind.DatatypeConverter; 9 | 10 | /** 11 | *

12 | *

13 | * 14 | * @author tetiana.iefimenko 15 | * @version $Id$ 16 | * @see 17 | */ 18 | public class ResourceUtil { 19 | public static String toBase64EncodedContent(InputStream content) { 20 | String emptyString = ""; 21 | BufferedReader buf = new BufferedReader(new InputStreamReader(content)); 22 | 23 | StringBuilder sb = new StringBuilder(); 24 | String line = new String(); 25 | while(line != null){ 26 | sb.append(line).append("\n"); 27 | try { 28 | line = buf.readLine(); 29 | } catch (IOException e) { 30 | return emptyString; 31 | } 32 | } 33 | 34 | return toBase64EncodedContent(sb.toString()); 35 | } 36 | 37 | public static String toBase64EncodedContent(String string) { 38 | try { 39 | return DatatypeConverter.printBase64Binary(string.getBytes("UTF-8")); 40 | } catch (UnsupportedEncodingException e) { 41 | return ""; 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/settings/SettingsService.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.settings; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 4 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 5 | 6 | /** 7 | * @author Alex Krasnyanskiy 8 | * @since 6.0.3-ALPHA 9 | */ 10 | public class SettingsService extends AbstractAdapter { 11 | 12 | public SettingsService(SessionStorage sessionStorage) { 13 | super(sessionStorage); 14 | } 15 | 16 | public SingleSettingsAdapter settings(){ 17 | return new SingleSettingsAdapter(sessionStorage); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/thumbnails/ThumbnailsService.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.thumbnails; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 4 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 5 | 6 | /** 7 | * @author Alex Krasnyanskiy 8 | * @since 6.0.1-ALPHA 9 | */ 10 | public class ThumbnailsService extends AbstractAdapter { 11 | 12 | public ThumbnailsService(SessionStorage sessionStorage) { 13 | super(sessionStorage); 14 | } 15 | 16 | public BatchThumbnailAdapter thumbnails() { 17 | return new BatchThumbnailAdapter(sessionStorage); 18 | } 19 | 20 | public SingleThumbnailAdapter thumbnail() { 21 | return new SingleThumbnailAdapter(sessionStorage); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/AnonymousSession.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.core; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.AbstractAdapter; 4 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.bundles.BundlesService; 5 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.serverInfo.ServerInfoService; 6 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.settings.SettingsService; 7 | 8 | /** 9 | * @author Tetiana Iefimenko 10 | */ 11 | public class AnonymousSession { 12 | 13 | protected SessionStorage storage; 14 | 15 | public AnonymousSession(SessionStorage storage) { 16 | this.storage = storage; 17 | } 18 | 19 | public SessionStorage getStorage() { 20 | return storage; 21 | } 22 | 23 | protected ServiceType getService(Class serviceClass) { 24 | try { 25 | return serviceClass.getConstructor(SessionStorage.class).newInstance(storage); 26 | } catch (Exception e) { 27 | throw new RuntimeException(e); 28 | } 29 | } 30 | 31 | public ServerInfoService serverInfoService() { 32 | return getService(ServerInfoService.class); 33 | } 34 | 35 | public SettingsService settingsService() { 36 | return getService(SettingsService.class); 37 | } 38 | 39 | public BundlesService bundlesService() {return getService(BundlesService.class);} 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/AuthenticationCredentials.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.core; 22 | 23 | public class AuthenticationCredentials { 24 | 25 | private String username; 26 | private String password; 27 | 28 | public AuthenticationCredentials(String username, String password) { 29 | this.username = username; 30 | this.password = password; 31 | } 32 | 33 | public String getUsername() { 34 | return username; 35 | } 36 | 37 | public void setUsername(String username) { 38 | this.username = username; 39 | } 40 | 41 | public String getPassword() { 42 | return password; 43 | } 44 | 45 | public void setPassword(String password) { 46 | this.password = password; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/Callback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core; 23 | 24 | public interface Callback { 25 | public R execute(P data); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/MimeTypeUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core; 23 | 24 | import com.jaspersoft.jasperserver.dto.resources.ResourceMediaType; 25 | import com.jaspersoft.jasperserver.jaxrs.client.core.enums.MimeType; 26 | 27 | public class MimeTypeUtil { 28 | 29 | 30 | public static String toCorrectContentMime(RestClientConfiguration configuration, String srcMime) { 31 | return replaceMime(configuration.getContentMimeType(), srcMime); 32 | } 33 | 34 | public static String toCorrectAcceptMime(RestClientConfiguration configuration, String srcMime) { 35 | return replaceMime(configuration.getAcceptMimeType(), srcMime); 36 | } 37 | 38 | private static String replaceMime(MimeType configMimeType, String srcMime) { 39 | if (srcMime.endsWith("+{mime}")) { 40 | return srcMime.replace("+{mime}", configMimeType == MimeType.JSON ? ResourceMediaType.RESOURCE_JSON_TYPE : ResourceMediaType.RESOURCE_XML_TYPE); 41 | } 42 | return srcMime; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/RequestBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core; 23 | 24 | import com.jaspersoft.jasperserver.jaxrs.client.core.operationresult.OperationResult; 25 | 26 | import javax.ws.rs.core.MultivaluedMap; 27 | 28 | public interface RequestBuilder { 29 | 30 | //GET-DELETE 31 | OperationResult get(); 32 | OperationResult delete(); 33 | 34 | //PUT-POST 35 | OperationResult put(Object entity); 36 | OperationResult post(Object entity); 37 | 38 | //common 39 | RequestBuilder addParam(String name, String... values); 40 | RequestBuilder addParams(MultivaluedMap params); 41 | RequestBuilder addMatrixParam(String name, String... values); 42 | RequestBuilder addMatrixParams(MultivaluedMap params); 43 | 44 | //util 45 | RequestBuilder setPath(String path); 46 | RequestBuilder setContentType(String mime); 47 | RequestBuilder setAccept(String acceptMime); 48 | RequestBuilder addHeader(String name, String... values); 49 | RequestBuilder setHeaders(MultivaluedMap headers); 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/RequestExecution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.core; 22 | 23 | import java.util.concurrent.Future; 24 | 25 | public class RequestExecution { 26 | 27 | private Runnable task; 28 | private Future future; 29 | 30 | public RequestExecution(Runnable task){ 31 | this.task = task; 32 | } 33 | 34 | public void cancel(){ 35 | future.cancel(true); 36 | } 37 | 38 | public Runnable getTask() { 39 | return task; 40 | } 41 | 42 | public void setFuture(Future future) { 43 | this.future = future; 44 | } 45 | 46 | public Future getFuture() { 47 | return future; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/ThreadPoolUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core; 23 | 24 | import java.util.concurrent.ExecutorService; 25 | import java.util.concurrent.Executors; 26 | import java.util.concurrent.Future; 27 | 28 | public class ThreadPoolUtil { 29 | 30 | private static final ExecutorService executorService = Executors.newCachedThreadPool(); 31 | 32 | public synchronized static void runAsynchronously(RequestExecution requestExecutionTask){ 33 | Future future = executorService.submit(requestExecutionTask.getTask()); 34 | requestExecutionTask.setFuture(future); 35 | } 36 | 37 | public static ExecutorService getExecutorService() { 38 | return executorService; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/UrlUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2014-2018. TIBCO Software Inc. All Rights Reserved. Confidential & Proprietary. 3 | */ 4 | 5 | package com.jaspersoft.jasperserver.jaxrs.client.core; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * @author Tatyana Matveyeva 12 | * @version $Id$ 13 | */ 14 | public class UrlUtils { 15 | 16 | private UrlUtils() { 17 | //To prevent class from instantiation 18 | throw new AssertionError(); 19 | } 20 | 21 | /** 22 | * Encode provided string (curly braces) 23 | * @param param string to encode 24 | * @return encoded string 25 | */ 26 | public static String encode(String param) { 27 | return param.replaceAll("\\}", "%7D").replaceAll("\\{", "%7B"); 28 | 29 | } 30 | 31 | /** 32 | * Encode provided strings (curly braces) 33 | * @param params list of strings to encode 34 | * @return encoded list of strings 35 | */ 36 | public static List encode(List params) { 37 | List result = new ArrayList<>(); 38 | for (String param: params) { 39 | result.add(param.replaceAll("\\}", "%7D").replaceAll("\\{", "%7B")); 40 | } 41 | return result; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/enums/AuthenticationType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.enums; 23 | 24 | public enum AuthenticationType { 25 | SPRING, 26 | BASIC; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/enums/JRSVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.enums; 23 | 24 | public enum JRSVersion implements Comparable { 25 | 26 | //!!!order is important!!! the latest version must be in the end 27 | v4_7_0, 28 | v5_0_0, 29 | v5_1_0, 30 | v5_2_0, 31 | v5_5_0, 32 | v5_6_1, 33 | v6_0_0, 34 | v6_0_1, 35 | v6_1_0; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/enums/MimeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.enums; 23 | 24 | public enum MimeType { 25 | XML, JSON 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/enums/RequestMethod.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.core.enums; 2 | 3 | /** 4 | * @author Tetiana Iefimenko 5 | */ 6 | public enum RequestMethod { 7 | GET, 8 | DELETE, 9 | POST, 10 | PUT; 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/AccessDeniedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author Anton Fomin 30 | * @version $Id: AccessDeniedException.java 38348 2013-09-30 04:57:18Z carbiv $ 31 | */ 32 | public class AccessDeniedException extends JSClientWebException { 33 | 34 | public static final String ERROR_CODE_ACCESS_DENIED = "access.denied"; 35 | 36 | public AccessDeniedException() { 37 | super(); //To change body of overridden methods use File | Settings | File Templates. 38 | } 39 | 40 | public AccessDeniedException(String message) { 41 | super(message); //To change body of overridden methods use File | Settings | File Templates. 42 | } 43 | 44 | public AccessDeniedException(String message, List errorDescriptors) { 45 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 46 | } 47 | } -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/AuthenticationFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class AuthenticationFailedException extends JSClientWebException { 29 | 30 | public AuthenticationFailedException() { 31 | super(); //To change body of overridden methods use File | Settings | File Templates. 32 | } 33 | 34 | public AuthenticationFailedException(String message) { 35 | super(message); //To change body of overridden methods use File | Settings | File Templates. 36 | } 37 | 38 | public AuthenticationFailedException(String message, List errorDescriptors) { 39 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/BadRequestException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class BadRequestException extends JSClientWebException { 29 | 30 | public BadRequestException() { 31 | super(); //To change body of overridden methods use File | Settings | File Templates. 32 | } 33 | 34 | public BadRequestException(String message) { 35 | super(message); //To change body of overridden methods use File | Settings | File Templates. 36 | } 37 | 38 | public BadRequestException(String message, List errorDescriptors) { 39 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ConflictException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class ConflictException extends JSClientWebException { 29 | 30 | public ConflictException() { 31 | super(); //To change body of overridden methods use File | Settings | File Templates. 32 | } 33 | 34 | public ConflictException(String message) { 35 | super(message); //To change body of overridden methods use File | Settings | File Templates. 36 | } 37 | 38 | public ConflictException(String message, List errorDescriptors) { 39 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ExportFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | import com.jaspersoft.jasperserver.dto.importexport.State; 26 | 27 | import java.util.Arrays; 28 | import java.util.List; 29 | 30 | public class ExportFailedException extends JSClientWebException { 31 | 32 | public static final String ERROR_CODE_EXPORT_FAILED = "export.failed"; 33 | 34 | public ExportFailedException() { 35 | super(); //To change body of overridden methods use File | Settings | File Templates. 36 | } 37 | 38 | public ExportFailedException(String message) { 39 | super(message); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | 42 | public ExportFailedException(String message, List errorDescriptors) { 43 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 44 | } 45 | 46 | public ExportFailedException(State stateDto) { 47 | this(stateDto.getError().getMessage(), Arrays.asList(stateDto.getError())); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/FolderAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | *

30 | * 31 | * @author Zakhar.Tomchenco 32 | * @version $Id$ 33 | */ 34 | public class FolderAlreadyExistsException extends ResourceAlreadyExistsException { 35 | 36 | public static final String FOLDER_ALREADY_EXISTS = "folder.already.exits"; 37 | 38 | public FolderAlreadyExistsException() { 39 | super(); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | 42 | public FolderAlreadyExistsException(String message) { 43 | super(message); //To change body of overridden methods use File | Settings | File Templates. 44 | } 45 | 46 | public FolderAlreadyExistsException(String message, List errorDescriptors) { 47 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/FolderNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | *

30 | * 31 | * @author Zakhar.Tomchenco 32 | * @version $Id$ 33 | */ 34 | public class FolderNotFoundException extends ResourceNotFoundException { 35 | 36 | public static final String ERROR_CODE_FOLDER_NOT_FOUND = "folder.not.found"; 37 | 38 | public FolderNotFoundException() { 39 | super(); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | 42 | public FolderNotFoundException(String message) { 43 | super(message); //To change body of overridden methods use File | Settings | File Templates. 44 | } 45 | 46 | public FolderNotFoundException(String message, List errorDescriptors) { 47 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/HttpMethodNotAllowedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class HttpMethodNotAllowedException extends JSClientWebException { 29 | 30 | public HttpMethodNotAllowedException() { 31 | super(); //To change body of overridden methods use File | Settings | File Templates. 32 | } 33 | 34 | public HttpMethodNotAllowedException(String message) { 35 | super(message); //To change body of overridden methods use File | Settings | File Templates. 36 | } 37 | 38 | public HttpMethodNotAllowedException(String message, List errorDescriptors) { 39 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/IllegalParameterValueException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author Yaroslav.Kovalchyk 30 | * @version $Id: IllegalParameterValueException.java 30161 2013-03-22 19:20:15Z inesterenko $ 31 | */ 32 | public class IllegalParameterValueException extends JSClientWebException { 33 | 34 | public static final String ERROR_CODE = "illegal.parameter.value.error"; 35 | 36 | public IllegalParameterValueException() { 37 | super(); //To change body of overridden methods use File | Settings | File Templates. 38 | } 39 | 40 | public IllegalParameterValueException(String message) { 41 | super(message); //To change body of overridden methods use File | Settings | File Templates. 42 | } 43 | 44 | public IllegalParameterValueException(String message, List errorDescriptors) { 45 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/InternalServerErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class InternalServerErrorException extends JSClientWebException { 29 | 30 | public InternalServerErrorException() { 31 | super(); //To change body of overridden methods use File | Settings | File Templates. 32 | } 33 | 34 | public InternalServerErrorException(String message) { 35 | super(message); //To change body of overridden methods use File | Settings | File Templates. 36 | } 37 | 38 | public InternalServerErrorException(String message, List errorDescriptors) { 39 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/JSClientException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 22 | 23 | public class JSClientException extends RuntimeException { 24 | 25 | public JSClientException() { 26 | super(); 27 | } 28 | 29 | public JSClientException(String message, Throwable cause) { 30 | super(message, cause); 31 | } 32 | 33 | public JSClientException(Throwable cause) { 34 | super(cause); 35 | } 36 | 37 | public JSClientException(String message) { 38 | super(message); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/MandatoryParameterNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author Yaroslav.Kovalchyk 30 | * @version $Id: MandatoryParameterNotFoundException.java 35226 2013-08-09 07:08:53Z inesterenko $ 31 | */ 32 | public class MandatoryParameterNotFoundException extends JSClientWebException { 33 | 34 | public final static String MANDATORY_PARAMETER_ERROR = "mandatory.parameter.error"; 35 | 36 | public MandatoryParameterNotFoundException() { 37 | super(); 38 | } 39 | 40 | public MandatoryParameterNotFoundException(String message) { 41 | super(message); 42 | } 43 | 44 | public MandatoryParameterNotFoundException(String message, List errorDescriptors) { 45 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ModificationNotAllowedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author Zakhar.Tomchenco 30 | * @version $Id$ 31 | */ 32 | public class ModificationNotAllowedException extends AccessDeniedException { 33 | 34 | public static final String ERROR_CODE_MODIFICATION_NOT_ALLOWED = "modification.not.allowed"; 35 | 36 | public ModificationNotAllowedException() { 37 | super(); //To change body of overridden methods use File | Settings | File Templates. 38 | } 39 | 40 | public ModificationNotAllowedException(String message) { 41 | super(message); //To change body of overridden methods use File | Settings | File Templates. 42 | } 43 | 44 | public ModificationNotAllowedException(String message, List errorDescriptors) { 45 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/NoResultException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author: Zakhar.Tomchenco 30 | */ 31 | public class NoResultException extends AccessDeniedException { 32 | 33 | public static final String ERROR_CODE_NO_RESULT = "no.result.available"; 34 | 35 | public NoResultException() { 36 | super(); //To change body of overridden methods use File | Settings | File Templates. 37 | } 38 | 39 | public NoResultException(String message) { 40 | super(message); //To change body of overridden methods use File | Settings | File Templates. 41 | } 42 | 43 | public NoResultException(String message, List errorDescriptors) { 44 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/NoSuchImportTaskException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | *

30 | * 31 | * @author Yaroslav.Kovalchyk 32 | * @version $Id: NoSuchImportTaskException.java 36722 2013-09-05 14:19:10Z ykovalchyk $ 33 | */ 34 | public class NoSuchImportTaskException extends JSClientWebException { 35 | 36 | public static final String ERROR_CODE_NO_SUCH_IMPORT_PROCESS = "no.such.import.process"; 37 | 38 | public NoSuchImportTaskException() { 39 | super(); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | 42 | public NoSuchImportTaskException(String message) { 43 | super(message); //To change body of overridden methods use File | Settings | File Templates. 44 | } 45 | 46 | public NoSuchImportTaskException(String message, List errorDescriptors) { 47 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/NoSuchTaskException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author: Zakhar.Tomchenco 30 | */ 31 | public class NoSuchTaskException extends ResourceNotFoundException { 32 | 33 | public static final String ERROR_CODE_NO_SUCH_EXPORT_PROCESS = "no.such.export.process"; 34 | 35 | public NoSuchTaskException() { 36 | super(); //To change body of overridden methods use File | Settings | File Templates. 37 | } 38 | 39 | public NoSuchTaskException(String message) { 40 | super(message); //To change body of overridden methods use File | Settings | File Templates. 41 | } 42 | 43 | public NoSuchTaskException(String message, List errorDescriptors) { 44 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/NotAFileException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | *

30 | * 31 | * @author Zakhar.Tomchenco 32 | * @version $Id$ 33 | */ 34 | public class NotAFileException extends JSClientWebException { 35 | 36 | public static final String ERROR_NOT_A_FILE = "not.a.file"; 37 | 38 | public NotAFileException() { 39 | super(); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | 42 | public NotAFileException(String message) { 43 | super(message); //To change body of overridden methods use File | Settings | File Templates. 44 | } 45 | 46 | public NotAFileException(String message, List errorDescriptors) { 47 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/NotReadyResultException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author: Zakhar.Tomchenco 30 | */ 31 | public class NotReadyResultException extends AccessDeniedException { 32 | 33 | public static final String ERROR_CODE_NOT_READY = "resources.not.ready"; 34 | 35 | public NotReadyResultException() { 36 | super(); //To change body of overridden methods use File | Settings | File Templates. 37 | } 38 | 39 | public NotReadyResultException(String message) { 40 | super(message); //To change body of overridden methods use File | Settings | File Templates. 41 | } 42 | 43 | public NotReadyResultException(String message, List errorDescriptors) { 44 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ParamException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class ParamException extends JSClientWebException { 29 | 30 | public static final String ERROR_CODE_PARAMETER_VALUE_ERROR = "exception.remote.illegal.parameter.value.error"; 31 | 32 | public ParamException() { 33 | super(); //To change body of overridden methods use File | Settings | File Templates. 34 | } 35 | 36 | public ParamException(String message) { 37 | super(message); //To change body of overridden methods use File | Settings | File Templates. 38 | } 39 | 40 | public ParamException(String message, List errorDescriptors) { 41 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/PatchException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | *

30 | * 31 | * @author Zakhar.Tomchenco 32 | * @version $Id$ 33 | */ 34 | public class PatchException extends JSClientWebException { 35 | 36 | public static final String PATCH_FAILED = "patch.failed"; 37 | 38 | public PatchException() { 39 | super(); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | 42 | public PatchException(String message) { 43 | super(message); //To change body of overridden methods use File | Settings | File Templates. 44 | } 45 | 46 | public PatchException(String message, List errorDescriptors) { 47 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ReportExportException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class ReportExportException extends JSClientWebException { 29 | 30 | public static final String ERROR_EXPORTING_REPORT_UNIT = "webservices.error.errorExportingReportUnit"; 31 | public static final String ERROR_EXPORT_PARAMETERS_MISSED = "export.parameters.missing"; 32 | 33 | public ReportExportException() { 34 | super(); 35 | } 36 | 37 | public ReportExportException(String message) { 38 | super(message); 39 | } 40 | 41 | public ReportExportException(String message, List errorDescriptors) { 42 | super(message, errorDescriptors); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ReportInvalidPageRangeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class ReportInvalidPageRangeException extends JSClientWebException { 29 | 30 | public static final String INVALID_REPORT_RANGE = "thumbnail.invalid.page.range"; 31 | 32 | public ReportInvalidPageRangeException() { 33 | super(); 34 | } 35 | 36 | public ReportInvalidPageRangeException(String message) { 37 | super(message); 38 | } 39 | 40 | public ReportInvalidPageRangeException(String message, List errorDescriptors) { 41 | super(message, errorDescriptors); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ReportStartPageGreaterThenEndPageException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class ReportStartPageGreaterThenEndPageException extends JSClientWebException { 29 | 30 | public static final String REPORT_START_PAGE_GREATER_THEN_END_PAGE = "thumbnail.start.page.greater.then.end.page"; 31 | 32 | public ReportStartPageGreaterThenEndPageException() { 33 | super(); 34 | } 35 | 36 | public ReportStartPageGreaterThenEndPageException(String message) { 37 | super(message); 38 | } 39 | 40 | public ReportStartPageGreaterThenEndPageException(String message, List errorDescriptors) { 41 | super(message, errorDescriptors); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/RepresentationalTypeNotSupportedForResourceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class RepresentationalTypeNotSupportedForResourceException extends JSClientWebException { 29 | 30 | public RepresentationalTypeNotSupportedForResourceException() { 31 | super(); //To change body of overridden methods use File | Settings | File Templates. 32 | } 33 | 34 | public RepresentationalTypeNotSupportedForResourceException(String message) { 35 | super(message); //To change body of overridden methods use File | Settings | File Templates. 36 | } 37 | 38 | public RepresentationalTypeNotSupportedForResourceException(String message, List errorDescriptors) { 39 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/RequestedRepresentationNotAvailableForResourceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class RequestedRepresentationNotAvailableForResourceException extends JSClientWebException { 29 | 30 | public RequestedRepresentationNotAvailableForResourceException() { 31 | super(); //To change body of overridden methods use File | Settings | File Templates. 32 | } 33 | 34 | public RequestedRepresentationNotAvailableForResourceException(String message) { 35 | super(message); //To change body of overridden methods use File | Settings | File Templates. 36 | } 37 | 38 | public RequestedRepresentationNotAvailableForResourceException(String message, List errorDescriptors) { 39 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ResourceAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author Yaroslav.Kovalchyk 30 | * @version $Id: ResourceAlreadyExistsException.java 24125 2012-06-11 16:53:46Z inesterenko $ 31 | */ 32 | public class ResourceAlreadyExistsException extends JSClientWebException { 33 | 34 | public static final String RESOURCE_ALREADY_EXISTS = "resources.already.exists"; 35 | 36 | public ResourceAlreadyExistsException() { 37 | super(); //To change body of overridden methods use File | Settings | File Templates. 38 | } 39 | 40 | public ResourceAlreadyExistsException(String message) { 41 | super(message); //To change body of overridden methods use File | Settings | File Templates. 42 | } 43 | 44 | public ResourceAlreadyExistsException(String message, List errorDescriptors) { 45 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ResourceInUseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | *

30 | * 31 | * @author Zakhar.Tomchenco 32 | * @version $Id$ 33 | */ 34 | public class ResourceInUseException extends AccessDeniedException { 35 | 36 | public static final String ERROR_CODE = "resources.in.use"; 37 | 38 | public ResourceInUseException() { 39 | super(); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | 42 | public ResourceInUseException(String message) { 43 | super(message); //To change body of overridden methods use File | Settings | File Templates. 44 | } 45 | 46 | public ResourceInUseException(String message, List errorDescriptors) { 47 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author Yaroslav.Kovalchyk 30 | * @version $Id: ResourceNotFoundException.java 30161 2013-03-22 19:20:15Z inesterenko $ 31 | */ 32 | public class ResourceNotFoundException extends JSClientWebException { 33 | 34 | public static final String ERROR_CODE_RESOURCE_NOT_FOUND = "resources.not.found"; 35 | 36 | public ResourceNotFoundException() { 37 | super(); //To change body of overridden methods use File | Settings | File Templates. 38 | } 39 | 40 | public ResourceNotFoundException(String message) { 41 | super(message); //To change body of overridden methods use File | Settings | File Templates. 42 | } 43 | 44 | public ResourceNotFoundException(String message, List errorDescriptors) { 45 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/UnexpectedErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | public class UnexpectedErrorException extends JSClientWebException { 29 | 30 | public static final String ERROR_CODE_UNEXPECTED_ERROR = "unexpected.error"; 31 | 32 | public UnexpectedErrorException() { 33 | super(); 34 | } 35 | 36 | public UnexpectedErrorException(String message) { 37 | super(message); 38 | } 39 | 40 | public UnexpectedErrorException(String message, List errorDescriptors) { 41 | super(message, errorDescriptors); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/ValidationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 22 | 23 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 24 | 25 | import java.util.List; 26 | 27 | public class ValidationException extends JSClientWebException { 28 | 29 | public ValidationException() { 30 | super(); 31 | } 32 | 33 | public ValidationException(String message) { 34 | super(message); 35 | } 36 | 37 | public ValidationException(String message, List errorDescriptors) { 38 | super(message, errorDescriptors); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/VersionNotMatchException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | *

30 | * 31 | * @author Zakhar.Tomchenco 32 | * @version $Id$ 33 | */ 34 | public class VersionNotMatchException extends JSClientWebException { 35 | 36 | public static final String ERROR_VERSION_NOT_MATCH = "version.not.match"; 37 | 38 | public VersionNotMatchException() { 39 | super(); //To change body of overridden methods use File | Settings | File Templates. 40 | } 41 | 42 | public VersionNotMatchException(String message) { 43 | super(message); //To change body of overridden methods use File | Settings | File Templates. 44 | } 45 | 46 | public VersionNotMatchException(String message, List errorDescriptors) { 47 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/WeakPasswordException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions; 23 | 24 | import com.jaspersoft.jasperserver.dto.common.ErrorDescriptor; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * @author Zakhar.Tomchenco 30 | * @version $Id$ 31 | */ 32 | public class WeakPasswordException extends IllegalParameterValueException { 33 | 34 | public static final String ERROR_CODE_WEAK_PASSWORD = "weak.password"; 35 | 36 | public WeakPasswordException() { 37 | super(); //To change body of overridden methods use File | Settings | File Templates. 38 | } 39 | 40 | public WeakPasswordException(String message) { 41 | super(message); //To change body of overridden methods use File | Settings | File Templates. 42 | } 43 | 44 | public WeakPasswordException(String message, List errorDescriptors) { 45 | super(message, errorDescriptors); //To change body of overridden methods use File | Settings | File Templates. 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/handling/ErrorHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.handling; 23 | 24 | import javax.ws.rs.core.Response; 25 | 26 | public interface ErrorHandler { 27 | 28 | void handleError(Response response); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/operationresult/OperationResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.core.operationresult; 22 | 23 | import com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.JSClientWebException; 24 | 25 | import javax.ws.rs.core.GenericType; 26 | import javax.ws.rs.core.Response; 27 | 28 | public interface OperationResultFactory { 29 | public OperationResult getOperationResult(Response response, Class responseClass) throws JSClientWebException; 30 | public OperationResult getOperationResult(Response response, GenericType genericType) throws JSClientWebException; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/core/operationresult/WithEntityOperationResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.core.operationresult; 23 | 24 | import javax.ws.rs.core.GenericType; 25 | import javax.ws.rs.core.Response; 26 | 27 | public class WithEntityOperationResult extends OperationResult { 28 | 29 | public WithEntityOperationResult(Response response, Class entityClass) { 30 | super(response, entityClass); 31 | } 32 | 33 | public WithEntityOperationResult(Response response, GenericType genericType) { 34 | super(response, genericType); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/alerting/calender/BaseCalendar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.dto.alerting.calender; 23 | 24 | //import com.jaspersoft.jasperserver.dto.job.ClientJobCalendar; 25 | import com.jaspersoft.jasperserver.dto.alerting.ClientAlertCalendar; 26 | 27 | import javax.xml.bind.annotation.XmlRootElement; 28 | 29 | @XmlRootElement(name = "reportJobCalendar") 30 | public class BaseCalendar extends Calendar { 31 | 32 | public BaseCalendar(){ 33 | this.calendarType = ClientAlertCalendar.Type.base; 34 | } 35 | 36 | BaseCalendar(BaseCalendar other) { 37 | super(other); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/jobs/calendar/BaseCalendar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.dto.jobs.calendar; 23 | 24 | import com.jaspersoft.jasperserver.dto.job.ClientJobCalendar; 25 | import javax.xml.bind.annotation.XmlRootElement; 26 | 27 | @XmlRootElement(name = "reportJobCalendar") 28 | public class BaseCalendar extends Calendar { 29 | 30 | public BaseCalendar(){ 31 | this.calendarType = ClientJobCalendar.Type.base; 32 | } 33 | 34 | BaseCalendar(BaseCalendar other) { 35 | super(other); 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/reports/ExportsContainer.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.reports; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | *

8 | *

9 | * 10 | * @author tetiana.iefimenko 11 | * @version $Id$ 12 | * @see 13 | */ 14 | public class ExportsContainer { 15 | private Map executions = new HashMap(); 16 | 17 | public ExportsContainer() { 18 | } 19 | 20 | public ExportsContainer(ExportsContainer other) { 21 | this.executions = new HashMap<>(); 22 | final Map executions = other.getExecutions(); 23 | if (executions != null) { 24 | for (String execution : executions.keySet()) { 25 | this.executions.put(execution, new ExportExecution(executions.get(execution))); 26 | } 27 | } 28 | } 29 | 30 | public Map getExecutions() { 31 | return executions; 32 | } 33 | 34 | public ExportsContainer setExecutions(Map executions) { 35 | this.executions = executions; 36 | return this; 37 | } 38 | 39 | @Override 40 | public boolean equals(Object o) { 41 | if (this == o) return true; 42 | if (!(o instanceof ExportsContainer)) return false; 43 | 44 | ExportsContainer that = (ExportsContainer) o; 45 | 46 | return executions != null ? executions.equals(that.executions) : that.executions == null; 47 | } 48 | 49 | @Override 50 | public int hashCode() { 51 | return executions != null ? executions.hashCode() : 0; 52 | } 53 | 54 | @Override 55 | public String toString() { 56 | return "ExportsContainer{" + 57 | "executions=" + executions + 58 | '}'; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/reports/ReportExecutionsSetWrapper.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.reports; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | import javax.xml.bind.annotation.XmlElement; 6 | import javax.xml.bind.annotation.XmlRootElement; 7 | 8 | /** 9 | *

10 | *

11 | * 12 | * @author tetiana.iefimenko 13 | * @version $Id$ 14 | * @see 15 | */ 16 | @XmlRootElement(name = "reportExecutions") 17 | public class ReportExecutionsSetWrapper { 18 | 19 | private Set reportExecutionStatuses; 20 | 21 | public ReportExecutionsSetWrapper(){} 22 | 23 | public ReportExecutionsSetWrapper(Set reportExecutionStatuses) { 24 | if (reportExecutionStatuses != null) { 25 | this.reportExecutionStatuses = new HashSet<>(); 26 | for (ReportExecutionStatus reportExecutionStatus : reportExecutionStatuses) { 27 | this.reportExecutionStatuses.add(new ReportExecutionStatus(reportExecutionStatus)); 28 | } 29 | } 30 | } 31 | 32 | @XmlElement(name = "reportExecution") 33 | public Set getReportExecutionStatuses() { 34 | return reportExecutionStatuses; 35 | } 36 | 37 | public ReportExecutionsSetWrapper setReportExecutionStatuses(Set reportExecutionStatuses) { 38 | this.reportExecutionStatuses = reportExecutionStatuses; 39 | return this; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/reports/reportinfo/BookmarksInfo.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.reports.reportinfo; 2 | 3 | import javax.xml.bind.annotation.XmlElement; 4 | import javax.xml.bind.annotation.XmlElementWrapper; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import java.util.Objects; 8 | 9 | /** 10 | * @author Tatyana Matveyeva 11 | */ 12 | public class BookmarksInfo { 13 | private String id; 14 | private String type; 15 | private List bookmarks; 16 | 17 | public BookmarksInfo() {} 18 | 19 | public BookmarksInfo(BookmarksInfo other) { 20 | this.id = other.id; 21 | this.type = other.type; 22 | this.bookmarks = new ArrayList<>(bookmarks); 23 | } 24 | 25 | @XmlElement 26 | public String getId() { 27 | return id; 28 | } 29 | 30 | @XmlElement 31 | public String getType() { 32 | return type; 33 | } 34 | 35 | @XmlElementWrapper(name = "bookmarks") 36 | @XmlElement(name = "bookmark") 37 | public List getBookmarks() { 38 | return bookmarks; 39 | } 40 | 41 | public BookmarksInfo setId(String id) { 42 | this.id = id; 43 | return this; 44 | } 45 | 46 | public BookmarksInfo setType(String type) { 47 | this.type = type; 48 | return this; 49 | } 50 | 51 | public BookmarksInfo setBookmarks(List bookmarks) { 52 | this.bookmarks = bookmarks; 53 | return this; 54 | } 55 | 56 | @Override 57 | public boolean equals(Object o) { 58 | if (this == o) return true; 59 | if (o == null || getClass() != o.getClass()) return false; 60 | BookmarksInfo that = (BookmarksInfo) o; 61 | return Objects.equals(id, that.id) && 62 | Objects.equals(type, that.type) && 63 | Objects.equals(bookmarks, that.bookmarks); 64 | } 65 | 66 | @Override 67 | public int hashCode() { 68 | return Objects.hash(id, type, bookmarks); 69 | } 70 | 71 | @Override 72 | public String toString() { 73 | return "BookmarksInfo{" + 74 | "id='" + id + '\'' + 75 | ", type='" + type + '\'' + 76 | ", bookmarks=" + bookmarks + 77 | '}'; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/reports/reportinfo/Part.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.reports.reportinfo; 2 | 3 | import javax.xml.bind.annotation.XmlElement; 4 | import java.util.Objects; 5 | 6 | /** 7 | * @author Tatyana Matveyeva 8 | */ 9 | public class Part { 10 | private Integer idx; 11 | private String name; 12 | 13 | public Part() { 14 | } 15 | 16 | public Part(Part other) { 17 | idx = other.idx; 18 | name = other.name; 19 | } 20 | 21 | @XmlElement 22 | public Integer getIdx() { 23 | return idx; 24 | } 25 | 26 | @XmlElement 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public Part setIdx(Integer idx) { 32 | this.idx = idx; 33 | return this; 34 | } 35 | 36 | public Part setName(String name) { 37 | this.name = name; 38 | return this; 39 | } 40 | 41 | @Override 42 | public boolean equals(Object o) { 43 | if (this == o) return true; 44 | if (o == null || getClass() != o.getClass()) return false; 45 | Part part = (Part) o; 46 | return Objects.equals(idx, part.idx) && 47 | Objects.equals(name, part.name); 48 | } 49 | 50 | @Override 51 | public int hashCode() { 52 | return Objects.hash(idx, name); 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | return "Part{" + 58 | "idx=" + idx + 59 | ", name='" + name + '\'' + 60 | '}'; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/reports/reportinfo/PartsInfo.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.reports.reportinfo; 2 | 3 | import javax.xml.bind.annotation.XmlElement; 4 | import javax.xml.bind.annotation.XmlElementWrapper; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | import java.util.Objects; 8 | 9 | /** 10 | * @author Tatyana Matveyeva 11 | */ 12 | public class PartsInfo { 13 | private String id; 14 | private String type; 15 | private List parts; 16 | 17 | public PartsInfo() {} 18 | 19 | public PartsInfo(PartsInfo other) { 20 | this.id = other.id; 21 | this.type = other.type; 22 | this.parts = new ArrayList<>(other.parts); 23 | } 24 | 25 | @XmlElement 26 | public String getId() { 27 | return id; 28 | } 29 | 30 | @XmlElement 31 | public String getType() { 32 | return type; 33 | } 34 | 35 | @XmlElementWrapper(name = "parts") 36 | @XmlElement(name = "part") 37 | public List getParts() { 38 | return parts; 39 | } 40 | 41 | public PartsInfo setId(String id) { 42 | this.id = id; 43 | return this; 44 | } 45 | 46 | public PartsInfo setType(String type) { 47 | this.type = type; 48 | return this; 49 | } 50 | 51 | public PartsInfo setParts(List parts) { 52 | this.parts = parts; 53 | return this; 54 | } 55 | 56 | @Override 57 | public boolean equals(Object o) { 58 | if (this == o) return true; 59 | if (o == null || getClass() != o.getClass()) return false; 60 | PartsInfo partsInfo = (PartsInfo) o; 61 | return Objects.equals(id, partsInfo.id) && 62 | Objects.equals(type, partsInfo.type) && 63 | Objects.equals(parts, partsInfo.parts); 64 | } 65 | 66 | @Override 67 | public int hashCode() { 68 | return Objects.hash(id, type, parts); 69 | } 70 | 71 | @Override 72 | public String toString() { 73 | return "PartsInfo{" + 74 | "id='" + id + '\'' + 75 | ", type='" + type + '\'' + 76 | ", parts=" + parts + 77 | '}'; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/reports/reportinfo/ReportInfo.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.reports.reportinfo; 2 | 3 | import javax.xml.bind.annotation.XmlAccessOrder; 4 | import javax.xml.bind.annotation.XmlAccessorOrder; 5 | import javax.xml.bind.annotation.XmlElement; 6 | import javax.xml.bind.annotation.XmlRootElement; 7 | import java.util.Objects; 8 | 9 | /** 10 | * @author Tatyana Matveyeva 11 | */ 12 | @XmlRootElement 13 | @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) 14 | public class ReportInfo { 15 | private BookmarksInfo bookmarks; 16 | private PartsInfo parts; 17 | 18 | public ReportInfo() { 19 | } 20 | 21 | public ReportInfo(ReportInfo other) { 22 | this.bookmarks = other.bookmarks; 23 | this.parts = other.parts; 24 | } 25 | 26 | 27 | @XmlElement 28 | public BookmarksInfo getBookmarks() { 29 | return bookmarks; 30 | } 31 | 32 | 33 | @XmlElement 34 | public PartsInfo getParts() { 35 | return parts; 36 | } 37 | 38 | public ReportInfo setBookmarks(BookmarksInfo bookmarks) { 39 | this.bookmarks = bookmarks; 40 | return this; 41 | } 42 | 43 | public ReportInfo setParts(PartsInfo parts) { 44 | this.parts = parts; 45 | return this; 46 | } 47 | 48 | @Override 49 | public boolean equals(Object o) { 50 | if (this == o) return true; 51 | if (o == null || getClass() != o.getClass()) return false; 52 | ReportInfo that = (ReportInfo) o; 53 | return Objects.equals(bookmarks, that.bookmarks) && 54 | Objects.equals(parts, that.parts); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | return Objects.hash(bookmarks, parts); 60 | } 61 | 62 | @Override 63 | public String toString() { 64 | return "ReportInfo{" + 65 | "bookmarks=" + bookmarks + 66 | ", parts=" + parts + 67 | '}'; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/settings/DashboardSettings.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.settings; 2 | 3 | import java.util.LinkedList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Tetiana Iefimenko 8 | */ 9 | public class DashboardSettings { 10 | 11 | private List newItemsRegistry; 12 | 13 | public DashboardSettings() { 14 | } 15 | 16 | public DashboardSettings(DashboardSettings other) { 17 | if (other.newItemsRegistry != null) { 18 | this.newItemsRegistry = new LinkedList(); 19 | for (ItemRegistry itemRegistry : other.newItemsRegistry) { 20 | this.newItemsRegistry.add(new ItemRegistry(itemRegistry)); 21 | } 22 | } 23 | } 24 | 25 | public List getNewItemsRegistry() { 26 | return newItemsRegistry; 27 | } 28 | 29 | public DashboardSettings setNewItemsRegistry(List newItemsRegistry) { 30 | this.newItemsRegistry = newItemsRegistry; 31 | return this; 32 | } 33 | 34 | @Override 35 | public boolean equals(Object o) { 36 | if (this == o) return true; 37 | if (!(o instanceof DashboardSettings)) return false; 38 | 39 | DashboardSettings that = (DashboardSettings) o; 40 | 41 | return !(getNewItemsRegistry() != null ? !getNewItemsRegistry().equals(that.getNewItemsRegistry()) : that.getNewItemsRegistry() != null); 42 | 43 | } 44 | 45 | @Override 46 | public int hashCode() { 47 | return getNewItemsRegistry() != null ? getNewItemsRegistry().hashCode() : 0; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return "DashboardSettings{" + 53 | "newItemsRegistry=" + newItemsRegistry + 54 | '}'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/settings/DateTimeSettings.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.settings; 2 | 3 | /** 4 | * @author Tetiana Iefimenko 5 | */ 6 | public class DateTimeSettings { 7 | 8 | private Datepicker datepicker; 9 | private Timepicker timepicker; 10 | 11 | public DateTimeSettings() { 12 | } 13 | 14 | public DateTimeSettings(DateTimeSettings other) { 15 | this.datepicker = (other.datepicker != null) ? new Datepicker(other.datepicker) : null; 16 | this.timepicker = (other.timepicker != null) ? new Timepicker(other.timepicker) : null; 17 | } 18 | 19 | public Datepicker getDatepicker() { 20 | return datepicker; 21 | 22 | } 23 | 24 | public DateTimeSettings setDatepicker(Datepicker datepicker) { 25 | this.datepicker = datepicker; 26 | return this; 27 | } 28 | 29 | public Timepicker getTimepicker() { 30 | return timepicker; 31 | } 32 | 33 | public DateTimeSettings setTimepicker(Timepicker timepicker) { 34 | this.timepicker = timepicker; 35 | return this; 36 | } 37 | 38 | @Override 39 | public boolean equals(Object o) { 40 | if (this == o) return true; 41 | if (!(o instanceof DateTimeSettings)) return false; 42 | 43 | DateTimeSettings that = (DateTimeSettings) o; 44 | 45 | if (getDatepicker() != null ? !getDatepicker().equals(that.getDatepicker()) : that.getDatepicker() != null) 46 | return false; 47 | return !(getTimepicker() != null ? !getTimepicker().equals(that.getTimepicker()) : that.getTimepicker() != null); 48 | 49 | } 50 | 51 | @Override 52 | public int hashCode() { 53 | int result = getDatepicker() != null ? getDatepicker().hashCode() : 0; 54 | result = 31 * result + (getTimepicker() != null ? getTimepicker().hashCode() : 0); 55 | return result; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return "DateTimeSettings{" + 61 | "datepicker=" + datepicker + 62 | ", timepicker=" + timepicker + 63 | '}'; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/settings/InputControlsSettings.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.settings; 2 | 3 | /** 4 | * @author Tetiana Iefimenko 5 | */ 6 | public class InputControlsSettings { 7 | 8 | private Boolean useUrlParametersOnReset; 9 | 10 | public InputControlsSettings() { 11 | } 12 | 13 | public InputControlsSettings(InputControlsSettings other) { 14 | this.useUrlParametersOnReset = other.useUrlParametersOnReset; 15 | } 16 | 17 | public Boolean getUseUrlParametersOnReset() { 18 | return useUrlParametersOnReset; 19 | } 20 | 21 | public InputControlsSettings setUseUrlParametersOnReset(Boolean useUrlParametersOnReset) { 22 | this.useUrlParametersOnReset = useUrlParametersOnReset; 23 | return this; 24 | } 25 | 26 | @Override 27 | public boolean equals(Object o) { 28 | if (this == o) return true; 29 | if (!(o instanceof InputControlsSettings)) return false; 30 | 31 | InputControlsSettings that = (InputControlsSettings) o; 32 | 33 | return !(getUseUrlParametersOnReset() != null ? !getUseUrlParametersOnReset().equals(that.getUseUrlParametersOnReset()) : that.getUseUrlParametersOnReset() != null); 34 | 35 | } 36 | 37 | @Override 38 | public int hashCode() { 39 | return getUseUrlParametersOnReset() != null ? getUseUrlParametersOnReset().hashCode() : 0; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "InputControlsSettings{" + 45 | "useUrlParametersOnReset=" + useUrlParametersOnReset + 46 | '}'; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/settings/ItemRegistry.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.settings; 2 | 3 | /** 4 | * @author Tetiana Iefimenko 5 | */ 6 | public class ItemRegistry { 7 | 8 | private String id; 9 | private String label; 10 | private String description; 11 | 12 | public ItemRegistry() { 13 | } 14 | 15 | public ItemRegistry(ItemRegistry other) { 16 | this.id = other.id; 17 | this.label = other.label; 18 | this.description = other.description; 19 | } 20 | 21 | public String getId() { 22 | return id; 23 | } 24 | 25 | public ItemRegistry setId(String id) { 26 | this.id = id; 27 | return this; 28 | } 29 | 30 | public String getLabel() { 31 | return label; 32 | } 33 | 34 | public ItemRegistry setLabel(String label) { 35 | this.label = label; 36 | return this; 37 | } 38 | 39 | public String getDescription() { 40 | return description; 41 | } 42 | 43 | public ItemRegistry setDescription(String description) { 44 | this.description = description; 45 | return this; 46 | } 47 | 48 | @Override 49 | public boolean equals(Object o) { 50 | if (this == o) return true; 51 | if (!(o instanceof ItemRegistry)) return false; 52 | 53 | ItemRegistry that = (ItemRegistry) o; 54 | 55 | if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) return false; 56 | if (getLabel() != null ? !getLabel().equals(that.getLabel()) : that.getLabel() != null) return false; 57 | return !(getDescription() != null ? !getDescription().equals(that.getDescription()) : that.getDescription() != null); 58 | 59 | } 60 | 61 | @Override 62 | public int hashCode() { 63 | int result = getId() != null ? getId().hashCode() : 0; 64 | result = 31 * result + (getLabel() != null ? getLabel().hashCode() : 0); 65 | result = 31 * result + (getDescription() != null ? getDescription().hashCode() : 0); 66 | return result; 67 | } 68 | 69 | @Override 70 | public String toString() { 71 | return "ItemRegistry{" + 72 | "id='" + id + '\'' + 73 | ", label='" + label + '\'' + 74 | ", description='" + description + '\'' + 75 | '}'; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/settings/RequestSettings.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.settings; 2 | 3 | /** 4 | * @author Tetiana Iefimenko 5 | */ 6 | public class RequestSettings { 7 | 8 | private Integer maxInactiveInterval; 9 | private String contextPath; 10 | 11 | public RequestSettings() { 12 | } 13 | 14 | public RequestSettings(RequestSettings other) { 15 | this.maxInactiveInterval = other.maxInactiveInterval; 16 | this.contextPath = other.contextPath; 17 | } 18 | 19 | public Integer getMaxInactiveInterval() { 20 | return maxInactiveInterval; 21 | } 22 | 23 | public RequestSettings setMaxInactiveInterval(Integer maxInactiveInterval) { 24 | this.maxInactiveInterval = maxInactiveInterval; 25 | return this; 26 | } 27 | 28 | public String getContextPath() { 29 | return contextPath; 30 | } 31 | 32 | public RequestSettings setContextPath(String contextPath) { 33 | this.contextPath = contextPath; 34 | return this; 35 | } 36 | 37 | @Override 38 | public boolean equals(Object o) { 39 | if (this == o) return true; 40 | if (!(o instanceof RequestSettings)) return false; 41 | 42 | RequestSettings that = (RequestSettings) o; 43 | 44 | if (getMaxInactiveInterval() != null ? !getMaxInactiveInterval().equals(that.getMaxInactiveInterval()) : that.getMaxInactiveInterval() != null) 45 | return false; 46 | return !(getContextPath() != null ? !getContextPath().equals(that.getContextPath()) : that.getContextPath() != null); 47 | 48 | } 49 | 50 | @Override 51 | public int hashCode() { 52 | int result = getMaxInactiveInterval() != null ? getMaxInactiveInterval().hashCode() : 0; 53 | result = 31 * result + (getContextPath() != null ? getContextPath().hashCode() : 0); 54 | return result; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | return "RequestSettings{" + 60 | "maxInactiveInterval=" + maxInactiveInterval + 61 | ", contextPath='" + contextPath + '\'' + 62 | '}'; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/settings/UserTimeZone.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.dto.settings; 2 | 3 | /** 4 | * @author Tetiana Iefimenko. 5 | */ 6 | 7 | public class UserTimeZone { 8 | private String code; 9 | private String description; 10 | 11 | public UserTimeZone() { 12 | } 13 | 14 | public UserTimeZone(UserTimeZone other) { 15 | this.code = other.code; 16 | this.description = other.description; 17 | } 18 | 19 | public String getCode() { 20 | return code; 21 | } 22 | 23 | public UserTimeZone setCode(String code) { 24 | this.code = code; 25 | return this; 26 | } 27 | 28 | public String getDescription() { 29 | return description; 30 | } 31 | 32 | public UserTimeZone setDescription(String description) { 33 | this.description = description; 34 | return this; 35 | } 36 | 37 | @Override 38 | public boolean equals(Object o) { 39 | if (this == o) return true; 40 | if (!(o instanceof UserTimeZone)) return false; 41 | 42 | UserTimeZone that = (UserTimeZone) o; 43 | 44 | if (getCode() != null ? !getCode().equals(that.getCode()) : that.getCode() != null) return false; 45 | return !(getDescription() != null ? !getDescription().equals(that.getDescription()) : that.getDescription() != null); 46 | 47 | } 48 | 49 | @Override 50 | public int hashCode() { 51 | int result = getCode() != null ? getCode().hashCode() : 0; 52 | result = 31 * result + (getDescription() != null ? getDescription().hashCode() : 0); 53 | return result; 54 | } 55 | 56 | @Override 57 | public String toString() { 58 | return "UserTimeZone{" + 59 | "code='" + code + '\'' + 60 | ", description='" + description + '\'' + 61 | '}'; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/filters/BasicAuthenticationFilter.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.filters; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.core.AuthenticationCredentials; 4 | 5 | import javax.ws.rs.client.ClientRequestContext; 6 | import javax.ws.rs.client.ClientRequestFilter; 7 | import javax.ws.rs.core.MultivaluedMap; 8 | import javax.xml.bind.DatatypeConverter; 9 | import java.io.IOException; 10 | import java.io.UnsupportedEncodingException; 11 | 12 | /** 13 | * @author Tetiana Iefimenko 14 | */ 15 | public class BasicAuthenticationFilter implements ClientRequestFilter { 16 | private final AuthenticationCredentials credentials; 17 | 18 | public BasicAuthenticationFilter(AuthenticationCredentials credentials) { 19 | this.credentials = credentials; 20 | 21 | } 22 | 23 | @Override 24 | public void filter(ClientRequestContext clientRequestContext) throws IOException { 25 | MultivaluedMap headers = clientRequestContext.getHeaders(); 26 | if (credentials.getUsername() == null && credentials.getPassword() == null) { 27 | return; 28 | } 29 | final String basicAuthentication = getBasicAuthentication(); 30 | headers.add("Authorization", basicAuthentication); 31 | 32 | } 33 | 34 | private String getBasicAuthentication() { 35 | String token = this.credentials.getUsername() + ":" + this.credentials.getPassword(); 36 | try { 37 | return "Basic " + DatatypeConverter.printBase64Binary(token.getBytes("UTF-8")); 38 | } catch (UnsupportedEncodingException ex) { 39 | throw new IllegalStateException("Cannot encode with UTF-8", ex); 40 | } 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/com/jaspersoft/jasperserver/jaxrs/client/filters/SessionOutputFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | * http://www.jaspersoft.com. 4 | * 5 | * Unless you have purchased a commercial license agreement from Jaspersoft, 6 | * the following license terms apply: 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Affero General Public License as 10 | * published by the Free Software Foundation, either version 3 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Affero General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Affero General Public License 19 | * along with this program.  If not, see . 20 | */ 21 | package com.jaspersoft.jasperserver.jaxrs.client.filters; 22 | 23 | import javax.ws.rs.client.ClientRequestContext; 24 | import javax.ws.rs.client.ClientRequestFilter; 25 | import java.io.IOException; 26 | import java.util.ArrayList; 27 | import java.util.List; 28 | 29 | public class SessionOutputFilter implements ClientRequestFilter { 30 | 31 | private final String sessionId; 32 | 33 | public SessionOutputFilter(String sessionId) { 34 | this.sessionId = sessionId; 35 | } 36 | 37 | @Override 38 | public void filter(ClientRequestContext requestContext) throws IOException { 39 | List cookies = new ArrayList() {{add("JSESSIONID=" + sessionId);}}; 40 | requestContext.getHeaders().put("Cookie", cookies); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | # 2 | url=http://localhost:8080/jasperserver-pro 3 | #connectionTimeout= 4 | #readTimeout= 5 | jasperserverVersion=v6_0_0 6 | authenticationType=SPRING 7 | logHttp=true 8 | logHttpEntity=true 9 | restrictedHttpMethods=false 10 | handleErrors=true 11 | contentMimeType=JSON 12 | acceptMimeType=JSON 13 | -------------------------------------------------------------------------------- /src/main/resources/org/powermock/extensions/configuration.properties: -------------------------------------------------------------------------------- 1 | powermock.global-ignore=javax.management.* -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/alertingNew/trigger/CalendarTriggerTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.alertingNew.trigger; 2 | 3 | import com.jaspersoft.jasperserver.dto.alerting.ClientAlertCalendarTrigger; 4 | import com.jaspersoft.jasperserver.dto.alerting.ClientCalendarDaysType; 5 | import org.testng.annotations.BeforeMethod; 6 | import org.testng.annotations.Test; 7 | 8 | import java.util.Date; 9 | import java.util.TreeSet; 10 | 11 | import static java.util.Arrays.asList; 12 | import static org.testng.Assert.assertEquals; 13 | 14 | /** 15 | *

16 | *

17 | * 18 | * @author tetiana.iefimenko 19 | * @version $Id$ 20 | * @see 21 | */ 22 | public class CalendarTriggerTest { 23 | 24 | private ClientAlertCalendarTrigger calendarTrigger = new ClientAlertCalendarTrigger(); 25 | 26 | @BeforeMethod 27 | public void before() { 28 | 29 | calendarTrigger. 30 | setMinutes("1-10"). 31 | setHours("8-16"). 32 | setDaysType(ClientCalendarDaysType.ALL). 33 | setWeekDays(new TreeSet(asList((byte) 10, (byte) 21, (byte) 12))). 34 | setMonthDays("1,3,5-22"). 35 | setMonths(new TreeSet(asList((byte)1, (byte)11, (byte)12))). 36 | setCalendarName("Calendar name"). 37 | setEndDate(new Date()). 38 | setId(Long.valueOf(1000)). 39 | setMisfireInstruction(0). 40 | setStartDate(new Date()). 41 | setStartType(1). 42 | setTimezone("Some time zone"). 43 | setVersion(1); 44 | } 45 | 46 | @Test 47 | public void should_clone_object() { 48 | ClientAlertCalendarTrigger cloned = (ClientAlertCalendarTrigger) calendarTrigger.deepClone(); 49 | assertEquals(cloned, calendarTrigger); 50 | } 51 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/alertingNew/trigger/SimpleTriggerTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.alertingNew.trigger; 2 | 3 | import com.jaspersoft.jasperserver.dto.alerting.ClientAlertSimpleTrigger; 4 | import com.jaspersoft.jasperserver.dto.alerting.ClientIntervalUnitType; 5 | import org.testng.annotations.BeforeMethod; 6 | import org.testng.annotations.Test; 7 | 8 | import java.util.Date; 9 | 10 | import static org.testng.Assert.assertEquals; 11 | 12 | 13 | /** 14 | *

15 | *

16 | * 17 | * @author tetiana.iefimenko 18 | * @version $Id$ 19 | * @see 20 | */ 21 | public class SimpleTriggerTest { 22 | 23 | private ClientAlertSimpleTrigger simpleTrigger = new ClientAlertSimpleTrigger(); 24 | 25 | @BeforeMethod 26 | public void before() { 27 | 28 | simpleTrigger. 29 | setOccurrenceCount(10). 30 | setRecurrenceInterval(20). 31 | setRecurrenceIntervalUnit(ClientIntervalUnitType.DAY). 32 | setCalendarName("Calendar name"). 33 | setEndDate(new Date()). 34 | setId(Long.valueOf(1000)). 35 | setMisfireInstruction(10). 36 | setStartDate(new Date()). 37 | setStartType(1). 38 | setTimezone("Some time zone"). 39 | setVersion(1); 40 | } 41 | 42 | @Test 43 | public void should_clone_object() { 44 | ClientAlertSimpleTrigger cloned = (ClientAlertSimpleTrigger) simpleTrigger.deepClone(); 45 | 46 | assertEquals(cloned, simpleTrigger); 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/importexport/exportservice/ExportServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.importexport.exportservice; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 4 | import org.mockito.Mock; 5 | import org.powermock.modules.testng.PowerMockTestCase; 6 | import org.testng.annotations.AfterMethod; 7 | import org.testng.annotations.BeforeMethod; 8 | import org.testng.annotations.Test; 9 | 10 | import java.lang.reflect.Field; 11 | 12 | import static org.mockito.Mockito.reset; 13 | import static org.mockito.MockitoAnnotations.initMocks; 14 | import static org.powermock.api.support.membermodification.MemberMatcher.field; 15 | import static org.testng.Assert.assertEquals; 16 | import static org.testng.Assert.assertSame; 17 | 18 | /** 19 | * Unit tests for {@link ExportService} 20 | */ 21 | public class ExportServiceTest extends PowerMockTestCase { 22 | 23 | @Mock 24 | private SessionStorage storageMock; 25 | 26 | private ExportService service; 27 | 28 | @BeforeMethod 29 | public void after() { 30 | initMocks(this); 31 | service = new ExportService(storageMock); 32 | } 33 | 34 | @Test 35 | public void should_pass_param_to_parent_constructor() { 36 | assertSame(service.getSessionStorage(), storageMock); 37 | } 38 | 39 | @Test 40 | public void should_return_proper_ExportRequestAdapter_object() throws IllegalAccessException { 41 | ExportRequestAdapter adapter = service.task("k4ks3ds"); 42 | Field field = field(ExportRequestAdapter.class, "taskId"); 43 | String taskId = (String) field.get(adapter); 44 | 45 | assertEquals(adapter.getSessionStorage(), storageMock); 46 | assertSame(taskId, "k4ks3ds"); 47 | } 48 | 49 | @Test(expectedExceptions = IllegalArgumentException.class) 50 | public void should_throw_an_exception_when_pass_invalid_param() { 51 | service.task(""); 52 | } 53 | 54 | @AfterMethod 55 | public void before() { 56 | reset(storageMock); 57 | service = null; 58 | } 59 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/importexport/importservice/ImportServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.importexport.importservice; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 4 | import org.mockito.Mock; 5 | import org.powermock.modules.testng.PowerMockTestCase; 6 | import org.testng.annotations.AfterMethod; 7 | import org.testng.annotations.BeforeMethod; 8 | import org.testng.annotations.Test; 9 | 10 | import java.lang.reflect.Field; 11 | 12 | import static org.mockito.Mockito.reset; 13 | import static org.mockito.MockitoAnnotations.initMocks; 14 | import static org.powermock.api.support.membermodification.MemberMatcher.field; 15 | import static org.testng.Assert.assertEquals; 16 | import static org.testng.Assert.assertSame; 17 | 18 | /** 19 | * Unit tests for {@link ImportService} 20 | */ 21 | public class ImportServiceTest extends PowerMockTestCase { 22 | 23 | @Mock 24 | private SessionStorage storageMock; 25 | 26 | private ImportService service; 27 | 28 | @BeforeMethod 29 | public void after() { 30 | initMocks(this); 31 | service = new ImportService(storageMock); 32 | } 33 | 34 | @Test 35 | public void should_pass_param_to_parent_constructor() { 36 | assertSame(service.getSessionStorage(), storageMock); 37 | } 38 | 39 | 40 | @Test 41 | public void should_return_proper_ExportRequestAdapter_object() throws IllegalAccessException { 42 | ImportRequestAdapter adapter = service.task("k4ks3ds"); 43 | Field field = field(ImportRequestAdapter.class, "taskId"); 44 | String taskId = (String) field.get(adapter); 45 | 46 | assertEquals(adapter.getSessionStorage(), storageMock); 47 | assertSame(taskId, "k4ks3ds"); 48 | } 49 | 50 | @Test(expectedExceptions = IllegalArgumentException.class) 51 | public void should_throw_an_exception_when_pass_invalid_param() { 52 | service.task(""); 53 | } 54 | 55 | @AfterMethod 56 | public void before() { 57 | reset(storageMock); 58 | service = null; 59 | } 60 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/jobsNew/trigger/CalendarTriggerTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.jobsNew.trigger; 2 | 3 | import com.jaspersoft.jasperserver.dto.job.ClientCalendarDaysType; 4 | import com.jaspersoft.jasperserver.dto.job.ClientJobCalendarTrigger; 5 | import java.util.Date; 6 | import java.util.TreeSet; 7 | import org.testng.annotations.BeforeMethod; 8 | import org.testng.annotations.Test; 9 | 10 | import static java.util.Arrays.asList; 11 | import static org.testng.Assert.assertEquals; 12 | 13 | /** 14 | *

15 | *

16 | * 17 | * @author tetiana.iefimenko 18 | * @version $Id$ 19 | * @see 20 | */ 21 | public class CalendarTriggerTest { 22 | 23 | private ClientJobCalendarTrigger calendarTrigger = new ClientJobCalendarTrigger(); 24 | 25 | @BeforeMethod 26 | public void before() { 27 | 28 | calendarTrigger. 29 | setMinutes("1-10"). 30 | setHours("8-16"). 31 | setDaysType(ClientCalendarDaysType.ALL). 32 | setWeekDays(new TreeSet(asList((byte) 10, (byte) 21, (byte) 12))). 33 | setMonthDays("1,3,5-22"). 34 | setMonths(new TreeSet(asList((byte)1, (byte)11, (byte)12))). 35 | setCalendarName("Calendar name"). 36 | setEndDate(new Date()). 37 | setId(Long.valueOf(1000)). 38 | setMisfireInstruction(0). 39 | setStartDate(new Date()). 40 | setStartType(1). 41 | setTimezone("Some time zone"). 42 | setVersion(1); 43 | } 44 | 45 | @Test 46 | public void should_clone_object() { 47 | ClientJobCalendarTrigger cloned = (ClientJobCalendarTrigger) calendarTrigger.deepClone(); 48 | assertEquals(cloned, calendarTrigger); 49 | } 50 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/jobsNew/trigger/SimpleTriggerTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.jobsNew.trigger; 2 | 3 | import com.jaspersoft.jasperserver.dto.job.ClientIntervalUnitType; 4 | import com.jaspersoft.jasperserver.dto.job.ClientJobSimpleTrigger; 5 | import java.util.Date; 6 | import org.testng.annotations.BeforeMethod; 7 | import org.testng.annotations.Test; 8 | 9 | import static org.testng.Assert.assertEquals; 10 | 11 | 12 | /** 13 | *

14 | *

15 | * 16 | * @author tetiana.iefimenko 17 | * @version $Id$ 18 | * @see 19 | */ 20 | public class SimpleTriggerTest { 21 | 22 | private ClientJobSimpleTrigger simpleTrigger = new ClientJobSimpleTrigger(); 23 | 24 | @BeforeMethod 25 | public void before() { 26 | 27 | simpleTrigger. 28 | setOccurrenceCount(10). 29 | setRecurrenceInterval(20). 30 | setRecurrenceIntervalUnit(ClientIntervalUnitType.DAY). 31 | setCalendarName("Calendar name"). 32 | setEndDate(new Date()). 33 | setId(Long.valueOf(1000)). 34 | setMisfireInstruction(10). 35 | setStartDate(new Date()). 36 | setStartType(1). 37 | setTimezone("Some time zone"). 38 | setVersion(1); 39 | } 40 | 41 | @Test 42 | public void should_clone_object() { 43 | ClientJobSimpleTrigger cloned = (ClientJobSimpleTrigger) simpleTrigger.deepClone(); 44 | 45 | assertEquals(cloned, simpleTrigger); 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/permissions/PermissionMaskTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.permissions; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | import java.lang.reflect.Constructor; 6 | import java.lang.reflect.InvocationTargetException; 7 | 8 | import static org.testng.Assert.assertNotNull; 9 | 10 | public class PermissionMaskTest { 11 | 12 | @Test 13 | public void magic() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { 14 | 15 | Constructor constructor = PermissionMask.class.getDeclaredConstructor(); 16 | constructor.setAccessible(true); 17 | PermissionMask instance = constructor.newInstance(); 18 | 19 | assertNotNull(instance); 20 | 21 | } 22 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/resources/ResourceFilesMimeTypeTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.util.ResourceFilesMimeType; 4 | import org.testng.annotations.Test; 5 | 6 | import static org.testng.Assert.assertEquals; 7 | 8 | public class ResourceFilesMimeTypeTest { 9 | 10 | @Test 11 | public void should_check_enum() { 12 | 13 | assertEquals(ResourceFilesMimeType.CSS.toString(), "CSS"); 14 | assertEquals(ResourceFilesMimeType.HTML.getType(), "text/html"); 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/resources/ResourcesTypeResolverUtilTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources; 2 | 3 | import com.jaspersoft.jasperserver.dto.resources.ClientFolder; 4 | import com.jaspersoft.jasperserver.dto.resources.ClientOlapUnit; 5 | import com.jaspersoft.jasperserver.dto.resources.ClientQuery; 6 | import com.jaspersoft.jasperserver.dto.resources.ClientResource; 7 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.util.ResourcesTypeResolverUtil; 8 | import org.testng.annotations.Test; 9 | 10 | import static org.testng.Assert.assertEquals; 11 | import static org.testng.Assert.assertNotNull; 12 | import static org.testng.Assert.assertSame; 13 | 14 | public class ResourcesTypeResolverUtilTest { 15 | 16 | @Test 17 | public void should_return_proper_client_resource() { 18 | Class retrieved = ResourcesTypeResolverUtil.getClassForMime("application/repository.olapUnit+{json}"); 19 | assertSame(retrieved, ClientOlapUnit.class); 20 | } 21 | 22 | @Test 23 | public void should_proper_MimeType() { 24 | String retrieved = ResourcesTypeResolverUtil.getMimeType(ClientQuery.class); 25 | assertEquals(retrieved, "application/repository.query+{mime}"); 26 | } 27 | 28 | @Test 29 | public void should_return_class_of_object() { 30 | Class retrieved = ResourcesTypeResolverUtil.getResourceType(new ClientFolder()); 31 | assertSame(retrieved, ClientFolder.class); 32 | } 33 | 34 | @Test 35 | public void should_create_instance_of_class() { 36 | ResourcesTypeResolverUtil created = new ResourcesTypeResolverUtil(); 37 | assertNotNull(created); 38 | } 39 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/resources/support/builder/SecureMondrianConnectionResourceBuilderTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.support.builder; 2 | 3 | import com.jaspersoft.jasperserver.dto.resources.ClientSecureMondrianConnection; 4 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.compexResourcesSupport.builder.SecureMondrianConnectionResourceBuilder; 5 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.compexResourcesSupport.processor.CommonOperationProcessorImpl; 6 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 7 | import org.mockito.Mockito; 8 | import org.powermock.reflect.Whitebox; 9 | import org.testng.annotations.Test; 10 | 11 | import static org.testng.Assert.assertSame; 12 | 13 | /** 14 | * Unit tests for {@link com.jaspersoft.jasperserver.jaxrs.client.apiadapters.resources.compexResourcesSupport.builder.SecureMondrianConnectionResourceBuilder} 15 | */ 16 | public class SecureMondrianConnectionResourceBuilderTest { 17 | 18 | @Test 19 | public void should_pass_params_to_parent_class() { 20 | SessionStorage storageMock = Mockito.mock(SessionStorage.class); 21 | ClientSecureMondrianConnection dummyMondrianConnection = new ClientSecureMondrianConnection(); 22 | SecureMondrianConnectionResourceBuilder created = new SecureMondrianConnectionResourceBuilder(dummyMondrianConnection, storageMock); 23 | SessionStorage retrievedStorage = ((CommonOperationProcessorImpl)Whitebox.getInternalState(created, "processor")).getSessionStorage(); 24 | ClientSecureMondrianConnection retrievedConnection = Whitebox.getInternalState(created, "connection"); 25 | assertSame(retrievedStorage, storageMock); 26 | assertSame(retrievedConnection, dummyMondrianConnection); 27 | } 28 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/apiadapters/settings/SettingsServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.apiadapters.settings; 2 | 3 | import com.jaspersoft.jasperserver.jaxrs.client.core.SessionStorage; 4 | import org.powermock.modules.testng.PowerMockTestCase; 5 | import org.testng.annotations.Test; 6 | 7 | import static org.mockito.Mockito.doReturn; 8 | import static org.mockito.Mockito.mock; 9 | import static org.powermock.api.mockito.PowerMockito.spy; 10 | import static org.testng.Assert.assertNotNull; 11 | 12 | /** 13 | * @author Tetiana Iefimenko 14 | */ 15 | 16 | public class SettingsServiceTest extends PowerMockTestCase { 17 | 18 | @Test 19 | public void should_return_proper_settings_adapter() throws Exception { 20 | //given 21 | SettingsService service = new SettingsService(mock(SessionStorage.class)); 22 | //when 23 | SingleSettingsAdapter retrieved = service.settings(); 24 | //then 25 | assertNotNull(retrieved); 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/core/exceptions/handling/JRSExceptionsMappingTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.handling; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | import java.lang.reflect.Constructor; 6 | import java.lang.reflect.InvocationTargetException; 7 | 8 | import static org.testng.Assert.assertNotNull; 9 | 10 | public class JRSExceptionsMappingTest { 11 | 12 | @Test 13 | public void magic () throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { 14 | Constructor constructor = JRSExceptionsMapping.class.getDeclaredConstructor(); 15 | constructor.setAccessible(true); 16 | JRSExceptionsMapping instance = constructor.newInstance(); 17 | assertNotNull(instance); 18 | } 19 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/core/operationresult/WithEntityOperationResultTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.core.operationresult; 2 | 3 | import com.jaspersoft.jasperserver.dto.authority.ClientUser; 4 | import org.mockito.Mockito; 5 | import org.testng.Assert; 6 | import org.testng.annotations.Test; 7 | 8 | import javax.ws.rs.core.Response; 9 | 10 | /** 11 | * Unit test for {@link WithEntityOperationResult} 12 | */ 13 | @SuppressWarnings("unchecked") 14 | public class WithEntityOperationResultTest { 15 | 16 | @Test 17 | public void should_pass_params_to_parent_class() { 18 | Response responseMock = Mockito.mock(Response.class); 19 | WithEntityOperationResult operationResult = 20 | new WithEntityOperationResult(responseMock, ClientUser.class); 21 | Assert.assertEquals(ClientUser.class, operationResult.getEntityClass()); 22 | Assert.assertEquals(responseMock, operationResult.getResponse()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/test/java/com/jaspersoft/jasperserver/jaxrs/client/providers/CustomRepresentationTypeProviderTest.java: -------------------------------------------------------------------------------- 1 | package com.jaspersoft.jasperserver.jaxrs.client.providers; 2 | 3 | import org.testng.annotations.Test; 4 | 5 | import javax.ws.rs.core.MediaType; 6 | import java.lang.annotation.Annotation; 7 | 8 | import static org.testng.Assert.assertTrue; 9 | 10 | public class CustomRepresentationTypeProviderTest { 11 | 12 | @Test 13 | public void should_return_true_when_params_are_proper() { 14 | CustomRepresentationTypeProvider provider = new CustomRepresentationTypeProvider(); 15 | assertTrue(provider.isReadable(getClass(), getClass(), new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); 16 | } 17 | 18 | @Test 19 | public void method_should_return_true_when_params_are_proper() { 20 | CustomRepresentationTypeProvider provider = new CustomRepresentationTypeProvider(); 21 | assertTrue(provider.isWriteable(getClass(), getClass(), new Annotation[0], MediaType.APPLICATION_JSON_TYPE)); 22 | } 23 | } -------------------------------------------------------------------------------- /src/test/resources/url.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2005 - 2014 Jaspersoft Corporation. All rights reserved. 3 | # http://www.jaspersoft.com. 4 | # 5 | # Unless you have purchased a commercial license agreement from Jaspersoft, 6 | # the following license terms apply: 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU Affero General Public License as 10 | # published by the Free Software Foundation, either version 3 of the 11 | # License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU Affero General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU Affero General Public License 19 | # along with this program.  If not, see . 20 | # 21 | 22 | url=http://localhost:4444/jasperserver-pro/ 23 | contentMimeType=JSON 24 | acceptMimeType=JSON 25 | #contentMimeType=XML 26 | #acceptMimeType=XML 27 | connectionTimeout= 28 | readTimeout= --------------------------------------------------------------------------------