Importing SVN archives - B6M1

This commit is contained in:
Emmanuel BENOîT 2018-10-23 09:38:02 +02:00
commit fc4c6bd340
1695 changed files with 98617 additions and 0 deletions
legacyworlds-session
.classpath.project
.settings
pom.xml
src/main/java/com/deepclone/lw/cmd
CreateAuthChallengeCommand.javaCreateAuthChallengeResponse.javaMailError.javaMaintenanceResponse.javaObjectNameError.javaPasswordError.java
admin
AdminOverviewCommand.javaAdminOverviewResponse.javaAdminResponse.javaNoOperationCommand.javaSetPasswordCommand.javaSetPasswordResponse.java
adata
bans
bt
constants
i18n
logs
mntm
msg
naming

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>legacyworlds-session</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,6 @@
#Tue Apr 13 16:03:03 CEST 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -0,0 +1,9 @@
#Tue Apr 13 16:03:03 CEST 2010
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1

View file

@ -0,0 +1,16 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>legacyworlds</artifactId>
<groupId>com.deepclone.lw</groupId>
<version>5.99.1</version>
</parent>
<groupId>com.deepclone.lw</groupId>
<artifactId>legacyworlds-session</artifactId>
<version>5.99.1</version>
<name>Legacy Worlds sessions</name>
<description>This module contains the definition of sessions used in client-server communications and all related classes and exceptions.</description>
</project>

View file

@ -0,0 +1,11 @@
package com.deepclone.lw.cmd;
import com.deepclone.lw.session.Command;
public class CreateAuthChallengeCommand
extends Command
{
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd;
import com.deepclone.lw.session.CommandResponse;
public class CreateAuthChallengeResponse
extends CommandResponse
{
private static final long serialVersionUID = 1L;
private final String challenge;
public CreateAuthChallengeResponse( String challenge )
{
this.challenge = challenge;
}
public String getChallenge( )
{
return this.challenge;
}
}

View file

@ -0,0 +1,12 @@
package com.deepclone.lw.cmd;
public enum MailError {
EMPTY ,
INVALID ,
IN_USE ,
SEND_FAIL ,
MISMATCH
}

View file

@ -0,0 +1,60 @@
package com.deepclone.lw.cmd;
import java.sql.Timestamp;
import java.util.Date;
import com.deepclone.lw.session.CommandResponse;
public class MaintenanceResponse
extends CommandResponse
{
private static final long serialVersionUID = 1L;
private final Timestamp start;
private final Timestamp end;
private final String reason;
public MaintenanceResponse( Timestamp start , Timestamp end , String reason )
{
this.start = start;
this.end = end;
this.reason = reason;
}
public Timestamp getStart( )
{
return start;
}
public Timestamp getEnd( )
{
return end;
}
public String getReason( )
{
return reason;
}
public boolean isLate( )
{
return this.end.before( new Date( ) );
}
public Timestamp getCurrent( )
{
return new Timestamp( new Date( ).getTime( ) );
}
}

View file

@ -0,0 +1,11 @@
package com.deepclone.lw.cmd;
public enum ObjectNameError {
EMPTY ,
UNAVAILABLE ,
BANNED ,
INVALID
}

View file

@ -0,0 +1,10 @@
package com.deepclone.lw.cmd;
public enum PasswordError {
EMPTY ,
TOO_WEAK ,
MISMATCH
}

View file

@ -0,0 +1,11 @@
package com.deepclone.lw.cmd.admin;
import com.deepclone.lw.session.Command;
public class AdminOverviewCommand
extends Command
{
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,29 @@
package com.deepclone.lw.cmd.admin;
import com.deepclone.lw.cmd.admin.adata.AdminOverview;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class AdminOverviewResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final AdminOverview overview;
public AdminOverviewResponse( Administrator admin , AdminOverview overview )
{
super( admin );
this.overview = overview;
}
public AdminOverview getOverview( )
{
return overview;
}
}

View file

@ -0,0 +1,44 @@
package com.deepclone.lw.cmd.admin;
import com.deepclone.lw.cmd.admin.adata.Administrator;
import com.deepclone.lw.session.CommandResponse;
public class AdminResponse
extends CommandResponse
{
private static final long serialVersionUID = 1L;
private final Administrator admin;
private final boolean privilegeOk;
public AdminResponse( Administrator admin )
{
this.admin = admin;
this.privilegeOk = true;
}
public AdminResponse( Administrator admin , boolean priv )
{
this.admin = admin;
this.privilegeOk = priv;
}
public Administrator getAdmin( )
{
return admin;
}
public boolean isPrivilegeOk( )
{
return privilegeOk;
}
}

View file

@ -0,0 +1,35 @@
package com.deepclone.lw.cmd.admin;
import com.deepclone.lw.cmd.admin.adata.Privileges;
import com.deepclone.lw.session.Command;
public class NoOperationCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final Privileges requirePrivilege;
public NoOperationCommand( )
{
this.requirePrivilege = null;
}
public NoOperationCommand( Privileges requirePrivilege )
{
this.requirePrivilege = requirePrivilege;
}
public Privileges getRequirePrivilege( )
{
return requirePrivilege;
}
}

View file

@ -0,0 +1,52 @@
package com.deepclone.lw.cmd.admin;
import com.deepclone.lw.session.Command;
public class SetPasswordCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final String sha1Auth;
private final String md5Auth;
private final String password;
private final String passwordConfirm;
public SetPasswordCommand( String sha1Auth , String md5Auth , String password , String passwordConfirm )
{
this.sha1Auth = sha1Auth;
this.md5Auth = md5Auth;
this.password = password;
this.passwordConfirm = passwordConfirm;
}
public String getSha1Auth( )
{
return sha1Auth;
}
public String getMd5Auth( )
{
return md5Auth;
}
public String getPassword( )
{
return password;
}
public String getPasswordConfirm( )
{
return passwordConfirm;
}
}

View file

@ -0,0 +1,53 @@
package com.deepclone.lw.cmd.admin;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class SetPasswordResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
public static enum PasswordChangeStatus {
OK ,
EMPTY ,
TOO_WEAK ,
MISMATCH ,
PROHIBITED
}
private final boolean authError;
private final PasswordChangeStatus passwordError;
public SetPasswordResponse( )
{
super( null );
this.authError = false;
this.passwordError = PasswordChangeStatus.OK;
}
public SetPasswordResponse( Administrator admin , boolean authError , PasswordChangeStatus changeStatus )
{
super( admin );
this.authError = authError;
this.passwordError = changeStatus;
}
public boolean isAuthError( )
{
return authError;
}
public PasswordChangeStatus getPasswordError( )
{
return passwordError;
}
}

View file

@ -0,0 +1,106 @@
package com.deepclone.lw.cmd.admin.adata;
import java.io.Serializable;
public class AdminOverview
implements Serializable
{
private static final long serialVersionUID = 1L;
private int id;
private long newMessages;
private Long pendingNames;
private Long pendingBans;
private Long pendingBugs;
private Long openBugs;
private Long updatedBugs;
public int getId( )
{
return id;
}
public void setId( int id )
{
this.id = id;
}
public long getNewMessages( )
{
return newMessages;
}
public void setNewMessages( Long newMessages )
{
this.newMessages = newMessages;
}
public Long getPendingNames( )
{
return pendingNames;
}
public void setPendingNames( Long pendingNames )
{
this.pendingNames = pendingNames;
}
public Long getPendingBans( )
{
return pendingBans;
}
public void setPendingBans( Long pendingBans )
{
this.pendingBans = pendingBans;
}
public Long getPendingBugs( )
{
return pendingBugs;
}
public void setPendingBugs( Long pendingBugs )
{
this.pendingBugs = pendingBugs;
}
public Long getOpenBugs( )
{
return openBugs;
}
public void setOpenBugs( Long openBugs )
{
this.openBugs = openBugs;
}
public Long getUpdatedBugs( )
{
return updatedBugs;
}
public void setUpdatedBugs( Long updatedBugs )
{
this.updatedBugs = updatedBugs;
}
}

View file

@ -0,0 +1,46 @@
package com.deepclone.lw.cmd.admin.adata;
import java.util.List;
public class Administrator
extends AdministratorBasics
{
private static final long serialVersionUID = 1L;
private String address;
private boolean passwordChange;
public String getAddress( )
{
return address;
}
public void setAddress( String address )
{
this.address = address;
}
public void setPasswordChange( boolean passChangeRequired )
{
this.passwordChange = passChangeRequired;
}
public boolean isPasswordChange( )
{
return passwordChange;
}
public List< PrivEntry > getAllPrivileges( )
{
return PrivEntry.fromPrivileges( this.privileges );
}
}

View file

@ -0,0 +1,139 @@
package com.deepclone.lw.cmd.admin.adata;
import java.io.Serializable;
import java.util.List;
public class AdministratorBasics
implements Serializable
{
private static final long serialVersionUID = 1L;
private int id;
private String name;
protected int privileges;
public int getId( )
{
return id;
}
public void setId( int id )
{
this.id = id;
}
public String getName( )
{
return name;
}
public void setName( String name )
{
this.name = name;
}
public void setPrivileges( int privileges )
{
this.privileges = privileges;
}
public boolean isSuperuser( )
{
return Privileges.SUPER.hasPrivilege( this.privileges );
}
public boolean isCanSpam( )
{
return Privileges.SPAM.hasPrivilege( this.privileges );
}
public boolean isTranslator( )
{
return Privileges.I18N.hasPrivilege( this.privileges );
}
public boolean isConstantsAdmin( )
{
return Privileges.CNST.hasPrivilege( this.privileges );
}
public boolean isUserAdmin( )
{
return Privileges.USER.hasPrivilege( this.privileges );
}
public boolean isBanhammerUser( )
{
return Privileges.BANH.hasPrivilege( this.privileges );
}
public boolean isTickAdmin( )
{
return Privileges.TICK.hasPrivilege( this.privileges );
}
public boolean isNameAdmin( )
{
return Privileges.NAME.hasPrivilege( this.privileges );
}
public boolean isPrefAdmin( )
{
return Privileges.PREF.hasPrivilege( this.privileges );
}
public boolean isCanViewLogs( )
{
return Privileges.LOGS.hasPrivilege( this.privileges );
}
public boolean isBugMailReceiver( )
{
return Privileges.BUGM.hasPrivilege( this.privileges );
}
public boolean isBugTrackerAdmin( )
{
return Privileges.BUGT.hasPrivilege( this.privileges );
}
public boolean isMaintenanceAdmin( )
{
return Privileges.MNTM.hasPrivilege( this.privileges );
}
public boolean hasPrivilege( Privileges priv )
{
return priv.hasPrivilege( this.privileges );
}
public List< Privileges > getPrivileges( )
{
return Privileges.getPrivileges( this.privileges );
}
}

View file

@ -0,0 +1,44 @@
package com.deepclone.lw.cmd.admin.adata;
import java.util.LinkedList;
import java.util.List;
public class PrivEntry
{
private final Privileges privilege;
private final boolean present;
private PrivEntry( Privileges priv , int uPriv )
{
this.privilege = priv;
this.present = ( priv == Privileges.SUPER && priv.hasPrivilege( uPriv ) )
|| ( !Privileges.SUPER.hasPrivilege( uPriv ) && priv.hasPrivilege( uPriv ) );
}
public Privileges getPrivilege( )
{
return privilege;
}
public boolean isPresent( )
{
return present;
}
public static List< PrivEntry > fromPrivileges( int privileges )
{
List< PrivEntry > privs = new LinkedList< PrivEntry >( );
for ( Privileges p : Privileges.values( ) ) {
privs.add( new PrivEntry( p , privileges ) );
}
return privs;
}
}

View file

@ -0,0 +1,71 @@
package com.deepclone.lw.cmd.admin.adata;
import java.util.ArrayList;
import java.util.List;
public enum Privileges {
SPAM( 0x00000001 , "Sending in-game spam" ) ,
I18N( 0x00000002 , "Managing translations" ) ,
CNST( 0x00000004 , "Modifying game constants" ) ,
USER( 0x00000008 , "Managing user accounts" ) ,
BANH( 0x00000010 , "Using the banhammer" ) ,
TICK( 0x00000020 , "Pausing/restarting server-side tasks" ) ,
NAME( 0x00000040 , "Validating empire and planet names" ) ,
PREF( 0x00000080 , "Setting default preferences" ) ,
LOGS( 0x00000100 , "Browsing server logs" ) ,
BUGM( 0x00000200 , "Receiving automated error e-mail" ) ,
BUGT( 0x00000400 , "Managing bugs reported through the bug tracker" ) ,
MNTM( 0x00000800 , "Activating/disabling maintenance mode" ) ,
SUPER( 0x80000000 , "Superuser (all privileges + admin management)" );
private final int bits;
private final String description;
private Privileges( int bits , String description )
{
this.bits = bits;
this.description = description;
}
public int getBits( )
{
return bits;
}
public String getDescription( )
{
return description;
}
public boolean hasPrivilege( int privs )
{
return ( privs & this.bits ) != 0 || ( privs & 0x80000000 ) != 0;
}
public static List< Privileges > getPrivileges( int privs )
{
List< Privileges > result = new ArrayList< Privileges >( );
for ( Privileges p : Privileges.values( ) ) {
if ( p.hasPrivilege( privs ) ) {
result.add( p );
}
}
return result;
}
public int grant( int privileges )
{
return privileges | this.bits;
}
}

View file

@ -0,0 +1,80 @@
package com.deepclone.lw.cmd.admin.bans;
import java.sql.Timestamp;
public class ArchivedBanRequest
extends BanRequest
{
private static final long serialVersionUID = 1L;
private Timestamp update;
private boolean expired;
private Integer rejectedById;
private String rejectedByName;
private String rejectionReason;
public Timestamp getUpdate( )
{
return update;
}
public void setUpdate( Timestamp update )
{
this.update = update;
}
public boolean isExpired( )
{
return expired;
}
public void setExpired( boolean expired )
{
this.expired = expired;
}
public Integer getRejectedById( )
{
return rejectedById;
}
public void setRejectedById( Integer rejectedById )
{
this.rejectedById = rejectedById;
}
public String getRejectedByName( )
{
return rejectedByName;
}
public void setRejectedByName( String rejectedByName )
{
this.rejectedByName = rejectedByName;
}
public String getRejectionReason( )
{
return rejectionReason;
}
public void setRejectionReason( String rejectionReason )
{
this.rejectionReason = rejectionReason;
}
}

View file

@ -0,0 +1,107 @@
package com.deepclone.lw.cmd.admin.bans;
import java.io.Serializable;
import java.sql.Timestamp;
public class BanRequest
implements Serializable
{
private static final long serialVersionUID = 1L;
private int id;
private int requestedById;
private String requestedByName;
private String reason;
private Timestamp timestamp;
private int accountId;
private String accountMail;
public int getId( )
{
return id;
}
public void setId( int id )
{
this.id = id;
}
public int getRequestedById( )
{
return requestedById;
}
public void setRequestedById( int requestedById )
{
this.requestedById = requestedById;
}
public String getRequestedByName( )
{
return requestedByName;
}
public void setRequestedByName( String requestedByName )
{
this.requestedByName = requestedByName;
}
public String getReason( )
{
return reason;
}
public void setReason( String reason )
{
this.reason = reason;
}
public Timestamp getTimestamp( )
{
return timestamp;
}
public void setTimestamp( Timestamp timestamp )
{
this.timestamp = timestamp;
}
public int getAccountId( )
{
return accountId;
}
public void setAccountId( int accountId )
{
this.accountId = accountId;
}
public String getAccountMail( )
{
return accountMail;
}
public void setAccountMail( String accountMail )
{
this.accountMail = accountMail;
}
}

View file

@ -0,0 +1,8 @@
package com.deepclone.lw.cmd.admin.bans;
public enum BanType {
PENDING ,
ARCHIVED ,
VALIDATED
}

View file

@ -0,0 +1,14 @@
package com.deepclone.lw.cmd.admin.bans;
import com.deepclone.lw.session.Command;
public class BansSummaryCommand
extends Command
{
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,39 @@
package com.deepclone.lw.cmd.admin.bans;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class BansSummaryResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final List< SummaryEntry > entries;
public BansSummaryResponse( Administrator admin )
{
super( admin , false );
this.entries = null;
}
public BansSummaryResponse( Administrator admin , List< SummaryEntry > entries )
{
super( admin );
this.entries = entries;
}
public List< SummaryEntry > getEntries( )
{
return entries;
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.bans;
import com.deepclone.lw.session.Command;
public class ConfirmBanCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final int id;
public ConfirmBanCommand( int id )
{
this.id = id;
}
public int getId( )
{
return id;
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.bans;
import com.deepclone.lw.session.Command;
public class LiftBanCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final int id;
public LiftBanCommand( int id )
{
this.id = id;
}
public int getId( )
{
return id;
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.bans;
import com.deepclone.lw.session.Command;
public class ListBansCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final BanType type;
public ListBansCommand( BanType type )
{
this.type = type;
}
public BanType getType( )
{
return type;
}
}

View file

@ -0,0 +1,48 @@
package com.deepclone.lw.cmd.admin.bans;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class ListBansResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final BanType type;
private final List< BanRequest > bans;
public ListBansResponse( Administrator admin )
{
super( admin , false );
this.type = null;
this.bans = null;
}
public ListBansResponse( Administrator admin , BanType type , List< BanRequest > bans )
{
super( admin );
this.type = type;
this.bans = bans;
}
public BanType getType( )
{
return type;
}
public List< BanRequest > getBans( )
{
return bans;
}
}

View file

@ -0,0 +1,36 @@
package com.deepclone.lw.cmd.admin.bans;
import com.deepclone.lw.session.Command;
public class RejectBanCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final int id;
private final String reason;
public RejectBanCommand( int id , String reason )
{
this.id = id;
this.reason = reason;
}
public int getId( )
{
return id;
}
public String getReason( )
{
return reason;
}
}

View file

@ -0,0 +1,45 @@
package com.deepclone.lw.cmd.admin.bans;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class RejectBanResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final boolean error;
private final int id;
public RejectBanResponse( Administrator admin , boolean privError )
{
super( admin , !privError );
this.error = false;
this.id = 0;
}
public RejectBanResponse( Administrator admin , int requestId )
{
super( admin );
this.error = true;
this.id = requestId;
}
public boolean isError( )
{
return error;
}
public int getId( )
{
return id;
}
}

View file

@ -0,0 +1,44 @@
package com.deepclone.lw.cmd.admin.bans;
import com.deepclone.lw.session.Command;
public class RequestBanCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final String user;
private final boolean empire;
private final String reason;
public RequestBanCommand( String user , boolean empire , String reason )
{
this.user = user;
this.empire = empire;
this.reason = reason;
}
public String getUser( )
{
return user;
}
public boolean isEmpire( )
{
return empire;
}
public String getReason( )
{
return reason;
}
}

View file

@ -0,0 +1,70 @@
package com.deepclone.lw.cmd.admin.bans;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class RequestBanResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
public static enum Error {
NOT_FOUND ,
BANNED ,
NO_REASON
}
private final Error error;
private final String user;
private final boolean empire;
private final String reason;
public RequestBanResponse( Administrator admin , boolean privError )
{
super( admin , !privError );
this.error = null;
this.user = null;
this.empire = false;
this.reason = null;
}
public RequestBanResponse( Administrator admin , Error error , String user , boolean empire , String reason )
{
super( admin );
this.error = error;
this.user = user;
this.empire = empire;
this.reason = reason;
}
public Error getError( )
{
return error;
}
public String getUser( )
{
return user;
}
public boolean isEmpire( )
{
return empire;
}
public String getReason( )
{
return reason;
}
}

View file

@ -0,0 +1,36 @@
package com.deepclone.lw.cmd.admin.bans;
import java.io.Serializable;
public class SummaryEntry
implements Serializable
{
private static final long serialVersionUID = 1L;
private final BanType type;
private final long count;
public SummaryEntry( BanType type , long count )
{
this.type = type;
this.count = count;
}
public BanType getType( )
{
return type;
}
public long getCount( )
{
return count;
}
}

View file

@ -0,0 +1,67 @@
package com.deepclone.lw.cmd.admin.bans;
import java.sql.Timestamp;
public class ValidatedBanRequest
extends BanRequest
{
private static final long serialVersionUID = 1L;
private Timestamp update;
private boolean redeemable;
private int validatedById;
private String validatedByName;
public Timestamp getUpdate( )
{
return update;
}
public void setUpdate( Timestamp update )
{
this.update = update;
}
public boolean isRedeemable( )
{
return redeemable;
}
public void setRedeemable( boolean redeemable )
{
this.redeemable = redeemable;
}
public int getValidatedById( )
{
return validatedById;
}
public void setValidatedById( int validatedById )
{
this.validatedById = validatedById;
}
public String getValidatedByName( )
{
return validatedByName;
}
public void setValidatedByName( String validatedByName )
{
this.validatedByName = validatedByName;
}
}

View file

@ -0,0 +1,12 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.session.Command;
public class BugsSummaryCommand
extends Command
{
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,73 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class BugsSummaryResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final long pending;
private final long open;
private final long own;
private final long updated;
private final long total;
public BugsSummaryResponse( Administrator admin )
{
super( admin , false );
this.pending = 0;
this.open = 0;
this.own = 0;
this.updated = 0;
this.total = 0;
}
public BugsSummaryResponse( Administrator admin , long pending , long open , long own , long updated , long total )
{
super( admin );
this.pending = pending;
this.open = open;
this.own = own;
this.updated = updated;
this.total = total;
}
public long getPending( )
{
return pending;
}
public long getOpen( )
{
return open;
}
public long getOwn( )
{
return own;
}
public long getUpdated( )
{
return updated;
}
public long getTotal( )
{
return total;
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.session.Command;
public class GetSnapshotCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final long bugId;
public GetSnapshotCommand( long bugId )
{
this.bugId = bugId;
}
public long getBugId( )
{
return bugId;
}
}

View file

@ -0,0 +1,37 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class GetSnapshotResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final String snapshot;
public GetSnapshotResponse( Administrator admin , boolean privError )
{
super( admin , !privError );
this.snapshot = null;
}
public GetSnapshotResponse( Administrator admin , String snapshot )
{
super( admin );
this.snapshot = snapshot;
}
public String getSnapshot( )
{
return snapshot;
}
}

View file

@ -0,0 +1,87 @@
package com.deepclone.lw.cmd.admin.bt;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
import com.deepclone.lw.cmd.bt.data.BugReport;
import com.deepclone.lw.cmd.bt.data.BugStatus;
public class ListBugsResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final BugStatus status;
private final boolean ownOnly;
private final long first;
private final int count;
private final long entries;
private final List< BugReport > reports;
public ListBugsResponse( Administrator admin )
{
super( admin , false );
this.status = null;
this.ownOnly = false;
this.first = 0;
this.count = 0;
this.entries = 0;
this.reports = null;
}
public ListBugsResponse( Administrator admin , BugStatus status , boolean ownOnly , long first , int count ,
long entries , List< BugReport > reports )
{
super( admin );
this.status = status;
this.ownOnly = ownOnly;
this.first = first;
this.count = count;
this.entries = entries;
this.reports = reports;
}
public BugStatus getStatus( )
{
return status;
}
public boolean isOwnOnly( )
{
return ownOnly;
}
public long getFirst( )
{
return first;
}
public int getCount( )
{
return count;
}
public long getEntries( )
{
return entries;
}
public List< BugReport > getReports( )
{
return reports;
}
}

View file

@ -0,0 +1,10 @@
package com.deepclone.lw.cmd.admin.bt;
public enum MergeError {
NOT_FOUND ,
MERGED ,
STATUS
}

View file

@ -0,0 +1,36 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.session.Command;
public class MergeReportsCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final long id1;
private final long id2;
public MergeReportsCommand( long id1 , long id2 )
{
this.id1 = id1;
this.id2 = id2;
}
public long getId1( )
{
return id1;
}
public long getId2( )
{
return id2;
}
}

View file

@ -0,0 +1,66 @@
package com.deepclone.lw.cmd.admin.bt;
import java.util.List;
import com.deepclone.lw.cmd.admin.adata.Administrator;
import com.deepclone.lw.cmd.bt.data.BugEvent;
import com.deepclone.lw.cmd.bt.data.BugReport;
public class MergeReportsResponse
extends ViewBugResponse
{
private static final long serialVersionUID = 1L;
private final MergeError mergeError;
private final long mergeId;
public MergeReportsResponse( Administrator admin )
{
super( admin , false );
this.mergeError = null;
this.mergeId = 0;
}
public MergeReportsResponse( Administrator admin , boolean privError )
{
super( admin , privError );
this.mergeError = MergeError.NOT_FOUND;
this.mergeId = 0;
}
public MergeReportsResponse( Administrator admin , BugReport report , List< BugEvent > events ,
MergeError mergeError , long mergeId )
{
super( admin , report , events );
this.mergeError = mergeError;
this.mergeId = mergeId;
}
public MergeReportsResponse( MergeReportsResponse response , Object query )
{
super( response , query );
this.mergeError = response.mergeError;
this.mergeId = response.mergeId;
}
public MergeError getMergeError( )
{
return mergeError;
}
public long getMergeId( )
{
return mergeId;
}
}

View file

@ -0,0 +1,36 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.session.Command;
public class ModerateCommentCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final long id;
private final boolean validation;
public ModerateCommentCommand( long id , boolean validate )
{
this.id = id;
this.validation = validate;
}
public long getId( )
{
return id;
}
public boolean isValidation( )
{
return validation;
}
}

View file

@ -0,0 +1,92 @@
package com.deepclone.lw.cmd.admin.bt;
import java.util.List;
import com.deepclone.lw.cmd.ObjectNameError;
import com.deepclone.lw.cmd.admin.adata.Administrator;
import com.deepclone.lw.cmd.bt.data.BugEvent;
import com.deepclone.lw.cmd.bt.data.BugReport;
public class PostCommentResponse
extends ViewBugResponse
{
private static final long serialVersionUID = 1L;
private final boolean posted;
private final ObjectNameError commentError;
private final String comment;
private final boolean publicComment;
/** "Post comment" response indicating a successful post */
public PostCommentResponse( Administrator admin )
{
super( admin , false );
this.posted = true;
this.comment = null;
this.commentError = null;
this.publicComment = false;
}
/** "Post comment" response indicating a missing report or privilege error */
public PostCommentResponse( Administrator admin , boolean privError )
{
super( admin , privError );
this.posted = false;
this.comment = null;
this.commentError = null;
this.publicComment = false;
}
/** "Post comment" response indicating a comment error */
public PostCommentResponse( Administrator admin , BugReport report , List< BugEvent > events ,
ObjectNameError error , String comment , boolean publicComment )
{
super( admin , report , events );
this.posted = false;
this.commentError = error;
this.comment = comment;
this.publicComment = publicComment;
}
public PostCommentResponse( PostCommentResponse response , Object query )
{
super( response , query );
this.posted = false;
this.commentError = response.commentError;
this.comment = response.comment;
this.publicComment = response.publicComment;
}
public boolean isPosted( )
{
return posted;
}
public ObjectNameError getCommentError( )
{
return commentError;
}
public String getComment( )
{
return comment;
}
public boolean isPublicComment( )
{
return publicComment;
}
}

View file

@ -0,0 +1,119 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.cmd.ObjectNameError;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class ReportBugResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final long bugId;
private final ObjectNameError titleError;
private final String title;
private final ObjectNameError descriptionError;
private final String description;
private final boolean publicReport;
private final Object query;
public ReportBugResponse( Administrator admin )
{
super( admin , false );
this.bugId = 0;
this.titleError = null;
this.title = null;
this.descriptionError = null;
this.description = null;
this.publicReport = false;
this.query = null;
}
public ReportBugResponse( Administrator admin , long bugId )
{
super( admin );
this.bugId = bugId;
this.titleError = null;
this.title = null;
this.descriptionError = null;
this.description = null;
this.publicReport = false;
this.query = null;
}
public ReportBugResponse( Administrator admin , ObjectNameError titleError , String title ,
ObjectNameError descriptionError , String description , boolean publicReport )
{
super( admin );
this.bugId = 0;
this.titleError = titleError;
this.title = title;
this.descriptionError = descriptionError;
this.description = description;
this.publicReport = publicReport;
this.query = null;
}
public ReportBugResponse( ReportBugResponse response , Object query )
{
super( response.getAdmin( ) , response.isPrivilegeOk( ) );
this.bugId = 0;
this.titleError = response.titleError;
this.title = response.title;
this.descriptionError = response.descriptionError;
this.description = response.description;
this.publicReport = response.publicReport;
this.query = query;
}
public long getBugId( )
{
return bugId;
}
public ObjectNameError getTitleError( )
{
return titleError;
}
public String getTitle( )
{
return title;
}
public ObjectNameError getDescriptionError( )
{
return descriptionError;
}
public String getDescription( )
{
return description;
}
public boolean isPublicReport( )
{
return publicReport;
}
public Object getQuery( )
{
return query;
}
}

View file

@ -0,0 +1,37 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.cmd.bt.data.BugStatus;
import com.deepclone.lw.session.Command;
public class ReportStatusCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final long id;
private final BugStatus status;
public ReportStatusCommand( long id , BugStatus status )
{
this.id = id;
this.status = status;
}
public long getId( )
{
return id;
}
public BugStatus getStatus( )
{
return status;
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.session.Command;
public class ReportVisibilityCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final long id;
public ReportVisibilityCommand( long id )
{
this.id = id;
}
public long getId( )
{
return id;
}
}

View file

@ -0,0 +1,62 @@
package com.deepclone.lw.cmd.admin.bt;
import com.deepclone.lw.cmd.bt.data.BugStatus;
import com.deepclone.lw.session.Command;
public class ValidateReportCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final long id;
private final BugStatus status;
private final boolean publicReport;
private final int grantCredits;
private final boolean snapshot;
public ValidateReportCommand( long id , BugStatus status , boolean publicReport , int grantCredits ,
boolean snapshot )
{
this.id = id;
this.status = status;
this.publicReport = publicReport;
this.grantCredits = grantCredits;
this.snapshot = snapshot;
}
public long getId( )
{
return id;
}
public BugStatus getStatus( )
{
return status;
}
public boolean isPublicReport( )
{
return publicReport;
}
public int getGrantCredits( )
{
return grantCredits;
}
public boolean isSnapshot( )
{
return snapshot;
}
}

View file

@ -0,0 +1,68 @@
package com.deepclone.lw.cmd.admin.bt;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
import com.deepclone.lw.cmd.bt.data.BugEvent;
import com.deepclone.lw.cmd.bt.data.BugReport;
public class ViewBugResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final BugReport report;
private final List< BugEvent > events;
private final Object query;
public ViewBugResponse( Administrator admin , boolean privError )
{
super( admin , !privError );
this.report = null;
this.events = null;
this.query = null;
}
public ViewBugResponse( Administrator admin , BugReport report , List< BugEvent > events )
{
super( admin );
this.report = report;
this.events = events;
this.query = null;
}
public ViewBugResponse( ViewBugResponse response , Object query )
{
super( response.getAdmin( ) );
this.report = response.report;
this.events = response.events;
this.query = query;
}
public BugReport getReport( )
{
return report;
}
public List< BugEvent > getEvents( )
{
return events;
}
public Object getQuery( )
{
return query;
}
}

View file

@ -0,0 +1,49 @@
package com.deepclone.lw.cmd.admin.constants;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;
public class Category
implements Serializable , Comparable< Category >
{
private static final long serialVersionUID = 1L;
private final String name;
private final List< Definition > definitions;
public Category( String name , List< Definition > defs )
{
this.name = name;
this.definitions = defs;
Collections.sort( defs );
}
@Override
public int compareTo( Category other )
{
if ( other == null ) {
return 1;
}
return this.name.compareTo( other.name );
}
public String getName( )
{
return name;
}
public List< Definition > getDefinitions( )
{
return definitions;
}
}

View file

@ -0,0 +1,90 @@
package com.deepclone.lw.cmd.admin.constants;
import java.io.Serializable;
public class Definition
implements Serializable , Comparable< Definition >
{
private static final long serialVersionUID = 1L;
private String name;
private String description;
private double value;
private Double minValue;
private Double maxValue;
public String getName( )
{
return name;
}
public void setName( String name )
{
this.name = name;
}
public String getDescription( )
{
return description;
}
public void setDescription( String description )
{
this.description = description;
}
public double getValue( )
{
return value;
}
public void setValue( double value )
{
this.value = value;
}
public Double getMinValue( )
{
return minValue;
}
public void setMinValue( Double minValue )
{
this.minValue = minValue;
}
public Double getMaxValue( )
{
return maxValue;
}
public void setMaxValue( Double maxValue )
{
this.maxValue = maxValue;
}
@Override
public int compareTo( Definition other )
{
if ( other == null ) {
return 1;
}
return this.name.compareTo( other.name );
}
}

View file

@ -0,0 +1,11 @@
package com.deepclone.lw.cmd.admin.constants;
import com.deepclone.lw.session.Command;
public class GetConstantsCommand
extends Command
{
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,44 @@
package com.deepclone.lw.cmd.admin.constants;
import java.util.Collections;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class GetConstantsResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private List< Category > categories;
public GetConstantsResponse( Administrator admin )
{
super( admin , false );
}
public GetConstantsResponse( Administrator admin , List< Category > constants )
{
super( admin , true );
this.categories = constants;
Collections.sort( this.categories );
}
protected GetConstantsResponse( Administrator admin , boolean error )
{
super( admin , !error );
}
public List< Category > getCategories( )
{
return this.categories;
}
}

View file

@ -0,0 +1,36 @@
package com.deepclone.lw.cmd.admin.constants;
import com.deepclone.lw.session.Command;
public class SetConstantCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final String name;
private final double value;
public SetConstantCommand( String name , double value )
{
this.name = name;
this.value = value;
}
public String getName( )
{
return name;
}
public double getValue( )
{
return value;
}
}

View file

@ -0,0 +1,56 @@
package com.deepclone.lw.cmd.admin.constants;
import java.util.List;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class SetConstantResponse
extends GetConstantsResponse
{
private static final long serialVersionUID = 1L;
private final boolean error;
private final String name;
private final double value;
public SetConstantResponse( Administrator admin , boolean privError )
{
super( admin , privError );
this.error = false;
this.name = null;
this.value = 0;
}
public SetConstantResponse( Administrator admin , List< Category > cats , String name , double value )
{
super( admin , cats );
this.error = true;
this.name = name;
this.value = value;
}
public boolean isError( )
{
return error;
}
public String getName( )
{
return name;
}
public double getValue( )
{
return value;
}
}

View file

@ -0,0 +1,36 @@
package com.deepclone.lw.cmd.admin.i18n;
import com.deepclone.lw.session.Command;
public class ChangeLanguageCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final String id;
private final String name;
public ChangeLanguageCommand( String id , String name )
{
this.id = id;
this.name = name;
}
public String getId( )
{
return id;
}
public String getName( )
{
return name;
}
}

View file

@ -0,0 +1,45 @@
package com.deepclone.lw.cmd.admin.i18n;
import java.util.List;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class ChangeLanguageResponse
extends GetLanguageResponse
{
private static final long serialVersionUID = 1L;
private final boolean nameError;
public ChangeLanguageResponse( Administrator admin , Language language , List< I18NString > strings )
{
super( admin , language , strings );
this.nameError = true;
}
public ChangeLanguageResponse( Administrator admin , Language language )
{
super( admin , language , null );
this.nameError = false;
}
public ChangeLanguageResponse( Administrator admin )
{
super( admin );
this.nameError = false;
}
public boolean isNameError( )
{
return nameError;
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.i18n;
import com.deepclone.lw.session.Command;
public class GetLanguageCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final String language;
public GetLanguageCommand( String language )
{
this.language = language;
}
public String getLanguage( )
{
return language;
}
}

View file

@ -0,0 +1,52 @@
package com.deepclone.lw.cmd.admin.i18n;
import java.util.Collections;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class GetLanguageResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final Language language;
private final List< I18NString > strings;
public GetLanguageResponse( Administrator admin )
{
super( admin , false );
this.language = null;
this.strings = null;
}
public GetLanguageResponse( Administrator admin , Language language , List< I18NString > strings )
{
super( admin , true );
this.language = language;
this.strings = strings;
if ( strings != null ) {
Collections.sort( this.strings );
}
}
public Language getLanguage( )
{
return language;
}
public List< I18NString > getStrings( )
{
return strings;
}
}

View file

@ -0,0 +1,46 @@
package com.deepclone.lw.cmd.admin.i18n;
import java.io.Serializable;
public class I18NString
implements Serializable , Comparable< I18NString >
{
private static final long serialVersionUID = 1L;
private final String id;
private final String text;
public I18NString( String id , String text )
{
this.id = id;
this.text = text;
}
public String getId( )
{
return id;
}
public String getText( )
{
return text;
}
@Override
public int compareTo( I18NString other )
{
if ( other == null ) {
return 1;
}
return this.id.compareTo( other.id );
}
}

View file

@ -0,0 +1,64 @@
package com.deepclone.lw.cmd.admin.i18n;
import java.io.Serializable;
public class Language
implements Serializable , Comparable< Language >
{
private static final long serialVersionUID = 1L;
private String id;
private String name;
private int completion;
public String getId( )
{
return id;
}
public void setId( String id )
{
this.id = id;
}
public String getName( )
{
return name;
}
public void setName( String name )
{
this.name = name;
}
public int getCompletion( )
{
return completion;
}
public void setCompletion( int completion )
{
this.completion = completion;
}
@Override
public int compareTo( Language other )
{
if ( other == null ) {
return 1;
}
return this.id.compareTo( other.id );
}
}

View file

@ -0,0 +1,44 @@
package com.deepclone.lw.cmd.admin.i18n;
import com.deepclone.lw.session.Command;
public class SetStringCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final String language;
private final String id;
private final String text;
public SetStringCommand( String language , String id , String text )
{
this.language = language;
this.id = id;
this.text = text;
}
public String getLanguage( )
{
return language;
}
public String getId( )
{
return id;
}
public String getText( )
{
return text;
}
}

View file

@ -0,0 +1,45 @@
package com.deepclone.lw.cmd.admin.i18n;
import java.util.List;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class SetStringResponse
extends GetLanguageResponse
{
private static final long serialVersionUID = 1L;
private final String edited;
public SetStringResponse( Administrator admin )
{
super( admin );
this.edited = null;
}
public SetStringResponse( Administrator admin , Language language , List< I18NString > strings , String edited )
{
super( admin , language , strings );
this.edited = edited;
}
public SetStringResponse( Administrator admin , Language language )
{
super( admin , language , null );
this.edited = null;
}
public String getEdited( )
{
return edited;
}
}

View file

@ -0,0 +1,12 @@
package com.deepclone.lw.cmd.admin.i18n;
import com.deepclone.lw.session.Command;
public class ViewLanguagesCommand
extends Command
{
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,41 @@
package com.deepclone.lw.cmd.admin.i18n;
import java.util.Collections;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class ViewLanguagesResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final List< Language > languages;
public ViewLanguagesResponse( Administrator admin )
{
super( admin , false );
this.languages = null;
}
public ViewLanguagesResponse( Administrator admin , List< Language > languages )
{
super( admin , true );
this.languages = languages;
Collections.sort( this.languages );
}
public List< Language > getLanguages( )
{
return languages;
}
}

View file

@ -0,0 +1,50 @@
package com.deepclone.lw.cmd.admin.logs;
import java.io.Serializable;
import java.util.List;
public class ExceptionEntry
implements Serializable
{
private static final long serialVersionUID = 1L;
private final String className;
private final String message;
private List< TraceEntry > trace;
public ExceptionEntry( String className , String message )
{
this.className = className;
this.message = message;
}
public String getClassName( )
{
return className;
}
public String getMessage( )
{
return message;
}
public List< TraceEntry > getTrace( )
{
return trace;
}
public void setTrace( List< TraceEntry > trace )
{
this.trace = trace;
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.logs;
import com.deepclone.lw.session.Command;
public class GetEntryCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final long id;
public GetEntryCommand( long id )
{
this.id = id;
}
public long getId( )
{
return id;
}
}

View file

@ -0,0 +1,47 @@
package com.deepclone.lw.cmd.admin.logs;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class GetEntryResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final LogEntry entry;
private final List< ExceptionEntry > exceptions;
public GetEntryResponse( Administrator admin , boolean privError )
{
super( admin , !privError );
this.entry = null;
this.exceptions = null;
}
public GetEntryResponse( Administrator admin , LogEntry entry , List< ExceptionEntry > exceptions )
{
super( admin );
this.entry = entry;
this.exceptions = exceptions;
}
public LogEntry getEntry( )
{
return entry;
}
public List< ExceptionEntry > getExceptions( )
{
return exceptions;
}
}

View file

@ -0,0 +1,94 @@
package com.deepclone.lw.cmd.admin.logs;
import java.io.Serializable;
import java.sql.Timestamp;
public class LogEntry
implements Serializable
{
private static final long serialVersionUID = 1L;
private Long id;
private Timestamp timestamp;
private LogLevel level;
private String about;
private String entry;
private Long exception;
public Long getId( )
{
return id;
}
public void setId( Long id )
{
this.id = id;
}
public Timestamp getTimestamp( )
{
return timestamp;
}
public void setTimestamp( Timestamp timestamp )
{
this.timestamp = timestamp;
}
public LogLevel getLevel( )
{
return level;
}
public void setLevel( LogLevel level )
{
this.level = level;
}
public String getAbout( )
{
return about;
}
public void setAbout( String about )
{
this.about = about;
}
public String getEntry( )
{
return entry;
}
public void setEntry( String entry )
{
this.entry = entry;
}
public Long getException( )
{
return exception;
}
public void setException( Long exception )
{
this.exception = exception;
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.logs;
/**
* This enumeration defines the various levels which can be affected to system log entries.
*
* @author tseeker
*/
public enum LogLevel {
/** Trace mode entry */
TRACE ,
/** Entry that may be used for debugging purposes, but has no other actual use */
DEBUG ,
/** Entry that indicates that something important but mostly benign happened */
INFO ,
/**
* Entry that indicates that something went wrong, although it is unlikely to affect the whole
* system
*/
WARNING ,
/** Entry that indicates that something went really wrong and might affect the whole system */
ERROR
}

View file

@ -0,0 +1,24 @@
package com.deepclone.lw.cmd.admin.logs;
public enum LogType {
SYSTEM( "System log" ) ,
ADMIN( "Administration log" ) ,
PLAYER( "Player log" );
private final String description;
private LogType( String description )
{
this.description = description;
}
public String getDescription( )
{
return description;
}
}

View file

@ -0,0 +1,44 @@
package com.deepclone.lw.cmd.admin.logs;
import java.io.Serializable;
public class TraceEntry
implements Serializable
{
private static final long serialVersionUID = 1L;
private final String location;
private final String fileName;
private final Integer line;
public TraceEntry( String location , String fileName , Integer line )
{
this.location = location;
this.fileName = fileName;
this.line = line;
}
public String getLocation( )
{
return location;
}
public String getFileName( )
{
return fileName;
}
public Integer getLine( )
{
return line;
}
}

View file

@ -0,0 +1,69 @@
package com.deepclone.lw.cmd.admin.logs;
import com.deepclone.lw.session.Command;
public class ViewLogCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final LogType type;
private final long firstEntry;
private final int count;
private final LogLevel minLogLevel;
private final String component;
private final boolean exceptionOnly;
public ViewLogCommand( LogType type , long firstEntry , int count , LogLevel minLogLevel , String component ,
boolean exceptionOnly )
{
this.type = type;
this.firstEntry = firstEntry;
this.count = count;
this.minLogLevel = minLogLevel;
this.component = component;
this.exceptionOnly = exceptionOnly;
}
public LogType getType( )
{
return type;
}
public long getFirstEntry( )
{
return firstEntry;
}
public int getCount( )
{
return count;
}
public LogLevel getMinLogLevel( )
{
return minLogLevel;
}
public String getComponent( )
{
return component;
}
public boolean isExceptionOnly( )
{
return exceptionOnly;
}
}

View file

@ -0,0 +1,48 @@
package com.deepclone.lw.cmd.admin.logs;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class ViewLogResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final long count;
private final List< LogEntry > entries;
public ViewLogResponse( Administrator admin )
{
super( admin , false );
this.count = 0;
this.entries = null;
}
public ViewLogResponse( Administrator admin , long count , List< LogEntry > entries )
{
super( admin );
this.count = count;
this.entries = entries;
}
public long getCount( )
{
return count;
}
public List< LogEntry > getEntries( )
{
return entries;
}
}

