rename method to to discourage direct usage

This commit is contained in:
Fredrik Teschke
2015-01-29 16:24:50 +01:00
parent d322468f3d
commit 45e907b9e7
5 changed files with 13 additions and 8 deletions
@@ -41,7 +41,7 @@ public interface FileStorageService {
* @throws IllegalArgumentException
* if {@code name} is not a valid property name
*/
void setProperty(String name, String value) throws IllegalArgumentException;
void internalSetProperty(String name, String value) throws IllegalArgumentException;
String getName();
@@ -139,7 +139,7 @@ public class AmazonS3FileStorageServiceImpl implements FileStorageService {
}
@Override
public void setProperty(String name, String value) {
public void internalSetProperty(String name, String value) {
if (!properties.containsKey(name)) {
throw new IllegalArgumentException("Property " + name + " does not exist");
}
@@ -20,6 +20,11 @@ import com.sap.sse.osgi.CachedOsgiTypeBasedServiceFinderFactory;
* Implements {@link ServiceTrackerCustomizer} so that all {@link FileStorageServices} announced in the
* registry can receive their stored properties.
*
* TODO implements Replicable, build Operations
* add fully qualified classname of Replicable to java/target/env.sh
* register as Replicable OSGi service (com.sap.sse.security.impl.Activator#83)
* TODO store active selection
*
* @author Fredrik Teschke
*
*/
@@ -77,7 +82,7 @@ public class FileStorageManagementServiceImpl implements FileStorageManagementSe
throws NoCorrespondingServiceRegisteredException, IllegalArgumentException {
//TODO replicate
propertyStore.writeProperty(serviceName, propertyName, propertyValue);
serviceFinder.findService(serviceName).setProperty(propertyName, propertyValue);
serviceFinder.findService(serviceName).internalSetProperty(propertyName, propertyValue);
}
@Override
@@ -85,7 +90,7 @@ public class FileStorageManagementServiceImpl implements FileStorageManagementSe
FileStorageService service = context.getService(reference);
logger.info("Found new FileStorageService: adding properties to " + service.getName());
for (Entry<String, String> property : propertyStore.readAllProperties(service.getName()).entrySet()) {
service.setProperty(property.getKey(), property.getValue());
service.internalSetProperty(property.getKey(), property.getValue());
}
return service;
}
@@ -82,7 +82,7 @@ public class LocalFileStorageServiceImpl implements FileStorageService {
}
@Override
public void setProperty(String name, String value) throws IllegalArgumentException {
public void internalSetProperty(String name, String value) throws IllegalArgumentException {
// TODO Auto-generated method stub
}
@@ -10,9 +10,9 @@ public class AmazonS3TestSupport {
public static AmazonS3FileStorageServiceImpl createService() throws InvalidPropertiesException {
AmazonS3FileStorageServiceImpl service = new AmazonS3FileStorageServiceImpl();
service.setProperty("accessId", s3AccessId);
service.setProperty("accessKey", s3AccessKey);
service.setProperty("bucketName", s3BucketName);
service.internalSetProperty("accessId", s3AccessId);
service.internalSetProperty("accessKey", s3AccessKey);
service.internalSetProperty("bucketName", s3BucketName);
service.testProperties();
return service;
}