Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
7ed36fcf
Commit
7ed36fcf
authored
Feb 15, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added prop file for getting jar
parent
798834f3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
consumer.properties
drip-provisioner/etc/consumer.properties
+1
-0
Consumer.java
.../main/java/nl/uva/sne/drip/drip/provisioner/Consumer.java
+14
-3
No files found.
drip-provisioner/etc/consumer.properties
0 → 100644
View file @
7ed36fcf
jar.file.path
=
/path
\ No newline at end of file
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/Consumer.java
View file @
7ed36fcf
...
...
@@ -21,17 +21,21 @@ import com.rabbitmq.client.DefaultConsumer;
import
com.rabbitmq.client.Envelope
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.PrintWriter
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.commons.types.Parameter
;
...
...
@@ -45,12 +49,13 @@ import org.json.JSONObject;
* This is an example of a Message consumer
*
*
* @author H. Zhou
* @author H. Zhou
, S. Koulouzis
*/
public
class
Consumer
extends
DefaultConsumer
{
private
final
Channel
channel
;
private
final
String
jarFilePath
=
"/root/SWITCH/bin/ProvisioningCore.jar"
;
private
final
String
propertiesPath
=
"etc/consumer.properties"
;
private
String
jarFilePath
;
public
class
topologyElement
{
...
...
@@ -58,9 +63,15 @@ public class Consumer extends DefaultConsumer {
String
outputFilePath
=
""
;
}
public
Consumer
(
Channel
channel
)
{
public
Consumer
(
Channel
channel
)
throws
IOException
{
super
(
channel
);
this
.
channel
=
channel
;
Properties
prop
=
new
Properties
();
try
(
InputStream
in
=
new
FileInputStream
(
propertiesPath
))
{
prop
.
load
(
in
);
}
jarFilePath
=
prop
.
getProperty
(
"jar.file.path"
,
"/root/SWITCH/bin/ProvisioningCore.jar"
);
}
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment