Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Added TSQ manager and its IVT program
Browse files Browse the repository at this point in the history
Signed-off-by: Anuprakash Moothedath <[email protected]>
  • Loading branch information
Anuprakash-Moothedath committed Aug 28, 2024
1 parent a1ef630 commit ba7023d
Show file tree
Hide file tree
Showing 26 changed files with 1,002 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public interface ICicsRegion {
ICemt cemt() throws CicstsManagerException;
ICeda ceda() throws CicstsManagerException;
ICeci ceci() throws CicstsManagerException;
ITsqHandler tsq() throws CicstsManagerException;

/**
* Provides a CICS resource instance that can then be used to create a specific CICS resource
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
package dev.galasa.cicsts;

import javax.validation.constraints.NotNull;

public interface ITsqHandler {

/**
* Set TSQ name
* @param queueName TSQ name
* @throws TsqException if there is a problem in setting the TSQ name
*/
public void setQName(@NotNull String queueName) throws TsqException;

/**
* Get TSQ name
* @return TSQ name
* @throws TsqException if there is a problem in setting the TSQ name
*/
public String getQName() throws TsqException;

/**
* Read Data from TSQ. TSQ name is set using setName() method.
* TSQ item number to be read is passed as parm to this method.
* @param item Item number of the TSQ to be read
* @return Data read from TSQ as String
* @throws TsqException if there is a problem in reading from the TSQ
*/
public String readQ(@NotNull int item) throws TsqException;

/**
* Write inputData to TSQ. TSQ name is set using setName() method.
* @param inputData The string to be written to the TSQ
* @throws TsqException if there is a problem in writing to the TSQ
*/
public void writeQ(@NotNull String inputData) throws TsqException;

/**
* Delete TSQ. TSQ name is set using setName() method.
* @throws TsqException if there is a problem in deleting the TSQ
*/
public void deleteQ() throws TsqException;

/**
* Make TSQ Recoverable. TSQ name is set using setName() method.
* @throws TsqException if there is a problem in making the TSQ recoverable
*/
public void makeRecoverable() throws TsqException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
package dev.galasa.cicsts;

public class TsqException extends TsqManagerException {
private static final long serialVersionUID = 1L;

public TsqException() {
}

public TsqException(String message) {
super(message);
}

public TsqException(Throwable cause) {
super(cause);
}

public TsqException(String message, Throwable cause) {
super(message, cause);
}

public TsqException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
package dev.galasa.cicsts;

public class TsqManagerException extends CicstsManagerException {
private static final long serialVersionUID = 1L;

public TsqManagerException() {
}

public TsqManagerException(String message) {
super(message);
}

public TsqManagerException(Throwable cause) {
super(cause);
}

public TsqManagerException(String message, Throwable cause) {
super(message, cause);
}

public TsqManagerException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import dev.galasa.cicsts.spi.ICeciProvider;
import dev.galasa.cicsts.spi.ICedaProvider;
import dev.galasa.cicsts.spi.ICemtProvider;
import dev.galasa.cicsts.spi.ITsqProvider;
import dev.galasa.cicsts.spi.ICicsRegionLogonProvider;
import dev.galasa.cicsts.spi.ICicsRegionProvisioned;
import dev.galasa.cicsts.spi.ICicsRegionProvisioner;
Expand Down Expand Up @@ -80,6 +81,7 @@ public class CicstsManagerImpl extends AbstractManager implements ICicstsManager
private ICeciProvider ceciProvider;
private ICedaProvider cedaProvider;
private ICemtProvider cemtProvider;
private ITsqProvider tsqProvider;
private ICicsResourceProvider cicsResourceProvider;

@Override
Expand Down Expand Up @@ -361,6 +363,11 @@ public void registerCedaProvider(@NotNull ICedaProvider cedaProvider) {
this.cedaProvider = cedaProvider;
}

@Override
public void registerTsqProvider(@NotNull ITsqProvider tsqProvider) {
this.tsqProvider = tsqProvider;
}

@Override
public void registerCemtProvider(@NotNull ICemtProvider cemtProvider) {
this.cemtProvider = cemtProvider;
Expand Down Expand Up @@ -390,6 +397,16 @@ public ICedaProvider getCedaProvider() throws CicstsManagerException {

return this.cedaProvider;
}

@Override
@NotNull
public ITsqProvider getTsqProvider() throws CicstsManagerException {
if (this.tsqProvider == null) {
throw new CicstsManagerException("No TSQ provider has been registered");
}

return this.tsqProvider;
}

@Override
@NotNull
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
package dev.galasa.cicsts.internal.properties;

import java.util.ArrayList;
Expand Down Expand Up @@ -42,6 +42,7 @@ public static List<String> get() throws CicstsManagerException {
list.add("dev.galasa.cicsts.ceci.manager");
list.add("dev.galasa.cicsts.ceda.manager");
list.add("dev.galasa.cicsts.cemt.manager");
list.add("dev.galasa.cicsts.tsq.manager");
list.add("dev.galasa.cicsts.resource.manager");
list.add("dev.galasa.zosliberty.manager");
list.add("dev.galasa.textscan.manager");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
package dev.galasa.cicsts.spi;

import dev.galasa.cicsts.CicstsManagerException;
import dev.galasa.cicsts.ICeci;
import dev.galasa.cicsts.ICeda;
import dev.galasa.cicsts.ICemt;
import dev.galasa.cicsts.ITsqHandler;
import dev.galasa.cicsts.MasType;
import dev.galasa.cicsts.cicsresource.CicsJvmserverResourceException;
import dev.galasa.cicsts.cicsresource.ICicsResource;
Expand All @@ -29,6 +30,7 @@ public abstract class BaseCicsImpl implements ICicsRegionProvisioned {
private ICeci ceci;
private ICeda ceda;
private ICemt cemt;
private ITsqHandler tsq;
private ICicsResource cicsResource;
private IZosUNIXFile runTemporaryUNIXPath;

Expand Down Expand Up @@ -93,6 +95,14 @@ public ICeda ceda() throws CicstsManagerException {
return this.ceda;
}

@Override
public ITsqHandler tsq() throws CicstsManagerException {
if (this.tsq == null) {
this.tsq = this.cicstsManager.getTsqProvider().getTsq(this, this.cicstsManager);
}
return this.tsq;
}

@Override
public ICemt cemt() throws CicstsManagerException {
if (this.cemt == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
package dev.galasa.cicsts.spi;

import java.util.List;
Expand Down Expand Up @@ -44,6 +44,13 @@ public interface ICicstsManagerSpi {
* @param cedaProvider - the new provider
*/
void registerCedaProvider(@NotNull ICedaProvider cedaProvider);

/**
* Register the a ITsqHandler instance provider with the CICS TS Manager
*
* @param tsqProvider - the new provider
*/
void registerTsqProvider(@NotNull ITsqProvider tsqProvider);

/**
* Register the a ICicsResource instance provider with the CICS TS Manager
Expand Down Expand Up @@ -73,6 +80,13 @@ public interface ICicstsManagerSpi {
@NotNull
public ICedaProvider getCedaProvider() throws CicstsManagerException;

/**
* @return The registered TSQ provider
* @throws CicstsManagerException
*/
@NotNull
public ITsqProvider getTsqProvider() throws CicstsManagerException;

/**
* @return The registered CICS Resource provider
* @throws CicstsManagerException
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright contributors to the Galasa project
*
* SPDX-License-Identifier: EPL-2.0
*/
package dev.galasa.cicsts.spi;

import javax.validation.constraints.NotNull;

import dev.galasa.cicsts.ITsqHandler;
import dev.galasa.cicsts.TsqManagerException;
import dev.galasa.cicsts.ICicsRegion;

/**
* Provides CICS Region related TSQ objects
*
*/
public interface ITsqProvider {

/**
* Returns a unique instance of the ICemt per CICS region
*
* @param cicsRegion
* @param cicstsManager
* @return ITsqHandler object for this CICS region, will a different instance for different regions
* @throws TsqManagerException if getTsq() fails
*/
@NotNull
ITsqHandler getTsq(ICicsRegion cicsRegion, ICicstsManagerSpi cicstsManager) throws TsqManagerException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-snapshot: ${tstamp}
Bundle-Name: Galasa TSQ Manager IVTs
Export-Package: dev.galasa.cicsts.tsq.manager.ivt
Import-Package: !javax.validation.constraints, \
*
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
plugins {
id 'galasa.manager.ivt'
}

description = 'Galasa TSQ Manager IVTs'

version = '0.1.0'

dependencies {
implementation project (':galasa-managers-core-parent:dev.galasa.core.manager')
implementation project (':galasa-managers-cicsts-parent:dev.galasa.cicsts.tsq.manager')
implementation project (':galasa-managers-zos-parent:dev.galasa.zos3270.manager')
}


// Note: These values are consumed by the parent build process
// They indicate which packages of functionality this OSGi bundle should be delivered inside,
// or referenced from.
// The settings here are gathered together by the build process to create a release.yaml file
// which gathers-up all the packaging metadata about all the OSGi bundles in this component.
ext.projectName=project.name
ext.includeInOBR = true
ext.includeInMVP = true
ext.includeInBOM = false
ext.includeInIsolated = true
ext.includeInCodeCoverage = false
ext.includeInJavadoc = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rootProject.name = 'dev.galasa.cicsts.tsq.manager.ivt'

Loading

0 comments on commit ba7023d

Please sign in to comment.