Skip to content

Commit

Permalink
Updated logging and documentation
Browse files Browse the repository at this point in the history
Logging and code comments were still talking about XACML files. Now they
are just talking about ACLs.
  • Loading branch information
lkiesow committed Jul 31, 2024
1 parent 7f3e0a9 commit bf9e790
Showing 1 changed file with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
import java.util.Map;
import java.util.Optional;

import javax.xml.bind.JAXBException;

@Component(
immediate = true,
service = { ArtifactInstaller.class, AclScanner.class },
Expand All @@ -62,7 +60,7 @@
)
public class AclScanner implements ArtifactInstaller {

/** The directory name that has the XACML file defining the Acl **/
/** The directory name that holds the ACL files **/
public static final String ACL_DIRECTORY = "acl";

/** The logging instance */
Expand Down Expand Up @@ -127,10 +125,10 @@ public boolean canHandle(File artifact) {
}

/**
* Add an ACL based upon an XACML file to all the organizations.
* Add ACL from configuration directory to all organizations.
*
* @param artifact
* The File representing the XACML File.
* The File representing the ACL.
* @throws IOException
* @throws AccessControlParsingException
*/
Expand Down Expand Up @@ -170,10 +168,10 @@ private void addAcl(File artifact) throws IOException, AccessControlParsingExcep
}

/**
* Update an ACL based upon an XACML file on all the organizations.
* Update ACL from configuration directory in all organizations.
*
* @param artifact
* The File representing the XACML File.
* The File representing the ACL.
* @throws IOException
* @throws AccessControlParser
*/
Expand All @@ -194,24 +192,22 @@ private void updateAcl(File artifact) throws IOException, AccessControlParsingEx
if (!getAclService(org).updateAcl(new ManagedAclImpl(id, fileName, org.getId(), acl))) {
logger.warn("No Acl found with the id {} for the organisation {}.", id, org.getName());
} else {
logger.debug("Acl from XACML file {} has been updated for the organisation {}", fileName, org.getName());
logger.debug("Acl from file {} has been updated for the organisation {}", fileName, org.getName());
}
} else {
logger.info("The XACML file {} has not been added to the organisation {} and will therefore not be updated",
logger.info("The ACL file {} has not been added to the organisation {} and will therefore not be updated",
fileName, org.getName());
}
}
}

/**
* Remove an ACL based upon an XACML file from all the organizations.
* Remove ACL from configuration directory from all the organizations.
*
* @param artifact
* The File representing the XACML File.
* @throws IOException
* @throws JAXBException
* The File representing the ACL.
*/
private void removeAcl(File artifact) throws IOException, JAXBException {
private void removeAcl(File artifact) {
List<Organization> organizations = organizationDirectoryService.getOrganizations();

logger.debug("Removing Acl {}", artifact.getAbsolutePath());
Expand All @@ -226,21 +222,21 @@ private void removeAcl(File artifact) throws IOException, JAXBException {
try {
getAclService(org).deleteAcl(id);
} catch (NotFoundException e) {
logger.warn("Unable to delete managec acl {}: Managed acl already deleted!", id);
logger.debug("Unable to delete managed acl {}. Managed acl already deleted!", id);
} catch (AclServiceException e) {
logger.error("Unable to delete managed acl {}", id, e);
}
} else {
logger.debug("No Acl found with the id {}.", id);
logger.debug("No Acl matching file {} found.", fileName);
}
}
}

/**
* Generate an Acl Id with the XACML filename and the organization id
* Generate an Acl Id from ACL filename and organization id
*
* @param fileName
* the XACML file
* the ACL file
* @param org
* the organization
* @return the generated Acl Id
Expand Down

0 comments on commit bf9e790

Please sign in to comment.