(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 extends T> 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