Examples of ObjectSourceException


Examples of org.fcrepo.client.utility.validate.ObjectSourceException

                beginSearch();
            } else if (token != null) {
                resumeSearch();
            }
        } catch (RemoteException e) {
            throw new ObjectSourceException(e);
        }
    }
View Full Code Here

Examples of org.fcrepo.client.utility.validate.ObjectSourceException

        try {
            List<Datastream> datastreams = apim.getDatastreams(pid, null, null);
            return TypeUtility
                    .convertGenDatastreamArrayToDatastreamInfoSet(datastreams.toArray(new Datastream[]{}));
        } catch (Exception e) {
            throw new ObjectSourceException(e);
        }
    }
View Full Code Here

Examples of org.fcrepo.client.utility.validate.ObjectSourceException

                    apim.getRelationships(pid, null)
                            .toArray(new RelationshipTuple[0]);
            return TypeUtility
                    .convertGenRelsTupleArrayToRelationshipInfoList(tuples);
        } catch (Exception e) {
            throw new ObjectSourceException(e);
        }
    }
View Full Code Here

Examples of org.fcrepo.client.utility.validate.ObjectSourceException

                                            org.fcrepo.server.utilities.TypeUtility
                                                    .convertDataHandlerToBytes(ds
                                                            .getStream()));
            return new BasicContentModelInfo(object, model.getTypeModels());
        } catch (Exception e) {
            throw new ObjectSourceException("Problem fetching '"
                                                    + DS_COMPOSITE_MODEL
                                                    + "' datastream for pid='"
                                                    + pid + "'",
                                            e);
        }
View Full Code Here

Examples of org.fcrepo.client.utility.validate.ObjectSourceException

    /**
     * If we throw an {@link ObjectSourceException}, it will look like this.
     */
    public ObjectSourceException createObjectSourceException(String pid) {
        return new ObjectSourceException("forced exception on '" + pid + "'");
    }
View Full Code Here

Examples of org.fcrepo.client.utility.validate.ObjectSourceException

     * Convenience method: create a notation saying that we couldn't fetch this
     * content model.
     */
    private ValidationResultNotation noteErrorFetchingContentModel(ContentModelInfo model) {
        String pid = model.getPid();
        ObjectSourceException e = objectSource.createObjectSourceException(pid);
        return ValidationResultNotation.errorFetchingContentModel(pid, e);
    }
View Full Code Here

Examples of org.soybeanMilk.core.ObjectSourceException

      {
        return getGenericConverter().convert(sourceObj, targetType);
      }
      catch(ConvertException e)
      {
        throw new ObjectSourceException(e);
      }
    }
  }
View Full Code Here

Examples of org.soybeanMilk.core.ObjectSourceException

    if(WebConstants.Scope.REQUEST.equalsIgnoreCase(scopedKeys[0]))
    {
      if(scopedKeys.length > 1)
        getRequest().setAttribute(scopedKeys[1], obj);
      else
        throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, you can not replace "
            +SbmUtils.toString(WebConstants.Scope.REQUEST)+" scope object");
    }
    else if(WebConstants.Scope.SESSION.equalsIgnoreCase(scopedKeys[0]))
    {
      if(scopedKeys.length > 1)
        getRequest().getSession().setAttribute(scopedKeys[1], obj);
      else
        throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, you can not replace "
            +SbmUtils.toString(WebConstants.Scope.SESSION)+" scope object");
    }
    else if(WebConstants.Scope.APPLICATION.equalsIgnoreCase(scopedKeys[0]))
    {
      if(scopedKeys.length > 1)
        getApplication().setAttribute(scopedKeys[1], obj);
      else
        throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, you can not replace "
            +SbmUtils.toString(WebConstants.Scope.APPLICATION)+" scope object");
    }
    else if(WebConstants.Scope.PARAM.equalsIgnoreCase(scopedKeys[0]))
    {
      throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, set object to "
          +SbmUtils.toString(WebConstants.Scope.PARAM)+" scope is not supported");
    }
    else if(WebConstants.Scope.RESPONSE.equalsIgnoreCase(scopedKeys[0]))
    {
      throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, set object to "
          +SbmUtils.toString(WebConstants.Scope.RESPONSE)+" scope is not supported");
    }
    else if(WebConstants.Scope.OBJECT_SOURCE.equalsIgnoreCase(scopedKeys[0]))
    {
      throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, set object to "
          +SbmUtils.toString(WebConstants.Scope.OBJECT_SOURCE)+" scope is not supported");
    }
    else
      setObjectWithScopeUnknownKey(strKey, obj);
   
View Full Code Here

Examples of org.soybeanMilk.core.ObjectSourceException

   */
  @SuppressWarnings("unchecked")
  protected Object getObject(Serializable key, Type expectType) throws ObjectSourceException
  {
    if(key == null)
      throw new ObjectSourceException("[key] must not be null");
   
    Object result = null;
   
    String strKey=(key instanceof String ? (String)key : key.toString());
    String[] scopedKeys=SbmUtils.splitByFirstAccessor(strKey);
   
    if(WebConstants.Scope.PARAM.equalsIgnoreCase(scopedKeys[0]))
    {
      result=getParamFilterValue(getRequest().getParameterMap(), (scopedKeys.length > 1 ? scopedKeys[1] : null), expectType);
    }
    else if(WebConstants.Scope.REQUEST.equalsIgnoreCase(scopedKeys[0]))
    {
      if(scopedKeys.length > 1)
        result=getRequest().getAttribute(scopedKeys[1]);
      else
        result=getRequest();
    }
    else if(WebConstants.Scope.SESSION.equalsIgnoreCase(scopedKeys[0]))
    {
      if(scopedKeys.length > 1)
        result=getRequest().getSession().getAttribute(scopedKeys[1]);
      else
        result=getRequest().getSession();
    }
    else if(WebConstants.Scope.APPLICATION.equalsIgnoreCase(scopedKeys[0]))
    {
      if(scopedKeys.length > 1)
        result=getApplication().getAttribute(scopedKeys[1]);
      else
        result=getApplication();
    }
    else if(WebConstants.Scope.RESPONSE.equalsIgnoreCase(scopedKeys[0]))
    {
      if(scopedKeys.length > 1)
        throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, get object from "
            +HttpServletResponse.class.getSimpleName()+" is not supported");
      else
        result=getResponse();
    }
    else if(WebConstants.Scope.OBJECT_SOURCE.equalsIgnoreCase(scopedKeys[0]))
    {
      if(scopedKeys.length > 1)
        throw new ObjectSourceException("key "+SbmUtils.toString(key)+" is illegal, get object from "
            +WebObjectSource.class.getSimpleName()+" is not supported");
      else
        result=this;
    }
    else
View Full Code Here

Examples of org.soybeanMilk.core.ObjectSourceException

        }
       
        throw new ParamIllegalException(paramName, e.getSourceObject(), e.getTargetType(), e);
      }
      else
        throw new ObjectSourceException(e);
    }
   
    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.