Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Michael Ritter
chronopolis-core
Commits
5e995b78
Commit
5e995b78
authored
Oct 30, 2014
by
Michael Ritter
Browse files
add notifier
parent
534ffa53
Changes
2
Hide whitespace changes
Inline
Side-by-side
replication-shell/src/main/java/org/chronopolis/replicate/Notifier.java
0 → 100644
View file @
5e995b78
package
org.chronopolis.replicate
;
/**
* Created by shake on 10/29/14.
*/
public
interface
Notifier
{
String
getNotificationBody
();
}
replication-shell/src/main/java/org/chronopolis/replicate/ReplicationNotifier.java
0 → 100644
View file @
5e995b78
package
org.chronopolis.replicate
;
import
org.chronopolis.messaging.collection.CollectionInitMessage
;
import
java.io.PrintWriter
;
import
java.io.StringWriter
;
/**
* Created by shake on 10/29/14.
*/
public
class
ReplicationNotifier
implements
Notifier
{
private
final
CollectionInitMessage
message
;
private
boolean
success
;
private
String
aceStep
;
private
String
bagStep
;
private
String
tokenStep
;
private
String
rsyncStats
;
public
ReplicationNotifier
(
CollectionInitMessage
message
)
{
this
.
message
=
message
;
this
.
success
=
true
;
}
@Override
public
String
getNotificationBody
()
{
StringWriter
stringWriter
=
new
StringWriter
();
PrintWriter
textBody
=
new
PrintWriter
(
stringWriter
,
true
);
textBody
.
println
(
"Message received from: "
+
message
.
getOrigin
());
textBody
.
println
(
message
.
toString
());
textBody
.
println
();
textBody
.
println
();
textBody
.
println
(
"Step status:"
);
textBody
.
println
(
"Token Download - "
+
tokenStep
);
textBody
.
println
(
"Bag Download - "
+
bagStep
);
textBody
.
println
(
"ACE Register/Audit - "
+
aceStep
);
textBody
.
println
(
"Transfer Stats:"
);
textBody
.
println
(
rsyncStats
);
return
stringWriter
.
toString
();
}
public
boolean
isSuccess
()
{
return
success
;
}
public
void
setSuccess
(
final
boolean
success
)
{
this
.
success
=
success
;
}
public
String
getAceStep
()
{
return
aceStep
;
}
public
void
setAceStep
(
final
String
aceStep
)
{
this
.
aceStep
=
aceStep
;
}
public
String
getBagStep
()
{
return
bagStep
;
}
public
void
setBagStep
(
final
String
bagStep
)
{
this
.
bagStep
=
bagStep
;
}
public
String
getTokenStep
()
{
return
tokenStep
;
}
public
void
setTokenStep
(
final
String
tokenStep
)
{
this
.
tokenStep
=
tokenStep
;
}
public
String
getRsyncStats
()
{
return
rsyncStats
;
}
public
void
setRsyncStats
(
final
String
rsyncStats
)
{
this
.
rsyncStats
=
rsyncStats
;
}
public
CollectionInitMessage
getMessage
()
{
return
message
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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