Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8ddfa975
authored
Mar 21, 2010
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODO: insert there some nice description to this commit.
1 parent
1b4f025e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
2 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/SecurityBean.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/SecurityBeanLocal.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/SecurityLogType.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/SecurityBean.java
View file @
8ddfa97
...
@@ -44,4 +44,41 @@ public class SecurityBean implements SecurityBeanLocal {
...
@@ -44,4 +44,41 @@ public class SecurityBean implements SecurityBeanLocal {
logger
.
debug
(
entry
.
toString
(),
exception
);
logger
.
debug
(
entry
.
toString
(),
exception
);
entryFacade
.
create
(
entry
);
entryFacade
.
create
(
entry
);
}
}
public
void
logException
(
User
user
,
Exception
exception
)
{
LogEntryType
type
=
typeFacade
.
findOrCreate
(
SecurityLogType
.
unknownException
);
LogEntry
entry
=
new
LogEntry
();
entry
.
setType
(
type
);
entry
.
setTime
(
Calendar
.
getInstance
());
entry
.
setDescription
(
exception
.
getMessage
());
entry
.
setUser
(
user
);
logger
.
debug
(
entry
.
toString
(),
exception
);
entryFacade
.
create
(
entry
);
}
public
void
logMessage
(
User
user
,
String
description
)
{
logMessage
(
SecurityLogType
.
genericMessage
,
user
,
description
);
}
public
void
logMessage
(
SecurityLogType
paramType
,
User
user
,
String
description
)
{
LogEntryType
type
=
typeFacade
.
findOrCreate
(
paramType
);
LogEntry
entry
=
new
LogEntry
();
entry
.
setType
(
type
);
entry
.
setTime
(
Calendar
.
getInstance
());
entry
.
setDescription
(
description
);
entry
.
setUser
(
user
);
entryFacade
.
create
(
entry
);
}
public
void
logMessage
(
String
description
)
{
logMessage
(
SecurityLogType
.
genericMessage
,
description
);
}
public
void
logMessage
(
SecurityLogType
type
,
String
description
)
{
logMessage
(
type
,
null
,
description
);
}
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/SecurityBeanLocal.java
View file @
8ddfa97
...
@@ -7,6 +7,14 @@ import fi.insomnia.bortal.model.User;
...
@@ -7,6 +7,14 @@ import fi.insomnia.bortal.model.User;
@Local
@Local
public
interface
SecurityBeanLocal
{
public
interface
SecurityBeanLocal
{
void
logPermissionDenied
(
User
user
,
Exception
permissionDeniedException
);
void
logPermissionDenied
(
User
user
,
Exception
exception
);
void
logException
(
User
user
,
Exception
exception
);
void
logMessage
(
User
user
,
String
description
);
void
logMessage
(
SecurityLogType
type
,
User
user
,
String
description
);
void
logMessage
(
String
description
);
void
logMessage
(
SecurityLogType
type
,
String
description
);
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/SecurityLogType.java
View file @
8ddfa97
package
fi
.
insomnia
.
bortal
.
beans
;
package
fi
.
insomnia
.
bortal
.
beans
;
public
enum
SecurityLogType
{
public
enum
SecurityLogType
{
permissionDenied
permissionDenied
,
unknownException
,
genericMessage
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment