-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use long as id, and more supplements
- Loading branch information
1 parent
1c651c0
commit 3d9e04c
Showing
23 changed files
with
404 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
src/main/java/com/sitepark/ies/contentrepository/core/domain/exception/EntityNotFound.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
package com.sitepark.ies.contentrepository.core.domain.exception; | ||
|
||
import com.sitepark.ies.contentrepository.core.domain.entity.Identifier; | ||
|
||
public class EntityNotFound extends ContentRepositoryException { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private final Identifier identifier; | ||
private final long id; | ||
|
||
public EntityNotFound(Identifier identifier) { | ||
public EntityNotFound(long id) { | ||
super(); | ||
this.identifier = identifier; | ||
this.id = id; | ||
} | ||
|
||
public Identifier getIdentifier() { | ||
return this.identifier; | ||
public long getId() { | ||
return this.id; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return "Entity with identifier " + this.identifier + " not found"; | ||
return "Entity with id " + this.id + " not found"; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/sitepark/ies/contentrepository/core/domain/exception/GroupNotEmpty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.sitepark.ies.contentrepository.core.domain.exception; | ||
|
||
public class GroupNotEmpty extends ContentRepositoryException { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private final long id; | ||
|
||
public GroupNotEmpty(long id) { | ||
super(); | ||
this.id = id; | ||
} | ||
|
||
public long getId() { | ||
return this.id; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return "Group with id " + this.id + " not empty"; | ||
} | ||
|
||
} |
18 changes: 8 additions & 10 deletions
18
src/main/java/com/sitepark/ies/contentrepository/core/port/AccessControl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
package com.sitepark.ies.contentrepository.core.port; | ||
|
||
import com.sitepark.ies.contentrepository.core.domain.entity.Identifier; | ||
|
||
public interface AccessControl { | ||
|
||
boolean isEntityCreateable(Identifier parent); | ||
boolean isEntityReadable(Identifier identifier); | ||
boolean isEntityWritable(Identifier identifier); | ||
boolean isEntityRemovable(Identifier identifier); | ||
boolean isEntityCreateable(long parent); | ||
boolean isEntityReadable(long id); | ||
boolean isEntityWritable(long id); | ||
boolean isEntityRemovable(long id); | ||
|
||
boolean isGroupCreateable(Identifier parent); | ||
boolean isGroupReadable(Identifier identifier); | ||
boolean isGroupWritable(Identifier identifier); | ||
boolean isGroupRemoveable(Identifier identifier); | ||
boolean isGroupCreateable(long parent); | ||
boolean isGroupReadable(long id); | ||
boolean isGroupWritable(long id); | ||
boolean isGroupRemoveable(long id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/sitepark/ies/contentrepository/core/port/IdGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.sitepark.ies.contentrepository.core.port; | ||
|
||
public interface IdGenerator { | ||
Long generate(); | ||
long generate(); | ||
} |
6 changes: 2 additions & 4 deletions
6
src/main/java/com/sitepark/ies/contentrepository/core/port/Publisher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package com.sitepark.ies.contentrepository.core.port; | ||
|
||
import com.sitepark.ies.contentrepository.core.domain.entity.Identifier; | ||
|
||
public interface Publisher { | ||
void republish(Identifier identifier, long version); | ||
void depublish(Identifier identifier); | ||
void republish(long id, long version); | ||
void depublish(long id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/main/java/com/sitepark/ies/contentrepository/core/port/SearchIndex.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
package com.sitepark.ies.contentrepository.core.port; | ||
|
||
import com.sitepark.ies.contentrepository.core.domain.entity.Entity; | ||
import com.sitepark.ies.contentrepository.core.domain.entity.Identifier; | ||
|
||
public interface SearchIndex { | ||
void index(Entity entity); | ||
void remove(Identifier identifier); | ||
void remove(long id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.