1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-14 18:26:17 +00:00

Initial commit

This commit is contained in:
jendib
2013-07-27 18:33:20 +02:00
parent 41cb6dd9ae
commit 9b74bd8194
156 changed files with 72879 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
package com.sismics.security;
import java.util.Locale;
import org.joda.time.DateTimeZone;
/**
* Anonymous principal.
*
* @author jtremeaux
*/
public class AnonymousPrincipal implements IPrincipal {
public static final String ANONYMOUS = "anonymous";
/**
* User locale.
*/
private Locale locale;
/**
* User timezone.
*/
private DateTimeZone dateTimeZone;
/**
* Constructor of AnonymousPrincipal.
*/
public AnonymousPrincipal() {
// NOP
}
@Override
public String getId() {
return null;
}
@Override
public String getName() {
return ANONYMOUS;
}
@Override
public boolean isAnonymous() {
return true;
}
@Override
public Locale getLocale() {
return locale;
}
/**
* Setter of locale.
*
* @param locale locale
*/
public void setLocale(Locale locale) {
this.locale = locale;
}
@Override
public DateTimeZone getDateTimeZone() {
return dateTimeZone;
}
@Override
public String getEmail() {
return null;
}
/**
* Setter of dateTimeZone.
*
* @param dateTimeZone dateTimeZone
*/
public void setDateTimeZone(DateTimeZone dateTimeZone) {
this.dateTimeZone = dateTimeZone;
}
}