passed to jdk11 and gcube-bom 4

This commit is contained in:
Roberto Cirillo 2024-11-12 10:41:58 +01:00
parent fbfe1ffa11
commit e0fa9185eb
27 changed files with 43 additions and 39 deletions

View File

@ -6,6 +6,7 @@
* moved version from 3.1.0-SNAPSHOT to 4.0.0-SNAPSHOT
* upgrade to gcube-bom 3 and ScopeProvider removed
* removed environment variable scope
* passed to jdk11 and gcube-bom 4.0
## [v3.0.1-SNAPSHOT]
* removed http protocol;

View File

@ -16,8 +16,8 @@
</scm>
<properties>
<distroDirectory>${project.basedir}/distro</distroDirectory>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
</properties>
<dependencyManagement>
<dependencies>

View File

@ -107,7 +107,7 @@ public class Configuration {
public void getConfiguration(){
String[] newServer=null;
String currentScope;
currentScope = SecretManagerProvider.instance.get().getContext();
currentScope = SecretManagerProvider.get().getContext();
logger.debug("Scope found on ScopeProvider instance is "+currentScope);
logger.debug("Manually scope was set to"+RRScope+" it doesn't take effect");
//if a specific backend is not passed as input param then take the default one
@ -206,7 +206,7 @@ public class Configuration {
private String getHomeLibraryContext(){
String area=null;
String scope= SecretManagerProvider.instance.get().getContext();
String scope= SecretManagerProvider.get().getContext();
String context=null;
if (scope.startsWith("/gcube"))
context= HL_CONTEXT_DEV;
@ -368,7 +368,7 @@ public class Configuration {
@Deprecated
public String retrieveEncryptionPhrase() throws Exception {
String currentScope=SecretManagerProvider.instance.get().getContext();
String currentScope=SecretManagerProvider.get().getContext();
logger.debug("retrieve encryption prhase on scope: "+currentScope);
String encryptedKey=null;
// ISClientConnector isclient=getISClient();
@ -380,7 +380,7 @@ public class Configuration {
}
public String retrieveEncryptionField(String fieldName) throws Exception {
String currentScope=SecretManagerProvider.instance.get().getContext();
String currentScope=SecretManagerProvider.get().getContext();
logger.debug("retrieve encryption prhase on scope: "+currentScope);
String encryptedKey=null;
// ISClientConnector isclient=getISClient();

View File

@ -82,7 +82,7 @@ public class ISClientConnector {
setStorageResource(storageResource);
return storageResource;
}else
throw new RuntimeException("Storage ServiceEndpoint not found under scope: "+SecretManagerProvider.instance.get().getContext());
throw new RuntimeException("Storage ServiceEndpoint not found under scope: "+SecretManagerProvider.get().getContext());
}else{
logger.debug("service endpoint already discovered");
return getStorageResource();

View File

@ -53,7 +53,7 @@ public class StorageClient {
public StorageClient(String serviceClass, String serviceName, String owner, AccessType accessType){
String id=owner;
this.owner=owner;
this.scopeString=SecretManagerProvider.instance.get().getContext();
this.scopeString=SecretManagerProvider.get().getContext();
if(accessType!=null)
this.typeAccess=accessType;
else throw new RuntimeException("AccessType parameter must be not null");
@ -77,7 +77,7 @@ public class StorageClient {
public StorageClient(String serviceClass, String serviceName, String owner, AccessType accessType, BackendType backend){;
String id=owner;
this.owner=owner;
this.scopeString=SecretManagerProvider.instance.get().getContext();
this.scopeString=SecretManagerProvider.get().getContext();
if(accessType!=null)
this.typeAccess=accessType;
else throw new RuntimeException("AccessType parameter must be not null");
@ -100,7 +100,7 @@ public class StorageClient {
public StorageClient(String owner, AccessType accessType, MemoryType memory){
String id=owner;
this.owner=owner;
this.scopeString=SecretManagerProvider.instance.get().getContext();
this.scopeString=SecretManagerProvider.get().getContext();
if(accessType!=null)
this.typeAccess=accessType;
else throw new RuntimeException("AccessType parameter must be not null");
@ -124,7 +124,7 @@ public class StorageClient {
public StorageClient(String serviceClass, String serviceName, String owner, String server, AccessType accessType){
String id=owner;
this.owner=owner;
this.scopeString=SecretManagerProvider.instance.get().getContext();
this.scopeString=SecretManagerProvider.get().getContext();
if(accessType!=null)
this.typeAccess=accessType;
else throw new RuntimeException("AccessType parameter must be not null");
@ -148,7 +148,7 @@ public class StorageClient {
public StorageClient(String serviceClass, String serviceName, String owner, AccessType accessType, MemoryType memory){
String id=owner;
this.owner=owner;
this.scopeString=SecretManagerProvider.instance.get().getContext();
this.scopeString=SecretManagerProvider.get().getContext();
if(accessType!=null)
this.typeAccess=accessType;
else throw new RuntimeException("AccessType parameter must be not null");
@ -174,7 +174,7 @@ public class StorageClient {
public StorageClient(String serviceClass, String serviceName, String owner, AccessType accessType, MemoryType memory, BackendType backend){
String id=owner;
this.owner=owner;
this.scopeString=SecretManagerProvider.instance.get().getContext();
this.scopeString=SecretManagerProvider.get().getContext();
if(accessType!=null)
this.typeAccess=accessType;
else throw new RuntimeException("AccessType parameter must be not null");
@ -201,7 +201,7 @@ public class StorageClient {
public StorageClient(String serviceClass, String serviceName, String owner, AccessType accessType, MemoryType memory, String server){
String id=owner;
this.owner=owner;
this.scopeString=SecretManagerProvider.instance.get().getContext();
this.scopeString=SecretManagerProvider.get().getContext();
if(accessType!=null)
this.typeAccess=accessType;
else throw new RuntimeException("AccessType parameter must be not null");
@ -243,12 +243,12 @@ public class StorageClient {
}
if(getMemoryType() !=null)
engine.setGcubeMemoryType(getMemoryType().toString());
engine.setGcubeScope(SecretManagerProvider.instance.get().getContext());
engine.setGcubeScope(SecretManagerProvider.get().getContext());
engine.setOwnerGcube(owner);
cfg.getOptionalPropertiesFromRR(engine);
if(getCurrentScope()!=null){
if(!getCurrentScope().equals(SecretManagerProvider.instance.get().getContext()))
logger.warn("scope force to "+getCurrentScope()+"doesn't take effect. The current scope is set to"+SecretManagerProvider.instance.get().getContext());
if(!getCurrentScope().equals(SecretManagerProvider.get().getContext()))
logger.warn("scope force to "+getCurrentScope()+"doesn't take effect. The current scope is set to"+SecretManagerProvider.get().getContext());
}
return engine;
}

View File

@ -37,7 +37,7 @@ public class CopyDirTest {
@BeforeClass
public static void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {

View File

@ -39,7 +39,7 @@ public class CopyTest {
@Before
public void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -26,7 +26,7 @@ public class CountingTest {
@Before
public void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.PUBLIC, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -42,7 +42,7 @@ public class DownloadsTest {
@BeforeClass
public static void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
// ScopeProvider.instance.set(scope);
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE, Costants.BACKEND_TYPE).getClient();

View File

@ -43,7 +43,7 @@ public class DuplicateTest {
@Before
public void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();

View File

@ -37,7 +37,7 @@ public class ForceCloseTest {
@Before
public void getClient(){
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -27,7 +27,7 @@ public class FwsQueryTest {
@Before
public void setscope(){
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));;
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));;
}
// @Test

View File

@ -36,7 +36,7 @@ public class GetMetaFileTest {
@BeforeClass
public static void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.PUBLIC, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -37,7 +37,7 @@ public class HLcheckTest {
@Before
public void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
// ScopeProvider.instance.set(scope);
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED).getClient();

View File

@ -16,7 +16,7 @@ public class ICSecret extends Secret{
@Override
public Owner getOwner() {
return new Owner("guest", Collections.emptyList(), false);
return null;
}
@Override
@ -34,5 +34,8 @@ public class ICSecret extends Secret{
return false;
}
@Override
public boolean isValid(){ return true; }
}

View File

@ -32,7 +32,7 @@ public class LinkTest {
@Before
public void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();

View File

@ -38,7 +38,7 @@ public class LockTest {
@Before
public void getClient(){
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -34,7 +34,7 @@ public class MoveDirTest {
@BeforeClass
public static void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();

View File

@ -30,7 +30,7 @@ public class MoveTest {
@Before
public void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();

View File

@ -35,7 +35,7 @@ public class PropertiesTest {
@BeforeClass
public static void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.PUBLIC, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -33,7 +33,7 @@ public class RemoveTest {
@Before
public void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -33,7 +33,7 @@ public class RemoveVolatileArea {
@Before
public void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -44,7 +44,7 @@ public class ReplaceFileTest {
@Before
public void getClient(){
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -47,7 +47,7 @@ public class SoftCopyTest {
@BeforeClass
public static void getClient() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();

View File

@ -39,7 +39,7 @@ public class UploadsTest {
@BeforeClass
public static void getClient(){
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client=new StorageClient(serviceClass, serviceName, owner, AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
assertNotNull(client);

View File

@ -43,7 +43,7 @@ public class UrlResolverByIdTest {
@Before
public void init() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client = new StorageClient(serviceClass, serviceName, owner , AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
} catch (Exception e) {

View File

@ -26,7 +26,7 @@ public class UrlResolverTest {
@Before
public void init() throws RemoteBackendException{
SecretManagerProvider.instance.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
SecretManagerProvider.set(new ICSecret(Costants.DEFAULT_SCOPE_STRING));
try {
client = new StorageClient(serviceClass, serviceName, owner , AccessType.SHARED, Costants.DEFAULT_MEMORY_TYPE).getClient();
} catch (Exception e) {