本文整理汇总了Java中org.fosstrak.ale.exception.SecurityException类的典型用法代码示例。如果您正苦于以下问题:Java SecurityException类的具体用法?Java SecurityException怎么用?Java SecurityException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityException类属于org.fosstrak.ale.exception包,在下文中一共展示了SecurityException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setProperties
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void setProperties(String name, List<LRProperty> properties) throws NoSuchNameException, ValidationException, InUseException, ImmutableReaderException, SecurityException, ImplementationException {
throwValidationExceptionOnNullInput(properties);
LogicalReader logRd = logicalReaders.get(name);
throwNoSuchNameExceptionIfReaderNull(logRd, name);
LRSpec spec = logRd.getLRSpec();
if (spec.getProperties() == null) {
spec.setProperties(new LRSpec.Properties());
}
// we need to replace the properties, not just add to the old ones.
spec.getProperties().getProperty().clear();
spec.getProperties().getProperty().addAll(properties);
LOG.debug("set the properties");
try {
update(name, spec);
} catch (ReaderLoopException e) {
String errMsg = "ReaderLoopException during update.";
LOG.debug(errMsg, e);
throw new ImplementationException(errMsg, e);
}
}
示例2: addReaders
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void addReaders(String name, java.util.List<String> readers) throws NoSuchNameException, ValidationException, InUseException, ImmutableReaderException, ReaderLoopException, SecurityException, ImplementationException, NonCompositeReaderException {
LogicalReader logRd = logicalReaders.get(name);
throwNoSuchNameExceptionIfReaderNull(logRd, name);
throwNonCompositeReaderExceptionIfReaderNotComposite(logRd, name);
throwValidationExceptionIfNotAllReadersAvailable(readers);
LRSpec spec = logRd.getLRSpec();
if (spec.getReaders() == null) {
spec.setReaders(new LRSpec.Readers());
}
for (String reader : readers) {
if (!spec.getReaders().getReader().contains(reader)) {
spec.getReaders().getReader().add(reader);
}
}
update(name, spec);
}
示例3: define
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void define(String name, LRSpec spec) throws DuplicateNameException, ValidationException, SecurityException, ImplementationException {
LOG.debug("define");
throwValidationExceptionOnNullInput(name, "parameter name is null");
throwValidationExceptionOnNullInput(spec, "parameter spec is null");
LogicalReader logRead = getReaderProvider().createReader(name, spec);
// establish connection when basereader
if (logRead instanceof BaseReader) {
((BaseReader)logRead).connectReader();
}
persistenceWriteAPI.writeLRSpec(name, spec);
LOG.debug("saving reader: " + name + " " + logRead.getClass().getCanonicalName());
logicalReaders.put(name, logRead);
LOG.debug("successfully executed define");
}
示例4: setReaders
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void setReaders(String name, java.util.List<String> readers) throws NoSuchNameException, ValidationException, InUseException, ImmutableReaderException, NonCompositeReaderException, ReaderLoopException, SecurityException, ImplementationException {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
LogicalReader logRd = logicalReaders.get(name);
throwNoSuchNameExceptionIfReaderNull(logRd, name);
throwNonCompositeReaderExceptionIfReaderNotComposite(logRd, name);
throwValidationExceptionIfNotAllReadersAvailable(readers);
LRSpec spec = logRd.getLRSpec();
spec.setReaders(new LRSpec.Readers());
spec.getReaders().getReader().addAll(readers);
update(name, spec);
}
示例5: addReaders
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void addReaders(String name, java.util.List<String> readers) throws NoSuchNameException, ValidationException, InUseException, ImmutableReaderException, ReaderLoopException, SecurityException, ImplementationException, NonCompositeReaderException {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
LogicalReader logRd = logicalReaders.get(name);
throwNoSuchNameExceptionIfReaderNull(logRd, name);
throwNonCompositeReaderExceptionIfReaderNotComposite(logRd, name);
throwValidationExceptionIfNotAllReadersAvailable(readers);
LRSpec spec = logRd.getLRSpec();
if (spec.getReaders() == null) {
spec.setReaders(new LRSpec.Readers());
}
for (String reader : readers) {
if (!spec.getReaders().getReader().contains(reader)) {
spec.getReaders().getReader().add(reader);
}
}
update(name, spec);
}
示例6: undefineRole
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "UndefineRoleResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "undefineRoleReturn")
@WebMethod
public UndefineRoleResult undefineRole(
@WebParam(partName = "parms", name = "UndefineRole", targetNamespace = "urn:epcglobal:aleac:wsdl:1") UndefineRole arg0)
throws NoSuchRoleExceptionResponse,
UnsupportedOperationExceptionResponse, SecurityExceptionResponse,
ImplementationExceptionResponse {
try {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
aleac.undefineRole(arg0.getRoleName());
} catch (SecurityException e) {
throw new SecurityExceptionResponse(e.getMessage(), e);
}
return new UndefineRoleResult();
}
示例7: define
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void define(String name, LRSpec spec) throws DuplicateNameException, ValidationException, SecurityException, ImplementationException {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
LOG.debug("define");
throwValidationExceptionOnNullInput(name, "parameter name is null");
throwValidationExceptionOnNullInput(spec, "parameter spec is null");
if(logicalReaders.containsKey(name)) {
throw new DuplicateNameException("LRSpec "+name+" already exists");
}
LogicalReader logRead = getReaderProvider().createReader(name, spec);
// establish connection when basereader
if (logRead instanceof BaseReader) {
//((BaseReader)logRead).connectReader(); Call me if you got trouble, [email protected]
}
persistenceWriteAPI.writeLRSpec(name, spec);
LOG.debug("saving reader: " + name + " " + logRead.getClass().getCanonicalName());
logicalReaders.put(name, logRead);
LOG.debug("successfully executed define");
}
示例8: defineTMSpec
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "DefineTMSpecResult", targetNamespace = "urn:epcglobal:aletm:wsdl:1", partName = "defineTMSpecReturn")
@WebMethod
public DefineTMSpecResult defineTMSpec(
@WebParam(partName = "parms", name = "DefineTMSpec", targetNamespace = "urn:epcglobal:aletm:wsdl:1") DefineTMSpec arg0)
throws TMSpecValidationExceptionResponse,
DuplicateNameExceptionResponse, SecurityExceptionResponse,
ImplementationExceptionResponse {
try {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
aletm.defineTMSpec(arg0.getSpecName(), arg0.getSpec());
} catch (SecurityException e) {
throw new SecurityExceptionResponse(e.getMessage(), e);
}
return new DefineTMSpecResult();
}
示例9: undefinePermission
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "UndefinePermissionResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "undefinePermissionReturn")
@WebMethod
public UndefinePermissionResult undefinePermission(
@WebParam(partName = "parms", name = "UndefinePermission", targetNamespace = "urn:epcglobal:aleac:wsdl:1") UndefinePermission arg0)
throws UnsupportedOperationExceptionResponse,
SecurityExceptionResponse, ImplementationExceptionResponse,
NoSuchPermissionExceptionResponse {
try {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
aleac.undefinePermission(arg0.getPermName());
} catch (SecurityException e) {
throw new SecurityExceptionResponse(e.getMessage(), e);
}
return new UndefinePermissionResult();
}
示例10: defineRole
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "DefineRoleResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "defineRoleReturn")
@WebMethod
public DefineRoleResult defineRole(
@WebParam(partName = "parms", name = "DefineRole", targetNamespace = "urn:epcglobal:aleac:wsdl:1") DefineRole arg0)
throws UnsupportedOperationExceptionResponse,
DuplicateRoleExceptionResponse, RoleValidationExceptionResponse,
SecurityExceptionResponse, ImplementationExceptionResponse {
try {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
aleac.defineRole(arg0.getRoleName(), arg0.getRole());
} catch (SecurityException e) {
throw new SecurityExceptionResponse(e.getMessage(), e);
}
return new DefineRoleResult();
}
示例11: undefineTMSpec
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "UndefineTMSpecResult", targetNamespace = "urn:epcglobal:aletm:wsdl:1", partName = "undefineTMSpecReturn")
@WebMethod
public UndefineTMSpecResult undefineTMSpec(
@WebParam(partName = "parms", name = "UndefineTMSpec", targetNamespace = "urn:epcglobal:aletm:wsdl:1") UndefineTMSpec arg0)
throws ImplementationExceptionResponse,
NoSuchNameExceptionResponse, SecurityExceptionResponse {
try {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
aletm.undefineTMSpec(arg0.getSpecName());
} catch (SecurityException e) {
throw new SecurityExceptionResponse(e.getMessage(), e);
}
return new UndefineTMSpecResult();
}
示例12: removeRoles
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "RemoveRolesResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "removeRolesReturn")
@WebMethod
public RemoveRolesResult removeRoles(
@WebParam(partName = "parms", name = "RemoveRoles", targetNamespace = "urn:epcglobal:aleac:wsdl:1") RemoveRoles arg0)
throws NoSuchClientIdentityExceptionResponse,
UnsupportedOperationExceptionResponse, SecurityExceptionResponse,
ImplementationExceptionResponse {
try {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
aleac.removeRoles(arg0.getIdentityName(), arg0.getRoleNames().getRoleName());
} catch (SecurityException e) {
throw new SecurityExceptionResponse(e.getMessage(), e);
}
return new RemoveRolesResult();
}
示例13: checkAccess
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public boolean checkAccess(String objName, String opName)
throws SecurityException {
String loggedInId = ALEACImpl.getInstance().getLoggedInId();
List<User> foundUsers = findUsers(loggedInId);
if(foundUsers.size() == 1) {
User foundUser = foundUsers.get(0);
for(String foundUserRole : foundUser.getRoles()) {
List<Role> foundRoles = findRoles(foundUserRole);
if(foundRoles.size() == 1) {
Role foundRole = foundRoles.get(0);
for(Permission p : foundRole.getPermissions()) {
if(p.getObjectName().equals(objName) && p.getOpName().equals(opName)) {
return true;
}
}
}
}
}
return false;
}
示例14: definePermission
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "DefinePermissionResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "definePermissionReturn")
@WebMethod
public DefinePermissionResult definePermission(
@WebParam(partName = "parms", name = "DefinePermission", targetNamespace = "urn:epcglobal:aleac:wsdl:1") DefinePermission arg0)
throws UnsupportedOperationExceptionResponse,
PermissionValidationExceptionResponse, SecurityExceptionResponse,
ImplementationExceptionResponse,
DuplicatePermissionExceptionResponse {
try {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
aleac.definePermission(arg0.getPermName(), arg0.getPerm());
} catch (SecurityException e) {
throw new SecurityExceptionResponse(e.getMessage(), e);
}
return new DefinePermissionResult();
}
示例15: updateClientIdentity
import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "UpdateClientIdentityResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "updateClientIdentityReturn")
@WebMethod
public UpdateClientIdentityResult updateClientIdentity(
@WebParam(partName = "parms", name = "UpdateClientIdentity", targetNamespace = "urn:epcglobal:aleac:wsdl:1") UpdateClientIdentity arg0)
throws NoSuchClientIdentityExceptionResponse,
UnsupportedOperationExceptionResponse, SecurityExceptionResponse,
ImplementationExceptionResponse,
ClientIdentityValidationExceptionResponse {
try {
aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
aleac.updateClientIdentity(arg0.getIdentityName(), arg0.getId());
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return new UpdateClientIdentityResult();
}