Skip to content

Commit

Permalink
geosolutions-it#195: thrown exceptions when an operation is not suppo…
Browse files Browse the repository at this point in the history
…rted (persist)
  • Loading branch information
mbarto committed Nov 11, 2019
1 parent a7f0f78 commit fec7c51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public void setAttributesMapper(Map<String, String> attributesMapper) {
*/
@Override
public void persist(User... entities) {
throw new UnsupportedOperationException();
// NOT SUPPORTED
}

Expand Down Expand Up @@ -174,8 +175,7 @@ protected User doMapFromContext(DirContextOperations ctx) {
*/
@Override
public User merge(User entity) {
// DO NOTHING: PERSITENCE IS NOT SUPPORTED
return entity;
throw new UnsupportedOperationException();
}

/*
Expand All @@ -185,8 +185,7 @@ public User merge(User entity) {
*/
@Override
public boolean remove(User entity) {
// DO NOTHING: PERSITENCE IS NOT SUPPORTED
return true;
throw new UnsupportedOperationException();
}

/*
Expand All @@ -196,8 +195,7 @@ public boolean remove(User entity) {
*/
@Override
public boolean removeById(Long id) {
// DO NOTHING: PERSITENCE IS NOT SUPPORTED
return true;
throw new UnsupportedOperationException();
}

/*
Expand All @@ -219,8 +217,7 @@ public User find(Long id) {
*/
@Override
public User[] save(User... entities) {
// DO NOTHING: PERSITENCE IS NOT SUPPORTED
return entities;
throw new UnsupportedOperationException();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void setAddEveryOneGroup(boolean addEveryOneGroup) {
*/
@Override
public void persist(UserGroup... entities) {
// NOT SUPPORTED
throw new UnsupportedOperationException();
}

/*
Expand Down Expand Up @@ -216,8 +216,7 @@ protected boolean matchFilters(UserGroup group, ISearch search) {
*/
@Override
public UserGroup merge(UserGroup entity) {
// DO NOTHING: PERSITENCE IS NOT SUPPORTED
return entity;
throw new UnsupportedOperationException();
}

/*
Expand All @@ -227,8 +226,7 @@ public UserGroup merge(UserGroup entity) {
*/
@Override
public boolean remove(UserGroup entity) {
// DO NOTHING: PERSITENCE IS NOT SUPPORTED
return true;
throw new UnsupportedOperationException();
}

/*
Expand All @@ -238,14 +236,12 @@ public boolean remove(UserGroup entity) {
*/
@Override
public boolean removeById(Long id) {
// DO NOTHING: PERSITENCE IS NOT SUPPORTED
return true;
throw new UnsupportedOperationException();
}

@Override
public UserGroup[] save(UserGroup... entities) {
// DO NOTHING: PERSITENCE IS NOT SUPPORTED
return entities;
throw new UnsupportedOperationException();
}

@Override
Expand Down

0 comments on commit fec7c51

Please sign in to comment.