com.sap.cloud.sdk.cloudplatform.auditlog.ScpCfAuditLogFacade Maven / Gradle / Ivy
/*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*/
package com.sap.cloud.sdk.cloudplatform.auditlog;
import javax.annotation.Nonnull;
import com.sap.cloud.sdk.cloudplatform.WithRuntimeDependencies;
import com.sap.cloud.sdk.cloudplatform.auditlog.exception.AuditLogAccessException;
import com.sap.cloud.sdk.cloudplatform.exception.DependencyNotFoundException;
/**
* Audit log facade used with CloudFoundry.
*/
public class ScpCfAuditLogFacade implements AuditLogFacade, WithRuntimeDependencies
{
/**
* {@inheritDoc}
*/
@Nonnull
@Override
public Class extends AuditLog> getAuditLogClass()
{
return ScpCfAuditLog.class;
}
/**
* {@inheritDoc}
*/
@Override
public void assertRuntimeDependenciesExist()
throws DependencyNotFoundException
{
try {
Class.forName("com.sap.xs.audit.client.impl.v2.AuditLogMessageFactoryImpl");
}
catch( final ClassNotFoundException e ) {
throw new DependencyNotFoundException(
"Failed to instantiate "
+ ScpCfAuditLog.class.getSimpleName()
+ ". If you are not using the SAP Java Buildpack, "
+ "make sure to add the latest version of the following dependencies to your project: "
+ "\"com.sap.xs.auditlog:audit-java-client-api\", "
+ "\"com.sap.xs.auditlog:audit-java-client-impl\","
+ "\"com.sap.xs.java:xs-env\". "
+ "Note that these dependencies may not be available in Maven Central. "
+ "In this case, please install the latest version of the "
+ "\"Standard Java Client Libraries for XS Advanced\". "
+ "Visit \"https://support.sap.com/\" and "
+ "search for software downloads with name \"XS_JAVA\".",
e);
}
}
/**
* {@inheritDoc}
*/
@Nonnull
@Override
public AuditLog getAuditLog()
throws AuditLogAccessException
{
assertRuntimeDependenciesExist();
return new ScpCfAuditLog();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy