Package com.sun.xacml.attr

Examples of com.sun.xacml.attr.AttributeValue


    try
    {
      final String textValue = currentValue.toString();
      if(textValue == null || textValue.length() == 0)
        {return null;}
      final AttributeValue value = factory.createValue(attribute.getType(), textValue);
      for(final AttributeHandler handler : attributeHandlers)
        handler.checkUserValue(value, attribute);
      return value;
    }
    catch(final UnknownIdentifierException e)


   
    final EvaluationResult subjectID = context.getSubjectAttribute(attributeType, XACMLConstants.SUBJECT_ID_ATTRIBUTE, issuer, subjectCategory);
    if(subjectID.indeterminate())
      {return subjectID;}
   
    AttributeValue value = subjectID.getAttributeValue();
    if(value == null)
      {return errorResult("Could not find user for context: null subject-id");}
    if(value.isBag())
    {
      final BagAttribute bag = (BagAttribute)value;
      if(bag.isEmpty())
        {return errorResult("Could not find user for context: no subject-id found");}
      if(bag.size() > 1)

    final String[] groupArray = user.getGroups();
    final int size = (groupArray == null) ? 0 : groupArray.length;
    final Set<StringAttribute> groupAttributes = new HashSet<StringAttribute>(size);
    for(int i = 0; i < size; ++i)
      groupAttributes.add(new StringAttribute(groupArray[i]));
    final AttributeValue value = new BagAttribute(XACMLConstants.STRING_TYPE, groupAttributes);
    return new EvaluationResult(value);
   
  }

  * @param user The user making the request
  * @return A <code>Subject</code> for use in a <code>RequestCtx</code>
  */
  public Subject createUserSubject(Account user)
  {
    final AttributeValue value = new StringAttribute(user.getName());
    final Attribute attr = new Attribute(XACMLConstants.SUBJECT_ID_ATTRIBUTE, null, null, value);
    return new Subject(XACMLConstants.ACCESS_SUBJECT, Collections.singleton(attr));
  }

      {return;}
    if(attrID == null)
      {throw new NullPointerException("Attribute ID cannot be null");}
    if(attrValue == null)
      {throw new NullPointerException("Attribute value cannot be null");}
    final AttributeValue value = new StringAttribute(attrValue);
    final Attribute attr = new Attribute(attrID, null, null, value);
    attributes.add(attr);
  }

    if(attrID == null)
      {throw new NullPointerException("Attribute ID cannot be null");}
    if(uriString == null)
      {throw new NullPointerException("Attribute value cannot be null");}
    final URI uri = new URI(uriString);
    final AttributeValue value = new AnyURIAttribute(uri);
    final Attribute attr = new Attribute(attrID, null, null, value);
    attributes.add(attr);
  }

    }
   
    final TargetTableModel model = (TargetTableModel)table.getModel();
    final AttributeDesignator attribute = model.getAttribute(selectedColumn);
    final URI functionId = model.getFunctionId(selectedRow, selectedColumn);
    final AttributeValue value = model.getValue(selectedRow, selectedColumn);
    matchEditor.setMatch(attribute, functionId, value);
  }

      matchEditor.setMatch(null, null, null);
      return;
    }
   
    final URI functionId = matchEditor.getFunctionId();
    final AttributeValue value = matchEditor.getValue();
    removeSelectionListeners(table);
    ((TargetTableModel)table.getModel()).setValue(functionId, value, selectedRow, selectedColumn);
    table.setRowSelectionInterval(selectedRow, selectedRow);
    table.setColumnSelectionInterval(selectedColumn, selectedColumn);
    addSelectionListeners(table);

                    + "couldn't get resource attribute from xacml request "
                    + "bad status");
            return null;
        } // (resourceAttribute.getStatus() == null) == everything is ok

        AttributeValue attributeValue = attribute.getAttributeValue();
        if (!(attributeValue instanceof BagAttribute)) {
            logger.debug("AttributeFinder:getAttributeFromEvaluationCtx" + iAm()
                    + " exit on "
                    + "couldn't get resource attribute from xacml request "
                    + "no bag");

        if (attribute.getStatus() != null
                && !Status.STATUS_OK.equals(attribute.getStatus())) {
            return null;
        }

        AttributeValue attributeValue = attribute.getAttributeValue();
        if (!(attributeValue instanceof BagAttribute)) {
            return null;
        }

        BagAttribute bag = (BagAttribute) attributeValue;

TOP

Related Classes of com.sun.xacml.attr.AttributeValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.