/** * @return Parent of the resource, if any. Throws IllegalStateException if it's the root-level resource. */ public IResource getParent() { switch (level) { case KEYSPACE: return root(); case TABLE: return keyspace(keyspace); } throw new IllegalStateException("Root-level resource can't have a parent"); }
/** * @return Parent of the resource, if any. Throws IllegalStateException if it's the root-level resource. */ public IResource getParent() { switch (level) { case KEYSPACE: return root(); case TABLE: return keyspace(keyspace); } throw new IllegalStateException("Root-level resource can't have a parent"); }
/** * @return Parent of the resource, if any. Throws IllegalStateException if it's the root-level resource. */ public IResource getParent() { switch (level) { case KEYSPACE: return root(); case COLUMN_FAMILY: return keyspace(keyspace); } throw new IllegalStateException("Root-level resource can't have a parent"); }
/** * @return Parent of the resource, if any. Throws IllegalStateException if it's the root-level resource. */ public IResource getParent() { switch (level) { case KEYSPACE: return root(); case TABLE: return keyspace(keyspace); } throw new IllegalStateException("Root-level resource can't have a parent"); }
/** * Parses a data resource name into a DataResource instance. * * @param name Name of the data resource. * @return DataResource instance matching the name. */ public static DataResource fromName(String name) { String[] parts = StringUtils.split(name, '/'); if (!parts[0].equals(ROOT_NAME) || parts.length > 3) throw new IllegalArgumentException(String.format("%s is not a valid data resource name", name)); if (parts.length == 1) return root(); if (parts.length == 2) return keyspace(parts[1]); return table(parts[1], parts[2]); }
/** * Parses a data resource name into a DataResource instance. * * @param name Name of the data resource. * @return DataResource instance matching the name. */ public static DataResource fromName(String name) { String[] parts = StringUtils.split(name, '/'); if (!parts[0].equals(ROOT_NAME) || parts.length > 3) throw new IllegalArgumentException(String.format("%s is not a valid data resource name", name)); if (parts.length == 1) return root(); if (parts.length == 2) return keyspace(parts[1]); return table(parts[1], parts[2]); }
/** * Parses a data resource name into a DataResource instance. * * @param name Name of the data resource. * @return DataResource instance matching the name. */ public static DataResource fromName(String name) { String[] parts = StringUtils.split(name, '/'); if (!parts[0].equals(ROOT_NAME) || parts.length > 3) throw new IllegalArgumentException(String.format("%s is not a valid data resource name", name)); if (parts.length == 1) return root(); if (parts.length == 2) return keyspace(parts[1]); return columnFamily(parts[1], parts[2]); }
/** * Parses a data resource name into a DataResource instance. * * @param name Name of the data resource. * @return DataResource instance matching the name. */ public static DataResource fromName(String name) { String[] parts = StringUtils.split(name, '/'); if (!parts[0].equals(ROOT_NAME) || parts.length > 3) throw new IllegalArgumentException(String.format("%s is not a valid data resource name", name)); if (parts.length == 1) return root(); if (parts.length == 2) return keyspace(parts[1]); return table(parts[1], parts[2]); }
public void hasAllKeyspacesAccess(Permission perm) throws UnauthorizedException { if (isInternal) return; validateLogin(); ensureHasPermission(perm, DataResource.root()); }
public void hasAllKeyspacesAccess(Permission perm) throws UnauthorizedException { if (isInternal) return; validateLogin(); ensureHasPermission(perm, DataResource.root()); }
public void hasAllKeyspacesAccess(Permission perm) throws UnauthorizedException { if (isInternal) return; validateLogin(); ensureHasPermission(perm, DataResource.root()); }
public void hasAllKeyspacesAccess(Permission perm) throws UnauthorizedException { if (isInternal) return; validateLogin(); ensureHasPermission(perm, DataResource.root()); }
/** * Creates an IResource instance from its external name. * Resource implementation class is inferred by matching against the known IResource * impls' root level resources. * @param name * @return an IResource instance created from the name */ public static IResource fromName(String name) { if (name.startsWith(RoleResource.root().getName())) return RoleResource.fromName(name); else if (name.startsWith(DataResource.root().getName())) return DataResource.fromName(name); else if (name.startsWith(FunctionResource.root().getName())) return FunctionResource.fromName(name); else if (name.startsWith(JMXResource.root().getName())) return JMXResource.fromName(name); else throw new IllegalArgumentException(String.format("Name %s is not valid for any resource type", name)); }
/** * Creates an IResource instance from its external name. * Resource implementation class is inferred by matching against the known IResource * impls' root level resources. * @param name * @return an IResource instance created from the name */ public static IResource fromName(String name) { if (name.startsWith(RoleResource.root().getName())) return RoleResource.fromName(name); else if (name.startsWith(DataResource.root().getName())) return DataResource.fromName(name); else if (name.startsWith(FunctionResource.root().getName())) return FunctionResource.fromName(name); else if (name.startsWith(JMXResource.root().getName())) return JMXResource.fromName(name); else throw new IllegalArgumentException(String.format("Name %s is not valid for any resource type", name)); }
/** * Creates an IResource instance from its external name. * Resource implementation class is inferred by matching against the known IResource * impls' root level resources. * @param name * @return an IResource instance created from the name */ public static IResource fromName(String name) { if (name.startsWith(RoleResource.root().getName())) return RoleResource.fromName(name); else if (name.startsWith(DataResource.root().getName())) return DataResource.fromName(name); else if (name.startsWith(FunctionResource.root().getName())) return FunctionResource.fromName(name); else if (name.startsWith(JMXResource.root().getName())) return JMXResource.fromName(name); else throw new IllegalArgumentException(String.format("Name %s is not valid for any resource type", name)); }
res = DataResource.root();
res = DataResource.root();
res = DataResource.root();
res = DataResource.root();