|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspartime.code.EncodeurSpartimeService
public class EncodeurSpartimeService
This class is a wrapper allowing the computation of all supported codes in PersoCode system, in an homogeneous manner. It's aimed to be packaged as a library for software integrators or as a web service.
Constructor Summary | |
---|---|
EncodeurSpartimeService()
|
Method Summary | |
---|---|
boolean |
addCodeQR(int serial,
java.lang.String code)
Adds a code to the list of codes aimed to be stored in a QRCode |
boolean |
dropCodesQR()
Deletes all the codes from the list aimed to be stored into a QRCode |
java.lang.String |
getCodeDateADate(java.lang.String ISOStart,
java.lang.String ISOEnd,
boolean unique,
int command,
java.lang.String... userName)
Computes a "Date to Date" code |
java.lang.String |
getCodeFonctionAddCreneau(int activite,
int start,
int end,
java.lang.String... userName)
Computes a function code allowing the appending of a time interval for an activity |
java.lang.String |
getCodeFonctionAddOpposition(java.lang.String code,
java.lang.String... userName)
Computes a "function code" allowing a "code stop" |
java.lang.String |
getCodeFonctionAddPerso(java.lang.String code,
int command,
java.lang.String... userName)
Computes a function code allowing the appending of a personal code |
java.lang.String |
getCodeFonctionDelActivite(int activite,
java.lang.String... userName)
Computes a function code allowing the removal of an activity (Multi-Activity) |
java.lang.String |
getCodeFonctionDelCreneau(int creneau,
java.lang.String... userName)
Computes a function code allowing the removal of a time interval from an activity |
java.lang.String |
getCodeFonctionDelOpposition(java.lang.String code,
java.lang.String... userName)
Computes a function code allowing the removal of a code stop |
java.lang.String |
getCodeFonctionDelPerso(java.lang.String code,
java.lang.String... userName)
Computes a function code allowing the removal of a personal code |
java.lang.String |
getCodeFonctionModCreneau(int creneau,
int start,
int end,
java.lang.String... userName)
Computes a function code allowing the modification of a yet existing time interval |
java.lang.String |
getCodeFonctionSetDateTime(java.lang.String ISODate,
java.lang.String... userName)
Computes a function code allowing the gate-keeper's clock to be set |
java.lang.String |
getCodeGestionnaire(java.lang.String... userName)
Computes adminitrator's code |
java.lang.String |
getCodeHeure(java.lang.String ISODateStart,
java.lang.String ISODateEnd,
int user,
boolean unique,
int command,
java.lang.String... userName)
Computes an hour-code (valid from 1 hour up to 24 hours - allowed durations depends on the profile) |
java.lang.String |
getCodeInstallateur(java.lang.String ISODate,
java.lang.String... userName)
Computes the installator's code for the specified day |
java.lang.String |
getCodeInstantane(java.lang.String ISODate,
int delta,
boolean unique,
int command,
java.lang.String... userName)
Computes an instantaneous code |
java.lang.String |
getCodeJour(java.lang.String ISODateStart,
java.lang.String ISODateEnd,
int user,
boolean unique,
int command,
java.lang.String... userName)
Computes a day-code (valid from half a day up to 31 days - allowed durations depends on the profile) |
java.lang.String |
getCodeMois(java.lang.String ISODateStart,
int nbMonth,
int user,
boolean unique,
int command,
java.lang.String... userName)
Computes a month-code (valid 1, 2, 3, 4, 6, or 12 months) |
java.lang.String |
getCodePeriodiqueHebdo(int user,
java.lang.String ISOStart,
int duration,
boolean unique,
int command,
java.lang.String... userName)
Computes a weekly periodical code. |
java.lang.String |
getCodePeriodiqueJourV2(int user,
java.lang.String ISOStart,
int duration,
int nbTrimestres,
int joursActifs,
int command,
java.lang.String... userName)
Computes a daily periodical code, version 2. |
java.lang.String[] |
getCryptoParametersFromShortKey(java.lang.String shortKey)
Extracts crypto parameters from short key of a gate keeper |
java.lang.String |
getQRCode(java.lang.String... userName)
Computes and returns a QRCode formatted in such a manner it can be interpreted by the "facilitacces" gate-keepers familly |
int |
getSerialFromCryptog(java.lang.String cryptogramme)
Retreives the serial number of a gate-keeper, given the cryptogramme which is a value displayed on the screen when pressing COR key twice |
boolean |
setCryptoParameters(java.lang.String key,
int iv,
java.lang.String profil,
int base)
Initialises the encoder with ciphering and coding parameters This method *MUST* be called before any other |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EncodeurSpartimeService()
Method Detail |
---|
public java.lang.String[] getCryptoParametersFromShortKey(java.lang.String shortKey) throws spartime.code.EncodeurSpartimeException
shortKey
- the short key (looks like 16549A75C000001P61 for example)
spartime.code.EncodeurSpartimeException
public boolean setCryptoParameters(java.lang.String key, int iv, java.lang.String profil, int base) throws spartime.code.EncodeurSpartimeException
key
- The key used for ciphering, expressed as an hexadecimal Stringiv
- The Initial Value used for ciphering. Usually equals to the serial number of the "gate-keeper".profil
- Gate-Keeper profile, i.e. the number of distinct equivalent codes that can be obtained for each of the 62 different durations (one year, six months,..., one hour)base
- The base in which codes are expressed. Base 14 by default (16 keys keypads)
spartime.code.EncodeurSpartimeException
- if something goes wrong (more details in the message)public int getSerialFromCryptog(java.lang.String cryptogramme) throws spartime.code.EncodeurSpartimeException
cryptogramme
- the number displayed on the gate-keeper
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeGestionnaire(java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeInstallateur(java.lang.String ISODate, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
ISODate
- The day the code should be valid, expressed as ISO8601 on 13 digits (e.g.:20081231T0000).userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeDateADate(java.lang.String ISOStart, java.lang.String ISOEnd, boolean unique, int command, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
ISOStart
- Date since which the code is valid (included) expressed as ISO8601 on 13 to 15 digits (e.g.:20081231T0000)ISOEnd
- Date until which the code is valid (included) expressed as ISO8601 on 13 to 15 digits (e.g.:20081231T0000)unique
- True if the code as to be limited in it's number of utilisations (the number depends on the gate-keeper configuration)command
- userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeFonctionAddOpposition(java.lang.String code, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
code
- The code to be stoppeduserName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeFonctionDelOpposition(java.lang.String code, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
code
- The code on which a stop has to be removeduserName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeFonctionAddPerso(java.lang.String code, int command, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
code
- The personal code to be appendedcommand
- userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeFonctionDelPerso(java.lang.String code, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
code
- The personal code to be removeduserName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeFonctionDelActivite(int activite, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
activite
- The number of the activity to be removed in the TAGuserName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeFonctionAddCreneau(int activite, int start, int end, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
activite
- The number of the activity the time interval has to be appendedstart
- The start of the time interval, expressed as the number of quarters of an hour since the Monday at 00:00 (from 0 to 671)end
- The end of the time interval, expressed as the number of quarters of an hour since the Monday at 00:00 (from 0 to 671)userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeFonctionModCreneau(int creneau, int start, int end, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
creneau
- The number of the time interval to be modifiedstart
- The new start of the time interval, expressed as the number of quarters of an hour since the Monday at 00:00 (from 0 to 671)end
- The new end of the time interval, expressed as the number of quarters of an hour since the Monday at 00:00 (from 0 to 671)userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeFonctionDelCreneau(int creneau, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
creneau
- The number of the time interval to be removeduserName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeFonctionSetDateTime(java.lang.String ISODate, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
ISODate
- The date/time at which the gate-keeper's clock as to be set, expressed as ISO8601 on 13 digits (e.g.:20081231T0000).
The minutes of the date must be a multiple of 10 modulo 60 (i.e.: 0,10,20,30,40 or 50).userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodePeriodiqueJourV2(int user, java.lang.String ISOStart, int duration, int nbTrimestres, int joursActifs, int command, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
user
- User's unique number for the given period (0 to 63)ISOStart
- The code's validity's start expressed as ISO8601. Only YEAR and HOUR are used as this type of codes necessarily starts on January, 1st, on an entire hour, and on valid days (see bellow)duration
- Code's validity's duration for each valid day, expressed as a number of hours minus one (from 0 to 15, meaning from 1h to 16h)nbTrimestres
- The number of quarters (of a year) the code has to be valid (from 0 to 3, meaning 1 quarter to 4 quarters)joursActifs
- Valid week's days: 0 is Monday to Saturday; 1 is Saturday and Sunday; 2 is Monday to Friday; 3 is Monday to Sunday.command
- userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodePeriodiqueHebdo(int user, java.lang.String ISOStart, int duration, boolean unique, int command, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
user
- User's unique number for the given period (0 or 1)ISOStart
- The code's validity's start expressed as ISO8601. Only YEAR, DAY OF WEEK and HOUR are used as this type of codes necessarily starts on the first "DAY OF WEEK" in January, on an entire hour, and longs all the yearduration
- Code's validity's duration for each valid day, expressed as a number of hours minus one (from 0 to 15, meaning from 1h to 16h)unique
- True if the code as to be limited in it's number of utilisations (the number depends on the gate-keeper configuration)command
- userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeInstantane(java.lang.String ISODate, int delta, boolean unique, int command, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
ISODate
- Code's validity's start, expressed as ISO8601 on 13 digits (e.g.:20081231T0000)delta
- An offset, in number of minutes, to be applied to the gate-keeper's clock when the code is typed (from -8 to +8)unique
- True if the code as to be limited in it's number of utilisations (the number depends on the gate-keeper configuration)command
- userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeHeure(java.lang.String ISODateStart, java.lang.String ISODateEnd, int user, boolean unique, int command, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
ISODateStart
- Code's validity's start (included), expressed as ISO8601 on 13 digits (e.g.:20081231T0000). Must be on an entire hour (e.g. 08h00, 09h00, etc...)ISODateEnd
- Code's validity's end (included), expressed as ISO8601 on 13 digits (e.g.:20081231T0059). Must be on an entire hour minus one minute (e.g. 08h59, 09h59, etc...)user
- User's unique number for the given period (from 0 to the corresponding value in the profile)unique
- True if the code as to be limited in it's number of utilisations (the number depends on the gate-keeper configuration)command
- userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeJour(java.lang.String ISODateStart, java.lang.String ISODateEnd, int user, boolean unique, int command, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
ISODateStart
- Code's validity's start (included), expressed as ISO8601 on 13 digits (e.g.:20081231T0000). Must start at 00h00 or 12h00.ISODateEnd
- Code's validity's end (included), expressed as ISO8601 on 13 digits (e.g.:20090101T0000). The number of days between end and start must be an integer, except for the "half-a-day" code.user
- User's unique number for the given period (from 0 to the corresponding value in the profile)unique
- True if the code as to be limited in it's number of utilisations (the number depends on the gate-keeper configuration)command
- userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public java.lang.String getCodeMois(java.lang.String ISODateStart, int nbMonth, int user, boolean unique, int command, java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
ISODateStart
- Code's validity's start (included), expressed as ISO8601 on 13 digits (e.g.:20081231T0000). Must be the first day of the month, at 0h00. Valid months are 1+X*nbMonth where X belongs to {0..12/nbMonth}nbMonth
- The number of month the code's validity have to last. Must be 1, 2, 3, 4, 6, or 12.user
- User's unique number for the given period (from 0 to the corresponding value in the profile)unique
- True if the code as to be limited in it's number of utilisations (the number depends on the gate-keeper configuration)command
- userName
- the name of the user who's code is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
public boolean addCodeQR(int serial, java.lang.String code) throws spartime.code.EncodeurSpartimeException
serial
- The serial number of the gateKeeper on which the code workscode
- The code to be stored into a QRCode
spartime.code.EncodeurSpartimeException
public boolean dropCodesQR() throws spartime.code.EncodeurSpartimeException
spartime.code.EncodeurSpartimeException
public java.lang.String getQRCode(java.lang.String... userName) throws spartime.code.EncodeurSpartimeException
userName
- the name of the user who's QRCode is computed for. Like "M. Jean DUPONT".
spartime.code.EncodeurSpartimeException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |