ccc.web.jaxrs
Class SecurityImpl

java.lang.Object
  extended by ccc.web.jaxrs.SecurityImpl
All Implemented Interfaces:
Security

public class SecurityImpl
extends java.lang.Object
implements Security

This class exposes parts of our public API using JAX-RS.

Author:
Civic Computing Ltd.

Field Summary
 
Fields inherited from interface ccc.api.core.Security
COLLECTION, CURRENT, PROPERTIES
 
Constructor Summary
SecurityImpl()
           
 
Method Summary
 java.lang.Boolean isLoggedIn()
          Determine if a user is associated with the current session.
 java.lang.Boolean login(java.lang.String username, java.lang.String password)
          Log in to CCC.
 void logout()
          Log out from the current session.
static void logSuccesfulLogin(java.lang.String username, java.lang.String ip, java.lang.String forwarded)
          Log a successful login attempt..
 java.lang.String readAllProperties()
          Read the properties for the session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityImpl

public SecurityImpl()
Method Detail

isLoggedIn

public java.lang.Boolean isLoggedIn()
Determine if a user is associated with the current session.

Specified by:
isLoggedIn in interface Security
Returns:
True if a user is associated, false otherwise.

login

public java.lang.Boolean login(java.lang.String username,
                               java.lang.String password)
Log in to CCC.

Specified by:
login in interface Security
Parameters:
username - The user's username.
password - The user's password.
Returns:
True if the login fails, false otherwise.

logout

public void logout()
Log out from the current session.

Specified by:
logout in interface Security

readAllProperties

public java.lang.String readAllProperties()
Read the properties for the session.

Specified by:
readAllProperties in interface Security
Returns:
The properties as a string.

logSuccesfulLogin

public static void logSuccesfulLogin(java.lang.String username,
                                     java.lang.String ip,
                                     java.lang.String forwarded)
Log a successful login attempt..

Parameters:
username - The username used to log in.
ip - The IP address the user logged in from.
forwarded - The IP addresses the request has been forwarded for.


Copyright © 2010. All Rights Reserved.