View file

@ -0,0 +1,36 @@
package com.deepclone.lw.cmd.admin.mntm;
import com.deepclone.lw.session.Command;
public class EnableMaintenanceCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final String reason;
private final int duration;
public EnableMaintenanceCommand( String reason , int duration )
{
this.reason = reason;
this.duration = duration;
}
public String getReason( )
{
return reason;
}
public int getDuration( )
{
return duration;
}
}

View file

@ -0,0 +1,14 @@
package com.deepclone.lw.cmd.admin.mntm;
import com.deepclone.lw.session.Command;
public class EndMaintenanceCommand
extends Command
{
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.mntm;
import com.deepclone.lw.session.Command;
public class ExtendMaintenanceCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final int duration;
public ExtendMaintenanceCommand( int duration )
{
this.duration = duration;
}
public int getDuration( )
{
return duration;
}
}

View file

@ -0,0 +1,58 @@
package com.deepclone.lw.cmd.admin.mntm;
import java.util.Date;
import com.deepclone.lw.cmd.ObjectNameError;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class MaintenanceChangeResponse
extends MaintenanceStatusResponse
{
private static final long serialVersionUID = 1L;
private final String newReason;
private final ObjectNameError reasonError;
private final long newDuration;
public MaintenanceChangeResponse( Administrator admin , boolean privError )
{
super( admin , privError );
this.newReason = null;
this.reasonError = null;
this.newDuration = 0;
}
public MaintenanceChangeResponse( Administrator admin , String reason , Date started , Date until ,
String newReason , ObjectNameError reasonError , long newDuration )
{
super( admin , reason , started , until );
this.newReason = newReason;
this.reasonError = reasonError;
this.newDuration = newDuration;
}
public String getNewReason( )
{
return newReason;
}
public ObjectNameError getReasonError( )
{
return reasonError;
}
public long getNewDuration( )
{
return newDuration;
}
}

View file

@ -0,0 +1,14 @@
package com.deepclone.lw.cmd.admin.mntm;
import com.deepclone.lw.session.Command;
public class MaintenanceStatusCommand
extends Command
{
private static final long serialVersionUID = 1L;
}

View file

@ -0,0 +1,57 @@
package com.deepclone.lw.cmd.admin.mntm;
import java.util.Date;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class MaintenanceStatusResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final String reason;
private final Date started;
private final Date until;
public MaintenanceStatusResponse( Administrator admin , boolean privError )
{
super( admin , !privError );
this.reason = null;
this.started = null;
this.until = null;
}
public MaintenanceStatusResponse( Administrator admin , String reason , Date start , Date end )
{
super( admin );
this.reason = reason;
this.started = start;
this.until = end;
}
public String getReason( )
{
return reason;
}
public Date getStarted( )
{
return started;
}
public Date getUntil( )
{
return until;
}
}

View file

@ -0,0 +1,97 @@
package com.deepclone.lw.cmd.admin.msg;
import com.deepclone.lw.cmd.msgdata.MessageType;
import com.deepclone.lw.session.Command;
public class ComposeMessageCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final Boolean inbox;
private final Long replyTo;
private MessageType type;
private String target;
private String subject;
private String contents;
public ComposeMessageCommand( )
{
this.inbox = null;
this.replyTo = null;
}
public ComposeMessageCommand( boolean inbox , long replyTo )
{
this.inbox = inbox;
this.replyTo = replyTo;
}
public MessageType getType( )
{
return type;
}
public void setType( MessageType type )
{
this.type = type;
}
public String getTarget( )
{
return target;
}
public void setTarget( String target )
{
this.target = target;
}
public String getSubject( )
{
return subject;
}
public void setSubject( String subject )
{
this.subject = subject;
}
public String getContents( )
{
return contents;
}
public void setContents( String contents )
{
this.contents = contents;
}
public Boolean getInbox( )
{
return inbox;
}
public Long getReplyTo( )
{
return replyTo;
}
}

View file

@ -0,0 +1,160 @@
package com.deepclone.lw.cmd.admin.msg;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
import com.deepclone.lw.cmd.msgdata.Message;
import com.deepclone.lw.cmd.msgdata.MessageType;
public class ComposeMessageResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private MessageType messageType;
private String target;
private String title;
private String contents;
private final Boolean inbox;
private final Message replyTo;
private boolean targetError = false;
private boolean timingError = false;
private boolean titleError = false;
private boolean contentsError = false;
public ComposeMessageResponse( Administrator admin )
{
super( admin );
this.inbox = null;
this.replyTo = null;
}
public ComposeMessageResponse( Administrator admin , boolean inbox , Message replyTo )
{
super( admin );
this.inbox = inbox;
this.replyTo = replyTo;
}
public Boolean getInbox( )
{
return inbox;
}
public Message getReplyTo( )
{
return replyTo;
}
public MessageType getMessageType( )
{
return messageType;
}
public void setMessageType( MessageType messageType )
{
this.messageType = messageType;
}
public String getTarget( )
{
return target;
}
public void setTarget( String target )
{
this.target = target;
}
public String getTitle( )
{
return title;
}
public void setTitle( String title )
{
this.title = title;
}
public String getContents( )
{
return contents;
}
public void setContents( String contents )
{
this.contents = contents;
}
public boolean isTargetError( )
{
return targetError;
}
public void setTargetError( boolean targetError )
{
this.targetError = targetError;
}
public boolean isTimingError( )
{
return timingError;
}
public void setTimingError( boolean timingError )
{
this.timingError = timingError;
}
public boolean isTitleError( )
{
return titleError;
}
public void setTitleError( boolean titleError )
{
this.titleError = titleError;
}
public boolean isContentsError( )
{
return contentsError;
}
public void setContentsError( boolean contentsError )
{
this.contentsError = contentsError;
}
public boolean isError( )
{
return ( this.titleError || this.contentsError || this.targetError || this.timingError );
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.msg;
import com.deepclone.lw.session.Command;
public class GetMessagesCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final boolean inbox;
public GetMessagesCommand( boolean inbox )
{
this.inbox = inbox;
}
public boolean isInbox( )
{
return inbox;
}
}

