Switching back return types for v1 service

This commit is contained in:
Martin Stockhammer 2020-12-29 11:13:24 +01:00
parent c7344aa1c4
commit d6a63099a1
2 changed files with 9 additions and 10 deletions

View File

@ -22,7 +22,6 @@
import org.apache.archiva.admin.model.beans.LdapConfiguration; import org.apache.archiva.admin.model.beans.LdapConfiguration;
import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration; import org.apache.archiva.admin.model.beans.RedbackRuntimeConfiguration;
import org.apache.archiva.redback.authorization.RedbackAuthorization; import org.apache.archiva.redback.authorization.RedbackAuthorization;
import org.apache.archiva.rest.api.model.ActionStatus;
import org.apache.archiva.rest.api.model.RBACManagerImplementationInformation; import org.apache.archiva.rest.api.model.RBACManagerImplementationInformation;
import org.apache.archiva.rest.api.model.RedbackImplementationsInformations; import org.apache.archiva.rest.api.model.RedbackImplementationsInformations;
import org.apache.archiva.rest.api.model.UserManagerImplementationInformation; import org.apache.archiva.rest.api.model.UserManagerImplementationInformation;
@ -57,7 +56,7 @@ RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION) @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
ActionStatus updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration ) Boolean updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
throws ArchivaRestServiceException; throws ArchivaRestServiceException;
@Path("userManagerImplementationInformations") @Path("userManagerImplementationInformations")
@ -86,7 +85,7 @@ RedbackImplementationsInformations getRedbackImplementationsInformations()
@GET @GET
@Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
@RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
ActionStatus checkLdapConnection() Boolean checkLdapConnection()
throws ArchivaRestServiceException; throws ArchivaRestServiceException;
@Path("checkLdapConnection") @Path("checkLdapConnection")
@ -94,6 +93,6 @@ ActionStatus checkLdapConnection()
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION) @RedbackAuthorization(permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION)
ActionStatus checkLdapConnection( LdapConfiguration ldapConfiguration ) Boolean checkLdapConnection( LdapConfiguration ldapConfiguration )
throws ArchivaRestServiceException; throws ArchivaRestServiceException;
} }

View File

@ -113,7 +113,7 @@ public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
} }
@Override @Override
public ActionStatus updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration ) public Boolean updateRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
throws ArchivaRestServiceException throws ArchivaRestServiceException
{ {
try try
@ -222,7 +222,7 @@ public ActionStatus updateRedbackRuntimeConfiguration( RedbackRuntimeConfigurati
} }
return ActionStatus.SUCCESS; return Boolean.TRUE;
} }
catch (ArchivaRestServiceException e) { catch (ArchivaRestServiceException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
@ -302,7 +302,7 @@ public RedbackImplementationsInformations getRedbackImplementationsInformations(
} }
@Override @Override
public ActionStatus checkLdapConnection() public Boolean checkLdapConnection()
throws ArchivaRestServiceException throws ArchivaRestServiceException
{ {
LdapConnection ldapConnection = null; LdapConnection ldapConnection = null;
@ -324,11 +324,11 @@ public ActionStatus checkLdapConnection()
} }
} }
return ActionStatus.SUCCESS; return Boolean.TRUE;
} }
@Override @Override
public ActionStatus checkLdapConnection( LdapConfiguration ldapConfiguration ) public Boolean checkLdapConnection( LdapConfiguration ldapConfiguration )
throws ArchivaRestServiceException throws ArchivaRestServiceException
{ {
LdapConnection ldapConnection = null; LdapConnection ldapConnection = null;
@ -379,7 +379,7 @@ public ActionStatus checkLdapConnection( LdapConfiguration ldapConfiguration )
} }
} }
return ActionStatus.SUCCESS; return Boolean.TRUE;
} }
private Properties toProperties( Map<String, String> map ) private Properties toProperties( Map<String, String> map )