Changes according maven check style plugin

feature/appm-store/pbac
megala21 7 years ago
parent b32c59b840
commit 300e7a710e

@ -214,7 +214,7 @@ public interface ApplicationManagementAPI {
name = "isWithImages",
value = "Whether to return application with images",
required = false)
@QueryParam("isWithImages") Boolean IsWithImages
@QueryParam("isWithImages") Boolean isWithImages
);
@PUT

@ -32,7 +32,6 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.device.application.mgt.api.beans.ErrorResponse;
import org.wso2.carbon.device.application.mgt.common.ApplicationRelease;
import org.wso2.carbon.device.application.mgt.common.Platform;
import javax.validation.constraints.Size;
@ -211,7 +210,7 @@ public interface PlatformManagementAPI {
response = ErrorResponse.class)
})
Response addPlatform(
@Multipart(value = "Platform", type = "application/json" ) Platform platform,
@Multipart(value = "Platform", type = "application/json") Platform platform,
@Multipart(value = "icon", required = false) Attachment iconFile
);
@ -371,7 +370,7 @@ public interface PlatformManagementAPI {
response = ErrorResponse.class)
})
Response getPlatformTags(
@ApiParam(name = "name", value ="The initial part of the name of platform tags that we need to retrieve",
@ApiParam(name = "name", value = "The initial part of the name of platform tags that we need to retrieve",
required = true)
@PathParam("name") @Size(min = 3) String name
);

@ -217,8 +217,8 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI {
@POST
@Path("/upload-image-artifacts/{uuid}")
public Response uploadApplicationArtifacts(@PathParam("uuid") String applicationUUID,
@Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile, @Multipart
("screenshot") List<Attachment> attachmentList) {
@Multipart("icon") Attachment iconFile, @Multipart("banner") Attachment bannerFile,
@Multipart("screenshot") List<Attachment> attachmentList) {
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
try {
InputStream iconFileStream;

@ -21,7 +21,6 @@ package org.wso2.carbon.device.application.mgt.common;
import org.wso2.carbon.device.application.mgt.common.jaxrs.Exclude;
import java.awt.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@ -27,7 +27,6 @@ import java.util.List;
* ApplicationReleaseManager is responsible for handling all the operations related with
* {@link org.wso2.carbon.device.application.mgt.common.ApplicationRelease} which involving addition, updating ,
* deletion and viewing.
*
*/
public interface ApplicationReleaseManager {
@ -38,35 +37,38 @@ public interface ApplicationReleaseManager {
* @param applicationRelease ApplicatonRelease that need to be be created.
* @return the unique id of the application release, if the application release succeeded else -1
*/
public ApplicationRelease createRelease(String appicationUuid, ApplicationRelease applicationRelease) throws
ApplicationManagementException;
ApplicationRelease createRelease(String appicationUuid, ApplicationRelease applicationRelease)
throws ApplicationManagementException;
/**
* To get the application release of the Application/
*
* @param applicationUuid UUID of the Application.
* @param version Version of the ApplicationRelease that need to be retrieved.
* @return ApplicationRelease related with particular Application UUID and version.
* @throws ApplicationManagementException ApplicationManagementException
*/
public ApplicationRelease getRelease(String applicationUuid, String version) throws ApplicationManagementException;
ApplicationRelease getRelease(String applicationUuid, String version) throws ApplicationManagementException;
/**
* To get all the releases of a particular Application.
*
* @param applicationUuid UUID of the Application to get all the releases.
* @return the List of the Application releases related with the particular Application.
* @throws ApplicationManagementException Application Management Exception.
*/
public List<ApplicationRelease> getReleases(String applicationUuid) throws ApplicationManagementException;
List<ApplicationRelease> getReleases(String applicationUuid) throws ApplicationManagementException;
/**
* To make a particular application release as the default / not default-one
*
* @param uuid UUID of the application
* @param version Version of the application
* @param isDefault is default or not.
* @param releaseChannel Release channel to make the
* @throws ApplicationManagementException Application Management Exception.
*/
public void changeDefaultRelease(String uuid, String version, boolean isDefault, String releaseChannel)
void changeDefaultRelease(String uuid, String version, boolean isDefault, String releaseChannel)
throws ApplicationManagementException;
/**
@ -77,8 +79,8 @@ public interface ApplicationReleaseManager {
* @return Updated Application Release.
* @throws ApplicationManagementException Application Management Exception.
*/
public ApplicationRelease updateRelease(String applicationUuid, ApplicationRelease applicationRelease) throws
ApplicationManagementException;
ApplicationRelease updateRelease(String applicationUuid, ApplicationRelease applicationRelease)
throws ApplicationManagementException;
/**
* To delete a particular release
@ -87,7 +89,7 @@ public interface ApplicationReleaseManager {
* @param version Version of the ApplicationRelease that need to be deleted.
* @throws ApplicationManagementException Application Management Exception.
*/
public void deleteApplicationRelease(String applicationUuid, String version) throws ApplicationManagementException;
void deleteApplicationRelease(String applicationUuid, String version) throws ApplicationManagementException;
/**
* To delete all the application releases related with the the particular application.
@ -95,5 +97,5 @@ public interface ApplicationReleaseManager {
* @param applicationUuid UUID of the application.
* @throws ApplicationManagementException Application Management Exception.
*/
public void deleteApplicationReleases(String applicationUuid) throws ApplicationManagementException;
void deleteApplicationReleases(String applicationUuid) throws ApplicationManagementException;
}

@ -36,37 +36,40 @@ public interface ApplicationStorageManager {
* @param applicationUUID UUID of the application
* @param iconFile Icon File input stream
* @param bannerFile Banner File input stream
* @throws ApplicationStorageManagementException Application Storage Management Exception.
* @throws ResourceManagementException Resource Management Exception.
*/
public void uploadImageArtifacts(String applicationUUID, InputStream iconFile, InputStream bannerFile,
void uploadImageArtifacts(String applicationUUID, InputStream iconFile, InputStream bannerFile,
List<InputStream> screenshots) throws ResourceManagementException;
/**
* To upload release artifacts for an Application.
*
* @param applicationUUID UUID of the application related with the release.
* @param versionName Name of version of the Applcation Release.
* @param binaryFile Binary File for the release.
* @throws ApplicationStorageManagementException Application Storage Management Exception.
* @throws ResourceManagementException Resource Management Exception.
*/
public void uploadReleaseArtifacts(String applicationUUID, String versionName, InputStream binaryFile)
void uploadReleaseArtifacts(String applicationUUID, String versionName, InputStream binaryFile)
throws ResourceManagementException;
/**
* To get released artifacts for the particular version of the application.
*
* @param applicationUUID UUID of the Application
* @param versionName Version of the release to be retrieved
* @return the artifact related with the Application Release.
* @throws ApplicationStorageManagementException Application Storage Management Exception.
*/
public InputStream getReleasedArtifacts(String applicationUUID, String versionName) throws
ApplicationStorageManagementException;
InputStream getReleasedArtifacts(String applicationUUID, String versionName)
throws ApplicationStorageManagementException;
/**
* To delete all the artifacts related with a particular Application.
*
* @param applicationUUID UUID of the Application.
* @throws ApplicationStorageManagementException Application Storage Management Exception.
*/
public void deleteApplicationArtifacts(String applicationUUID) throws ApplicationStorageManagementException;
void deleteApplicationArtifacts(String applicationUUID) throws ApplicationStorageManagementException;
/**
* To delete the artifacts related with particular Application Release.
@ -75,16 +78,16 @@ public interface ApplicationStorageManager {
* @param version Version of ApplicationRelease that need to be deleted.
* @throws ApplicationStorageManagementException Application Storage Management Exception.
*/
public void deleteApplicationReleaseArtifacts(String applicationUUID, String version)
void deleteApplicationReleaseArtifacts(String applicationUUID, String version)
throws ApplicationStorageManagementException;
/**
* To delete all release artifacts related with particular Application Release.
*
* @param applicationUUID UUID of the Application.
* @throws ApplicationStorageManagementException Application Storage Management Exception
*/
public void deleteAllApplicationReleaseArtifacts(String applicationUUID) throws
ApplicationStorageManagementException;
void deleteAllApplicationReleaseArtifacts(String applicationUUID) throws ApplicationStorageManagementException;
/**
* To get particular image artifact of the application.
@ -95,6 +98,6 @@ public interface ApplicationStorageManager {
* @return the relevant image artifact.
* @throws ApplicationStorageManagementException Application Storage Management Exception.
*/
public ImageArtifact getImageArtifact(String applicationUUID, String name, int count) throws
ApplicationStorageManagementException;
ImageArtifact getImageArtifact(String applicationUUID, String name, int count)
throws ApplicationStorageManagementException;
}

@ -19,8 +19,6 @@
package org.wso2.carbon.device.application.mgt.common.services;
import org.wso2.carbon.device.application.mgt.common.Category;
import org.wso2.carbon.device.application.mgt.common.Filter;
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationCategoryManagementException;
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException;
import java.util.List;

@ -35,7 +35,7 @@ public interface PlatformManager {
* @param tenantId ID of the tenant
* @throws PlatformManagementException Platform Management Exception
*/
public void initialize(int tenantId) throws PlatformManagementException;
void initialize(int tenantId) throws PlatformManagementException;
/**
* To get platforms of the specific tenant.
@ -44,7 +44,7 @@ public interface PlatformManager {
* @return List of platforms
* @throws PlatformManagementException Platform Management Exception
*/
public List<Platform> getPlatforms(int tenantId) throws PlatformManagementException;
List<Platform> getPlatforms(int tenantId) throws PlatformManagementException;
/**
* To get platform with the given platform identifier and tenant ID.
@ -54,7 +54,7 @@ public interface PlatformManager {
* @return the Specific platform with the platform identifier and tenant
* @throws PlatformManagementException Platform Management Exception
*/
public Platform getPlatform(int tenantId, String platformIdentifier) throws PlatformManagementException;
Platform getPlatform(int tenantId, String platformIdentifier) throws PlatformManagementException;
/**
* To register a platform under particular tenant.
@ -63,7 +63,7 @@ public interface PlatformManager {
* @param platform Platform to be registered
* @throws PlatformManagementException Platform Management Exception
*/
public void register(int tenantId, Platform platform) throws PlatformManagementException;
void register(int tenantId, Platform platform) throws PlatformManagementException;
/**
* To update a platform.
@ -73,8 +73,7 @@ public interface PlatformManager {
* @param platform Platform to be updated
* @throws PlatformManagementException Platform Management Exception
*/
public void update(int tenantId, String oldPlatformIdentifier, Platform platform)
throws PlatformManagementException;
void update(int tenantId, String oldPlatformIdentifier, Platform platform) throws PlatformManagementException;
/**
* To un-register the platform.
@ -84,8 +83,7 @@ public interface PlatformManager {
* @param isFileBased To indicate whether a file based or not.
* @throws PlatformManagementException Platform Management Exception.
*/
public void unregister(int tenantId, String platformIdentifier, boolean isFileBased)
throws PlatformManagementException;
void unregister(int tenantId, String platformIdentifier, boolean isFileBased) throws PlatformManagementException;
/**
* To add mapping to platform identifiers with the tenant ID.
@ -94,7 +92,7 @@ public interface PlatformManager {
* @param platformIdentifiers Platform Identifiers
* @throws PlatformManagementException Platform Management Exception
*/
public void addMapping(int tenantId, List<String> platformIdentifiers) throws PlatformManagementException;
void addMapping(int tenantId, List<String> platformIdentifiers) throws PlatformManagementException;
/**
* To add mapping to a platform for a tenant.
@ -103,7 +101,7 @@ public interface PlatformManager {
* @param platformIdentifier ID of the platform, the mapping should be added.
* @throws PlatformManagementException Platform Management Exception.
*/
public void addMapping(int tenantId, String platformIdentifier) throws PlatformManagementException;
void addMapping(int tenantId, String platformIdentifier) throws PlatformManagementException;
/**
* To remove a mapping of a platform to a tenant.
@ -112,7 +110,7 @@ public interface PlatformManager {
* @param platformIdentifier ID of the platform.
* @throws PlatformManagementException Platform Management Exception.
*/
public void removeMapping(int tenantId, String platformIdentifier) throws PlatformManagementException;
void removeMapping(int tenantId, String platformIdentifier) throws PlatformManagementException;
/**
* To update the platform status(ENABLED / DISABLED).
@ -122,7 +120,7 @@ public interface PlatformManager {
* @param status Status to be updated.
* @throws PlatformManagementException Platform Management Exception.
*/
public void updatePlatformStatus(int tenantId, String platformIdentifier, String status)
void updatePlatformStatus(int tenantId, String platformIdentifier, String status)
throws PlatformManagementException;
/**
@ -131,7 +129,7 @@ public interface PlatformManager {
* @param tenantId ID of the tenant.
* @throws PlatformManagementException Platform Management Exception.
*/
public void removePlatforms(int tenantId) throws PlatformManagementException;
void removePlatforms(int tenantId) throws PlatformManagementException;
/**
* To get the platform tags.
@ -140,5 +138,5 @@ public interface PlatformManager {
* @return list of the platform tags that start with the character sequence.
* @throws PlatformManagementException PlatformManagement Exception
*/
public List<String> getPlatformTags(String name) throws PlatformManagementException;
List<String> getPlatformTags(String name) throws PlatformManagementException;
}

@ -34,17 +34,18 @@ public interface PlatformStorageManager {
*
* @param platformIdentifier Identifier of the platform
* @param iconFile Icon File input stream
* @throws PlatformStorageManagementException Platform Storage Management Exception.
* @throws ResourceManagementException Resource Management Exception.
*/
public void uploadIcon(String platformIdentifier, InputStream iconFile) throws ResourceManagementException;
void uploadIcon(String platformIdentifier, InputStream iconFile) throws ResourceManagementException;
/**
* To get the icon for a particular platform.
*
* @param platformIdentifier Identifier of the platform.
* @return the icon for the given platform.
* @throws PlatformStorageManagementException Platform Storage Management Exception.
*/
public ImageArtifact getIcon(String platformIdentifier) throws PlatformStorageManagementException;
ImageArtifact getIcon(String platformIdentifier) throws PlatformStorageManagementException;
/**
* To delete the icon of a particular platform
@ -52,5 +53,5 @@ public interface PlatformStorageManager {
* @param platformIdentifier Identifier of the platform to which delete icon.
* @throws PlatformStorageManagementException PlatformStorageManagement Exception.
*/
public void deleteIcon(String platformIdentifier) throws PlatformStorageManagementException;
void deleteIcon(String platformIdentifier) throws PlatformStorageManagementException;
}

@ -36,8 +36,8 @@ import org.wso2.carbon.device.application.mgt.core.dao.impl.category.GenericCate
import org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate.GenericLifecycleStateImpl;
import org.wso2.carbon.device.application.mgt.core.dao.impl.platform.GenericPlatformDAOImpl;
import org.wso2.carbon.device.application.mgt.core.dao.impl.platform.OracleMsSQLPlatformDAOImpl;
import org.wso2.carbon.device.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl;
import org.wso2.carbon.device.application.mgt.core.dao.impl.subscription.GenericSubscriptionDAOImpl;
import org.wso2.carbon.device.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl;
import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException;
import org.wso2.carbon.device.application.mgt.core.util.ApplicationMgtDatabaseCreator;
import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil;

@ -90,8 +90,7 @@ public class GenericPlatformDAOImpl extends AbstractDAOImpl implements PlatformD
if (isBatchExecutionSupported) {
preparedStatement.addBatch();
}
else {
} else {
preparedStatement.execute();
}
}

@ -157,10 +157,10 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
throws ResourceManagementException {
Application application = validateApplication(applicationUUID);
String artifactDirectoryPath = storagePath + application.getId();
if (log.isDebugEnabled())
if (log.isDebugEnabled()) {
log.debug("Artifact Directory Path for saving the application release related artifacts related with "
+ "application " + applicationUUID + " is " + artifactDirectoryPath);
}
StorageManagementUtil.createArtifactDirectory(artifactDirectoryPath);
if (binaryFile != null) {
try {
@ -171,7 +171,6 @@ public class ApplicationStorageManagerImpl implements ApplicationStorageManager
+ applicationUUID, e);
}
}
}
@Override

@ -21,7 +21,6 @@ package org.wso2.carbon.device.application.mgt.core.util;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import org.wso2.carbon.device.application.mgt.common.ImageArtifact;
import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException;
import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException;
import java.io.File;
@ -32,12 +31,15 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
/**
* This is a util class that handles Storage Management related tasks.
*/
public class StorageManagementUtil {
/**
* This method is responsible for creating artifact parent directories in the given path.
*
* @param artifactDirectoryPath Path for the artifact directory.
* @throws ApplicationStorageManagementException Application Storage Management Exception.
* @throws ResourceManagementException Resource Management Exception.
*/
public static void createArtifactDirectory(String artifactDirectoryPath) throws ResourceManagementException {
File artifactDirectory = new File(artifactDirectoryPath);
@ -65,7 +67,6 @@ public class StorageManagementUtil {
artifactDirectory.delete();
}
/**
* To save a file in a given location.
*

Loading…
Cancel
Save