Skip to content

Commit 63aa019

Browse files
author
JMaggesi
committed
First commit
0 parents  commit 63aa019

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+5972
-0
lines changed

LICENSE

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (c) 2013, Jonatan Maggesi
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
* Neither the name of Assert4SOA-MatchMaker nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Assert4SOA-MatchMaker
2+
3+
We present a security-enhanced solution to the
4+
discovery and selection of services. This solution integrates a
5+
test-based certification scheme proving the security properties
6+
of services. In particular, we describe two algorithms enabling
7+
clients to select the service that best addresses their security requirements.
8+
We also present a prototype implementation of our
9+
approach and an experimental evaluation of its performances.
10+
11+
The software proposed select the best service using the proposed solution in the following paper:
12+
* [Security certification-aware service discovery and selection](http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=6449460&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D6449460)
13+
14+
# License
15+
* Free Software: BSD License

lib/BaseX73.jar

2.29 MB
Binary file not shown.
1.52 MB
Binary file not shown.

lib/guava-12.0.1.jar

1.71 MB
Binary file not shown.

lib/jackson-annotations-2.1.1.jar

33.7 KB
Binary file not shown.

lib/jackson-core-2.1.1.jar

202 KB
Binary file not shown.

lib/jackson-databind-2.1.1.jar

901 KB
Binary file not shown.

src/.svn/all-wcprops

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
K 25
2+
svn:wc:ra_dav:version-url
3+
V 32
4+
/svn/Assert/!svn/ver/9/trunk/src
5+
END
6+
Program.java
7+
K 25
8+
svn:wc:ra_dav:version-url
9+
V 46
10+
/svn/Assert/!svn/ver/12/trunk/src/Program.java
11+
END
12+
SlaveMatchMaker.java
13+
K 25
14+
svn:wc:ra_dav:version-url
15+
V 54
16+
/svn/Assert/!svn/ver/11/trunk/src/SlaveMatchMaker.java
17+
END

src/.svn/entries

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
10
2+
3+
dir
4+
9
5+
https://159.149.71.91/svn/Assert/trunk/src
6+
https://159.149.71.91/svn/Assert
7+
8+
9+
10+
2012-08-02T19:05:43.406928Z
11+
9
12+
Jonatan
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
d9744f84-d650-0145-a206-326680d4b200
28+
29+
Program.java
30+
file
31+
12
32+
33+
34+
35+
2012-08-08T13:12:09.000000Z
36+
3d46d3cb7c9b755395f4ad9e2f12c581
37+
2012-08-08T17:12:52.592444Z
38+
12
39+
Jonatan
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
7348
62+
63+
SlaveMatchMaker.java
64+
file
65+
11
66+
67+
68+
69+
2012-08-02T22:22:29.000000Z
70+
102986bf1f9fa2d22d741d198b6a9777
71+
2012-08-04T00:08:32.505938Z
72+
11
73+
Jonatan
74+
75+
76+
77+
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+
95+
4480
96+
97+
eu
98+
dir
99+
+235
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
import java.util.ArrayList;
2+
import java.util.Collection;
3+
import java.util.HashMap;
4+
import java.util.HashSet;
5+
import java.util.Map;
6+
import java.util.Map.Entry;
7+
import java.util.Set;
8+
9+
import com.google.common.collect.HashBasedTable;
10+
import com.google.common.collect.HashMultimap;
11+
import com.google.common.collect.Multimap;
12+
import com.google.common.collect.Table;
13+
14+
import org.w3c.dom.Document;
15+
import eu.assert4soa.datamodel.ASSERT;
16+
import eu.assert4soa.datamodel.CandidateService;
17+
import eu.assert4soa.datamodel.PartiallyOrderedSet;
18+
import eu.assert4soa.datamodel.datamodelFactory;
19+
import eu.unimi.ematchmakerconfiguration.ModelWeight;
20+
import eu.unimi.ematchmakerconfiguration.QualityLevel;
21+
import eu.unimi.ontologyquestioner.BaseXOntologyManager;
22+
import eu.unimi.retriever.Retriever;
23+
24+
25+
26+
27+
/*******************************************************************
28+
* Copyright (c) - Universit� degli Studi di Milano (Crema)
29+
*
30+
* @author Jonatan Maggesi <jmaggesi@gmail.com>
31+
*
32+
******************************************************************/
33+
34+
/**
35+
* @author Jonatan Maggesi
36+
*
37+
*/
38+
public class Program {
39+
40+
/**
41+
* @param args
42+
*/
43+
public static void main(String[] args) {
44+
BaseXOntologyManager match = new BaseXOntologyManager("localhost", 1984, "developer", "developer");
45+
ArrayList<String> results = match.getSubClasses("integrity_AES_128", true);
46+
47+
System.out.println("Risultati ottenuti dall'Ontologia SOTTOCLASSI di integrity: ");
48+
49+
if (results != null){
50+
for (String result : results) {
51+
System.out.println(result);
52+
}
53+
} else {
54+
System.out.println("Results vuoto");
55+
}
56+
57+
System.out.println("");
58+
results = match.getSuperClasses("integrity_AES_256", false);
59+
60+
System.out.println("Risultati ottenuti dall'Ontologia SUPERCLASSI di integrity_AES_256: ");
61+
62+
if (results != null){
63+
for (String result : results) {
64+
System.out.println(result);
65+
}
66+
}
67+
datamodelFactory dmf = datamodelFactory.eINSTANCE;
68+
//ASSERT test = dmf.createASSERT("Test");
69+
70+
Set<ASSERT> asserts = new HashSet<ASSERT>();
71+
72+
System.out.println("");
73+
System.out.println("ASSERT Presenti nel DB");
74+
System.out.println("");
75+
76+
results = match.getAllAssert();
77+
if (results != null){
78+
System.out.println("Numero di assert presenti nel db: " + results.size());
79+
80+
for (String result : results) {
81+
//System.out.println("");
82+
//System.out.println(result);
83+
84+
asserts.add(dmf.createASSERT(result));
85+
86+
}
87+
}
88+
89+
HashMap<String, Double> testMetrics = new HashMap<String, Double>();
90+
HashMap<String, Double> modelIndexes = new HashMap<String, Double>();
91+
92+
for(ASSERT asser : asserts){
93+
System.out.println();
94+
System.out.println("Propriet� di sicurezza: " + Retriever.getSecurityPropertyName(asser));
95+
System.out.println("Modello del Servizio: " + Retriever.getModelType(asser));
96+
System.out.println();
97+
System.out.println("Metriche Test: ");
98+
99+
testMetrics = Retriever.getTestMetrics(asser);
100+
101+
for(Map.Entry<String, Double> cursor : testMetrics.entrySet()){
102+
System.out.println("Nome Metrica : " + cursor.getKey() + " Valore: " + cursor.getValue());
103+
}
104+
105+
System.out.println();
106+
107+
System.out.println("Model Indexes: ");
108+
109+
modelIndexes = Retriever.getModelIndexes(asser);
110+
111+
for(Map.Entry<String, Double> cursor : modelIndexes.entrySet()){
112+
System.out.println("Nome ModelIndexes : " + cursor.getKey() + " Valore: " + cursor.getValue());
113+
}
114+
115+
System.out.println();
116+
117+
}
118+
119+
Table<String, String, Double> tab = HashBasedTable.create();
120+
tab.put("Index-1", "Weight", -1.0);
121+
tab.put("Index-1", "Min", 0.0);
122+
tab.put("Index-1", "Max", 4.0);
123+
tab.put("Index-1", "Test", 6.9);
124+
tab.put("Index-1", "Test", 10.0);
125+
tab.put("Index-2", "Test", 30.0);
126+
127+
Map<String, Double> row = tab.row("Index-1");
128+
System.out.println();
129+
130+
System.out.println("Test: " + row.get("Test"));
131+
132+
Double min = tab.get("Index-2", "Min");
133+
134+
System.out.println("Index-2 MIN: " + min);
135+
136+
tab = Retriever.getModelWeightTable(ModelWeight.CONFIDENT);
137+
tab = Retriever.getModelIndexTable(asserts, tab);
138+
Multimap<QualityLevel, ASSERT> map = Retriever.groupByModelIndex(asserts, ModelWeight.CONFIDENT);
139+
for( Entry<QualityLevel, ASSERT> cursor : map.entries()){
140+
QualityLevel lev = cursor.getKey();
141+
142+
System.out.println("Livello: " + lev.toString());
143+
144+
}
145+
146+
for(ASSERT ass : asserts){
147+
System.out.println(Retriever.getCompleteSecurityProperty(ass));
148+
}
149+
150+
Retriever.getSecurityPropertyHierarchy("integrity");
151+
152+
153+
Multimap<String, String> hierarchy = HashMultimap.create();
154+
hierarchy.put("I50", null);
155+
hierarchy.put("I50A", null);
156+
hierarchy.put("I400", "I50");
157+
hierarchy.put("I400", "I50A");
158+
159+
Multimap<String, String> grouped = HashMultimap.create();
160+
grouped.put("I400", "Test");
161+
grouped.put("I400", "Prova");
162+
grouped.put("I50", "Test1");
163+
grouped.put("I50", "Prova1");
164+
grouped.put("I50A", "Prova2");
165+
166+
//Multimap<String, String> relations = Retriever.testRelations(hierarchy, grouped);
167+
168+
PartiallyOrderedSet<Set<String>> test = dmf.createPartialOrder();
169+
// test.add("test");
170+
// test.add("Prova");
171+
// test.addRelation("test", "Prova");
172+
// test.add("Prova2");
173+
174+
test = Retriever.getPartialOrder2(grouped, hierarchy);
175+
//System.out.println(test.isGreater("test", "Prova2"));
176+
//HashSet<String> provami = new HashSet<String>(1);
177+
//provami.add("Prova2");
178+
//test.remove(provami);
179+
180+
PartiallyOrderedSet<Set<String>> testMerge = dmf.createPartialOrder();
181+
HashSet<String> primo = new HashSet<String>();
182+
primo.add("Test");
183+
HashSet<String> secondo = new HashSet<String>();
184+
secondo.add("Prova");
185+
186+
HashSet<String> terzo = new HashSet<String>();
187+
terzo.add("Terzo");
188+
//test.add(terzo);
189+
test.addRelation(test.getMinimalElements(), terzo);
190+
191+
testMerge.add(primo);
192+
testMerge.add(secondo);
193+
testMerge.addRelation(primo, secondo);
194+
195+
//Set<Set<String>> elements = test.getMinimalElements();
196+
Set<Set<String>> elements = new HashSet<Set<String>>();
197+
HashSet<String> element1 = new HashSet<String>();
198+
element1.add("Test");
199+
element1.add("Prova");
200+
elements.add(element1);
201+
202+
for(Set<String> element : elements){
203+
test = Retriever.mergePartialOrder2(element, test, testMerge);
204+
}
205+
Retriever.getParentElement2(terzo, test);
206+
207+
System.out.println(test.getMaximelElements());
208+
System.out.println(test.getMinimalElements());
209+
210+
// PartiallyOrderedSet<String> test2 = dmf.createPartialOrder();
211+
// test2.add("test");
212+
// test2.add("Prova");
213+
// test2.addRelation("test", "Prova");
214+
// test2.add("Prova2");
215+
//
216+
// System.out.println(test2.getMaximelElements());
217+
// System.out.println(test2.getMinimalElements());
218+
219+
// Multimap<String, String> testMulti = HashMultimap.create();
220+
// testMulti.put("Test", "prova1");
221+
// testMulti.put("Test", null);
222+
// testMulti.put("Test", "prova2");
223+
//
224+
// Collection<String> valuesMulti = testMulti.get("Test");
225+
// System.out.println(valuesMulti);
226+
//
227+
// testMulti.put("Test", "prova1");
228+
//
229+
// valuesMulti = testMulti.get("Test");
230+
// System.out.println(valuesMulti);
231+
232+
//System.out.println(tab.size());
233+
}
234+
235+
}

0 commit comments

Comments
 (0)