View file

@ -0,0 +1,33 @@
package com.deepclone.lw.cmd.admin.msg;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
import com.deepclone.lw.cmd.msgdata.MessageListEntry;
public class GetMessagesResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final List< MessageListEntry > messages;
public GetMessagesResponse( Administrator admin , List< MessageListEntry > messages )
{
super( admin );
this.messages = messages;
}
public List< MessageListEntry > getMessages( )
{
return messages;
}
}

View file

@ -0,0 +1,10 @@
package com.deepclone.lw.cmd.admin.msg;
public enum MessageBoxAction {
DELETE ,
MARK_READ ,
MARK_UNREAD
}

View file

@ -0,0 +1,52 @@
package com.deepclone.lw.cmd.admin.msg;
import com.deepclone.lw.session.Command;
public class MessageBoxCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final MessageBoxAction action;
private final boolean inbox;
private final long[] selection;
public MessageBoxCommand( boolean inbox , long[] selection )
{
this.action = MessageBoxAction.DELETE;
this.inbox = inbox;
this.selection = selection;
}
public MessageBoxCommand( long[] selection , boolean read )
{
this.action = read ? MessageBoxAction.MARK_READ : MessageBoxAction.MARK_UNREAD;
this.inbox = true;
this.selection = selection;
}
public MessageBoxAction getAction( )
{
return action;
}
public boolean isInbox( )
{
return inbox;
}
public long[] getSelection( )
{
return selection;
}
}

View file

@ -0,0 +1,68 @@
package com.deepclone.lw.cmd.admin.msg;
import com.deepclone.lw.cmd.msgdata.MessageType;
import com.deepclone.lw.session.Command;
public class PrepareMessageCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final MessageType type;
private final Long id;
private final Boolean inbox;
private PrepareMessageCommand( MessageType type , Long id )
{
this.type = type;
this.id = id;
this.inbox = null;
}
public PrepareMessageCommand( long id , boolean inbox )
{
this.type = MessageType.INTERNAL;
this.id = id;
this.inbox = inbox;
}
public MessageType getType( )
{
return type;
}
public Long getId( )
{
return id;
}
public Boolean getInbox( )
{
return inbox;
}
public static PrepareMessageCommand newMessage( )
{
return new PrepareMessageCommand( null , null );
}
public static PrepareMessageCommand newMessageTo( MessageType type , int id )
{
if ( type == MessageType.INTERNAL ) {
throw new IllegalArgumentException( );
}
return new PrepareMessageCommand( type , (long) id );
}
}

View file

@ -0,0 +1,36 @@
package com.deepclone.lw.cmd.admin.msg;
import com.deepclone.lw.session.Command;
public class ReadMessageCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final boolean inbox;
private final long id;
public ReadMessageCommand( boolean inbox , long id )
{
this.inbox = inbox;
this.id = id;
}
public boolean isInbox( )
{
return inbox;
}
public long getId( )
{
return id;
}
}

View file

@ -0,0 +1,47 @@
package com.deepclone.lw.cmd.admin.msg;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
import com.deepclone.lw.cmd.msgdata.Message;
public class ReadMessageResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final boolean inbox;
private final Message message;
public ReadMessageResponse( Administrator admin , boolean inbox )
{
super( admin );
this.inbox = inbox;
this.message = null;
}
public ReadMessageResponse( Administrator admin , boolean inbox , Message message )
{
super( admin );
this.inbox = inbox;
this.message = message;
}
public boolean isInbox( )
{
return inbox;
}
public Message getMessage( )
{
return message;
}
}

View file

@ -0,0 +1,36 @@
package com.deepclone.lw.cmd.admin.msg;
import com.deepclone.lw.session.Command;
public class SendSpamCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final String title;
private final String body;
public SendSpamCommand( String title , String body )
{
this.title = title;
this.body = body;
}
public String getTitle( )
{
return title;
}
public String getBody( )
{
return body;
}
}

View file

@ -0,0 +1,28 @@
package com.deepclone.lw.cmd.admin.naming;
import com.deepclone.lw.session.Command;
public class GetNamesCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final NameType type;
public GetNamesCommand( NameType type )
{
this.type = type;
}
public NameType getType( )
{
return type;
}
}

View file

@ -0,0 +1,48 @@
package com.deepclone.lw.cmd.admin.naming;
import java.util.List;
import com.deepclone.lw.cmd.admin.AdminResponse;
import com.deepclone.lw.cmd.admin.adata.Administrator;
public class GetNamesResponse
extends AdminResponse
{
private static final long serialVersionUID = 1L;
private final NameType type;
private final List< Name > names;
public GetNamesResponse( Administrator admin )
{
super( admin , false );
this.type = null;
this.names = null;
}
public GetNamesResponse( Administrator admin , NameType type , List< Name > names )
{
super( admin );
this.type = type;
this.names = names;
}
public NameType getType( )
{
return type;
}
public List< Name > getNames( )
{
return names;
}
}

View file

@ -0,0 +1,52 @@
package com.deepclone.lw.cmd.admin.naming;
import java.io.Serializable;
public class Name
implements Serializable
{
private static final long serialVersionUID = 1L;
private final int id;
private final String name;
private final String extra;
private final NameType type;
public Name( int id , String name , String extra , NameType type )
{
this.id = id;
this.name = name;
this.extra = extra;
this.type = type;
}
public int getId( )
{
return id;
}
public String getName( )
{
return name;
}
public String getExtra( )
{
return extra;
}
public NameType getType( )
{
return type;
}
}

View file

@ -0,0 +1,10 @@
package com.deepclone.lw.cmd.admin.naming;
public enum NameAction {
VALIDATE ,
REJECT ,
REJECT_BAN ,
RESET
}

View file

@ -0,0 +1,30 @@
package com.deepclone.lw.cmd.admin.naming;
public enum NameType {
MAP_PENDING( "Map names - validation pending" ) ,
MAP_VALIDATED( "Map names - validated" ) ,
MAP_CHANGED( "Map names - modified" ) ,
EMPIRE( "Empire names" ) ,
ALLIANCE( "Alliance names" );
private String description;
private NameType( String description )
{
this.description = description;
}
public String getDescription( )
{
return this.description;
}
public String getId( )
{
return this.toString( ).replace( "_" , "-" ).toLowerCase( );
}
}

View file

@ -0,0 +1,44 @@
package com.deepclone.lw.cmd.admin.naming;
import com.deepclone.lw.session.Command;
public class NamesActionCommand
extends Command
{
private static final long serialVersionUID = 1L;
private final NameType type;
private final NameAction action;
private final int[] identifiers;
public NamesActionCommand( NameType type , NameAction action , int[] identifiers )
{
this.type = type;
this.identifiers = identifiers;
this.action = action;
}
public NameType getType( )
{
return type;
}
public NameAction getAction( )
{
return action;
}
public int[] getIdentifiers( )
{
return identifiers;
}
}

View file

@ -0,0 +1,14 @@
package com.deepclone.lw.cmd.admin.naming;
import com.deepclone.lw.session.Command;
public class NamesSummaryCommand
extends Command
{
private static final long serialVersionUID = 1L;
}

Some files were not shown because too many files have changed in this diff Show more