Commit 0735faf2 authored by frederic motte's avatar frederic motte
Browse files

remove the role of the SF

parent b21e23b3
......@@ -17,7 +17,7 @@ public interface SFGenerator {
* @return A SF element which contains the WAR element
* @throws SFGeneratorException
*/
SF generateSecurityFilter(String sfName, String role, String STSUrl, byte[] securityModel, List<String> groups, ConnectionAccount account) throws SFGeneratorException;
SF generateSecurityFilter(String sfName, String STSUrl, byte[] securityModel, List<String> groups, ConnectionAccount account) throws SFGeneratorException;
/**
* Generation of the security filter present in front of the choreography
......@@ -29,6 +29,6 @@ public interface SFGenerator {
* @return A SF element which contains the WAR element
* @throws SFGeneratorException
*/
SF generateSecurityFilter(String sfName, String role, String STSUrl, String domain, List<String> groups) throws SFGeneratorException;
SF generateSecurityFilter(String sfName, String STSUrl, String domain, List<String> groups) throws SFGeneratorException;
}
......@@ -211,9 +211,9 @@ public class SFGeneratorImpl implements SFGenerator {
@Override
public SF generateSecurityFilter(String sfName, String role, String STSUrl, byte[] securityModel, List<String> groups, ConnectionAccount account) throws SFGeneratorException {
public SF generateSecurityFilter(String sfName, String STSUrl, byte[] securityModel, List<String> groups, ConnectionAccount account) throws SFGeneratorException {
SF sf = new SF(sfName,role);
SF sf = new SF(sfName);
try {
String destDir = FileUtils.getTempDirectoryPath();
String initialDestDir = destDir;
......@@ -239,9 +239,9 @@ public class SFGeneratorImpl implements SFGenerator {
@Override
public SF generateSecurityFilter(String sfName, String role, String STSUrl, String domain, List<String> groups)
public SF generateSecurityFilter(String sfName, String STSUrl, String domain, List<String> groups)
throws SFGeneratorException {
SF sf = new SF(sfName,role);
SF sf = new SF(sfName);
try {
String destDir = FileUtils.getTempDirectoryPath();
String initialDestDir = destDir;
......@@ -276,7 +276,7 @@ public class SFGeneratorImpl implements SFGenerator {
SFGenerator cdGenerator = new SFGeneratorImpl();
String domain = "domain2";
SF cd = cdGenerator.generateSecurityFilter(SFName,"SF", "http://127.0.0.1:8080/SecurityTokenService", domain , groups);
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", domain , groups);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
......@@ -287,7 +287,7 @@ public class SFGeneratorImpl implements SFGenerator {
byte[] securityModel = Files.readAllBytes(securityPath);
SFGenerator cdGenerator = new SFGeneratorImpl();
SF cd = cdGenerator.generateSecurityFilter(SFName,"SF", "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, null);
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, null);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
......@@ -302,7 +302,7 @@ public class SFGeneratorImpl implements SFGenerator {
account.setLogin("root");
account.setPassword("password");
SF cd = cdGenerator.generateSecurityFilter(SFName,"SF", "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, account);
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, account);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
......@@ -313,33 +313,33 @@ public class SFGeneratorImpl implements SFGenerator {
byte[] securityModel = Files.readAllBytes(securityPath);
SFGenerator cdGenerator = new SFGeneratorImpl();
SF cd = cdGenerator.generateSecurityFilter(SFName,"SF", "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, null);
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, null);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
{
System.out.println("Generation of a SF in front of a POI Service.");
String SFName = "POISF";
Path securityPath = Paths.get("POIService.security");
byte[] securityModel = Files.readAllBytes(securityPath);
SFGenerator cdGenerator = new SFGeneratorImpl();
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, null);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
{
System.out.println("Generation of a SF in front of a Traffic Information Service.");
String SFName = "TrafficInformationSF";
Path securityPath = Paths.get("TrafficInformationService.security");
byte[] securityModel = Files.readAllBytes(securityPath);
LoginPasswordConnectionAccount account = new LoginPasswordConnectionAccount();
account.setLogin("root");
account.setPassword("password");
SFGenerator cdGenerator = new SFGeneratorImpl();
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, account);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
//
// {
// System.out.println("Generation of a SF in front of a POI Service.");
// String SFName = "POISF";
// Path securityPath = Paths.get("POIService.security");
// byte[] securityModel = Files.readAllBytes(securityPath);
//
// SFGenerator cdGenerator = new SFGeneratorImpl();
// SF cd = cdGenerator.generateSecurityFilter(SFName,"SF", "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, null);
// FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
// }
//
// {
// System.out.println("Generation of a SF in front of a Traffic Information Service.");
// String SFName = "TrafficInformationSF";
// Path securityPath = Paths.get("TrafficInformationService.security");
// byte[] securityModel = Files.readAllBytes(securityPath);
// LoginPasswordConnectionAccount account = new LoginPasswordConnectionAccount();
// account.setLogin("root");
// account.setPassword("password");
// SFGenerator cdGenerator = new SFGeneratorImpl();
// SF cd = cdGenerator.generateSecurityFilter(SFName,"SF", "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, account);
// FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
// }
// {
// System.out.println("Generation of a SF in front of a legacy Service. During the service definition, the service owner has not provided an account to access it. the account must be provided by the designer");
......
......@@ -3,15 +3,14 @@ package eu.chorevolution.transformations.sfgenerator.model;
public class SF {
String name;
String role;
byte[] war;
public SF() {
}
public SF(String name, String role) {
public SF(String name) {
this.name = name;
this.role = role;
}
public String getName() {
......@@ -22,14 +21,6 @@ public class SF {
this.name = name;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public byte[] getWar() {
return war;
}
......
Supports Markdown
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