Commit 0b9757c6 authored by Matija Obreza's avatar Matija Obreza
Browse files

Reorganized packages for better Spring auto-configuration

parent bdf9cd88
/*
* Copyright 2018 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.genesys.catalog.server.rest.model;
/**
* The Class PermissionJson.
*/
public class PermissionJson {
private Long sid;
private String authority;
private long oid;
private String clazz;
private boolean create;
private boolean read;
private boolean write;
private boolean delete;
private boolean manage;
@Override
public String toString() {
return "PJ oid=" + oid + " class=" + clazz + " (sid=" + sid + " OR authority=" + authority + ")";
}
/**
* Sets the sid.
*
* @param sid the new sid
*/
public void setSid(final Long sid) {
this.sid = sid;
}
/**
* Gets the sid.
*
* @return the sid
*/
public Long getSid() {
return sid;
}
/**
* Sets the authority.
*
* @param authority the new authority
*/
public void setAuthority(final String authority) {
this.authority = authority;
}
/**
* Gets the authority.
*
* @return the authority
*/
public String getAuthority() {
return authority;
}
/**
* Gets the oid.
*
* @return the oid
*/
public long getOid() {
return oid;
}
/**
* Sets the oid.
*
* @param oid the new oid
*/
public void setOid(final long oid) {
this.oid = oid;
}
/**
* Gets the clazz.
*
* @return the clazz
*/
public String getClazz() {
return clazz;
}
/**
* Sets the clazz.
*
* @param clazz the new clazz
*/
public void setClazz(final String clazz) {
this.clazz = clazz;
}
/**
* Checks if is creates the.
*
* @return true, if is creates the
*/
public boolean isCreate() {
return create;
}
/**
* Sets the creates the.
*
* @param create the new creates the
*/
public void setCreate(final boolean create) {
this.create = create;
}
/**
* Checks if is read.
*
* @return true, if is read
*/
public boolean isRead() {
return read;
}
/**
* Sets the read.
*
* @param read the new read
*/
public void setRead(final boolean read) {
this.read = read;
}
/**
* Checks if is write.
*
* @return true, if is write
*/
public boolean isWrite() {
return write;
}
/**
* Sets the write.
*
* @param write the new write
*/
public void setWrite(final boolean write) {
this.write = write;
}
/**
* Checks if is delete.
*
* @return true, if is delete
*/
public boolean isDelete() {
return delete;
}
/**
* Sets the delete.
*
* @param delete the new delete
*/
public void setDelete(final boolean delete) {
this.delete = delete;
}
/**
* Checks if is manage.
*
* @return true, if is manage
*/
public boolean isManage() {
return manage;
}
/**
* Sets the manage.
*
* @param manage the new manage
*/
public void setManage(final boolean manage) {
this.manage = manage;
}
}
......@@ -62,6 +62,8 @@ import org.genesys.filerepository.InvalidRepositoryPathException;
import org.genesys.filerepository.NoSuchRepositoryFileException;
import org.genesys.filerepository.model.RepositoryFile;
import org.genesys.filerepository.service.RepositoryService;
import org.genesys2.server.component.security.AsAdminInvoker;
import org.genesys2.server.component.security.SecurityUtils;
import org.genesys2.server.exception.InvalidApiUsageException;
import org.genesys2.server.exception.NotFoundElement;
import org.genesys2.server.model.PublishState;
......@@ -69,8 +71,6 @@ import org.genesys2.server.model.UserRole;
import org.genesys2.server.model.genesys.Accession;
import org.genesys2.server.model.genesys.AccessionRef;
import org.genesys2.server.persistence.AccessionRepository;
import org.genesys2.server.security.AsAdminInvoker;
import org.genesys2.server.security.SecurityUtils;
import org.genesys2.server.service.DownloadService;
import org.genesys2.util.JPAUtils;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -35,11 +35,11 @@ import org.genesys.catalog.model.traits.DescriptorList;
import org.genesys.catalog.persistence.traits.DescriptorListRepository;
import org.genesys.catalog.service.DescriptorListService;
import org.genesys.catalog.service.DescriptorService;
import org.genesys2.server.component.security.SecurityUtils;
import org.genesys2.server.exception.InvalidApiUsageException;
import org.genesys2.server.exception.NotFoundElement;
import org.genesys2.server.model.PublishState;
import org.genesys2.server.model.UserRole;
import org.genesys2.server.security.SecurityUtils;
import org.genesys2.util.JPAUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -38,11 +38,11 @@ import org.genesys.catalog.persistence.traits.DescriptorRepository;
import org.genesys.catalog.persistence.vocab.VocabularyTermRepository;
import org.genesys.catalog.service.DescriptorService;
import org.genesys.catalog.service.VersionManager;
import org.genesys2.server.component.security.SecurityUtils;
import org.genesys2.server.exception.InvalidApiUsageException;
import org.genesys2.server.exception.NotFoundElement;
import org.genesys2.server.model.PublishState;
import org.genesys2.server.model.UserRole;
import org.genesys2.server.security.SecurityUtils;
import org.genesys2.server.service.DownloadService;
import org.genesys2.util.JPAUtils;
import org.slf4j.Logger;
......
......@@ -28,12 +28,12 @@ import org.genesys.catalog.model.Partner;
import org.genesys.catalog.model.filters.PartnerFilter;
import org.genesys.catalog.persistence.PartnerRepository;
import org.genesys.catalog.service.PartnerService;
import org.genesys2.server.component.security.SecurityUtils;
import org.genesys2.server.exception.NotFoundElement;
import org.genesys2.server.model.UserRole;
import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.model.impl.QFaoInstitute;
import org.genesys2.server.persistence.FaoInstituteRepository;
import org.genesys2.server.security.SecurityUtils;
import org.genesys2.server.service.filter.InstituteFilter;
import org.genesys2.util.JPAUtils;
import org.slf4j.Logger;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.server.aspect;
package org.genesys2.server.component.aspect;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.server.aspect;
package org.genesys2.server.component.aspect;
import java.util.Arrays;
......@@ -45,7 +45,7 @@ public class AsAdminAspect {
// Our copy of the SYS_ADMIN account
private static Authentication SYS_ADMIN = null;
@Around("org.genesys2.server.aspect.SystemArchitecture.allServices()" + " && @annotation(org.genesys2.server.aspect.AsAdmin)")
@Around("org.genesys2.server.component.aspect.SystemArchitecture.allServices()" + " && @annotation(org.genesys2.server.component.aspect.AsAdmin)")
public Object authenticateAsAdmin(ProceedingJoinPoint pjp) throws Throwable {
Authentication adminAuthorization = getSystemAdminAccount();
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.genesys2.server.aspect;
package org.genesys2.server.component.aspect;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.server.aspect;
package org.genesys2.server.component.aspect;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
......@@ -34,11 +34,11 @@ public class SystemArchitecture {
public void businessServices() {
}
@Pointcut("execution(* org.genesys2.server.listener.sample.*.*(..))")
@Pointcut("execution(* org.genesys2.server.component.listener.*.*(..))")
public void sampleServices() {
}
@Pointcut("execution(* org.genesys2.server.security.*.*(..))")
@Pointcut("execution(* org.genesys2.server.component.security.*.*(..))")
public void securityServices() {
}
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.genesys2.server.listener.sample;
package org.genesys2.server.component.listener;
import java.io.IOException;
import java.io.InputStream;
......@@ -27,7 +27,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.genesys2.server.listener.RunAsAdminListener;
import org.genesys2.server.model.impl.Article;
import org.genesys2.server.service.CRMException;
import org.genesys2.server.service.ContentService;
......
......@@ -14,13 +14,12 @@
* limitations under the License.
*/
package org.genesys2.server.listener.sample;
package org.genesys2.server.component.listener;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.lang3.StringUtils;
import org.genesys2.server.listener.RunAsAdminListener;
import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.service.CropService;
import org.genesys2.server.service.GenesysService;
......
......@@ -14,11 +14,11 @@
* limitations under the License.
**/
package org.genesys2.server.listener;
package org.genesys2.server.component.listener;
import java.util.concurrent.Callable;
import org.genesys2.server.security.AsAdminInvoker;
import org.genesys2.server.component.security.AsAdminInvoker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
......
......@@ -14,11 +14,11 @@
* limitations under the License.
**/
package org.genesys2.server.security;
package org.genesys2.server.component.security;
import java.util.concurrent.Callable;
import org.genesys2.server.aspect.AsAdmin;
import org.genesys2.server.component.aspect.AsAdmin;
import org.springframework.stereotype.Service;
@Service
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.server.servlet.util;
package org.genesys2.server.component.security;
import java.io.BufferedReader;
import java.io.IOException;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.genesys2.server.security;
package org.genesys2.server.component.security;
import org.genesys.blocks.security.SecurityContextUtil;
import org.genesys.blocks.security.model.AclAwareModel;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
**/
package org.genesys2.spring;
package org.genesys2.server.mvc;
import java.time.LocalDate;
......
......@@ -28,8 +28,8 @@ import javax.servlet.http.HttpServletResponse;
import org.genesys.blocks.security.NotUniqueUserException;
import org.genesys.blocks.security.UserException;
import org.genesys.blocks.security.service.PasswordPolicy.PasswordPolicyException;
import org.genesys2.server.component.security.GoogleOAuthUtil;
import org.genesys2.server.model.impl.User;
import org.genesys2.server.servlet.util.GoogleOAuthUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
......
......@@ -21,7 +21,7 @@ import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.genesys2.server.aspect.AsAdmin;
import org.genesys2.server.component.aspect.AsAdmin;
import org.genesys2.server.model.impl.Article;
import org.genesys2.server.mvc.BaseController;
import org.genesys2.server.service.ContentService;
......
......@@ -40,6 +40,7 @@ import javax.validation.Valid;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.genesys2.server.component.security.SecurityUtils;
import org.genesys2.server.model.UserRole;
import org.genesys2.server.model.kpi.Dimension;
import org.genesys2.server.model.kpi.DimensionKey;
......@@ -55,7 +56,6 @@ import org.genesys2.server.persistence.kpi.ExecutionRepository;
import org.genesys2.server.persistence.kpi.ExecutionRunRepository;
import org.genesys2.server.persistence.kpi.KPIParameterRepository;
import org.genesys2.server.persistence.kpi.ObservationRepository;
import org.genesys2.server.security.SecurityUtils;
import org.genesys2.server.service.KPIService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -32,6 +32,7 @@ import javax.validation.Valid;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.StopWatch;
import org.genesys2.server.component.security.SecurityUtils;
import org.genesys2.server.exception.InvalidApiUsageException;
import org.genesys2.server.exception.NotFoundElement;
import org.genesys2.server.model.PublishState;
......@@ -48,7 +49,6 @@ import org.genesys2.server.persistence.FaoInstituteRepository;
import org.genesys2.server.persistence.SubsetAccessionRefRepository;
import org.genesys2.server.persistence.SubsetCreatorRepository;
import org.genesys2.server.persistence.SubsetRepository;
import org.genesys2.server.security.SecurityUtils;
import org.genesys2.server.service.SubsetService;
import org.genesys2.server.service.filter.SubsetFilter;
import org.genesys2.util.JPAUtils;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment