Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
adapt
ace
Commits
68528448
Commit
68528448
authored
Apr 04, 2017
by
Michael Ritter
Browse files
Add new log entries to differentiate cancelled/aborted audits
parent
e56ff67b
Changes
2
Show whitespace changes
Inline
Side-by-side
ace-am/src/main/java/edu/umiacs/ace/monitor/log/LogEnum.java
View file @
68528448
...
...
@@ -100,6 +100,10 @@ public enum LogEnum {
FILE_REGISTER
(
25
,
"File Registered"
,
"New file registered but is not ready for auditing"
),
FILE_AUDIT_FALLBACK
(
26
,
"File Audit Fallback"
,
"File Audit could not connect to the IMS, falling back to audit-only mode"
),
SMTP_ERROR
(
27
,
"SMTP Communication Error"
,
"Could not connect to designated SMTP host"
),
// audit stop errors
FILE_AUDIT_CANCEL
(
30
,
"File Audit Cancel"
,
"Auditing of this collection's files was cancelled"
),
FILE_AUDIT_ABORT
(
31
,
"File Audit Aborted"
,
"Auditing of this collection's files was aborted"
),
SYSTEM_ERROR
(
99
,
"System Error"
,
"Unknown system error occurred, check server logs"
);
private
int
type
;
private
String
shortName
;
...
...
@@ -178,6 +182,11 @@ public enum LogEnum {
case
26
:
return
FILE_AUDIT_FALLBACK
;
case
30
:
return
FILE_AUDIT_CANCEL
;
case
31
:
return
FILE_AUDIT_ABORT
;
case
99
:
return
SYSTEM_ERROR
;
}
...
...
ace-am/src/main/java/edu/umiacs/ace/monitor/log/LogServlet.java
View file @
68528448
...
...
@@ -282,42 +282,43 @@ public class LogServlet extends EntityManagerServlet {
* @return
*/
private
String
generateTypeString
(
Map
<
String
,
String
>
selectedTypes
)
{
String
returnString
=
""
;
String
Builder
returnString
=
new
StringBuilder
()
;
if
(
selectedTypes
.
size
()
>
0
)
{
returnString
=
" l.logType IN ( "
;
returnString
=
new
StringBuilder
(
" l.logType IN ( "
)
;
}
for
(
String
key
:
selectedTypes
.
keySet
()
)
{
if
(
CHOICE_ERRORS
.
equals
(
key
)
)
{
returnString
+=
LogEnum
.
SYSTEM_ERROR
.
getType
()
+
","
;
returnString
+=
LogEnum
.
SITE_UNACCESSABLE
.
getType
()
+
","
;
returnString
+=
LogEnum
.
LOG_TYPE_UNKNOWN
.
getType
()
+
","
;
returnString
+=
LogEnum
.
CREATE_TOKEN_ERROR
.
getType
()
+
","
;
returnString
+=
LogEnum
.
ERROR_READING
.
getType
()
+
","
;
returnString
+=
LogEnum
.
UNKNOWN_IMS_COMMUNICATION_ERROR
.
getType
()
+
","
;
returnString
.
append
(
LogEnum
.
SYSTEM_ERROR
.
getType
()).
append
(
","
);
returnString
.
append
(
LogEnum
.
SITE_UNACCESSABLE
.
getType
()).
append
(
","
);
returnString
.
append
(
LogEnum
.
LOG_TYPE_UNKNOWN
.
getType
()).
append
(
","
);
returnString
.
append
(
LogEnum
.
CREATE_TOKEN_ERROR
.
getType
()).
append
(
","
);
returnString
.
append
(
LogEnum
.
ERROR_READING
.
getType
()).
append
(
","
);
returnString
.
append
(
LogEnum
.
UNKNOWN_IMS_COMMUNICATION_ERROR
.
getType
()).
append
(
","
);
}
else
if
(
CHOICE_MISSING
.
equals
(
key
)
)
{
returnString
+=
LogEnum
.
FILE_MISSING
.
getType
()
+
","
;
returnString
+=
LogEnum
.
FILE_CORRUPT
.
getType
()
+
","
;
returnString
+=
LogEnum
.
MISSING_TOKEN
.
getType
()
+
","
;
returnString
.
append
(
LogEnum
.
FILE_MISSING
.
getType
()
).
append
(
","
)
;
returnString
.
append
(
LogEnum
.
FILE_CORRUPT
.
getType
()
).
append
(
","
)
;
returnString
.
append
(
LogEnum
.
MISSING_TOKEN
.
getType
()
).
append
(
","
)
;
}
else
if
(
CHOICE_NEWMASTER
.
equals
(
key
)
)
{
returnString
+=
LogEnum
.
FILE_NEW
.
getType
()
+
","
;
returnString
+=
LogEnum
.
ADD_TOKEN
.
getType
()
+
","
;
returnString
+=
LogEnum
.
FILE_ONLINE
.
getType
()
+
","
;
returnString
.
append
(
LogEnum
.
FILE_NEW
.
getType
()
).
append
(
","
)
;
returnString
.
append
(
LogEnum
.
ADD_TOKEN
.
getType
()
).
append
(
","
)
;
returnString
.
append
(
LogEnum
.
FILE_ONLINE
.
getType
()
).
append
(
","
)
;
returnString
.
append
(
LogEnum
.
FILE_REGISTER
.
getType
()).
append
(
","
);
}
else
if
(
CHOICE_SYNC
.
equals
(
key
)
)
{
returnString
+=
LogEnum
.
FILE_AUDIT_FINISH
.
getType
()
+
","
;
returnString
+=
LogEnum
.
FILE_AUDIT_START
.
getType
()
+
","
;
returnString
.
append
(
LogEnum
.
FILE_AUDIT_FINISH
.
getType
()).
append
(
","
);
returnString
.
append
(
LogEnum
.
FILE_AUDIT_START
.
getType
()).
append
(
","
);
returnString
.
append
(
LogEnum
.
FILE_AUDIT_CANCEL
.
getType
()).
append
(
","
);
returnString
.
append
(
LogEnum
.
FILE_AUDIT_ABORT
.
getType
()).
append
(
","
);
}
}
if
(
returnString
.
length
()
>
0
)
{
// remove last ','
returnString
=
returnString
.
substring
(
0
,
returnString
.
length
()
-
1
);
returnString
+=
")"
;
returnString
=
new
StringBuilder
(
returnString
.
substring
(
0
,
returnString
.
length
()
-
1
)
)
;
returnString
.
append
(
")"
)
;
}
return
returnString
;
return
returnString
.
toString
()
;
}
/**
...
...
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