Skip to content

Commit

Permalink
Merge pull request #47 from indigo-dc/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
kmarszalek authored Apr 17, 2018
2 parents b3db975 + 1885b17 commit 2fb80ee
Show file tree
Hide file tree
Showing 257 changed files with 386 additions and 8,498 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV IAM_AUTHORIZE_URL 'https://iam-test.indigo-datacloud.eu/authorize'
ENV IAM_CLIENT_ID '53b937c5-fd53-4626-9400-8b21838d7de2'
ENV IAM_CLIENT_SECRET 'fcqrPQYZtR-CETMdvxrNoQAKtDw-Qy8hb0ItHd4cX6IJpi6f7124YDYV8SAuL99KfkWMQchQalBP2fJAlhRB7Q'
ENV CMDB_URL 'http://indigo.cloud.plgrid.pl'
ENV ONEDATA_URL 'https://onedata.indigo-datacloud.eu'
ENV ONEDATA_URL 'https://onedata.org'
ENV MYSQL_ADDRESS 'mysql'
ENV MYSQL_PORT '3306'
ENV MYSQL_DB 'indigo_slam'
Expand Down
47 changes: 0 additions & 47 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@
</properties>

<dependencies>
<!--<dependency>-->
<!--<groupId>org.codehaus.jackson</groupId>-->
<!--<artifactId>jackson-core-lgpl</artifactId>-->
<!--<version>2.8.3</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.codehaus.jackson</groupId>-->
<!--<artifactId>jackson-mapper-lgpl</artifactId>-->
<!--<version>2.8.3</version>-->
<!--</dependency>-->
<dependency>
<groupId>com.agreemount</groupId>
<artifactId>engine</artifactId>
Expand All @@ -80,11 +70,6 @@
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId>
<version>9.4-1206-jdbc42</version> </dependency> -->
<!-- <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId>
</dependency> -->

<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
Expand Down Expand Up @@ -147,8 +132,6 @@
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>
<!-- <dependency> <groupId>pl.cyfronet</groupId> <artifactId>bazaar-uo-ext</artifactId>
<version>0.0.1-SNAPSHOT</version> </dependency> -->
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
Expand All @@ -165,13 +148,6 @@
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>

<!--breaks things with engine, for some reasons spring throws null pointer exceptions on some components-->
<!--<dependency>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-devtools</artifactId>-->
<!--<optional>true</optional>-->
<!--</dependency>-->
</dependencies>

<build>
Expand Down Expand Up @@ -266,23 +242,11 @@
</plugins>
</build>

<scm>
<connection>scm:git:ssh://[email protected]:7999/fiddev/duo-demo.git</connection>
<url>https://git.plgrid.pl/projects/fiddev</url>
<developerConnection>scm:git:ssh://[email protected]:7999/fiddev/duo-demo.git</developerConnection>
<tag>HEAD</tag>
</scm>

<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
<!--<repository>-->
<!--<id>agreemount-cyfro-releases</id>-->
<!--<layout>default</layout>-->
<!--<url>https://gforge.cyfronet.pl/nexus/content/repositories/agreemount-cyfro-releases</url>-->
<!--</repository>-->
<repository>
<id>agreemount-cyfro-releases</id>
<layout>default</layout>
Expand All @@ -297,15 +261,4 @@
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>

<distributionManagement>
<repository>
<id>fiddev-releases</id>
<url>https://gforge.cyfronet.pl/nexus/content/repositories/fiddev-releases</url>
</repository>
<snapshotRepository>
<id>fiddev-snapshots</id>
<url>https://gforge.cyfronet.pl/nexus/content/repositories/fiddev-snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>

This file was deleted.

35 changes: 35 additions & 0 deletions src/main/java/pl/cyfronet/indigo/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package pl.cyfronet.indigo;

import com.agreemount.slaneg.fixtures.FileRulesProvidersConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.*;

/**
* @author bwilk
*
*/
@SpringBootApplication
@EnableAutoConfiguration
@PropertySources({
@PropertySource("classpath:bootstrap.properties"),
@PropertySource("classpath:hibernate.properties"),
@PropertySource("classpath:auth.properties"),
@PropertySource("classpath:bazaar.properties"),
@PropertySource("classpath:mongo.properties")
})
@ComponentScan(
basePackages = {"com.agreemount","pl.cyfronet.indigo"},
excludeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,
value = FileRulesProvidersConfiguration.class)
}
)
public class Application {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.ltos.bean;
package pl.cyfronet.indigo.bean;

import java.util.Date;

Expand All @@ -14,8 +14,6 @@
import lombok.Data;
import lombok.ToString;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
* @author bwilk
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package pl.cyfronet.ltos.bean;
package pl.cyfronet.indigo.bean;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
* @author bwilk
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package pl.cyfronet.ltos.bean;
package pl.cyfronet.indigo.bean;

import javax.persistence.Embeddable;
import javax.persistence.IdClass;
import java.io.Serializable;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.ltos.bean;
package pl.cyfronet.indigo.bean;

import java.util.List;

Expand All @@ -9,8 +9,6 @@
import javax.persistence.Id;
import javax.persistence.ManyToMany;

import com.fasterxml.jackson.annotation.JsonIgnore;

import lombok.Data;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.ltos.bean;
package pl.cyfronet.indigo.bean;

/**
* Created by chomik on 27.01.16.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.ltos.bean;
package pl.cyfronet.indigo.bean;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.ltos.bean;
package pl.cyfronet.indigo.bean;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.ltos.bean.legacy;
package pl.cyfronet.indigo.bean.legacy;

/**
* Created by chomik on 27.01.16.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.ltos.bean.legacy;
package pl.cyfronet.indigo.bean.legacy;

/**
* Created by lpalonek on 04.12.14.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.ltos.bean.legacy;
package pl.cyfronet.indigo.bean.legacy;

/**
* Created by lpalonek on 04.12.14.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.ltos.bean.legacy;
package pl.cyfronet.indigo.bean.legacy;

import lombok.Data;

Expand Down
28 changes: 28 additions & 0 deletions src/main/java/pl/cyfronet/indigo/controller/CmdbController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package pl.cyfronet.indigo.controller;

import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
public class CmdbController {

static Logger logger = LoggerFactory
.getLogger(CmdbController.class);

@Value("${cmdb.url}")
private String cmdbUrl;

@RequestMapping(value = "api/sites", method = RequestMethod.GET)
@ResponseBody
public String getSites() throws UnirestException {
return Unirest.get(cmdbUrl+"/cmdb/service/list").asString().getBody();
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package pl.cyfronet.ltos.rest.controller;
package pl.cyfronet.indigo.controller;

import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import pl.cyfronet.ltos.bean.DocumentWeight;
import pl.cyfronet.ltos.bean.User;
import pl.cyfronet.ltos.repository.DocumentWeightRepository;
import pl.cyfronet.ltos.repository.UserRepository;
import pl.cyfronet.ltos.security.PortalUser;
import pl.cyfronet.indigo.bean.DocumentWeight;
import pl.cyfronet.indigo.bean.User;
import pl.cyfronet.indigo.repository.DocumentWeightRepository;
import pl.cyfronet.indigo.repository.UserRepository;
import pl.cyfronet.indigo.security.PortalUser;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package pl.cyfronet.ltos.controller;
package pl.cyfronet.indigo.controller;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import pl.cyfronet.ltos.security.PortalUser;
import org.springframework.web.servlet.view.RedirectView;
import pl.cyfronet.indigo.security.PortalUser;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;

@Controller
Expand All @@ -30,4 +33,13 @@ public ModelAndView home(PortalUser user) {
mav.getModelMap().addAttribute("version", version);
return mav;
}

@RequestMapping(value = "/auth/logout", method = RequestMethod.GET)
public RedirectView logout(HttpSession session) {
session.invalidate();
RedirectView redirectView = new RedirectView();
redirectView.setContextRelative(true);
redirectView.setUrl("/");
return redirectView;
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package pl.cyfronet.ltos.rest.controller;
package pl.cyfronet.indigo.controller;

import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import pl.cyfronet.ltos.repository.UserRepository;
import pl.cyfronet.ltos.rest.bean.IndigoWrapper;
import pl.cyfronet.ltos.rest.bean.sla.Sla;
import pl.cyfronet.ltos.rest.logic.IndigoRestLogic;
import pl.cyfronet.indigo.repository.UserRepository;
import pl.cyfronet.indigo.rest.bean.IndigoWrapper;
import pl.cyfronet.indigo.rest.bean.sla.Sla;
import pl.cyfronet.indigo.rest.logic.IndigoRestLogic;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package pl.cyfronet.bazaar.engine.extension.action.definition;
package pl.cyfronet.indigo.engine.extension.action.definition;

import com.agreemount.slaneg.action.definition.Action;
import com.agreemount.slaneg.annotation.HandleWithImplementation;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import pl.cyfronet.bazaar.engine.extension.action.impl.SetOrganizationAsTeamImpl;
import pl.cyfronet.indigo.engine.extension.action.impl.SetOrganizationAsTeamImpl;

@Getter
@Setter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package pl.cyfronet.bazaar.engine.extension.action.impl;
package pl.cyfronet.indigo.engine.extension.action.impl;

import com.agreemount.bean.document.Document;
import com.agreemount.bean.identity.provider.IdentityProvider;
Expand All @@ -8,7 +8,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import pl.cyfronet.bazaar.engine.extension.action.definition.SetOrganizationAsTeam;
import pl.cyfronet.indigo.engine.extension.action.definition.SetOrganizationAsTeam;

@Component
@Scope("prototype")
Expand Down
Loading

0 comments on commit 2fb80ee

Please sign in to comment.