当前位置: 首页>>代码示例>>Java>>正文


Java SecurityException类代码示例

本文整理汇总了Java中org.fosstrak.ale.exception.SecurityException的典型用法代码示例。如果您正苦于以下问题:Java SecurityException类的具体用法?Java SecurityException怎么用?Java SecurityException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SecurityException类属于org.fosstrak.ale.exception包,在下文中一共展示了SecurityException类的40个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);			
	}		
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:26,代码来源:LogicalReaderManagerImpl.java


示例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);
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:20,代码来源:LogicalReaderManagerImpl.java


示例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");
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:21,代码来源:LogicalReaderManagerImpl.java


示例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);
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:17,代码来源:LogicalReaderManagerImpl.java


示例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);
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:22,代码来源:LogicalReaderManagerImpl.java


示例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();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:18,代码来源:ALEACServicePortTypeImpl.java


示例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");
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:24,代码来源:LogicalReaderManagerImpl.java


示例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();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:18,代码来源:ALETMServicePortTypeImpl.java


示例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();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:18,代码来源:ALEACServicePortTypeImpl.java


示例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();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:18,代码来源:ALEACServicePortTypeImpl.java


示例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();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:17,代码来源:ALETMServicePortTypeImpl.java


示例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();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:18,代码来源:ALEACServicePortTypeImpl.java


示例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;
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:24,代码来源:LocalRBAC.java


示例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();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:19,代码来源:ALEACServicePortTypeImpl.java


示例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();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:20,代码来源:ALEACServicePortTypeImpl.java


示例16: getPermission

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "GetPermissionResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "getPermissionReturn")
@WebMethod
public ACPermission getPermission(
		@WebParam(partName = "parms", name = "GetPermission", targetNamespace = "urn:epcglobal:aleac:wsdl:1") GetPermission arg0)
		throws UnsupportedOperationExceptionResponse,
		SecurityExceptionResponse, ImplementationExceptionResponse,
		NoSuchPermissionExceptionResponse {
	
	try {
		aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
		return aleac.getPermission(arg0.getPermName());
	} catch (SecurityException e) {
		throw new SecurityExceptionResponse(e.getMessage(), e);
	}
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:17,代码来源:ALEACServicePortTypeImpl.java


示例17: addPermissions

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "AddPermissionsResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "addPermissionsReturn")
@WebMethod
public AddPermissionsResult addPermissions(
		@WebParam(partName = "parms", name = "AddPermissions", targetNamespace = "urn:epcglobal:aleac:wsdl:1") AddPermissions arg0)
		throws NoSuchRoleExceptionResponse,
		UnsupportedOperationExceptionResponse, SecurityExceptionResponse,
		ImplementationExceptionResponse, NoSuchPermissionExceptionResponse {
	try {
		aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
		aleac.addPermissions(arg0.getRoleName(), arg0.getPermissionNames().getPermissionName());
	} catch (SecurityException e) {
		throw new SecurityExceptionResponse(e.getMessage(), e);
	}
	
	return new AddPermissionsResult();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:18,代码来源:ALEACServicePortTypeImpl.java


示例18: getRole

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "GetRoleResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "getRoleReturn")
@WebMethod
public ACRole getRole(
		@WebParam(partName = "parms", name = "GetRole", targetNamespace = "urn:epcglobal:aleac:wsdl:1") GetRole arg0)
		throws NoSuchRoleExceptionResponse,
		UnsupportedOperationExceptionResponse, SecurityExceptionResponse,
		ImplementationExceptionResponse {
	try {
		aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
		return aleac.getRole(arg0.getRoleName());
		
	} catch (SecurityException e) {
		throw new SecurityExceptionResponse(e.getMessage(), e);
	}
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:17,代码来源:ALEACServicePortTypeImpl.java


示例19: updateRole

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
@WebResult(name = "UpdateRoleResult", targetNamespace = "urn:epcglobal:aleac:wsdl:1", partName = "updateRoleReturn")
@WebMethod
public UpdateRoleResult updateRole(
		@WebParam(partName = "parms", name = "UpdateRole", targetNamespace = "urn:epcglobal:aleac:wsdl:1") UpdateRole arg0)
		throws NoSuchRoleExceptionResponse,
		UnsupportedOperationExceptionResponse,
		RoleValidationExceptionResponse, SecurityExceptionResponse,
		ImplementationExceptionResponse {
	try {
		//aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
		aleac.updateRole(arg0.getRoleName(), arg0.getRole());
	} catch (SecurityException e) {
		throw new SecurityExceptionResponse();
	}
	
	throw new ImplementationExceptionResponse();
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:19,代码来源:ALEACServicePortTypeImpl.java


示例20: undefinePermission

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void undefinePermission(String permObjName, String permOpName) throws SecurityException {
	/*
	PermObj pObj = new PermObj();
	pObj.setObjectName(permObjName);
	adminMgr.deletePermObj(pObj);
	*/
	Permission p = new Permission();
	p.setObjectName(permObjName);
	p.setOpName(permOpName);
	try {
		adminMgr.deletePermission(p);
	} catch (us.jts.fortress.SecurityException e) {
		e.printStackTrace();
		throw new SecurityException();
	}
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:18,代码来源:FortressRBACClient.java


示例21: findUsers

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
public List<org.fosstrak.ale.server.ac.User> findUsers(String userName) throws SecurityException {
	User ue = new User();
	ue.setUserId(userName);
	
	List<User> listUser = null;
	try {
		listUser = rm.findUsers(ue);
	} catch (us.jts.fortress.SecurityException e) {
		e.printStackTrace();
		throw new SecurityException();
	}
	
	List<org.fosstrak.ale.server.ac.User> toReturn = new ArrayList<org.fosstrak.ale.server.ac.User>();
	for(User u : listUser) {
		List<org.fosstrak.ale.server.ac.Role> toAdd = new ArrayList<org.fosstrak.ale.server.ac.Role>();
		
		toReturn.add(new org.fosstrak.ale.server.ac.User(u.getUserId(), null));	
	}
	
	return toReturn;
	
    
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:24,代码来源:FortressRBACClient.java


示例22: findPermissions

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
public List<org.fosstrak.ale.server.ac.Permission> findPermissions(String permObjName, String permOpName) throws SecurityException {
	Permission pe = new Permission();
	pe.setObjectName(permObjName);
	pe.setOpName(permOpName);
	
	try {
		List<Permission> listPerm = rm.findPermissions(pe);
		List<org.fosstrak.ale.server.ac.Permission> toReturn = new ArrayList<org.fosstrak.ale.server.ac.Permission>();
		
		for(Permission p : listPerm) {
			toReturn.add(new org.fosstrak.ale.server.ac.Permission(p.getObjectName(), p.getOpName(), p.getRoles()));
		}
		
		return toReturn;
		
	} catch (us.jts.fortress.SecurityException e) {
		e.printStackTrace();
		throw new SecurityException();
	}
	
	
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:23,代码来源:FortressRBACClient.java


示例23: getPropertyValue

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public String getPropertyValue(String name, String propertyName) throws NoSuchNameException, SecurityException, ImplementationException {
			
	LogicalReader logRd = logicalReaders.get(name);
	throwNoSuchNameExceptionIfReaderNull(logRd, name);
	
	List<LRProperty> propList = logRd.getProperties();
	for (LRProperty prop : propList) {
		if (prop.getName().equalsIgnoreCase(propertyName)) {
			return prop.getValue();
		}
	}
	return null;
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:15,代码来源:LogicalReaderManagerImpl.java


示例24: 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 {
	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);
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:14,代码来源:LogicalReaderManagerImpl.java


示例25: getLRSpec

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public LRSpec getLRSpec(String name) throws NoSuchNameException, SecurityException, ImplementationException {
	LogicalReader logRd = logicalReaders.get(name);

	throwNoSuchNameExceptionIfReaderNull(logRd, name);
	
	return logRd.getLRSpec();		
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:9,代码来源:LogicalReaderManagerImpl.java


示例26: getLogicalReaderNames

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public java.util.List<String> getLogicalReaderNames() throws SecurityException, ImplementationException {
	List<String> rdNames = new ArrayList<String>();
	Iterable<String> it = logicalReaders.keySet();
	for (String reader : it) {
		rdNames.add(reader);
	}
	return rdNames;
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:10,代码来源:LogicalReaderManagerImpl.java


示例27: undefine

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void undefine(String name) throws NoSuchNameException, InUseException, SecurityException, ImmutableReaderException, ImplementationException {
	// the logicalReader must delete himself from its observables
	LOG.debug("undefining reader " + name);
	LogicalReader reader = getLogicalReader(name);
	
	throwNoSuchNameExceptionIfReaderNull(reader, name);
	
	// according to the EPC standard a reader cannot be undefined when there is 
	// an active CC or EC pointing to the reader
	// this raises an InUseException
	if (reader.countObservers() > 0) {
		throw new InUseException(name + "is still in use.");
	}
	
	if (reader instanceof CompositeReader) {
		CompositeReader composite = (CompositeReader) reader;
		composite.unregisterAsObserver();
	} else if (reader instanceof BaseReader) {
		BaseReader basereader = (BaseReader) reader;
		basereader.disconnectReader();
		basereader.cleanup();
	} else {
		throw new ImplementationException("try to undefine unknown reader type - ALE knows BaseReader and CompositeReader - atomic readers must subclass BaseReader, composite readers (collections of readers) must subclass CompositeReader - this is a serious problem!!! reader-name: " + name);
	}
	
	persistenceRemoveAPI.removeLRSpec(name);
	
	logicalReaders.remove(name);
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:31,代码来源:LogicalReaderManagerImpl.java


示例28: update

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void update(String name, LRSpec spec)  throws NoSuchNameException, ValidationException, InUseException,  ImmutableReaderException, ReaderLoopException, SecurityException, ImplementationException {
	LogicalReader logRd = logicalReaders.get(name);
	throwNoSuchNameExceptionIfReaderNull(logRd, name);
	
	logRd.update(spec);
	
	persistenceRemoveAPI.removeLRSpec(name);
	persistenceWriteAPI.writeLRSpec(name, spec);
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:11,代码来源:LogicalReaderManagerImpl.java


示例29: getPropertyValue

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public String getPropertyValue(String name, String propertyName) throws NoSuchNameException, SecurityException, ImplementationException {
	aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
	
	LogicalReader logRd = logicalReaders.get(name);
	throwNoSuchNameExceptionIfReaderNull(logRd, name);
	
	List<LRProperty> propList = logRd.getProperties();
	for (LRProperty prop : propList) {
		if (prop.getName().equalsIgnoreCase(propertyName)) {
			return prop.getValue();
		}
	}
	return null;
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:16,代码来源:LogicalReaderManagerImpl.java


示例30: getLRSpec

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public LRSpec getLRSpec(String name) throws NoSuchNameException, SecurityException, ImplementationException {
	aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
	LogicalReader logRd = logicalReaders.get(name);

	throwNoSuchNameExceptionIfReaderNull(logRd, name);
	
	return logRd.getLRSpec();		
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:10,代码来源:LogicalReaderManagerImpl.java


示例31: getLogicalReaderNames

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public java.util.List<String> getLogicalReaderNames() throws SecurityException, ImplementationException {
	aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
	List<String> rdNames = new ArrayList<String>();
	Iterable<String> it = logicalReaders.keySet();
	for (String reader : it) {
		rdNames.add(reader);
	}
	return rdNames;
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:11,代码来源:LogicalReaderManagerImpl.java


示例32: undefine

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void undefine(String name) throws NoSuchNameException, InUseException, SecurityException, ImmutableReaderException, ImplementationException {
	aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
	// the logicalReader must delete himself from its observables
	LOG.debug("undefining reader " + name);
	LogicalReader reader = getLogicalReader(name);
	
	throwNoSuchNameExceptionIfReaderNull(reader, name);
	
	// according to the EPC standard a reader cannot be undefined when there is 
	// an active CC or EC pointing to the reader
	// this raises an InUseException
	if (reader.countObservers() > 0) {
		throw new InUseException(name + "is still in use.");
	}
	for(String ecspecName : ale.getECSpecNames()) {
		ECSpec ecspec = ale.getECSpec(ecspecName);
		if(ecspec.getLogicalReaders().getLogicalReader().contains(name)) {
			throw new InUseException(name + "is still in use.");
		}
	}
	
	if (reader instanceof CompositeReader) {
		CompositeReader composite = (CompositeReader) reader;
		composite.unregisterAsObserver();
	} else if (reader instanceof BaseReader) {
		BaseReader basereader = (BaseReader) reader;
		basereader.disconnectReader();
		basereader.cleanup();
	} else {
		throw new ImplementationException("try to undefine unknown reader type - ALE knows BaseReader and CompositeReader - atomic readers must subclass BaseReader, composite readers (collections of readers) must subclass CompositeReader - this is a serious problem!!! reader-name: " + name);
	}
	
	persistenceRemoveAPI.removeLRSpec(name);
	
	logicalReaders.remove(name);
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:38,代码来源:LogicalReaderManagerImpl.java


示例33: setLogicalReader

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void setLogicalReader(LogicalReader reader) throws ImplementationException, SecurityException {
	aleac.checkAccess(authScope, Thread.currentThread().getStackTrace()[1].getMethodName());
	if (logicalReaders.containsKey(reader.getName())) {
		throw new ImplementationException("reader duplicated");
	}
	
	logicalReaders.put(reader.getName(), reader);
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:10,代码来源:LogicalReaderManagerImpl.java


示例34: updateClientid

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void updateClientid(String userId, String password,
		List<String> roleNames) throws SecurityException {
	List<User> foundUsers = findUsers(userId);
	if(foundUsers.size() == 1) {
		User u = foundUsers.get(0);
		listUser.remove(u);
		u.setUserId(userId);
		u.setPassword(password);
		u.setRoles(roleNames);
		listUser.add(u);
	}
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:14,代码来源:LocalRBAC.java


示例35: updatePermission

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void updatePermission(String permObjName, String permOpName,
		Set<String> roles) throws SecurityException {
	List<Permission> foundPerm = findPermissions(permObjName, permOpName);
	if(foundPerm.size() == 1) {
		Permission p = foundPerm.get(0);
		listPerm.remove(p);
		
		p.setObjectName(permObjName);
		p.setOpName(permOpName);
		p.setRoles(roles);
		
		listPerm.add(p);
	}
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:16,代码来源:LocalRBAC.java


示例36: defineRole

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void defineRole(String roleName) throws SecurityException {
	List<Role> foundRole = findRoles(roleName);
	if(foundRole.size() == 1) {
		listRole.remove(foundRole.get(0));
	}
	Role r = new Role(roleName);
	listRole.add(r);
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:10,代码来源:LocalRBAC.java


示例37: undefineRole

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void undefineRole(String roleName) throws SecurityException {
	List<Role> foundRole = findRoles(roleName);
	if(foundRole.size() == 1) {
		listRole.remove(foundRole.get(0));
	}
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:8,代码来源:LocalRBAC.java


示例38: definePermission

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void definePermission(String permObjName, String permOpName)
		throws SecurityException {
	List<Permission> foundPerm = findPermissions(permObjName, permOpName);
	if(foundPerm.size() == 1) {
		listPerm.remove(foundPerm.get(0));
	}
	Permission p = new Permission(permObjName, permOpName, null);
	listPerm.add(p);
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:11,代码来源:LocalRBAC.java


示例39: undefinePermission

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void undefinePermission(String permObjName, String permOpName)
		throws SecurityException {
	List<Permission> foundPerm = findPermissions(permObjName, permOpName);
	if(foundPerm.size() == 1) {
		listPerm.remove(foundPerm.get(0));
	}
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:9,代码来源:LocalRBAC.java


示例40: deassignPermissionToRole

import org.fosstrak.ale.exception.SecurityException; //导入依赖的package包/类
@Override
public void deassignPermissionToRole(String roleName, String permObjName,
		String permOpName) throws SecurityException {
	List<Role> foundRole = findRoles(roleName);
	List<Permission> foundPermission = findPermissions(permObjName, permOpName);
	if(foundRole.size() == 1 && foundPermission.size() == 1) {
		Role r = foundRole.get(0);
		Permission p = foundPermission.get(0);
		if(r.getPermissions().contains(p)) r.removePerm(p);
		if(p.getRoles().contains(roleName)) p.getRoles().remove(roleName);
	}
}
 
开发者ID:gs1oliot,项目名称:oliot-fc,代码行数:13,代码来源:LocalRBAC.java



注:本文中的org.fosstrak.ale.exception.SecurityException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。