├── .gitignore ├── LICENSE.txt ├── README.md ├── pom.xml ├── sdk-extension ├── README.md ├── pom.xml ├── sdk-extension-src │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── hpe │ │ └── adm │ │ └── nga │ │ └── sdk │ │ └── extension │ │ ├── ExtendedOctaneClassFactory.java │ │ ├── OctaneExtensionUtil.java │ │ ├── StringQuery.java │ │ ├── businessrules │ │ ├── BusinessRuleEntityModel.java │ │ ├── BusinessRulesService.java │ │ ├── Fact.java │ │ ├── FactFieldModel.java │ │ └── ReferenceArrayFieldModel.java │ │ ├── entities │ │ ├── ExtendedEntityList.java │ │ └── ExtendedGetEntities.java │ │ └── network │ │ ├── RequestInterceptor.java │ │ ├── ResponseInterceptor.java │ │ └── google │ │ └── InterceptorGoogleHttpClient.java └── sdk-extension-usage-examples │ ├── pom.xml │ └── src │ └── main │ └── java │ └── com │ └── hpe │ └── adm │ └── nga │ └── sdk │ └── extension │ ├── BusinessRulesCRUDExample.java │ ├── GetExpandQueryExample.java │ ├── OctaneConnectionConstants.java │ ├── Util.java │ ├── interceptor │ └── InterceptorExample.java │ └── stringquery │ └── StringQueryExample.java ├── sdk-generate-entity-models-maven-plugin ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── hpe │ │ └── adm │ │ └── nga │ │ └── sdk │ │ └── generate │ │ ├── GenerateModels.java │ │ ├── GenerateModelsPlugin.java │ │ ├── GeneratorHelper.java │ │ └── SLF4JLogChute.java │ └── resources │ ├── Entity.vm │ ├── EntityModel.vm │ ├── Lists.vm │ ├── OctaneList.vm │ ├── Phases.vm │ ├── TypedEntityList.vm │ └── logback.xml ├── sdk-integration-tests ├── pom.xml └── src │ └── test │ ├── java │ └── com │ │ └── hpe │ │ └── adm │ │ └── nga │ │ └── sdk │ │ ├── tests │ │ ├── admin │ │ │ ├── TestSharedSpaceAdmin.java │ │ │ └── TestWorkSpaceAdmin.java │ │ ├── attachments │ │ │ └── TestAttachments.java │ │ ├── authentication │ │ │ └── TestAuthentication.java │ │ ├── base │ │ │ └── TestBase.java │ │ ├── comments │ │ │ └── TestComments.java │ │ ├── context │ │ │ └── TestSwitchContext.java │ │ ├── cookieupdate │ │ │ └── TestCookieUpdate.java │ │ ├── crud │ │ │ ├── TestCreateEntity.java │ │ │ ├── TestDeleteEntity.java │ │ │ └── TestUpdateEntity.java │ │ ├── errrohandling │ │ │ └── TestOctaneException.java │ │ ├── filtering │ │ │ ├── TestCrossFiltering.java │ │ │ ├── TestFieldsFilter.java │ │ │ ├── TestLimit.java │ │ │ ├── TestLogicalOperators.java │ │ │ └── TestSupportFiltering.java │ │ ├── generate │ │ │ └── TestGenerateModels.java │ │ ├── metadata │ │ │ └── TestReadMetadata.java │ │ ├── orderby │ │ │ └── TestOrderBy.java │ │ ├── parallelexecution │ │ │ └── TestParallelExecution.java │ │ ├── sandbox │ │ │ └── Demo.java │ │ ├── siteadmin │ │ │ └── server │ │ │ │ └── TestGetServerVersion.java │ │ └── tests │ │ │ ├── TestGherkinScript.java │ │ │ └── TestTestSteps.java │ │ └── utils │ │ ├── AuthenticationUtils.java │ │ ├── CommonUtils.java │ │ ├── ConfigurationUtils.java │ │ ├── ContextUtils.java │ │ ├── HttpUtils.java │ │ ├── QueryUtils.java │ │ └── generator │ │ └── DataGenerator.java │ └── resources │ ├── configuration.properties │ └── logback.xml ├── sdk-src ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── hpe │ │ │ └── adm │ │ │ └── nga │ │ │ └── sdk │ │ │ ├── APIMode.java │ │ │ ├── Octane.java │ │ │ ├── SiteAdmin.java │ │ │ ├── attachments │ │ │ ├── AttachmentList.java │ │ │ ├── CreateAttachment.java │ │ │ └── GetBinaryAttachment.java │ │ │ ├── authentication │ │ │ ├── Authentication.java │ │ │ ├── BasicAuthentication.java │ │ │ ├── ClientAuthentication.java │ │ │ ├── JSONAuthentication.java │ │ │ ├── SessionIdAuthentication.java │ │ │ ├── SimpleBasicAuthentication.java │ │ │ ├── SimpleClientAuthentication.java │ │ │ ├── SimpleUserAuthentication.java │ │ │ └── UserAuthentication.java │ │ │ ├── classfactory │ │ │ ├── DefaultOctaneClassFactory.java │ │ │ └── OctaneClassFactory.java │ │ │ ├── entities │ │ │ ├── EntityList.java │ │ │ ├── OctaneCollection.java │ │ │ ├── TypedEntityList.java │ │ │ ├── create │ │ │ │ ├── CreateEntities.java │ │ │ │ ├── CreateHelper.java │ │ │ │ └── CreateTypedEntities.java │ │ │ ├── delete │ │ │ │ ├── DeleteEntities.java │ │ │ │ ├── DeleteEntity.java │ │ │ │ ├── DeleteHelper.java │ │ │ │ ├── DeleteTypedEntities.java │ │ │ │ └── DeleteTypedEntity.java │ │ │ ├── get │ │ │ │ ├── GetEntities.java │ │ │ │ ├── GetEntity.java │ │ │ │ ├── GetHelper.java │ │ │ │ ├── GetTypedEntities.java │ │ │ │ ├── GetTypedEntity.java │ │ │ │ └── GetTypedHelper.java │ │ │ └── update │ │ │ │ ├── UpdateEntities.java │ │ │ │ ├── UpdateEntity.java │ │ │ │ ├── UpdateHelper.java │ │ │ │ ├── UpdateTypedEntities.java │ │ │ │ └── UpdateTypedEntity.java │ │ │ ├── exception │ │ │ ├── OctaneException.java │ │ │ └── OctanePartialException.java │ │ │ ├── manualtests │ │ │ ├── GetTestSteps.java │ │ │ ├── TestStepList.java │ │ │ ├── UpdateTestSteps.java │ │ │ ├── script │ │ │ │ ├── GetTestScriptModel.java │ │ │ │ └── UpdateTestScriptModel.java │ │ │ └── teststeps │ │ │ │ ├── AbstractTestStep.java │ │ │ │ ├── CallTestStep.java │ │ │ │ ├── TestStep.java │ │ │ │ ├── TestStepParser.java │ │ │ │ └── ValidationTestStep.java │ │ │ ├── metadata │ │ │ ├── EntityMetadata.java │ │ │ ├── FieldMetadata.java │ │ │ ├── GetEntityMetadata.java │ │ │ ├── GetFieldMetadata.java │ │ │ ├── Metadata.java │ │ │ ├── MetadataOctaneRequest.java │ │ │ ├── features │ │ │ │ ├── AttachmentsFeature.java │ │ │ │ ├── AuditingFeature.java │ │ │ │ ├── BusinessRulesFeature.java │ │ │ │ ├── CommentsFeature.java │ │ │ │ ├── Feature.java │ │ │ │ ├── GroupingFeature.java │ │ │ │ ├── HierarchyFeature.java │ │ │ │ ├── MailingFeature.java │ │ │ │ ├── OrderingFeature.java │ │ │ │ ├── PhasesFeature.java │ │ │ │ ├── RestFeature.java │ │ │ │ ├── SubTypesFeature.java │ │ │ │ ├── SubTypesOfFeature.java │ │ │ │ └── UdfFearture.java │ │ │ └── fieldfeatures │ │ │ │ └── BusinessRules.java │ │ │ ├── model │ │ │ ├── AllowedReferences.java │ │ │ ├── ArrayFieldModel.java │ │ │ ├── BooleanFieldModel.java │ │ │ ├── DateFieldModel.java │ │ │ ├── EmptyFieldModel.java │ │ │ ├── Entity.java │ │ │ ├── EntityMetadata.java │ │ │ ├── EntityModel.java │ │ │ ├── EntityUtil.java │ │ │ ├── ErrorModel.java │ │ │ ├── FieldMetadata.java │ │ │ ├── FieldModel.java │ │ │ ├── FloatFieldModel.java │ │ │ ├── LongFieldModel.java │ │ │ ├── ModelParser.java │ │ │ ├── MultiReferenceFieldModel.java │ │ │ ├── ObjectFieldModel.java │ │ │ ├── OctaneCollectionImpl.java │ │ │ ├── OctaneCollectionSupplier.java │ │ │ ├── ReferenceErrorModel.java │ │ │ ├── ReferenceFieldModel.java │ │ │ ├── StringFieldModel.java │ │ │ └── TypedEntityModel.java │ │ │ ├── network │ │ │ ├── OctaneHttpClient.java │ │ │ ├── OctaneHttpRequest.java │ │ │ ├── OctaneHttpResponse.java │ │ │ ├── OctaneRequest.java │ │ │ ├── OctaneUrl.java │ │ │ ├── google │ │ │ │ └── GoogleHttpClient.java │ │ │ └── jetty │ │ │ │ └── JettyHttpClient.java │ │ │ ├── query │ │ │ ├── NullField.java │ │ │ ├── NullReferenceField.java │ │ │ ├── Query.java │ │ │ └── QueryMethod.java │ │ │ └── siteadmin │ │ │ ├── Server.java │ │ │ └── version │ │ │ ├── GetServerVersion.java │ │ │ └── Version.java │ └── overview.html │ └── test │ ├── java │ └── com │ │ └── hpe │ │ └── adm │ │ └── nga │ │ └── sdk │ │ ├── attachments │ │ └── TestAttachments.java │ │ ├── entities │ │ ├── TestCreateEntities.java │ │ └── TestUpdateEntities.java │ │ ├── exception │ │ └── TestOctaneExceptions.java │ │ ├── model │ │ ├── TestEntityUtil.java │ │ ├── TestModel.java │ │ └── TestQuery.java │ │ ├── network │ │ ├── TestOctaneUrl.java │ │ └── google │ │ │ └── TestGoogleHttpClient.java │ │ ├── query │ │ └── TestQueryMethod.java │ │ └── unit_tests │ │ └── common │ │ ├── CommonMethods.java │ │ └── CommonUtils.java │ └── resources │ ├── file.pdf │ ├── getEntitiesMetadataString.txt │ ├── getFieldsMetadataString.txt │ ├── logback.xml │ ├── sample.pdf │ ├── test.txt │ └── test1.txt └── sdk-usage-examples ├── pom.xml └── src └── main └── java └── com └── hpe └── adm └── nga └── sdk └── examples ├── APIModeExample.java ├── CreateContextExample.java ├── EntityExample.java ├── MetadataExample.java ├── TestExample.java └── customhttpclient ├── DummyOctaneHttpClient.java └── DummyOctaneHttpClientExample.java /.gitignore: -------------------------------------------------------------------------------- 1 | ###### JAVA ####### 2 | *.class 3 | 4 | # Mobile Tools for Java (J2ME) 5 | .mtj.tmp/ 6 | 7 | # Package Files # 8 | *.jar 9 | *.war 10 | *.ear 11 | 12 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 13 | hs_err_pid* 14 | 15 | ###### MAVEN ####### 16 | target/ 17 | pom.xml.tag 18 | pom.xml.releaseBackup 19 | pom.xml.versionsBackup 20 | pom.xml.next 21 | release.properties 22 | dependency-reduced-pom.xml 23 | buildNumber.properties 24 | .mvn/timing.properties 25 | 26 | ###### INTELLIJ #### 27 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 28 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 29 | 30 | # User-specific stuff: 31 | .idea/workspace.xml 32 | .idea/tasks.xml 33 | .idea/dictionaries 34 | .idea/vcs.xml 35 | .idea/jsLibraryMappings.xml 36 | 37 | # Sensitive or high-churn files: 38 | .idea/dataSources.ids 39 | .idea/dataSources.xml 40 | .idea/sqlDataSources.xml 41 | .idea/dynamic.xml 42 | .idea/uiDesigner.xml 43 | 44 | # Gradle: 45 | .gradle 46 | .idea/gradle.xml 47 | .idea/libraries 48 | 49 | # Mongo Explorer plugin: 50 | .idea/mongoSettings.xml 51 | 52 | ## File-based project format: 53 | *.iws 54 | 55 | ## Plugin-specific files: 56 | 57 | # Ingeration test config file 58 | sdk-integration-test/src/test/resources/configuration.properties 59 | 60 | # IntelliJ 61 | .idea 62 | *.iml 63 | /out/ 64 | 65 | # mpeltonen/sbt-idea plugin 66 | .idea_modules/ 67 | 68 | # JIRA plugin 69 | atlassian-ide-plugin.xml 70 | 71 | # Crashlytics plugin (for Android Studio and IntelliJ) 72 | com_crashlytics_export_strings.xml 73 | crashlytics.properties 74 | crashlytics-build.properties 75 | fabric.properties 76 | 77 | # ECLIPSE 78 | 79 | .metadata 80 | bin/ 81 | tmp/ 82 | *.tmp 83 | *.bak 84 | *.swp 85 | *~.nib 86 | local.properties 87 | .settings/ 88 | .loadpath 89 | .recommenders 90 | 91 | # Eclipse Core 92 | .project 93 | 94 | # External tool builders 95 | .externalToolBuilders/ 96 | 97 | # Locally stored "Eclipse launch configurations" 98 | *.launch 99 | 100 | # PyDev specific (Python IDE for Eclipse) 101 | *.pydevproject 102 | 103 | # CDT-specific (C/C++ Development Tooling) 104 | .cproject 105 | 106 | # JDT-specific (Eclipse Java Development Tools) 107 | .classpath 108 | 109 | # Java annotation processor (APT) 110 | .factorypath 111 | 112 | # PDT-specific (PHP Development Tools) 113 | .buildpath 114 | 115 | # sbteclipse plugin 116 | .target 117 | 118 | # Tern plugin 119 | .tern-project 120 | 121 | # TeXlipse plugin 122 | .texlipse 123 | 124 | # STS (Spring Tool Suite) 125 | .springBeans 126 | 127 | # Code Recommenders 128 | .recommenders/ 129 | /sdk-src/mockserver*.log 130 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2016-2025 Open Text. 2 | 3 | The only warranties for products and services of Open Text and 4 | its affiliates and licensors (“Open Text”) are as may be set forth 5 | in the express warranty statements accompanying such products and services. 6 | Nothing herein should be construed as constituting an additional warranty. 7 | Open Text shall not be liable for technical or editorial errors or 8 | omissions contained herein. The information contained herein is subject 9 | to change without notice. 10 | 11 | Except as specifically indicated otherwise, this document contains 12 | confidential information and a valid license is required for possession, 13 | use or copying. If this work is provided to the U.S. Government, 14 | consistent with FAR 12.211 and 12.212, Commercial Computer Software, 15 | Computer Software Documentation, and Technical Data for Commercial Items are 16 | licensed to the U.S. Government under vendor's standard commercial license. 17 | 18 | Licensed under the Apache License, Version 2.0 (the "License"); 19 | you may not use this file except in compliance with the License. 20 | You may obtain a copy of the License at 21 | http://www.apache.org/licenses/LICENSE-2.0 22 | Unless required by applicable law or agreed to in writing, software 23 | distributed under the License is distributed on an "AS IS" BASIS, 24 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | See the License for the specific language governing permissions and 26 | limitations under the License. 27 | -------------------------------------------------------------------------------- /sdk-extension/README.md: -------------------------------------------------------------------------------- 1 | # sdk-extension 2 | Extension of ALMOctaneJavaRESTSDK 3 | - provides http client with support for request/response hooks/interceptors 4 | - provides option to build a com.hpe.adm.nga.sdk.query.Query directly from a java.lang.String 5 | - provides support for create, retrieve, update and delete operations on business rules using [BusinessRulesService](https://github.com/MicroFocus/ALMOctaneJavaRESTSDK/blob/master/sdk-extension/sdk-extension-src/src/main/java/com/hpe/adm/nga/sdk/extension/businessrules/BusinessRulesService.java). It also allows accessing the facts within business rules and makes it possible to change the references inside the facts (see [BusinessRulesCRUDExample](https://github.com/MicroFocus/ALMOctaneJavaRESTSDK/blob/master/sdk-extension/sdk-extension-usage-examples/src/main/java/com/hpe/adm/nga/sdk/extension/BusinessRulesCRUDExample.java)) -------------------------------------------------------------------------------- /sdk-extension/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | 34 | sdk-root 35 | com.microfocus.adm.almoctane.sdk 36 | 25.2-SNAPSHOT 37 | 38 | 4.0.0 39 | 40 | com.microfocus.adm.almoctane.sdk.extension 41 | sdk-extension-root 42 | pom 43 | 44 | ALM Octane REST API SDK Extension 45 | 46 | Extension of ALM Octane Java REST SDK, can be used for more advanced use cases. 47 | 48 | https://github.com/MicroFocus/ALMOctaneJavaRESTSDK 49 | 50 | 51 | sdk-extension-src 52 | sdk-extension-usage-examples 53 | 54 | 55 | 56 | 57 | junit 58 | junit 59 | ${junit.version} 60 | test 61 | 62 | 63 | com.microfocus.adm.almoctane.sdk 64 | sdk-src 65 | ${project.version} 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-src/src/main/java/com/hpe/adm/nga/sdk/extension/ExtendedOctaneClassFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension; 30 | 31 | import com.hpe.adm.nga.sdk.classfactory.OctaneClassFactory; 32 | import com.hpe.adm.nga.sdk.entities.EntityList; 33 | import com.hpe.adm.nga.sdk.entities.TypedEntityList; 34 | import com.hpe.adm.nga.sdk.extension.entities.ExtendedEntityList; 35 | import com.hpe.adm.nga.sdk.network.OctaneHttpClient; 36 | 37 | /** 38 | * Class factory for the extension 39 | */ 40 | public class ExtendedOctaneClassFactory implements OctaneClassFactory { 41 | 42 | private static final ExtendedOctaneClassFactory instance = new ExtendedOctaneClassFactory(); 43 | 44 | private ExtendedOctaneClassFactory(){} 45 | public static ExtendedOctaneClassFactory getInstance(){ return instance; } 46 | 47 | @Override 48 | public EntityList getEntityList(OctaneHttpClient octaneHttpClient, String baseDomain, String entityName) { 49 | return new ExtendedEntityList(octaneHttpClient, baseDomain + entityName); 50 | } 51 | 52 | /** 53 | * This is not supported at the moment. Do not use 54 | * 55 | * @param octaneHttpClient client 56 | * @param baseDomain domain 57 | * @param enityListClass class 58 | * @param return type 59 | * @return typed entitylist 60 | * @throws UnsupportedOperationException Don't use this 61 | */ 62 | @Override 63 | public T getEntityList(OctaneHttpClient octaneHttpClient, String baseDomain, Class enityListClass) { 64 | throw new UnsupportedOperationException("Currently cannot get typed entities from the extension. Sorry :("); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-src/src/main/java/com/hpe/adm/nga/sdk/extension/OctaneExtensionUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension; 30 | 31 | import com.hpe.adm.nga.sdk.classfactory.OctaneClassFactory; 32 | 33 | /** 34 | * Util class, will toggle extension, 35 | * all {@link com.hpe.adm.nga.sdk.Octane} classes build after {@link #enable()} will be build 36 | * using the {@link ExtendedOctaneClassFactory}.
37 | * These methods are not thread-safe! 38 | */ 39 | public class OctaneExtensionUtil { 40 | 41 | public static boolean isEnabled(){ 42 | String propValue = System 43 | .getProperties() 44 | .getProperty(OctaneClassFactory.OCTANE_CLASS_FACTORY_CLASS_NAME); 45 | 46 | return ExtendedOctaneClassFactory.class.getCanonicalName().equals(propValue); 47 | } 48 | 49 | public static void enable(){ 50 | System.getProperties().setProperty( 51 | OctaneClassFactory.OCTANE_CLASS_FACTORY_CLASS_NAME, 52 | ExtendedOctaneClassFactory.class.getCanonicalName()); 53 | } 54 | 55 | public static void disable(){ 56 | System.getProperties().remove(OctaneClassFactory.OCTANE_CLASS_FACTORY_CLASS_NAME); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-src/src/main/java/com/hpe/adm/nga/sdk/extension/StringQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension; 30 | 31 | import com.hpe.adm.nga.sdk.query.Query; 32 | 33 | /** 34 | * Variant of the Query object that allows you to bypass using a query builder 35 | * and just write the query string directly.
36 | * Can be useful when you already have the query built, for example, 37 | * it was fetched from the Octane server from some business rule. 38 | */ 39 | public class StringQuery extends Query { 40 | 41 | private StringQuery() { 42 | super(); 43 | } 44 | 45 | /** 46 | * Create a query object from a string directly, not validated client side 47 | * @param queryString string to put as the request's "query" query param value 48 | * @return com.hpe.adm.nga.sdk.extension.StringQuery to use in an OctaneRequest 49 | */ 50 | public static StringQuery fromString(String queryString){ 51 | StringQuery query = new StringQuery(); 52 | query.queryString = queryString; 53 | return query; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-src/src/main/java/com/hpe/adm/nga/sdk/extension/businessrules/FactFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension.businessrules; 30 | 31 | import com.hpe.adm.nga.sdk.model.FieldModel; 32 | 33 | public class FactFieldModel implements FieldModel { 34 | 35 | private String name = ""; 36 | private Fact value = null; 37 | 38 | public FactFieldModel(String name, Fact value) { 39 | setValue(name, value); 40 | } 41 | 42 | @Override 43 | public Fact getValue() { 44 | return value; 45 | } 46 | 47 | @Override 48 | public void setValue(String name, Fact value) { 49 | this.name = name; 50 | this.value = value; 51 | } 52 | 53 | @Override 54 | public String getName() { 55 | return name; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return value.toString(); 61 | } 62 | 63 | @Override 64 | public Object getJSONValue() { 65 | return value.toString(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-src/src/main/java/com/hpe/adm/nga/sdk/extension/businessrules/ReferenceArrayFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension.businessrules; 30 | 31 | import com.hpe.adm.nga.sdk.model.EntityModel; 32 | import com.hpe.adm.nga.sdk.model.ModelParser; 33 | import com.hpe.adm.nga.sdk.model.MultiReferenceFieldModel; 34 | import org.json.JSONArray; 35 | 36 | import java.util.Collection; 37 | 38 | /** 39 | * This class hold the ReferenceArrayFieldModel objects. These are normally arbitrary JSON arrays of entity models. In this case the JSON is 40 | * represented as a Collection of EntityModel 41 | */ 42 | public class ReferenceArrayFieldModel extends MultiReferenceFieldModel { 43 | 44 | /** 45 | * Creates a new ReferenceArrayFieldModel object 46 | * 47 | * @param newName - Field name 48 | * @param value - Field Value 49 | */ 50 | public ReferenceArrayFieldModel(String newName, Collection value) { 51 | super(newName, value); 52 | } 53 | 54 | @Override 55 | public Object getJSONValue() { 56 | JSONArray objEntities = new JSONArray(); 57 | getValue().forEach((i) -> objEntities.put(ModelParser.getInstance().getEntityJSONObject(i))); 58 | 59 | return objEntities; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-src/src/main/java/com/hpe/adm/nga/sdk/extension/entities/ExtendedEntityList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension.entities; 30 | 31 | import com.hpe.adm.nga.sdk.entities.EntityList; 32 | import com.hpe.adm.nga.sdk.network.OctaneHttpClient; 33 | 34 | /** 35 | * Extension of the entity list, used to provide and {@link ExtendedGetEntities} 36 | */ 37 | public final class ExtendedEntityList extends EntityList { 38 | 39 | public ExtendedEntityList(OctaneHttpClient octaneHttpClient, String entityListDomain) { 40 | super(octaneHttpClient, entityListDomain); 41 | } 42 | 43 | /** 44 | * Overrides original get from {@link EntityList} 45 | * @return an extended version of the original {@link com.hpe.adm.nga.sdk.entities.get.GetEntities} 46 | */ 47 | public ExtendedGetEntities get() { 48 | return new ExtendedGetEntities(octaneHttpClient, urlDomain); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-src/src/main/java/com/hpe/adm/nga/sdk/extension/network/RequestInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension.network; 30 | 31 | import java.util.Map; 32 | 33 | /** 34 | * Interceptor for http requests 35 | * Methods are called before request is passed to the {@link com.hpe.adm.nga.sdk.network.OctaneHttpClient} implementation 36 | */ 37 | public interface RequestInterceptor { 38 | 39 | /** 40 | * Get and change the url before the request is executed 41 | * @param url original url 42 | * @return new url that is passed {@link com.hpe.adm.nga.sdk.network.OctaneHttpClient} implementation 43 | */ 44 | default String url(String url){ 45 | return url; 46 | } 47 | 48 | /** 49 | * Get and change the content before the request is executed 50 | * @param content original content of the request 51 | * @return new content that is passed {@link com.hpe.adm.nga.sdk.network.OctaneHttpClient} implementation 52 | */ 53 | default String content(String content){ return content; } 54 | 55 | /** 56 | * Get and change the headers before the request is executed 57 | * @param headers headers of the original request 58 | * @return new headers that are passed {@link com.hpe.adm.nga.sdk.network.OctaneHttpClient} implementation 59 | */ 60 | default Map headers(Map headers){ 61 | return headers; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-src/src/main/java/com/hpe/adm/nga/sdk/extension/network/ResponseInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension.network; 30 | 31 | import java.util.Map; 32 | 33 | /** 34 | * Interceptor for http response 35 | * Methods after the response is received by the {@link com.hpe.adm.nga.sdk.network.OctaneHttpClient} implementation 36 | */ 37 | public interface ResponseInterceptor { 38 | 39 | /** 40 | * Get and change the headers after the request is executed 41 | * @param headers headers of the original response 42 | * @return new headers that are passed {@link com.hpe.adm.nga.sdk.network.OctaneHttpClient} implementation 43 | */ 44 | default Map headers(Map headers){ 45 | return headers; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-usage-examples/src/main/java/com/hpe/adm/nga/sdk/extension/GetExpandQueryExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension; 30 | 31 | import com.hpe.adm.nga.sdk.Octane; 32 | import com.hpe.adm.nga.sdk.authentication.Authentication; 33 | import com.hpe.adm.nga.sdk.authentication.SimpleUserAuthentication; 34 | import com.hpe.adm.nga.sdk.extension.entities.ExtendedGetEntities; 35 | import com.hpe.adm.nga.sdk.model.EntityModel; 36 | 37 | import java.util.*; 38 | 39 | public class GetExpandQueryExample { 40 | 41 | public static void main(String[] args) { 42 | 43 | OctaneExtensionUtil.enable(); 44 | 45 | Authentication authentication = new SimpleUserAuthentication( 46 | OctaneConnectionConstants.username, 47 | OctaneConnectionConstants.password 48 | ); 49 | 50 | Octane octane = 51 | new Octane.Builder(authentication) 52 | .Server(OctaneConnectionConstants.urlDomain) 53 | .sharedSpace(OctaneConnectionConstants.sharedspaceId) 54 | .workSpace(OctaneConnectionConstants.workspaceId).build(); 55 | 56 | 57 | Map> expandMap = new HashMap<>(); 58 | expandMap.put("fields", new HashSet<>()); 59 | expandMap.get("fields").add("author"); 60 | 61 | final Collection defects = 62 | ((ExtendedGetEntities) octane.entityList("defects").get()) 63 | .expand(expandMap) 64 | .execute(); 65 | 66 | Util.printEntities(defects); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-usage-examples/src/main/java/com/hpe/adm/nga/sdk/extension/OctaneConnectionConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension; 30 | 31 | /** 32 | * Used to story some basic values that you can change to run the examples 33 | */ 34 | public interface OctaneConnectionConstants { 35 | 36 | //Server 37 | String urlDomain = "OCTANE_URL"; 38 | Long sharedspaceId = -1L; 39 | Long workspaceId = -1L; 40 | 41 | //Auth 42 | String username = "username"; 43 | String password = "password"; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /sdk-extension/sdk-extension-usage-examples/src/main/java/com/hpe/adm/nga/sdk/extension/stringquery/StringQueryExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.extension.stringquery; 30 | 31 | 32 | import com.hpe.adm.nga.sdk.Octane; 33 | import com.hpe.adm.nga.sdk.authentication.Authentication; 34 | import com.hpe.adm.nga.sdk.authentication.SimpleUserAuthentication; 35 | import com.hpe.adm.nga.sdk.extension.OctaneConnectionConstants; 36 | import com.hpe.adm.nga.sdk.extension.StringQuery; 37 | import com.hpe.adm.nga.sdk.extension.Util; 38 | import com.hpe.adm.nga.sdk.model.EntityModel; 39 | 40 | import java.util.Collection; 41 | 42 | public class StringQueryExample { 43 | 44 | public static void main(String[] args) { 45 | 46 | Authentication authentication 47 | = new SimpleUserAuthentication(OctaneConnectionConstants.username, OctaneConnectionConstants.password); 48 | 49 | Octane octane = 50 | new Octane.Builder(authentication) 51 | .Server(OctaneConnectionConstants.urlDomain) 52 | .sharedSpace(OctaneConnectionConstants.sharedspaceId) 53 | .workSpace(OctaneConnectionConstants.workspaceId) 54 | .build(); 55 | 56 | //Example: query to return stories or defects 57 | StringQuery stringQuery = StringQuery.fromString("subtype EQ 'story' || subtype EQ 'defect'"); 58 | 59 | //Fetch defects as an example a print them to the console 60 | Collection entities = octane 61 | .entityList("work_items") 62 | .get() 63 | .query(stringQuery) 64 | .execute(); 65 | 66 | Util.printEntities(entities); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /sdk-generate-entity-models-maven-plugin/src/main/resources/Entity.vm: -------------------------------------------------------------------------------- 1 | package com.hpe.adm.nga.sdk.model; 2 | 3 | public interface ${interfaceName} extends ${superInterfaceName} {} -------------------------------------------------------------------------------- /sdk-generate-entity-models-maven-plugin/src/main/resources/Lists.vm: -------------------------------------------------------------------------------- 1 | package $packageName; 2 | 3 | import com.hpe.adm.nga.sdk.model.EntityModel; 4 | import com.hpe.adm.nga.sdk.model.StringFieldModel; 5 | import java.util.Arrays; 6 | 7 | import com.hpe.adm.nga.sdk.enums.OctaneList; 8 | 9 | /** 10 | * Generated class - do not edit! 11 | */ 12 | public enum $className implements OctaneList { 13 | 14 | #set($listItems = $listItemsSet.getValue()) 15 | #set($rootModel = $listItems.get(0)) 16 | #set($rootModelName = ${rootModel[0]}) 17 | #foreach($listModel in $listItems)#if(!$foreach.first) 18 | #if($foreach.count > 2), #end${listModel[0]}("${listModel[1]}")#end 19 | #end; 20 | 21 | public static final String ROOT_ID = "${rootModel[1]}"; 22 | 23 | private final String id; 24 | 25 | $rootModelName(final String id) { 26 | this.id = id; 27 | } 28 | 29 | public final String getId() { 30 | return id; 31 | } 32 | 33 | public static $rootModelName getListNodeFromId(String id) { 34 | return Arrays.stream(${rootModelName}.values()).filter(listNode -> listNode.id.equals(id)).findFirst().orElse(null); 35 | } 36 | 37 | public final EntityModel getAsEntityModel() { 38 | final EntityModel entityModel = new EntityModel(); 39 | entityModel.setValue(new StringFieldModel("id", id)); 40 | entityModel.setValue(new StringFieldModel("type", "list_node")); 41 | return entityModel; 42 | } 43 | 44 | public static $rootModelName getFromEntityModel(final EntityModel entityModel) { 45 | return ${rootModelName}.getListNodeFromId(entityModel.getId()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /sdk-generate-entity-models-maven-plugin/src/main/resources/OctaneList.vm: -------------------------------------------------------------------------------- 1 | package com.hpe.adm.nga.sdk.enums; 2 | 3 | import com.hpe.adm.nga.sdk.model.EntityModel; 4 | 5 | public interface OctaneList { 6 | 7 | public String getId(); 8 | public EntityModel getAsEntityModel(); 9 | } 10 | -------------------------------------------------------------------------------- /sdk-generate-entity-models-maven-plugin/src/main/resources/Phases.vm: -------------------------------------------------------------------------------- 1 | package com.hpe.adm.nga.sdk.enums; 2 | 3 | import com.hpe.adm.nga.sdk.model.EntityModel; 4 | import com.hpe.adm.nga.sdk.model.StringFieldModel; 5 | import java.util.Arrays; 6 | 7 | /** 8 | * Generated class - do not edit! 9 | */ 10 | public final class Phases { 11 | 12 | #foreach($phase in ${phaseMap.entrySet()}) 13 | #set($phaseType = $phase.getKey()) 14 | public enum ${phaseType}Phase { 15 | #foreach($phaseValue in $phase.getValue()) 16 | #if($foreach.count > 1), #end${phaseValue[1]}("${phaseValue[0]}")#end; 17 | 18 | private final String id; 19 | 20 | ${phaseType}Phase(final String id) { 21 | this.id = id; 22 | } 23 | 24 | public final String getId() { 25 | return id; 26 | } 27 | 28 | public static ${phaseType}Phase getPhaseFromId(String id) { 29 | return Arrays.stream(${phaseType}Phase.values()).filter(phase -> phase.id.equals(id)).findFirst().orElse(null); 30 | } 31 | 32 | public final EntityModel getAsEntityModel() { 33 | final EntityModel entityModel = new EntityModel(); 34 | entityModel.setValue(new StringFieldModel("id", id)); 35 | entityModel.setValue(new StringFieldModel("type", "phase")); 36 | return entityModel; 37 | } 38 | 39 | public static ${phaseType}Phase getFromEntityModel(final EntityModel entityModel) { 40 | return ${phaseType}Phase.getPhaseFromId(entityModel.getId()); 41 | } 42 | } 43 | 44 | #end 45 | } 46 | -------------------------------------------------------------------------------- /sdk-generate-entity-models-maven-plugin/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 31 | 32 | 33 | 35 | 36 | 37 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /sdk-integration-tests/src/test/java/com/hpe/adm/nga/sdk/tests/authentication/TestAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.tests.authentication; 30 | 31 | import com.hpe.adm.nga.sdk.exception.OctaneException; 32 | import com.hpe.adm.nga.sdk.model.EntityModel; 33 | import com.hpe.adm.nga.sdk.tests.base.TestBase; 34 | import org.junit.Assert; 35 | import org.junit.Test; 36 | 37 | import java.util.Collection; 38 | 39 | /** 40 | * 41 | * Created by leufl on 14/11/2016. 42 | */ 43 | public class TestAuthentication extends TestBase { 44 | 45 | @Test 46 | public void testSignOut() throws Exception { 47 | octane.signOut(); 48 | try { 49 | Collection defectModel = octane.entityList("stories").get().execute(); 50 | Assert.fail("Sign out failed."); 51 | } catch (OctaneException e) {} 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sdk-integration-tests/src/test/java/com/hpe/adm/nga/sdk/tests/filtering/TestLimit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.tests.filtering; 30 | 31 | import com.hpe.adm.nga.sdk.model.EntityModel; 32 | import com.hpe.adm.nga.sdk.tests.base.TestBase; 33 | import com.hpe.adm.nga.sdk.utils.generator.DataGenerator; 34 | import org.junit.Assert; 35 | import org.junit.Test; 36 | 37 | import java.util.Collection; 38 | 39 | /** 40 | * 41 | * Created by perach on 08/05/2016. 42 | */ 43 | public class TestLimit extends TestBase { 44 | 45 | public TestLimit() { 46 | entityName = "releases"; 47 | } 48 | 49 | @Test 50 | public void testLimit() throws Exception { 51 | 52 | Collection generatedEntity = DataGenerator.generateEntityModelCollection(octane, entityName); 53 | entityList.create().entities(generatedEntity).execute(); 54 | 55 | Collection getAllEntities = entityList.get().execute(); 56 | int totalCount = getAllEntities.size(); 57 | 58 | if (totalCount > 1) { 59 | 60 | Collection getLimitEntities = entityList.get().limit(totalCount - 1).execute(); 61 | int limit = getLimitEntities.size(); 62 | 63 | Assert.assertTrue(limit + 1 == totalCount); 64 | } 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /sdk-integration-tests/src/test/java/com/hpe/adm/nga/sdk/tests/sandbox/Demo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.tests.sandbox; 30 | 31 | import com.hpe.adm.nga.sdk.model.EntityModel; 32 | import com.hpe.adm.nga.sdk.tests.base.TestBase; 33 | import com.hpe.adm.nga.sdk.utils.generator.DataGenerator; 34 | import org.junit.Test; 35 | 36 | import java.util.Collection; 37 | 38 | /** 39 | * 40 | * Created by Guy Guetta on 03/05/2016. 41 | */ 42 | public class Demo extends TestBase { 43 | 44 | public Demo() { 45 | entityName = "defect"; 46 | } 47 | 48 | @Test 49 | public void demoTest() throws Exception { 50 | Collection generatedEntity = DataGenerator.generateEntityModel(octane, entityName); 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sdk-integration-tests/src/test/java/com/hpe/adm/nga/sdk/tests/siteadmin/server/TestGetServerVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.tests.siteadmin.server; 30 | 31 | import com.hpe.adm.nga.sdk.siteadmin.version.Version; 32 | import com.hpe.adm.nga.sdk.tests.base.TestBase; 33 | import org.junit.Assert; 34 | import org.junit.Test; 35 | 36 | /** 37 | * Used to test the {@link com.hpe.adm.nga.sdk.siteadmin.version.GetServerVersion} API 38 | */ 39 | public class TestGetServerVersion extends TestBase { 40 | 41 | /** 42 | * Tests getting the server version 43 | */ 44 | @Test 45 | public void testGetServerVersion() { 46 | final Version serverVersion = siteAdmin.getServer().getServerVersion().execute(); 47 | Assert.assertNotNull(serverVersion); 48 | Assert.assertFalse(serverVersion.getVersion().isEmpty()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /sdk-integration-tests/src/test/java/com/hpe/adm/nga/sdk/utils/AuthenticationUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.utils; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | import com.hpe.adm.nga.sdk.authentication.Authentication; 33 | import com.hpe.adm.nga.sdk.authentication.SimpleClientAuthentication; 34 | import com.hpe.adm.nga.sdk.authentication.SimpleUserAuthentication; 35 | 36 | /** 37 | * Created by brucesp on 06/06/2016. 38 | */ 39 | public class AuthenticationUtils { 40 | public static Authentication getAuthentication(boolean useTechnicalPreviewAPI) { 41 | final APIMode apiMode = useTechnicalPreviewAPI ? APIMode.TechnicalPreviewAPIMode : null; 42 | final ConfigurationUtils configuration = ConfigurationUtils.getInstance(); 43 | String authenticationType = configuration.getString("sdk.authenticationType"); 44 | if (authenticationType == null || authenticationType.isEmpty() || authenticationType.equals("userpass")) { 45 | return new SimpleUserAuthentication(configuration.getString("sdk.username"), configuration.getString("sdk.password"), apiMode); 46 | } else if (authenticationType.equals("client")) { 47 | return new SimpleClientAuthentication(configuration.getString("sdk.clientId"), configuration.getString("sdk.clientSecret"), apiMode); 48 | } else { 49 | throw new IllegalArgumentException("Authentication not set!"); 50 | } 51 | } 52 | 53 | public static Authentication getAuthentication() { 54 | return getAuthentication(true); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /sdk-integration-tests/src/test/java/com/hpe/adm/nga/sdk/utils/ConfigurationUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.utils; 30 | 31 | import java.io.IOException; 32 | import java.util.Properties; 33 | 34 | /** 35 | * Created by brucesp on 06/06/2016. 36 | */ 37 | public class ConfigurationUtils { 38 | private static final ConfigurationUtils INSTANCE = new ConfigurationUtils(); 39 | 40 | final Properties combinedConfiguration = new Properties(); 41 | 42 | private ConfigurationUtils() { 43 | try { 44 | combinedConfiguration.load(Thread.currentThread().getContextClassLoader() 45 | .getResourceAsStream("configuration.properties")); 46 | System.getProperties() 47 | .forEach((key, value) -> combinedConfiguration.setProperty(key.toString(), value.toString())); 48 | } catch (IOException e) { 49 | throw new RuntimeException(e); 50 | } 51 | } 52 | 53 | public static final ConfigurationUtils getInstance() { 54 | return INSTANCE; 55 | } 56 | 57 | public final String getString(final String property) { 58 | return combinedConfiguration.getProperty(property); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /sdk-integration-tests/src/test/java/com/hpe/adm/nga/sdk/utils/QueryUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.utils; 30 | 31 | import com.hpe.adm.nga.sdk.query.Query; 32 | import com.hpe.adm.nga.sdk.query.QueryMethod; 33 | 34 | import java.util.List; 35 | 36 | /** 37 | * 38 | * Created by Guy Guetta on 21/04/2016. 39 | */ 40 | public class QueryUtils { 41 | public static Query getQueryForIds(List entityIds) { 42 | 43 | Query.QueryBuilder queryBuilder = null; 44 | 45 | for (int i = 0; i < entityIds.size(); i++) { 46 | if (queryBuilder == null) { 47 | queryBuilder = Query.statement("id", QueryMethod.EqualTo, entityIds.get(i)); 48 | } else { 49 | queryBuilder.or("id", QueryMethod.EqualTo, entityIds.get(i)); 50 | } 51 | } 52 | return queryBuilder.build(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /sdk-integration-tests/src/test/resources/configuration.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 Hewlett-Packard Enterprise Development Company, L.P. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # Properties used for running integration tests 17 | # Can also be injected using vm args with the same prop names, ex. -Dsdk.url=OCTANE_BASE_URL 18 | 19 | # Example: https://awesome-octane.saas.hpe.com/ui/?p=2004/26002 20 | # sdk.url = https://awesome-octane.saas.hpe.com 21 | # sdk.sharedSpaceId = 2004 22 | # sdk.workspaceId = 26002 23 | 24 | sdk.url=OCTANE_BASE_URL 25 | sdk.sharedSpaceId=SHAREDSPACE_ID 26 | sdk.workspaceId=WORKSPACE_ID 27 | # Pick one auth method 28 | # Auth using client id and secret 29 | # API keys can be created on a shared space by a shared space admin 30 | sdk.authenticationType=client 31 | sdk.clientId=CLIENT_ID_HERE 32 | sdk.clientSecret=CLIENT_SECRET_HERE 33 | 34 | # Auth using username and password 35 | # Normal users can be created on the workspace directly 36 | #sdk.authenticationType=userpass 37 | #sdk.username=USERNAME_HERE 38 | #sdk.password=PASSWORD_HERE 39 | -------------------------------------------------------------------------------- /sdk-integration-tests/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/attachments/GetBinaryAttachment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.attachments; 30 | 31 | import com.hpe.adm.nga.sdk.network.OctaneHttpClient; 32 | import com.hpe.adm.nga.sdk.network.OctaneHttpRequest; 33 | import com.hpe.adm.nga.sdk.network.OctaneHttpResponse; 34 | import com.hpe.adm.nga.sdk.network.OctaneRequest; 35 | 36 | import java.io.InputStream; 37 | 38 | /** 39 | * This class hold the GetBinary objects (handle the binary data of a unique Attachment model ) 40 | */ 41 | public class GetBinaryAttachment { 42 | 43 | private final OctaneRequest octaneRequest; 44 | private final OctaneHttpClient octaneHttpClient; 45 | 46 | protected GetBinaryAttachment(OctaneHttpClient octaneHttpClient, String urlDomain, String entityId) { 47 | octaneRequest = new OctaneRequest(octaneHttpClient, urlDomain, entityId); 48 | this.octaneHttpClient = octaneHttpClient; 49 | } 50 | 51 | /** 52 | * GetEntities Request execution of binary data 53 | * @return a stream with binary data 54 | */ 55 | public InputStream execute() { 56 | InputStream inputStream = null; 57 | 58 | OctaneHttpRequest octaneHttpRequest = new OctaneHttpRequest.GetOctaneHttpRequest(octaneRequest.getFinalRequestUrl()) 59 | .setAcceptType(OctaneHttpRequest.OCTET_STREAM_CONTENT_TYPE); 60 | OctaneHttpResponse response = octaneHttpClient.execute(octaneHttpRequest); 61 | 62 | if (response.isSuccessStatusCode()) { 63 | inputStream = response.getInputStream(); 64 | } 65 | 66 | return inputStream; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/authentication/BasicAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.authentication; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | 33 | /** 34 | * Represents basic authentication 35 | */ 36 | public abstract class BasicAuthentication extends Authentication { 37 | 38 | /** 39 | * Represents basic authentication 40 | * 41 | * @param apiMode The mode to use if necessary 42 | */ 43 | BasicAuthentication(final APIMode apiMode) { 44 | super(apiMode, true, false); 45 | } 46 | 47 | /** 48 | * The id that is used for the authentication 49 | * 50 | * @return client id or username 51 | */ 52 | abstract public String getAuthenticationId(); 53 | 54 | /** 55 | * The secret that is used for the authentication 56 | * 57 | * @return client secret or password 58 | */ 59 | abstract public String getAuthenticationSecret(); 60 | } 61 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/authentication/ClientAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.authentication; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | 33 | /** 34 | * Used for api key authentications 35 | * Created by brucesp on 19-Dec-16. 36 | */ 37 | abstract class ClientAuthentication extends JSONAuthentication { 38 | 39 | ClientAuthentication(final APIMode apiMode) { 40 | super(apiMode); 41 | } 42 | 43 | final protected String getAuthenticationIdKey() { 44 | return "client_id"; 45 | } 46 | 47 | final protected String getAuthenticationSecretKey() { 48 | return "client_secret"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/authentication/SessionIdAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.authentication; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | 33 | /** 34 | * Authentication using the LWSSO cookie directly 35 | */ 36 | public class SessionIdAuthentication extends Authentication { 37 | 38 | private final String sessionID; 39 | 40 | /** 41 | * The mode to use or null if none is needed 42 | * 43 | * @param sessionID The session ID 44 | * @param apiMode The mode 45 | */ 46 | public SessionIdAuthentication(String sessionID, APIMode apiMode) { 47 | super(apiMode, false, true); 48 | this.sessionID = sessionID; 49 | } 50 | 51 | public String getSessionID() { 52 | return sessionID; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/authentication/SimpleBasicAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.authentication; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | import org.apache.commons.lang3.StringEscapeUtils; 33 | 34 | /*** 35 | * Basic implementation for using basic authentication with Octane. This stores the user and password in memory 36 | */ 37 | public class SimpleBasicAuthentication extends BasicAuthentication { 38 | private final String userName; 39 | private final String password; 40 | 41 | /** 42 | * @param userName The user 43 | * @param password The password 44 | * @param apiMode API Mode - can be nullable 45 | */ 46 | public SimpleBasicAuthentication(final String userName, final String password, final APIMode apiMode) { 47 | super(apiMode); 48 | this.userName = StringEscapeUtils.escapeJava(userName); 49 | this.password = password; 50 | } 51 | 52 | /** 53 | * @param userName The user 54 | * @param password The password 55 | */ 56 | public SimpleBasicAuthentication(final String userName, final String password) { 57 | this(userName, password, null); 58 | } 59 | 60 | public String getAuthenticationId() { 61 | return userName; 62 | } 63 | 64 | public String getAuthenticationSecret() { 65 | return password; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/authentication/SimpleClientAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.authentication; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | import org.apache.commons.lang3.StringEscapeUtils; 33 | 34 | /** 35 | * Default class to enable api key authentications 36 | * Created by brucesp on 23/05/2016. 37 | */ 38 | public class SimpleClientAuthentication extends ClientAuthentication { 39 | 40 | private final String clientId; 41 | private final String clientSecret; 42 | 43 | /* 44 | * @param clientId The api key 45 | * @param clientSecret The api secret 46 | * @param apiMode API Mode - can be nullable 47 | */ 48 | public SimpleClientAuthentication(final String clientId, final String clientSecret, final APIMode apiMode) { 49 | super(apiMode); 50 | this.clientId = StringEscapeUtils.escapeJava(clientId); 51 | this.clientSecret = clientSecret; 52 | } 53 | 54 | /* 55 | * @param clientId The api key 56 | * @param clientSecret The api secret 57 | */ 58 | public SimpleClientAuthentication(final String clientId, final String clientSecret) { 59 | this(clientId, clientSecret, null); 60 | } 61 | 62 | protected String getAuthenticationId() { 63 | return clientId; 64 | } 65 | 66 | protected String getAuthenticationSecret() { 67 | return clientSecret; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/authentication/SimpleUserAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.authentication; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | import org.apache.commons.lang3.StringEscapeUtils; 33 | 34 | /** 35 | * Default class to enable user authentications 36 | * Created by brucesp on 23/05/2016. 37 | */ 38 | public class SimpleUserAuthentication extends UserAuthentication { 39 | 40 | private final String userName; 41 | private final String password; 42 | 43 | /** 44 | * 45 | * @param userName The user 46 | * @param password The password 47 | * @param apiMode API Mode - can be nullable 48 | */ 49 | public SimpleUserAuthentication(final String userName, final String password, final APIMode apiMode) { 50 | super(apiMode); 51 | this.userName = StringEscapeUtils.escapeJava(userName); 52 | this.password = password; 53 | } 54 | 55 | /** 56 | * 57 | * @param userName The user 58 | * @param password The password 59 | */ 60 | public SimpleUserAuthentication(final String userName, final String password) { 61 | this(userName, password, null); 62 | } 63 | 64 | protected String getAuthenticationId() { 65 | return userName; 66 | } 67 | 68 | protected String getAuthenticationSecret() { 69 | return password; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/authentication/UserAuthentication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.authentication; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | 33 | /** 34 | * Used for user/password authentications 35 | * Created by brucesp on 19-Dec-16. 36 | */ 37 | abstract class UserAuthentication extends JSONAuthentication { 38 | 39 | UserAuthentication(final APIMode apiMode) { 40 | super(apiMode); 41 | } 42 | 43 | final protected String getAuthenticationIdKey() { 44 | return "user"; 45 | } 46 | 47 | final protected String getAuthenticationSecretKey() { 48 | return "password"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/classfactory/DefaultOctaneClassFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.classfactory; 30 | 31 | import com.hpe.adm.nga.sdk.entities.EntityList; 32 | import com.hpe.adm.nga.sdk.entities.TypedEntityList; 33 | import com.hpe.adm.nga.sdk.network.OctaneHttpClient; 34 | 35 | import java.lang.reflect.InvocationTargetException; 36 | 37 | /** 38 | * Default implementation of the {@link OctaneClassFactory}, used by {@link OctaneClassFactory#getImplementation(String)} 39 | * when no string or system property is specified 40 | */ 41 | final class DefaultOctaneClassFactory implements OctaneClassFactory{ 42 | 43 | private static final OctaneClassFactory instance = new DefaultOctaneClassFactory(); 44 | 45 | private DefaultOctaneClassFactory(){} 46 | 47 | static OctaneClassFactory getInstance(){ 48 | return instance; 49 | } 50 | 51 | @Override 52 | public EntityList getEntityList(OctaneHttpClient octaneHttpClient, String baseDomain, String entityName) { 53 | return new EntityList(octaneHttpClient, baseDomain + entityName); 54 | } 55 | 56 | @Override 57 | public T getEntityList(OctaneHttpClient octaneHttpClient, String baseDomain, Class entityListClass) { 58 | try { 59 | return entityListClass.getConstructor(OctaneHttpClient.class, String.class).newInstance(octaneHttpClient, baseDomain); 60 | } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { 61 | throw new RuntimeException(e); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/entities/OctaneCollection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.entities; 30 | 31 | import com.hpe.adm.nga.sdk.model.Entity; 32 | 33 | import java.util.Collection; 34 | 35 | /** 36 | * An extension of the {@link Collection} interface that incorporates important metadata about the collection that has 37 | * been returned. 38 | * 39 | * These are the total_count and exceeds_total_count fields. These are important when scrolling through paged data to 40 | * know whether there is more data to fetch. Exceeds total count signifies whether the requested data page size is larger 41 | * than allowed by server constraints. 42 | * 43 | * See the REST API documentation for more details 44 | */ 45 | public interface OctaneCollection extends Collection { 46 | 47 | /** 48 | * Returned when the total count field has not been set 49 | */ 50 | int NO_TOTAL_COUNT_SET = -1; 51 | 52 | /** 53 | * The total count of available entities that answer to the current query 54 | * @return total count or NO_TOTAL_COUNT_SET if not set 55 | */ 56 | int getTotalCount(); 57 | 58 | /** 59 | * Whether the requested number of entities exceeds the total available number of entities 60 | * @return exceeds total count (false if not set as well) 61 | */ 62 | boolean exceedsTotalCount(); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/entities/delete/DeleteHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.entities.delete; 30 | 31 | import com.hpe.adm.nga.sdk.entities.OctaneCollection; 32 | import com.hpe.adm.nga.sdk.model.EntityModel; 33 | import com.hpe.adm.nga.sdk.network.OctaneHttpRequest; 34 | import com.hpe.adm.nga.sdk.network.OctaneRequest; 35 | 36 | /** 37 | * A helper for deleting entities 38 | */ 39 | final class DeleteHelper { 40 | 41 | private static final DeleteHelper INSTANCE = new DeleteHelper(); 42 | 43 | private DeleteHelper() { 44 | } 45 | 46 | static DeleteHelper getInstance() { 47 | return INSTANCE; 48 | } 49 | 50 | /** 51 | * 1. GetEntities Request execution with json data 2. Parse response to a 52 | * new EntityModel object 53 | * 54 | * @param octaneRequest the octane request 55 | */ 56 | EntityModel deleteEntityModel(OctaneRequest octaneRequest) { 57 | OctaneHttpRequest octaneHttpRequest = new OctaneHttpRequest.DeleteOctaneHttpRequest(octaneRequest.getFinalRequestUrl()); 58 | octaneHttpRequest.setHeaders(octaneRequest.getHeaders()); 59 | return octaneRequest.getEntityResponse(octaneHttpRequest); 60 | } 61 | 62 | /** 63 | * Execute a DeleteEntities request 64 | * 65 | * @param octaneRequest the octane request 66 | * @return null 67 | */ 68 | OctaneCollection deleteEntityModels(OctaneRequest octaneRequest) { 69 | OctaneHttpRequest octaneHttpRequest = new OctaneHttpRequest.DeleteOctaneHttpRequest(octaneRequest.getFinalRequestUrl()); 70 | octaneHttpRequest.setHeaders(octaneRequest.getHeaders()); 71 | return octaneRequest.getEntitiesResponse(octaneHttpRequest); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/entities/delete/DeleteTypedEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.entities.delete; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | import com.hpe.adm.nga.sdk.entities.TypedEntityList; 33 | import com.hpe.adm.nga.sdk.model.TypedEntityModel; 34 | import com.hpe.adm.nga.sdk.network.OctaneHttpClient; 35 | import com.hpe.adm.nga.sdk.network.OctaneRequest; 36 | 37 | /** 38 | * The generic super class for the context of delete for typed entities. 39 | * 40 | * @param The type of the entity model 41 | * @see DeleteEntity for the non typed version 42 | */ 43 | public abstract class DeleteTypedEntity extends TypedEntityList.TypedEntityRequest { 44 | private final OctaneRequest octaneRequest; 45 | 46 | protected DeleteTypedEntity(final Class typedEntityModelClass, final OctaneHttpClient octaneHttpClient, final String urlDomain, final String entityId) { 47 | super(typedEntityModelClass); 48 | octaneRequest = new OctaneRequest(octaneHttpClient, urlDomain, entityId); 49 | } 50 | 51 | /** 52 | * Carries out the execution and returns the deleted entity 53 | * 54 | * @return The deleted entity 55 | 56 | */ 57 | public final T execute() { 58 | return getEntityInstance(DeleteHelper.getInstance().deleteEntityModel(octaneRequest)); 59 | } 60 | 61 | /** 62 | * Carries out the execution and returns the entity, using a custom api mode 63 | * 64 | * @return The entity 65 | */ 66 | public final T execute(APIMode header) { 67 | octaneRequest.addHeader(header); 68 | T result = execute(); 69 | octaneRequest.removeHeader(header); 70 | return result; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/entities/get/GetTypedHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.entities.get; 30 | 31 | import com.hpe.adm.nga.sdk.entities.TypedEntityList; 32 | import com.hpe.adm.nga.sdk.network.OctaneRequest; 33 | 34 | /** 35 | * A helper class for shared functionality for get typed entities 36 | */ 37 | final class GetTypedHelper { 38 | 39 | /** 40 | * Set Fields Parameters 41 | * 42 | * @param octaneRequest The request to be sent to the server 43 | * @param fields An array or comma separated list of fields to be retrieved 44 | */ 45 | static void addFields(final OctaneRequest octaneRequest, final F... fields) { 46 | final String fieldsAsString[] = new String[fields.length]; 47 | for (int i = 0; i < fields.length; ++i) { 48 | fieldsAsString[i] = fields[i].getFieldName(); 49 | } 50 | octaneRequest.getOctaneUrl().addFieldsParam(fieldsAsString); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/exception/OctaneException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.exception; 30 | 31 | import com.hpe.adm.nga.sdk.model.ErrorModel; 32 | 33 | /** 34 | * 35 | * This extends the RuntimeException objects and serve all functionality concern to 36 | * Octane Exceptions. 37 | * 38 | */ 39 | public class OctaneException extends RuntimeException { 40 | 41 | private final ErrorModel errorModel; 42 | 43 | /** 44 | * Creates a new OctaneException object based on error model 45 | * 46 | * @param error - error model 47 | * 48 | */ 49 | public OctaneException(ErrorModel error){ 50 | this.errorModel = error; 51 | } 52 | 53 | /** 54 | * get error model 55 | * @return error model 56 | */ 57 | public ErrorModel getError(){ 58 | return errorModel; 59 | } 60 | 61 | @Override 62 | public String getMessage() { 63 | if (errorModel == null) { 64 | return "Unknown error."; 65 | } 66 | return errorModel.toString(); 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/manualtests/TestStepList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.manualtests; 30 | 31 | import com.hpe.adm.nga.sdk.network.OctaneHttpClient; 32 | 33 | /** 34 | * An object that enables getting or updating (or creating) test steps using the SDK 35 | * 36 | * @see Create Manual Test Steps 37 | */ 38 | public class TestStepList { 39 | 40 | private final OctaneHttpClient octaneHttpClient; 41 | private final String scriptUrl; 42 | 43 | /** 44 | * The constructor. The test id HAS to refer to a manual_test otherwise the API call will fail 45 | * 46 | * @param octaneHttpClient The client to use 47 | * @param baseDomain The base domain from which the URL will be constructed 48 | * @param testId Has to be a manual test ID otherwise the API will fail 49 | */ 50 | public TestStepList(OctaneHttpClient octaneHttpClient, String baseDomain, final String testId) { 51 | this.octaneHttpClient = octaneHttpClient; 52 | this.scriptUrl = baseDomain + "tests/" + testId + "/script"; 53 | } 54 | 55 | /** 56 | * Returns an instance of {@link GetTestSteps} in order to see test steps 57 | * 58 | * @return the instance 59 | */ 60 | public GetTestSteps get() { 61 | return new GetTestSteps(octaneHttpClient, scriptUrl); 62 | } 63 | 64 | /** 65 | * Returns an instance of {@link UpdateTestSteps} in order to update or create test steps 66 | * 67 | * @return the instance 68 | */ 69 | public UpdateTestSteps update() { 70 | return new UpdateTestSteps(octaneHttpClient, scriptUrl); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/manualtests/teststeps/CallTestStep.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.manualtests.teststeps; 30 | 31 | /** 32 | * A test step representing calling another test (see Octane documentation) 33 | * Note: The called ID is not checked by the SDK - the REST API will fail if there is a problem 34 | */ 35 | public class CallTestStep extends AbstractTestStep { 36 | private final String testId; 37 | private final String callStepString; 38 | 39 | /** 40 | * The prefix for the call step 41 | */ 42 | public static final String PREFIX = "- @"; 43 | 44 | /** 45 | * Callstep has two parts - the ID of the called test and an optional step 46 | * 47 | * @param testId the id to call 48 | * @param testStep the optional step 49 | */ 50 | public CallTestStep(final String testId, final String testStep) { 51 | super(testId.concat(" ").concat(testStep), false); 52 | this.testId = testId; 53 | this.callStepString = testStep; 54 | } 55 | 56 | @Override 57 | String getTestStepPrefix() { 58 | return PREFIX; 59 | } 60 | 61 | /** 62 | * The test ID 63 | * 64 | * @return id 65 | */ 66 | public String getTestId() { 67 | return testId; 68 | } 69 | 70 | /** 71 | * The string of the optional call step 72 | * 73 | * @return the string after the test id 74 | */ 75 | public String getCallStepString() { 76 | return callStepString; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/manualtests/teststeps/TestStep.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.manualtests.teststeps; 30 | 31 | /** 32 | * A normal test step 33 | */ 34 | public class TestStep extends AbstractTestStep { 35 | /** 36 | * The Prefix of a normal test step 37 | */ 38 | public static final String PREFIX = "- "; 39 | 40 | /** 41 | * Constructor 42 | * 43 | * @param testStep the step 44 | */ 45 | public TestStep(final String testStep) { 46 | super(testStep); 47 | } 48 | 49 | @Override 50 | String getTestStepPrefix() { 51 | return PREFIX; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/manualtests/teststeps/TestStepParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.manualtests.teststeps; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | 34 | /** 35 | * Used to parse the step to see what type of test it is and to create the correct object instance 36 | */ 37 | public class TestStepParser { 38 | 39 | /** 40 | * Create a list of objects representing the steps 41 | * 42 | * @param testScript The script to parse 43 | * @return The list of objects 44 | */ 45 | public static List parseTestSteps(String testScript) { 46 | final String[] steps = testScript.split("\n"); 47 | final List abstractTestSteps = new ArrayList<>(steps.length); 48 | for (final String step : steps) { 49 | if (step.startsWith(ValidationTestStep.PREFIX)) { 50 | abstractTestSteps.add(new ValidationTestStep(step.substring(ValidationTestStep.PREFIX.length()))); 51 | } else if (step.startsWith(CallTestStep.PREFIX)) { 52 | abstractTestSteps.add( 53 | new CallTestStep( 54 | step.substring(CallTestStep.PREFIX.length(), step.indexOf(" ", CallTestStep.PREFIX.length())), 55 | step.substring(step.indexOf(" ", CallTestStep.PREFIX.length()) + 1)) 56 | ); 57 | } else if (step.startsWith(TestStep.PREFIX)) { 58 | abstractTestSteps.add(new TestStep(step.substring(TestStep.PREFIX.length()))); 59 | } 60 | } 61 | 62 | return abstractTestSteps; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/manualtests/teststeps/ValidationTestStep.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.manualtests.teststeps; 30 | 31 | /** 32 | * A class representing the validation test step. See Octane documentation for more details 33 | */ 34 | public class ValidationTestStep extends AbstractTestStep { 35 | /** 36 | * The prefix for the validation test step 37 | */ 38 | public static final String PREFIX = "- ?"; 39 | 40 | /** 41 | * Constructor 42 | * 43 | * @param validationTestStep the validation test step 44 | */ 45 | public ValidationTestStep(final String validationTestStep) { 46 | super(validationTestStep); 47 | } 48 | 49 | @Override 50 | String getTestStepPrefix() { 51 | return PREFIX; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/MetadataOctaneRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata; 30 | 31 | import com.hpe.adm.nga.sdk.network.OctaneHttpClient; 32 | import com.hpe.adm.nga.sdk.network.OctaneRequest; 33 | import com.hpe.adm.nga.sdk.query.Query; 34 | import com.hpe.adm.nga.sdk.query.QueryMethod; 35 | 36 | /** 37 | * Abstract request used for fetching metadata 38 | */ 39 | abstract class MetadataOctaneRequest { 40 | 41 | protected static final String JSON_DATA_FIELD_NAME = "data"; 42 | protected static final String LOGGER_RESPONSE_JSON_FORMAT = "Response_Json: {}"; 43 | protected final OctaneRequest octaneRequest; 44 | protected final OctaneHttpClient octaneHttpClient; 45 | 46 | protected MetadataOctaneRequest(OctaneHttpClient octaneHttpClient, String urlDomain) { 47 | octaneRequest = new OctaneRequest(octaneHttpClient, urlDomain); 48 | this.octaneHttpClient = octaneHttpClient; 49 | } 50 | 51 | final MetadataOctaneRequest addEntities(String queryFieldName, String... entities) { 52 | if (entities == null || entities.length == 0) { 53 | return this; 54 | } else { 55 | Query.QueryBuilder builder = null; 56 | for (String entity : entities) { 57 | if (builder == null) { 58 | builder = Query.statement(queryFieldName, QueryMethod.EqualTo, entity); 59 | } else { 60 | builder = builder.or(Query.statement(queryFieldName, QueryMethod.EqualTo, entity)); 61 | } 62 | } 63 | octaneRequest.getOctaneUrl().setDqlQueryParam(builder.build()); 64 | return this; 65 | } 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/AttachmentsFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | 32 | /** 33 | * 34 | * This class hold the AttachmentsFeature object and serve all functionality concern to Attachments Feature 35 | * 36 | */ 37 | public class AttachmentsFeature extends Feature{ 38 | 39 | private String relation_name; 40 | 41 | /** 42 | * get relation name 43 | * @return the name of the relation 44 | */ 45 | public String getRelationName() { return relation_name; } 46 | } 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/AuditingFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * Created by ngthien on 8/3/2016. 34 | */ 35 | public class AuditingFeature extends Feature { 36 | } 37 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/BusinessRulesFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * This class hold the BusinessRuleFeature object and serve all functionality concern to Business Rule Feature 34 | * 35 | */ 36 | public class BusinessRulesFeature extends Feature{ 37 | 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/CommentsFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * This class hold the CommentsFeature object and serve all functionality concern to Comments Feature 34 | * 35 | */ 36 | public class CommentsFeature extends Feature{ 37 | 38 | private String relation_name; 39 | 40 | public String getRelationName() { return relation_name; } 41 | } 42 | 43 | 44 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/Feature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * This class hold the base class of all Features 34 | * 35 | */ 36 | public class Feature { 37 | 38 | private String name =""; 39 | 40 | /** 41 | * get feature name 42 | * @return The name of the feature 43 | */ 44 | public String getName(){ 45 | return name; 46 | } 47 | 48 | /** 49 | * set feature name 50 | * @param newName The name of the feature 51 | */ 52 | public void setName(String newName){ 53 | name = newName; 54 | } 55 | 56 | } 57 | 58 | 59 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/GroupingFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * Created by ngthien on 8/3/2016. 34 | */ 35 | public class GroupingFeature extends Feature { 36 | } 37 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/HierarchyFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * This class hold the HierarchyFeature object and serve all functionality concern to Hierarchy Feature 34 | * 35 | */ 36 | public class HierarchyFeature extends Feature{ 37 | 38 | private String[] child_types; 39 | private String[] parent_types; 40 | private Root root; 41 | 42 | /** 43 | * get Child Types 44 | * @return an array of child types 45 | */ 46 | public String[] getChildTypes(){return child_types;} 47 | 48 | /** 49 | * get Parent Types 50 | * @return an array of parent types 51 | */ 52 | public String[] getParentTypes(){return parent_types;} 53 | 54 | /** 55 | * get Root Types 56 | * @return the root type 57 | */ 58 | public Root getRootEnt(){return root;} 59 | 60 | /** 61 | * Root Data structure 62 | * 63 | */ 64 | public static class Root { 65 | private String type; 66 | private String id; 67 | 68 | /** 69 | * get type 70 | * @return the type of the root 71 | */ 72 | public String getType(){return type;} 73 | 74 | /** 75 | * get id 76 | * @return the id of the root 77 | */ 78 | public String getId(){return id;} 79 | } 80 | } 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/MailingFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * This class hold the MailingFeature object and serve all functionality concern to mailing Feature 34 | * 35 | */ 36 | public class MailingFeature extends Feature{ 37 | 38 | 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/OrderingFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * Created by ngthien on 8/3/2016. 34 | */ 35 | public class OrderingFeature extends Feature { 36 | 37 | private Aspect[] aspects; 38 | 39 | /** 40 | * get aspects 41 | * @return the ordering aspects 42 | */ 43 | public Aspect[] getAspects() { return aspects; } 44 | 45 | public class Aspect { 46 | private String aspect_name; 47 | private String order_field_name; 48 | private String context_field_name; 49 | 50 | public String getAspectName() { return aspect_name; } 51 | public String getOrderFieldName() { return order_field_name; } 52 | public String getContextFieldName() { return context_field_name; } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/PhasesFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * Created by ngthien on 8/3/2016. 34 | */ 35 | public class PhasesFeature extends Feature { 36 | } 37 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/RestFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | import com.hpe.adm.nga.sdk.metadata.FieldMetadata.AccessLevel; 32 | 33 | /** 34 | * 35 | * This class hold the RestFeature object and serve all functionality concern to rest Feature 36 | * 37 | */ 38 | public class RestFeature extends Feature{ 39 | 40 | private String url; 41 | private String[] methods; 42 | private AccessLevel access_level; 43 | 44 | /** 45 | * get url 46 | * 47 | * @return The url of the rest feature 48 | */ 49 | public String getUrl(){ 50 | return url; 51 | } 52 | 53 | /** 54 | * get supported methods 55 | * 56 | * @return the supported methods (GET, POST, PUT, DELETE) 57 | */ 58 | public String[] getMethods(){ 59 | return methods; 60 | } 61 | 62 | /** 63 | * get access level of the methods 64 | * 65 | * @return the Access Level of the Feature 66 | */ 67 | public AccessLevel getAccessLevel() { 68 | return access_level; 69 | } 70 | } 71 | 72 | 73 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/SubTypesFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * This class hold the SubTypesFeature object and serve all functionality concern to SubTypes Feature 34 | * 35 | */ 36 | public class SubTypesFeature extends Feature{ 37 | 38 | private String[] types; 39 | private boolean editable; 40 | 41 | /** 42 | * get types 43 | * @return an array of subtypes 44 | */ 45 | public String[] getTypes(){return types;} 46 | 47 | /** 48 | * get editable 49 | * @return whether this is editable 50 | */ 51 | public boolean getEditable() { return editable; } 52 | } 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/SubTypesOfFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * This class hold the SubTypesOfFeature object and serve all functionality concern to SubTypesOf Feature 34 | * 35 | */ 36 | public class SubTypesOfFeature extends Feature{ 37 | 38 | private String type; 39 | 40 | /** 41 | * get types 42 | * @return the type of subtype 43 | */ 44 | public String getType(){return type;} 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/features/UdfFearture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.features; 30 | 31 | /** 32 | * 33 | * Created by ngthien on 8/3/2016. 34 | */ 35 | public class UdfFearture extends Feature { 36 | } 37 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/metadata/fieldfeatures/BusinessRules.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.metadata.fieldfeatures; 30 | 31 | /** 32 | * 33 | * Created by ngthien on 8/3/2016. 34 | */ 35 | class BusinessRules { 36 | private static final String name = "business_rules"; 37 | private boolean show_in_action; 38 | private boolean show_in_condition; 39 | 40 | public String getName() {return name;} 41 | public boolean getShowInAction() {return show_in_action;} 42 | public boolean getShowInCondition() {return show_in_condition;} 43 | } 44 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/AllowedReferences.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | import java.lang.annotation.ElementType; 32 | import java.lang.annotation.Retention; 33 | import java.lang.annotation.RetentionPolicy; 34 | import java.lang.annotation.Target; 35 | 36 | /** 37 | * Annotation that defines the true references that are allowed for the given method 38 | * When a reference field can return more than one type of reference this defines the actual 39 | * sub types that are returned 40 | */ 41 | @Retention(RetentionPolicy.RUNTIME) 42 | @Target(ElementType.METHOD) 43 | public @interface AllowedReferences { 44 | Class[] value(); 45 | } 46 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/ArrayFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | import org.json.JSONArray; 32 | 33 | /** 34 | * This class hold the ArrayFieldModel objects. These are normally arbitrary JSON arrays of primitives. In this case the JSON is 35 | * represented as a string 36 | */ 37 | public class ArrayFieldModel extends StringFieldModel implements FieldModel { 38 | 39 | /** 40 | * Creates a new ArrayFieldModel object 41 | * 42 | * @param newName - Field name 43 | * @param newValue - Field Value 44 | */ 45 | public ArrayFieldModel(String newName, String newValue) { 46 | super(newName, newValue); 47 | } 48 | 49 | @Override 50 | public Object getJSONValue() { 51 | return new JSONArray(getValue()); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/BooleanFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | /** 32 | * 33 | * This class hold the BooleanFieldModel objects and serve as a Boolean type FieldModel data holder 34 | * 35 | */ 36 | public class BooleanFieldModel implements FieldModel { 37 | 38 | //Private 39 | private String name = ""; 40 | private Boolean value = false; 41 | 42 | /** 43 | * Creates a new BooleanFieldModel object 44 | * 45 | * @param newName - Field name 46 | * @param newValue - Field Value 47 | */ 48 | public BooleanFieldModel(String newName,Boolean newValue){ 49 | 50 | setValue(newName,newValue); 51 | } 52 | 53 | /** 54 | * get value 55 | */ 56 | public Boolean getValue() { 57 | return value; 58 | } 59 | 60 | /** 61 | * get Field's name 62 | */ 63 | public String getName(){ 64 | return name; 65 | } 66 | 67 | /** 68 | * set Field's name/value 69 | */ 70 | public void setValue(String newName,Boolean newValue){ 71 | 72 | name = newName; 73 | value = newValue; 74 | } 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/DateFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | import java.time.ZoneId; 32 | import java.time.ZonedDateTime; 33 | 34 | /** 35 | * 36 | * This class holds the DateFieldModel objects and serves as a ZonedDateTime type FieldModel data holder. Note according to 37 | * the Octane server specification all dates are stored in the UTC time zone. Therefore when sending information to the 38 | * server the timezone is converted to UTC (whilst keeping the same instant). All dates that are returned are in the UTC 39 | * time zone and it is up to the consumer to convert to the correct time zone if necessary 40 | * 41 | * 42 | */ 43 | public class DateFieldModel implements FieldModel { 44 | 45 | //Private 46 | private String name = ""; 47 | private ZonedDateTime value = null; 48 | 49 | /** 50 | * Creates a new DateFieldModel object 51 | * 52 | * @param newName - Field name 53 | * @param newValue - Field Value 54 | */ 55 | public DateFieldModel(String newName,ZonedDateTime newValue){ 56 | 57 | setValue(newName,newValue); 58 | } 59 | 60 | /** 61 | * get the date in the UTC time zone 62 | */ 63 | public ZonedDateTime getValue() { 64 | return value; 65 | } 66 | 67 | /** 68 | * get Field's name 69 | */ 70 | public String getName(){ 71 | return name; 72 | } 73 | 74 | /** 75 | * set Field's name/value. The timezone will be converted to UTC upon being sent to the server 76 | */ 77 | public void setValue(String newName,ZonedDateTime newValue){ 78 | 79 | name = newName; 80 | value = newValue == null ? null : newValue.withZoneSameInstant(ZoneId.of("Z")); 81 | } 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/EmptyFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | /** 32 | * 33 | * This class represents an Empty Field 34 | * 35 | */ 36 | public class EmptyFieldModel implements FieldModel { 37 | 38 | private String name; 39 | 40 | public EmptyFieldModel(String strKey) { 41 | setValue(strKey, null); 42 | } 43 | 44 | @Override 45 | public Object getValue() { 46 | return null; 47 | } 48 | 49 | @Override 50 | public void setValue(String name, Object value) { 51 | this.name = name; 52 | } 53 | 54 | @Override 55 | public String getName() { 56 | return name; 57 | } 58 | 59 | @Override 60 | public boolean hasValue() { 61 | return false; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/Entity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | import javax.annotation.Nullable; 32 | 33 | /** 34 | * An interface representing the basic Octane entity. 35 | */ 36 | public interface Entity { 37 | 38 | /** 39 | * Returns the type of the entity. All entities that are returned from the server have a type. 40 | * If a type has not been set this will return null 41 | * @return the type of the entity or null if not set 42 | */ 43 | @Nullable 44 | String getType(); 45 | 46 | /** 47 | * Returns the ID of the entity. Most (if not all) entities have an ID. However it is possible for the entity to not 48 | * have an ID even when returned from the server. 49 | * If the ID has not been set this will return null 50 | * @return the ID of the entity or null if not set 51 | */ 52 | @Nullable 53 | String getId(); 54 | } 55 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/EntityMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | /** 32 | * Some useful metadata for the generated class such as available HTTP methods and the 33 | * REST collection URL 34 | */ 35 | public @interface EntityMetadata { 36 | enum AvailableMethods {GET, UPDATE, CREATE, DELETE} 37 | 38 | /** 39 | * Available methods for the generated class 40 | * @return methods 41 | */ 42 | AvailableMethods[] availableMethods(); 43 | 44 | /** 45 | * The collection name 46 | * @return url 47 | */ 48 | String url(); 49 | } 50 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/ErrorModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | import org.json.JSONObject; 32 | 33 | import java.util.Set; 34 | 35 | /** 36 | * 37 | * This class hold the ErrorModel objects and server as an error data holder 38 | * entities. 39 | */ 40 | public class ErrorModel extends EntityModel{ 41 | 42 | public static final String HTTP_STATUS_CODE_PROPERTY_NAME = "http_status_code"; 43 | public static final String STACK_TRACE_PROPERTY_NAME = "stack_trace"; 44 | 45 | /** 46 | * Creates a new ErrorModel object with given field models 47 | * 48 | * @param value 49 | * - a collection of field models 50 | */ 51 | public ErrorModel(Set value) { 52 | super(value); 53 | } 54 | 55 | @Override 56 | public String toString() { 57 | JSONObject jsonObject = ModelParser.getInstance().getEntityJSONObject(this); 58 | jsonObject.remove(STACK_TRACE_PROPERTY_NAME); 59 | return jsonObject.toString(); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/FieldMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | import java.lang.annotation.ElementType; 32 | import java.lang.annotation.Retention; 33 | import java.lang.annotation.RetentionPolicy; 34 | import java.lang.annotation.Target; 35 | 36 | /** 37 | * Adds useful metadata information to the method such as whether the field is required or sortable 38 | */ 39 | @Retention(RetentionPolicy.RUNTIME) 40 | @Target(ElementType.METHOD) 41 | public @interface FieldMetadata { 42 | /** 43 | * Is the field required 44 | * @return required 45 | */ 46 | boolean required() default false; 47 | /** 48 | * Is the field filterable 49 | * @return filterable 50 | */ 51 | boolean filterable() default true; 52 | /** 53 | * Is the field sortable 54 | * @return sortable 55 | */ 56 | boolean sortable() default true; 57 | /** 58 | * The minimum value for the field (where relevant) 59 | * @return minvalue 60 | */ 61 | long minValue() default Long.MIN_VALUE; 62 | /** 63 | * The maximum value for the field (where relevant) 64 | * @return maxvalue 65 | */ 66 | long maxValue() default Long.MAX_VALUE; 67 | 68 | /** 69 | * The maximum length for the string field (where relevant) 70 | * @return max length 71 | */ 72 | long maxLength() default Integer.MAX_VALUE; 73 | } 74 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/FieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | /** 32 | * 33 | * Interface of FieldModel 34 | * 35 | * 36 | */ 37 | public interface FieldModel { 38 | 39 | T getValue(); 40 | void setValue(String name, T value); 41 | String getName(); 42 | default boolean hasValue() { 43 | return true; 44 | } 45 | default Object getJSONValue() { 46 | return getValue(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/FloatFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | /** 32 | * 33 | * Created by ngthien on 8/3/2016. 34 | */ 35 | public class FloatFieldModel implements FieldModel { 36 | private Float value; 37 | private String name; 38 | 39 | public FloatFieldModel(String newName, Float newValue) { 40 | setValue(newName, newValue); 41 | } 42 | 43 | @Override 44 | public Float getValue() { 45 | return value; 46 | } 47 | 48 | @Override 49 | public void setValue(String newName, Float newValue) { 50 | name = newName; 51 | value = newValue; 52 | } 53 | 54 | @Override 55 | public String getName() { 56 | return name; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/LongFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | /** 32 | * 33 | * This class hold the LongFieldModel objects and serve as a long type FieldModel data holder 34 | * 35 | * 36 | */ 37 | public class LongFieldModel implements FieldModel { 38 | 39 | //Private 40 | private String name = ""; 41 | private Long value = 0L; 42 | 43 | /** 44 | * Creates a new LongFieldModel object 45 | * 46 | * @param newName - Field name 47 | * @param newValue - Field Value 48 | */ 49 | public LongFieldModel(String newName,Long newValue){ 50 | 51 | setValue(newName,newValue); 52 | } 53 | 54 | /** 55 | * get value 56 | */ 57 | public Long getValue() { 58 | return value; 59 | } 60 | 61 | /** 62 | * get Field's name 63 | */ 64 | public String getName(){ 65 | return name; 66 | } 67 | 68 | /** 69 | * set Field's name/value 70 | */ 71 | public void setValue(String newName,Long newValue){ 72 | 73 | name = newName; 74 | value = newValue; 75 | } 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/ObjectFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | import org.json.JSONObject; 32 | 33 | /** 34 | * This class hold the ObjectFieldModel objects. These are normally arbitrary JSON objects. In this case the JSON is 35 | * represented as a string 36 | */ 37 | public class ObjectFieldModel extends StringFieldModel implements FieldModel { 38 | 39 | @Override 40 | public Object getJSONValue() { 41 | return new JSONObject(getValue()); 42 | } 43 | 44 | /** 45 | * Creates a new StringFieldModel object 46 | * 47 | * @param newName - Field name 48 | * @param newValue - Field Value 49 | */ 50 | public ObjectFieldModel(String newName, String newValue) { 51 | super(newName, newValue); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/OctaneCollectionImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | import com.hpe.adm.nga.sdk.entities.OctaneCollection; 32 | 33 | import java.util.LinkedHashSet; 34 | 35 | /** 36 | * Implementation of the {@link OctaneCollection}. Implements a {@link java.util.Set} 37 | */ 38 | final class OctaneCollectionImpl extends LinkedHashSet implements OctaneCollection { 39 | 40 | private final int totalCount; 41 | private final boolean exceedsTotalCount; 42 | 43 | OctaneCollectionImpl(final int totalCount, final boolean exceedsTotalCount) { 44 | super(); 45 | this.exceedsTotalCount = exceedsTotalCount; 46 | this.totalCount = totalCount; 47 | } 48 | 49 | OctaneCollectionImpl() { 50 | this(NO_TOTAL_COUNT_SET, false); 51 | } 52 | 53 | @Override 54 | public int getTotalCount() { 55 | return totalCount; 56 | } 57 | 58 | @Override 59 | public boolean exceedsTotalCount() { 60 | return exceedsTotalCount; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/OctaneCollectionSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | import com.hpe.adm.nga.sdk.entities.OctaneCollection; 32 | 33 | import java.util.function.Supplier; 34 | 35 | /** 36 | * Implementation of the {@link Supplier} that returns a new {@link OctaneCollection} 37 | * @param The type of entity that will be returned 38 | */ 39 | public final class OctaneCollectionSupplier implements Supplier> { 40 | 41 | private final int totalCount; 42 | private final boolean exceedsTotalCount; 43 | 44 | /** 45 | * The original collection that will be converted. It takes the parameters of the collection and transfers them 46 | * over 47 | * @param octaneCollection The original octane collection 48 | */ 49 | public OctaneCollectionSupplier(final OctaneCollection octaneCollection){ 50 | totalCount = octaneCollection.getTotalCount(); 51 | exceedsTotalCount = octaneCollection.exceedsTotalCount(); 52 | } 53 | 54 | @Override 55 | public OctaneCollection get() { 56 | return new OctaneCollectionImpl<>(totalCount, exceedsTotalCount); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/ReferenceFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | 32 | import org.json.JSONObject; 33 | 34 | /** 35 | * 36 | * This class hold the ReferenceFieldModel objects and serve as a ReferenceField type FieldModel data holder 37 | * 38 | * 39 | */ 40 | public class ReferenceFieldModel implements FieldModel { 41 | 42 | //Private 43 | private EntityModel refValue; 44 | private String refName; 45 | 46 | /** 47 | * Creates a new ReferenceFieldModel object 48 | * 49 | * @param name - Field name 50 | * @param value - Field Value 51 | */ 52 | public ReferenceFieldModel(String name,EntityModel value){ 53 | 54 | setValue( name, value); 55 | } 56 | 57 | /** 58 | * GetEntities Value 59 | */ 60 | public EntityModel getValue(){ 61 | return refValue ; 62 | } 63 | 64 | /** 65 | * GetEntities name 66 | */ 67 | public String getName(){ 68 | return refName; 69 | } 70 | 71 | /** 72 | * Set name/value 73 | */ 74 | public void setValue(String name,EntityModel value){ 75 | 76 | refValue = value; 77 | refName = name; 78 | } 79 | 80 | @Override 81 | public Object getJSONValue() { 82 | return refValue != null ? ModelParser.getInstance().getEntityJSONObject(refValue) : JSONObject.NULL; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/model/StringFieldModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.model; 30 | 31 | /** 32 | * 33 | * This class hold the StringFieldModel objects and serve as a string type FieldModel data holder 34 | * 35 | * 36 | */ 37 | public class StringFieldModel implements FieldModel { 38 | 39 | //Private 40 | private String name=""; 41 | private String value=""; 42 | 43 | /** 44 | * Creates a new StringFieldModel object 45 | * 46 | * @param newName - Field name 47 | * @param newValue - Field Value 48 | */ 49 | public StringFieldModel(String newName,String newValue){ 50 | 51 | setValue(newName,newValue); 52 | } 53 | 54 | /** 55 | * get value 56 | */ 57 | public String getValue() { 58 | return value; 59 | } 60 | 61 | /** 62 | * get name 63 | */ 64 | public String getName(){ 65 | return name; 66 | } 67 | 68 | /** 69 | * set value - name/value 70 | */ 71 | public void setValue(String newName,String newValue){ 72 | 73 | name = newName; 74 | value = newValue; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/network/OctaneHttpClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.network; 30 | 31 | import com.hpe.adm.nga.sdk.authentication.JSONAuthentication; 32 | 33 | /** 34 | * 35 | * HTTP Client 36 | * 37 | * Created by leufl on 2/11/2016. 38 | */ 39 | public interface OctaneHttpClient { 40 | 41 | //Constants 42 | String OAUTH_AUTH_URL = "/authentication/sign_in"; 43 | String OAUTH_SIGNOUT_URL = "/authentication/sign_out"; 44 | String LWSSO_COOKIE_KEY = "LWSSO_COOKIE_KEY"; 45 | String OCTANE_USER_COOKIE_KEY = "OCTANE_USER"; 46 | 47 | /** 48 | * Authenticate with the Octane server using an implementation of the {@link JSONAuthentication} class. 49 | * If basic authentication is being used then the authentication is an inherent part of execute and therefore 50 | * authentication does not need to be called explicitly. True will be returned in this case 51 | * 52 | * @return true if the authentication was successful, false otherwise 53 | */ 54 | boolean authenticate(); 55 | 56 | /** 57 | * Signs out and removes cookies 58 | */ 59 | void signOut(); 60 | 61 | OctaneHttpResponse execute(OctaneHttpRequest octaneHttpRequest); 62 | } 63 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/query/NullField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.query; 30 | 31 | public class NullField { 32 | public String toString() { 33 | return "null"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/query/NullReferenceField.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.query; 30 | 31 | public class NullReferenceField { 32 | public String toString() { 33 | return "{null}"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sdk-src/src/main/java/com/hpe/adm/nga/sdk/siteadmin/Server.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.siteadmin; 30 | 31 | import com.hpe.adm.nga.sdk.network.OctaneHttpClient; 32 | import com.hpe.adm.nga.sdk.siteadmin.version.GetServerVersion; 33 | 34 | /** 35 | * Creates an instance that represents the {@code server} API 36 | */ 37 | public class Server { 38 | 39 | // private members 40 | private final OctaneHttpClient octaneHttpClient; 41 | private final String urlDomain; 42 | 43 | /** 44 | * Creates a new Server object 45 | * 46 | * @param octaneHttpClient - Http Request Factory 47 | * @param siteAdminDomain - siteAdmin Domain Name 48 | */ 49 | public Server(OctaneHttpClient octaneHttpClient, String siteAdminDomain) { 50 | urlDomain = siteAdminDomain + "server/"; 51 | this.octaneHttpClient = octaneHttpClient; 52 | } 53 | 54 | /** 55 | * Gets the API for server version 56 | * 57 | * @return the correct API 58 | */ 59 | public GetServerVersion getServerVersion() { 60 | return new GetServerVersion(octaneHttpClient, urlDomain); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /sdk-src/src/main/overview.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | The ALM Octane REST API Java SDK. 4 |

5 |

6 | To create a new instance use the {@link com.hpe.adm.nga.sdk.Octane} class. Once an Octane instance has been created 7 | the shared space and workspace contexts can be added. See the various documentation for more information. 8 |

9 |

10 | To create a new instance use the following example: 11 |

12 |

13 | Octane octane = new Octane.Builder(new SimpleUserAuthentication("user", "pass")).build(); 14 |

15 | -------------------------------------------------------------------------------- /sdk-src/src/test/java/com/hpe/adm/nga/sdk/attachments/TestAttachments.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.attachments; 30 | 31 | import com.hpe.adm.nga.sdk.Octane; 32 | import com.hpe.adm.nga.sdk.unit_tests.common.CommonMethods; 33 | import org.junit.BeforeClass; 34 | import org.junit.Test; 35 | import org.junit.runner.RunWith; 36 | import org.mockito.internal.util.reflection.Whitebox; 37 | import org.powermock.api.mockito.PowerMockito; 38 | import org.powermock.core.classloader.annotations.PowerMockIgnore; 39 | import org.powermock.modules.junit4.PowerMockRunner; 40 | 41 | import static org.junit.Assert.assertEquals; 42 | 43 | @PowerMockIgnore("javax.management.*") 44 | @RunWith(PowerMockRunner.class) 45 | public class TestAttachments { 46 | private static Octane octane; 47 | private static AttachmentList spiedAttachments; 48 | 49 | @BeforeClass 50 | public static void setUpBeforeClass() throws Exception { 51 | octane = CommonMethods.getOctaneForTest(); 52 | AttachmentList attachments = octane.attachmentList(); 53 | spiedAttachments = PowerMockito.spy(attachments); 54 | } 55 | 56 | @Test 57 | public void testCorrectUrl(){ 58 | String expectedResult = CommonMethods.getDomain() + "/api/shared_spaces/" + CommonMethods.getSharedSpace() + "/workspaces/" + CommonMethods.getWorkSpace() + "/attachments"; 59 | String internalUrl = (String)Whitebox.getInternalState(spiedAttachments, "attachmentListDomain"); 60 | assertEquals(expectedResult, internalUrl); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /sdk-src/src/test/java/com/hpe/adm/nga/sdk/network/TestOctaneUrl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.network; 30 | 31 | import com.hpe.adm.nga.sdk.unit_tests.common.CommonMethods; 32 | import org.junit.Test; 33 | 34 | import static org.junit.Assert.assertEquals; 35 | 36 | /** 37 | * Test for {@link OctaneUrl} 38 | */ 39 | public class TestOctaneUrl { 40 | 41 | /** 42 | * Test correct build of URL with field specification, limits, offset and orderBy. 43 | * The method invokes internal protected method with retrieved private parameters. 44 | */ 45 | @Test 46 | public void testUrlBuilder() { 47 | final String expectedResult = CommonMethods.getDomain() + "?offset=1&limit=10&order_by=-version_stamp&fields=version_stamp,item_type"; 48 | OctaneUrl octaneUrl = new OctaneUrl(CommonMethods.getDomain()); 49 | octaneUrl.addFieldsParam("version_stamp", "item_type"); 50 | octaneUrl.setLimitParam(10); 51 | octaneUrl.setOffsetParam(1); 52 | octaneUrl.setOrderByParam("version_stamp", false); 53 | 54 | assertEquals(expectedResult, octaneUrl.toString()); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /sdk-src/src/test/resources/file.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MicroFocus/ALMOctaneJavaRESTSDK/10d1e0c6ae350207b9b7883865beda60886f2304/sdk-src/src/test/resources/file.pdf -------------------------------------------------------------------------------- /sdk-src/src/test/resources/getEntitiesMetadataString.txt: -------------------------------------------------------------------------------- 1 | {"data":[{"features":[{"name":"subtype_of","type":"test"},{"name":"has_comments","relation_name":"comments_to_test_suite"},{"methods":["DELETE","POST","GET","PUT"],"name":"rest","url":"test_suites"},{"name":"has_attachments","relation_name":"attachments_to_test_suite"},{"name":"business_rules"}],"name":"test_suite","label":"Test Suite","type":"entity_metadata","can_modify_label":false},{"features":[{"name":"subtype_of","type":"taxonomy_node"},{"methods":["DELETE","POST","GET","PUT"],"name":"rest","url":"taxonomy_item_nodes"}],"name":"taxonomy_item_node","label":"Taxonomy Item Node","type":"entity_metadata","can_modify_label":false},{"features":[{"name":"has_comments","relation_name":"comments_to_theme"},{"name":"has_attachments","relation_name":"attachments_to_theme"},{"name":"subtype_of","type":"work_item"},{"name":"mailing","url":"mails"},{"methods":["DELETE","POST","GET","PUT"],"name":"rest","url":"themes"},{"parent_types":["work_item_root"],"root":{"type":"work_item_root","id":1001},"name":"hierarchical_entity","child_types":["feature"]},{"name":"business_rules"}],"name":"theme","label":"Theme","type":"entity_metadata","can_modify_label":false}],"total_count":3} -------------------------------------------------------------------------------- /sdk-src/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sdk-src/src/test/resources/sample.pdf: -------------------------------------------------------------------------------- 1 | text file testing 2 | -------------------------------------------------------------------------------- /sdk-src/src/test/resources/test.txt: -------------------------------------------------------------------------------- 1 | text file testing 2 | -------------------------------------------------------------------------------- /sdk-src/src/test/resources/test1.txt: -------------------------------------------------------------------------------- 1 | text file testing 2 | -------------------------------------------------------------------------------- /sdk-usage-examples/src/main/java/com/hpe/adm/nga/sdk/examples/APIModeExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.examples; 30 | 31 | import com.hpe.adm.nga.sdk.APIMode; 32 | import com.hpe.adm.nga.sdk.authentication.SimpleClientAuthentication; 33 | 34 | /** 35 | * An example to show how to use a different REST API mode 36 | */ 37 | public class APIModeExample { 38 | 39 | public void setAPIMode() { 40 | // please note that this mode does not exist and is for an example only! 41 | APIMode privateMode = new APIMode() { 42 | @Override 43 | public String getHeaderValue() { 44 | return "OCTANE_PRIVATE_MODE"; 45 | } 46 | 47 | @Override 48 | public String getHeaderKey() { 49 | return "true"; 50 | } 51 | }; 52 | 53 | new SimpleClientAuthentication("client", "secret", privateMode); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /sdk-usage-examples/src/main/java/com/hpe/adm/nga/sdk/examples/CreateContextExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 Open Text. 3 | * 4 | * The only warranties for products and services of Open Text and 5 | * its affiliates and licensors (“Open Text”) are as may be set forth 6 | * in the express warranty statements accompanying such products and services. 7 | * Nothing herein should be construed as constituting an additional warranty. 8 | * Open Text shall not be liable for technical or editorial errors or 9 | * omissions contained herein. The information contained herein is subject 10 | * to change without notice. 11 | * 12 | * Except as specifically indicated otherwise, this document contains 13 | * confidential information and a valid license is required for possession, 14 | * use or copying. If this work is provided to the U.S. Government, 15 | * consistent with FAR 12.211 and 12.212, Commercial Computer Software, 16 | * Computer Software Documentation, and Technical Data for Commercial Items are 17 | * licensed to the U.S. Government under vendor's standard commercial license. 18 | * 19 | * Licensed under the Apache License, Version 2.0 (the "License"); 20 | * you may not use this file except in compliance with the License. 21 | * You may obtain a copy of the License at 22 | * http://www.apache.org/licenses/LICENSE-2.0 23 | * Unless required by applicable law or agreed to in writing, software 24 | * distributed under the License is distributed on an "AS IS" BASIS, 25 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | * See the License for the specific language governing permissions and 27 | * limitations under the License. 28 | */ 29 | package com.hpe.adm.nga.sdk.examples; 30 | 31 | import com.hpe.adm.nga.sdk.Octane; 32 | import com.hpe.adm.nga.sdk.authentication.Authentication; 33 | import com.hpe.adm.nga.sdk.authentication.SimpleClientAuthentication; 34 | 35 | /** 36 | * Creates a simple context 37 | * 38 | * Created by brucesp on 03-Jan-17. 39 | */ 40 | public class CreateContextExample { 41 | 42 | public static void main (String [] args){ 43 | new CreateContextExample().createContext(); 44 | } 45 | 46 | public void createContext() { 47 | // two types of authentication 48 | // 1) API Key 49 | Authentication clientAuthentication = new SimpleClientAuthentication("clientId", "clientSecret"); 50 | 51 | // 2) User/pass 52 | //Authentication userPassAuthentication = new SimpleUserAuthentication("user", "password"); 53 | 54 | // get instance of Octane Builder 55 | final Octane.Builder octaneBuilder = new Octane.Builder(clientAuthentication); 56 | 57 | // now we can add the server 58 | octaneBuilder.Server("http://myd-vm10632.hpeswlab.net:8081"); 59 | // the sharedspace 60 | octaneBuilder.sharedSpace(1001); 61 | // the workspace 62 | octaneBuilder.workSpace(1002); 63 | //sets the client to HTTP2 client, by default is set to HTTP1.1 64 | //octaneBuilder.isHttp2(true); 65 | 66 | // finally we build the context and get an Octane instance: 67 | 68 | Octane octane = octaneBuilder.build(); 69 | 70 | // octane.entityList("defects").get().limit(2).execute(); 71 | octane.entityList("defects").get().execute(); 72 | } 73 | 74 | } 75 | --------------------------------------------------------------------------------